Current project: PHP/MySQL star generator

Post requests, images, descriptions and reports about work in progress here.
Topic author
Mneme
Posts: 78
Joined: 01.06.2010
With us: 9 years 2 months

Current project: PHP/MySQL star generator

Post #1by Mneme » 22.09.2012, 03:20

I'm sure it's been done, but for my own uses I am working on a program to generate Celestia data; a picture is worth a thousand words: http://w.tarazedi.com/image1095

The idea is to generate large batches of fully-usable star systems within a defined region of space for the benefit of sci-fi worldbuilders. I have functional single through quaternary star systems, with (reasonably) accurate population distributions. Planets, which will be rather more complicated, are coming soon. I will be making this available when I am done.

I have a 0.9 version of the planet textures (a sample of which may be found here: http://w.tarazedi.com/image1094 ) available at this location: http://w.tarazedi.com/Atlas The texture pack has about a hundred files and is about 30MB. All textures are 1024x768. There are various layers including maps, bumps, specs, nights, and clouds. When the planet building part of the program is complete, planets will be randomly generated and classified according to the following scheme to choose the textures which might apply to them:

Code: Select all

Type                  Temperature Range         prevalence per system type
                                          metal-poor   Si      C
Ice   Ice Solid Planet         0   K   -   75 K      80%         80%      80%
MeC   Methane-Cloud Gas Giant      0   K   -   75 K      20%         20%      20%
ISi   Ice-Silicate Solid Planet   75   K   -   150 K       5%         75%       5%
ICa   Ice-Carbon Solid Planet      75   K   -   150 K      15%          5%      75%
AmC   Ammonia-Cloud Gas Giant      75    K   -   150 K      80%         20%      20%
Sil   Silicate Solid Planet      150 K   -   400 K       4%         30%       5%
Car   Carbon Solid Planet         150   K   -   400   K       1%          5%      30%
WaC   Water-Cloud   Gas Giant      150 L   -   400 K      80%         30%      30%
MSi   Metal-Silicate Solid Planet   150 K   -   400 K       4%         30%       5%
MCa   Metal-Carbon Solid Planet   150 K   -    400 K       1%          5%      30%
Met   Metal Solid Planet         400 K   -   800 K       1%         10%      10%
Cla   Clarified Gas Giant         400 K   -   800 K      99%         90%      90%
Rem   Remnant Solid Planet      800 K   -   1200 K       1%          5%       5%
AlC   Alkali-Cloud Gas Giant      800 K   -   1200 K      99%         95%      95%
SiC   Silicate-Cloud Planet      1200 K   -   3600 K      100%      100%   100%
Vap   Vaporized Planet         3600 K   +            100%      100%   100%


Enjoy.
Last edited by Mneme on 03.11.2012, 02:48, edited 2 times in total.

Avatar
omega13a M
Posts: 120
Joined: 15.10.2011
Age: 35
With us: 7 years 10 months
Location: California
Contact:

Re: Current project: PHP/MySQL star generator

Post #2by omega13a » 22.09.2012, 05:18

Can't download anything from that link. I go to http://www.tarazedi.com/files/StargenTextures.exe and I end up getting redirected to http://w.tarazedi.com/About . :(
A fish without a bicycle cannot contemplate his navel

My Celestia Add-ons
The Omega Galaxy

Avatar
John Van Vliet
Posts: 2711
Joined: 28.08.2002
With us: 16 years 11 months

Re: Current project: PHP/MySQL star generator

Post #3by John Van Vliet » 22.09.2012, 21:47

--- edit ---
Last edited by John Van Vliet on 19.10.2013, 04:26, edited 1 time in total.

Topic author
Mneme
Posts: 78
Joined: 01.06.2010
With us: 9 years 2 months

Re: Current project: PHP/MySQL star generator

Post #4by Mneme » 23.09.2012, 15:38

Sorry about that. My .htaccess files are a bit weird because of how my host disables hotlinking. Check the top of this page; I added a link to the textures that WILL WORK. http://w.tarazedi.com/Atlas I have also made it a .zip file as suggested.

Later I'll have to figure out why the forums can't link a file. *sigh*

Avatar
John Van Vliet
Posts: 2711
Joined: 28.08.2002
With us: 16 years 11 months

Re: Current project: PHP/MySQL star generator

Post #5by John Van Vliet » 24.09.2012, 08:40

--- edit ---
Last edited by John Van Vliet on 19.10.2013, 04:25, edited 2 times in total.

Topic author
Mneme
Posts: 78
Joined: 01.06.2010
With us: 9 years 2 months

Re: Current project: PHP/MySQL star generator

Post #6by Mneme » 24.09.2012, 15:47

Hotlinks do not work, but it does work if you download it from the page.

Topic author
Mneme
Posts: 78
Joined: 01.06.2010
With us: 9 years 2 months

Re: Current project: PHP/MySQL star generator

Post #7by Mneme » 28.09.2012, 00:57

So far the star generator makes complete and more aesthetically-pleasing star systems, and orbital elements and temperatures for planets... so I'm about 75% done. :) If you want to play with the previous version (star systems only): http://www.tarazedi.com/files/backup%20 ... Sept10.php

Right now my database says my 15 hottest planets are:

Code: Select all

828   30031901   Va Gushthyuak I   3153
829   30031902   Va Gushthyuak II   2327
830   30031903   Va Gushthyuak III   1245
831   30031904   Va Gushthyuak IV   1198
832   30031905   Va Gushthyuak V   1034
833   30031906   Va Gushthyuak VI   1028
566   30021801   Va Zuuq I   735
784   30030201   Zhegevsudhef I   722
223   30009501   'Etanun I   639
29   30002201   Dhuthuumdadhjfizhof I   603
299   30012201   Nizanemis I   600
375   30014401   Stel Pl Prime   595
30   30002202   Dhuthuumdadhjfizhof II   588
1361   30049701   'Uluthuzenu I   580
31   30002203   Dhuthuumdadhjfizhof III   558


The Va Gushthyuak system is a binary with an M2Ia red supergiant and a DB9 white dwarf, separated by 13.7 AU and orbiting in 10.9 years. :)

Avatar
Goofy
Posts: 241
Joined: 30.08.2011
With us: 7 years 11 months
Location: Italy

Re: Current project: PHP/MySQL star generator

Post #8by Goofy » 28.09.2012, 07:54

Mneme wrote:So far the star generator makes complete and more aesthetically-pleasing star systems, and orbital elements and temperatures for planets... so I'm about 75% done. :) If you want to play with the previous version (star systems only): http://www.tarazedi.com/files/backup%20 ... Sept10.php
:)
Hi Mneme, I'm playing with your Star Generator and I find it very interesting.
Just curious: why the "cube" area?
Why not a "sphere" area or even a "random" one?
Thank you for your addon.
Bye

Goofy :D
"Something is always better than nothing!"
ASUS G75VX4007H- Intel i7 3630QM, 2.4 GHz-SSD 250GB+SSD 1TB, SATA 3-32GB DDR3 1600 MHz- Nvidia GeForce GTX 780MX 3 GB

Topic author
Mneme
Posts: 78
Joined: 01.06.2010
With us: 9 years 2 months

Re: Current project: PHP/MySQL star generator

Post #9by Mneme » 28.09.2012, 14:31

Laziness, to put it bluntly. :) CBA to come up with the math.

Avatar
Goofy
Posts: 241
Joined: 30.08.2011
With us: 7 years 11 months
Location: Italy

Re: Current project: PHP/MySQL star generator

Post #10by Goofy » 28.09.2012, 16:02

Mneme wrote:Laziness, to put it bluntly. :) CBA to come up with the math.
Mine was not a critic, obviously. :wink:
But if you'll go on with this project (I strongly hope so!), could you think about the possibility of a Gaussian star concentration?
I would like to try it for "fictitious" globular clusters. 8O
If you'll try this solution, I suggest you to split your addon, i.e. with and without planets generation.
Bye and thank you once again, and take your time.
Bye

Goofy :D
"Something is always better than nothing!"
ASUS G75VX4007H- Intel i7 3630QM, 2.4 GHz-SSD 250GB+SSD 1TB, SATA 3-32GB DDR3 1600 MHz- Nvidia GeForce GTX 780MX 3 GB

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 17
With us: 17 years 4 months
Location: Hamburg, Germany

Re: Current project: PHP/MySQL star generator

Post #11by t00fri » 28.09.2012, 16:28

Goofy wrote:I would like to try it for "fictitious" globular clusters. 8O
..
Goofy :D

Goofy,

how about having some fun with my "crazy" CM thread: "Imagine the Solar System was part of a Globular Cluster"?

http://forum.celestialmatters.org/viewtopic.php?t=422

My shader stars satisfy all astrophysical constraints including a realistic luminosity (or mass) distribution and a correct Hertzsprung-Russell relation with adequate distributions of star colors. Moreover the normal star rendering and the rendering of the globular clusters is done with the SAME shader code.

Then that's how stars should look like:

[Click on image by all means!]
4_g151_1.jpg

Soon users will be able to land on any one of the cluster stars which will provide an amazing sky experience ...

Fridger
Image

Avatar
Goofy
Posts: 241
Joined: 30.08.2011
With us: 7 years 11 months
Location: Italy

Re: Current project: PHP/MySQL star generator

Post #12by Goofy » 28.09.2012, 18:17

t00fri wrote:
Goofy wrote:I would like to try it for "fictitious" globular clusters. 8O
Goofy :D
Goofy,
how about having some fun with my "crazy" CM thread: "Imagine the Solar System was part of a Globular Cluster"?
http://forum.celestialmatters.org/viewtopic.php?t=422
Soon users will be able to land on any one of the cluster stars which will provide an amazing sky experience ...Fridger
Hi Fridger.
Yes, I've already seen your incredible results on Celestia.Sci globular clusters rendering (and even more on galaxies rendering, wow! 8O ) and cannot wait to put my hands on it.
But, meanwhile, I can use Mneme's fictitious star generator, in order to give my students an idea on how the sky could be as seen from an inner planet.
I found somewhere Rassilon's globular cluster generator, that gives a strangely flat globular shape, at least to me, and this new one may give more real results.
Moreover it's still a work on progress, so can be issued to obtain very nice results, provided that we'll accept them as unreal.
Just to give an example, I tried this combination of queries:
Star number 10000 10000 10000 10000
Cube size 100 50 30 15
Star code 666 777 888 999
Below you can see the results.
Despite the cubic shape (but not so evident), I like it.
Waiting for Celestia-Sci wonders, bye.

Goofy :D
Last edited by Goofy on 28.09.2012, 18:53, edited 2 times in total.
"Something is always better than nothing!"
ASUS G75VX4007H- Intel i7 3630QM, 2.4 GHz-SSD 250GB+SSD 1TB, SATA 3-32GB DDR3 1600 MHz- Nvidia GeForce GTX 780MX 3 GB

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 17
With us: 17 years 4 months
Location: Hamburg, Germany

Re: Current project: PHP/MySQL star generator

Post #13by t00fri » 28.09.2012, 18:45

OK, your present results look pretty good, except for the star sizes in the core regions, perhaps. They are looking too similar to me.

Much success,
Fridger
Image

Avatar
Goofy
Posts: 241
Joined: 30.08.2011
With us: 7 years 11 months
Location: Italy

Re: Current project: PHP/MySQL star generator

Post #14by Goofy » 28.09.2012, 18:49

t00fri wrote:OK, your present results look pretty good.
Much success, Fridger
Thank you, Fridger. :D
I'm sure that Mneme will make a good tuning of his Star generator, and this will give much better results.
Let's wait for it.
Bye

Goofy :D
"Something is always better than nothing!"
ASUS G75VX4007H- Intel i7 3630QM, 2.4 GHz-SSD 250GB+SSD 1TB, SATA 3-32GB DDR3 1600 MHz- Nvidia GeForce GTX 780MX 3 GB

Topic author
Mneme
Posts: 78
Joined: 01.06.2010
With us: 9 years 2 months

Re: Current project: PHP/MySQL star generator

Post #15by Mneme » 28.09.2012, 20:53

Damn that's a lot of stars. :) I was wondering how clusters would look; not too bad it seems. Unfortunately the new version for performance limits to 999 per query because it does a lot more work than the version I have up there, but you can run it as many times as necessary.

Currently my position data calculates like this:

$edge = angular width of $cube;
$ra = rand( $ra - $edge, $ra + $cube2 );
$dec = rand( $dec - $edge, $dec + $cube2 );
$dist = rand( $dist - $edge, $dist + $cube );

I'm not clear on how to make a Gaussian distribution, and while I am clear on at least one way to make a spherical distribution, I had some trouble getting PHP to play nice with it. I was converting the input to Cartesians, generating a position, and converting it back, but I wasn't having any luck on that last step. I figure that I can use my current method but weight it toward the center by using two rands per coordinate as a 0 to 1 and multiplying them together, then multiplying that by the cube size. That would fuzz out the edges a lot and remove the cubic appearance. If anyone can show me the math for a better way I'd consider using it; I'm not an astronomer, programmer, or mathematician; I just play with things. :)

If you were using 666, 777, etc. you are overlapping star numbers on that version because it didn't populate a database. Try 60000, 70000, etc. Also if you want more blue stars and/or giants within the core, you can set those, if you didn't already. The default probabilities for star types are set to approximate estimates I found for the solar neighborhood, which for main sequence stars is:

if($starclassrand > 5000000){ $starclass = "L"; $starcoeff = 0; }
if($starclassrand <= 5000000){ $starclass = "M"; $starcoeff = 10; }
if($starclassrand <= 605000){ $starclass = "K"; $starcoeff = 20; }
if($starclassrand <= 380000){ $starclass = "G"; $starcoeff = 30; }
if($starclassrand <= 150000){ $starclass = "F"; $starcoeff = 40; }
if($starclassrand <= 30000){ $starclass = "A"; $starcoeff = 50; }
if($starclassrand <= 6500){ $starclass = "B"; $starcoeff = 60; }
if($starclassrand <= 30){ $starclass = "O"; $starcoeff = 70; }
if($starclassrand <= 2){ $starclass = "WR"; $starcoeff = 80; }

There is a 10% probability of a white dwarf, and logarithmic probability of each successive luminosity class, since I didn't really find any good estimates to work with.

Today I'm gonna see if I can finish off planet calculation... this is gonna be interesting... *grumble*

Avatar
Goofy
Posts: 241
Joined: 30.08.2011
With us: 7 years 11 months
Location: Italy

Re: Current project: PHP/MySQL star generator

Post #16by Goofy » 28.09.2012, 22:47

t00fri wrote:... except for the star sizes in the core regions, perhaps. They are looking too similar to me. Much success, Fridger
Hi Fridger.
You are absolutely right, and moreover I think there are a bit too many external blu supergiants.
Perhaps Mneme should give another kind od adjustment in the options, e.g. giving as "0" really NO blu (or red) stars.
Anyway he is working on it, so let's see what happens. :wink:
Bye

Goofy :D
"Something is always better than nothing!"
ASUS G75VX4007H- Intel i7 3630QM, 2.4 GHz-SSD 250GB+SSD 1TB, SATA 3-32GB DDR3 1600 MHz- Nvidia GeForce GTX 780MX 3 GB

Topic author
Mneme
Posts: 78
Joined: 01.06.2010
With us: 9 years 2 months

Re: Current project: PHP/MySQL star generator

Post #17by Mneme » 28.09.2012, 22:51

0 blue skew means normal color distribution, which is to say getting blue stars is like winning the lottery. :)

Avatar
Goofy
Posts: 241
Joined: 30.08.2011
With us: 7 years 11 months
Location: Italy

Re: Current project: PHP/MySQL star generator

Post #18by Goofy » 29.09.2012, 00:17

Mneme wrote:If you were using 666, 777, etc. you are overlapping star numbers on that version because it didn't populate a database. Try 60000, 70000, etc.
Thank you, but I was already using 6660000 etc, here I wrote three digits only just to show what I did.
The 40000 stars are all there, believe me, and it's a pleasure to fly within! :blue:
Mneme wrote:Also if you want more blue stars and/or giants within the core, you can set those, if you didn't already.
Yes. I did. But I see that if I put "0" at blu or red stars, there are some blu or red supergiants in the external cloud. :(
I think it would be better to have the real possibility to ask for "0" blu or red supergiants.
Mneme wrote:The default probabilities for star types are set to approximate estimates I found for the solar neighborhood....

Mneme, this is Fridger's business, but I'm sure that globular clusters have an H-R Diagram very different compared with our neighborhood's: in globulars most stars are population 2, with a small percentage of red and blu giants and supergiants, if I'm right (Fridger?).
Mneme wrote:Today I'm gonna see if I can finish off planet calculation... this is gonna be interesting... *grumble*
Nice, waiting for.
And please, if possible, give the possibility to chose "no planets", too.
Bye

Goofy :D
"Something is always better than nothing!"
ASUS G75VX4007H- Intel i7 3630QM, 2.4 GHz-SSD 250GB+SSD 1TB, SATA 3-32GB DDR3 1600 MHz- Nvidia GeForce GTX 780MX 3 GB

Avatar
Goofy
Posts: 241
Joined: 30.08.2011
With us: 7 years 11 months
Location: Italy

Re: Current project: PHP/MySQL star generator

Post #19by Goofy » 29.09.2012, 00:52

Just finished, so here the new globular: 107000 stars, in tel concentric cubes, with decreasing size and star number going to the center, and increasing red stars value going to the center.
The stc file is 54MB, and my machine gasps a bit starting Celestia, but when loaded the cluster can be navigated without problems.
Hope you'll like it, if you don't mind the cubic shape, but the middle image is very nice, in my opinion. :oops:
Bye

Goofy :D
"Something is always better than nothing!"
ASUS G75VX4007H- Intel i7 3630QM, 2.4 GHz-SSD 250GB+SSD 1TB, SATA 3-32GB DDR3 1600 MHz- Nvidia GeForce GTX 780MX 3 GB

Topic author
Mneme
Posts: 78
Joined: 01.06.2010
With us: 9 years 2 months

Re: Current project: PHP/MySQL star generator

Post #20by Mneme » 29.09.2012, 01:04

Goofy wrote:Mneme, this is Fridger's business, but I'm sure that globular clusters have an H-R Diagram very different compared with our neighborhood's: in globulars most stars are population 2, with a small percentage of red and blu giants and supergiants, if I'm right (Fridger?).

Yes, this is true. If anyone can show me some good numbers on spectral class and luminosity class distributions in clusters of age X, I would love to implement that.

I may include a skip planets option, good idea.


Return to “Add-on development”

Who is online

Users browsing this forum: 4 guests