Planet Builder 1.0

Description: The place to discuss creating, porting and modifying Celestia's source code.

selden
Avatar
selden
Posts: 10014
With us: 14 years 10 months
Location: NY, USA

#41by selden » 14.11.2002, 19:20

Ras',

I hope I'm not the only one, too! I haven't had a chance to even look at the planetary system features.

You might ask Chris if he can provide access to the Web server logs for your pages. At least you could get an idea of how many people have downloaded the program.
Selden

chris
Site Admin
chris
Site Admin
Posts: 4217
With us: 15 years 5 months
Location: Seattle, Washington, USA

#42by chris » 14.11.2002, 19:26

selden wrote:Ras',

I hope I'm not the only one, too! I haven't had a chance to even look at the planetary system features.

You might ask Chris if he can provide access to the Web server logs for your pages. At least you could get an idea of how many people have downloaded the program.

2100 hits to Rassilon's pages since Sunday . . . Looks like there's plenty of interest in the add-ons. 42 hits to Generator.zip, but they're not all separate downloads.

--Chris

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#43by Rassilon » 14.11.2002, 19:27

Im sure alot have...Theres over 500 hits to this thread...Im just trying to stir the participation in this forum a bit...hell stir it needs a australian boot in the bum is more like it...Seems alot are shy around here :mrgreen:

I thought of something else too...how do I go about figuring out the size of a star when all I have is distance stellar type and magnitude? Ive searched the web and Ill be damned if I can figure it out with the formulas they give...I suppose what I need is the math formulas chris uses in Celestia...guess its time for one of those searches through the code...so how many lines is Celestia up to now lol?
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

bh
bh

#44by bh » 14.11.2002, 19:53

Rassilon...

sorry about this, I followed your instructions, HIP 400000 enter and 'G' and all I did was got very close to Io! Am I goofing up on this? Just downloaded ver 1.1. Will try again.

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#45by Rassilon » 14.11.2002, 20:41

Yes I would re-generate the cluster and click the view button now in ver 1.1...right at the top it should tell you what number your starting with just to be sure...ok out of that and go file > save to save it to your extras directory...Now load celestia hit enter as before type HIP 400000 if thats the first number and hit enter...then g...

remember ver 1.1 now calls for you to use the log menu opt to select NGC 104...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

chris
Site Admin
chris
Site Admin
Posts: 4217
With us: 15 years 5 months
Location: Seattle, Washington, USA

#46by chris » 14.11.2002, 21:48

Rassilon wrote:I thought of something else too...how do I go about figuring out the size of a star when all I have is distance stellar type and magnitude? Ive searched the web and Ill be damned if I can figure it out with the formulas they give...I suppose what I need is the math formulas chris uses in Celestia...guess its time for one of those searches through the code...so how many lines is Celestia up to now lol?

The calculation of star radius in Celestia is based on the luminosity and surface temperature of the star. In star.cpp, there are tables to derive surface temperature from stellar class. Then, given the L = the luminosity of the star relative to the sun, Ts = temp of the sun, Ta = temp of the star, the size in solar radii is sqrt(L)*(Ta/Ts)^2

--Chris

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#47by Rassilon » 14.11.2002, 23:31

Thanks chris that helps alot...Maybe now I can get my planets positioned the way I want them...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#48by Rassilon » 15.11.2002, 00:36

Well its not working for me for some odd reason...either its Visual Basic or I've left something out...At any rate heres the code I added:

Code: Select all

    oTemp(0) = 50000:  oTemp(1) = 50000: oTemp(2) = 50000: oTemp(3) = 50000: oTemp(4) = 47000
    oTemp(5) = 44500:  oTemp(6) = 41000: oTemp(7) = 38000: oTemp(8) = 35800: oTemp(9) = 33000
   
    bTemp(0) = 30000:  bTemp(1) = 25400: bTemp(2) = 22000: bTemp(3) = 18700: bTemp(4) = 17000
    bTemp(5) = 15400:  bTemp(6) = 14000: bTemp(7) = 13000: bTemp(8) = 11900: bTemp(9) = 10500
   
    aTemp(0) = 9520:  aTemp(1) = 9230: aTemp(2) = 8970: aTemp(3) = 8720: aTemp(4) = 8460
    aTemp(5) = 8200:  aTemp(6) = 8020: aTemp(7) = 7850: aTemp(8) = 7580: aTemp(9) = 7390
   
    aTemp(0) = 9520:  aTemp(1) = 9230: aTemp(2) = 8970: aTemp(3) = 8720: aTemp(4) = 8460
    aTemp(5) = 8200:  aTemp(6) = 8020: aTemp(7) = 7850: aTemp(8) = 7580: aTemp(9) = 7390
   
    fTemp(0) = 7200:  fTemp(1) = 7050: fTemp(2) = 6890: fTemp(3) = 6740: fTemp(4) = 6590
    fTemp(5) = 6440:  fTemp(6) = 6360: fTemp(7) = 6280: fTemp(8) = 6200: fTemp(9) = 6110
   
    gTemp(0) = 6030:  gTemp(1) = 5940: gTemp(2) = 5860: gTemp(3) = 5830: gTemp(4) = 5800
    gTemp(5) = 5770:  gTemp(6) = 5700: gTemp(7) = 5630: gTemp(8) = 5570: gTemp(9) = 5410

    kTemp(0) = 5250:  kTemp(1) = 5080: kTemp(2) = 4900: kTemp(3) = 4730: kTemp(4) = 4590
    kTemp(5) = 4350:  kTemp(6) = 4200: kTemp(7) = 4060: kTemp(8) = 3990: kTemp(9) = 3920

    kTemp(0) = 5250:  kTemp(1) = 5080: kTemp(2) = 4900: kTemp(3) = 4730: kTemp(4) = 4590
    kTemp(5) = 4350:  kTemp(6) = 4200: kTemp(7) = 4060: kTemp(8) = 3990: kTemp(9) = 3920

    mTemp(0) = 3850:  mTemp(1) = 3720: mTemp(2) = 3580: mTemp(3) = 3470: mTemp(4) = 3370
    mTemp(5) = 3240:  mTemp(6) = 3050: mTemp(7) = 2940: mTemp(8) = 2640: mTemp(9) = 2600
   
    SOLAR_RADIUS = 696000
    SOLAR_TEMP = 5860
    SOLAR_ABSMAG = 4.83
    LN_MAG = 1.085736

        ' find the luminosity and the radius
        lumStar = (SOLAR_ABSMAG - Log(starMag) * LN_MAG)
        Select Case s
        Case "O"
            starTemp = oTemp(lumSub)
        Case "B"
            starTemp = bTemp(lumSub)
        Case "A"
            starTemp = aTemp(lumSub)
        Case "F"
            starTemp = fTemp(lumSub)
        Case "G"
            starTemp = gTemp(lumSub)
        Case "K"
            starTemp = kTemp(lumSub)
        Case "M"
            starTemp = mTemp(lumSub)
        Case "R"
            starTemp = mTemp(lumSub)
        Case "S"
            starTemp = mTemp(lumSub)
        Case Else
            starTemp = 10000
        End Select
        ' in kilometers
        starRadius = SOLAR_RADIUS * Sqr(lumStar) * (SOLAR_TEMP / starTemp) ^ 2
        ' divide to find times bigger than sun
        starRadius = starRadius / SOLAR_RADIUS


The code is pretty much copied straight from your source as you can see...but I must be missing something...because a star coded like this in the stc file in Celestia is 17.24 x rSun:

Code: Select all

400001 {
   RA  5.1732
   Dec  -72.4188
   Distance  13371.5285
   SpectralType "A1Ib"
   AppMag 15.00 # Radii: 0.554110757590765
}


AppMag is the value assigned to starMag...

As you can see the Radii is 0.55 rounded up according to my program...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#49by Rassilon » 15.11.2002, 03:35

Well I found the problem...I forgot to convert from apparent to absolute...but now with the new code Im getting invalid procedure call errors...and its a bit random so Im thinking Im pretty much screwed on getting this perfect...

Heres the new code if it does any good...

Code: Select all

Function Log10(X As Double) As Double
    Log10 = Log(X) / Log(10)
End Function

LY_PER_PARSEC = 3.26167

        appMag = starMag
        absMag = (appMag + 5 - 5 * Log10(distValue / LY_PER_PARSEC))



These are the two lines which are giving me the error:

Code: Select all

lumStar = (SOLAR_ABSMAG - Log(absMag) * LN_MAG)
starRadius = SOLAR_RADIUS * Sqr(lumStar) * (SOLAR_TEMP / starTemp) ^ 2


It doesnt specify if its because the value is zero or something basically I believe that means the procedure itself is illegal...justr not all the time...so Im skipping this till later...maybe I wont even include it...back to the old guessing game :roll:

Ok well the reason is negitive numbers so by using the Abs() command I cleared that out...and viola...no change...still doesnt compute the correct values...suprised? Hell I even omitted the spectural class and made it always class V and still no go...wtf is going on? Ive looked and looked over Celestias source finally figured out that I was needing absolute magnitude over apparent and it STILL wont work...Im beginning to think its Visual Basic...plus the fact I really dont know if these values are even computing right....
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

chris
Site Admin
chris
Site Admin
Posts: 4217
With us: 15 years 5 months
Location: Seattle, Washington, USA

#50by chris » 15.11.2002, 03:55

Rassilon wrote:These are the two lines which are giving me the error:

Code: Select all

lumStar = (SOLAR_ABSMAG - Log(absMag) * LN_MAG)
starRadius = SOLAR_RADIUS * Sqr(lumStar) * (SOLAR_TEMP / starTemp) ^ 2


It doesnt specify if its because the value is zero or something basically I believe that means the procedure itself is illegal...justr not all the time...so Im skipping this till later...maybe I wont even include it...back to the old guessing game :roll:

Ok well the reason is negitive numbers so by using the Abs() command I cleared that out...and viola...no change...still doesnt compute the correct values...suprised?

I think that you're computing the luminosity of the star incorrectly. To convert from absolute magnitude to units of solar luminosity, use this

Code: Select all

lumStar = exp((SOLAR_ABSMAG - mag) / LN_MAG)


You were actually doing it backwards, converting from luminosity to absolute magnitude :wink: As a result, you were taking the log of a negative number, well, it doesn't work so well . . .

Don't get too frustrated, just keep on coding . . .

--Chris

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#51by Rassilon » 15.11.2002, 04:11

Yeah thats what it was...I dont know what I did but I was copying the code straight from Celestia's source and hell I mustve copied the wrong formula...doh...

Thanks for being patient...even though Im not ;)
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#52by Rassilon » 15.11.2002, 18:40

I have a question...has anyone noticed a gap in the cluster at all...I dont mean a small one I mean one that could easily span 30 light years near the top of the generated cluster (also im noticing the stars more lined up than before too)...I dont remember seeing that but as with the notepad incedent...which didnt at first have chr$(10) appended to the script...worked fine...now all the sudden didnt...now again theres an issue with the cluster right out of nowhere...and I know I didnt change anything except add the new variables chris helped me with...and theres no way in hell thats affecting the stars because I use that exclusively for the planets...but yeah I know how I miss things so who knows...but at any rate if anyone notices this with the current version they have let me know...

Anyways I may have to redo the way I generate the cluster...and that will be another week or so tacked on to 1.2's release...oh joy ;)
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#53by Rassilon » 15.11.2002, 19:21

Heres what I mean by gap lol guess what this time is not me I swear...

Image

I found out whats causing it...I added a string buffer routine to improve performance...what it does is loads the script string to maybe 5000 characters them moves to over to a buffer string...somehow this move is corrupting the data or the actual randomizer routine in the program itself...I take it out it works fine....When I look at the stc file there is no gap in the count of stars...which would make sense as also not only is there a gap but like I said before the stars seem more lined up than mixed up like theyt were originally...sooo too bad for that because with the buffer it was running 10 times faster than before...10,000 stars took a little over 2 minutes!...

(double edit - Randomize Timer in the for loop was causing this go figure...Its been there since day one...Hey if it wasnt for bad luck I would have none at all)

Oh well suppose maybe I should just stick to graphics...or get linux...I bet the same code under linux would work fine...well same variant of C++ that is...
Last edited by Rassilon on 15.11.2002, 19:55, edited 1 time in total.
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

bh
bh

#54by bh » 15.11.2002, 19:25

Hi Rassilon...

Downloaded Ver 1.1 and generated a rather interesting looking ssc file. Took about three minutes on my setup. I've got pulsars, asteroids, moons, four ringed planets and two earth like planets! Still haven't seen them in celestia though.
A couple of questions.

1/ Can I tag this file on the end of extrasolar.ssc? Celestia will not talk to my extras folder. In fact the newly generated system is the only file I have in there.

2/ Is pulsar.3ds in the new textures zip file?

I will download this later tonight! I can't wait to see the results...aah for an Nvidia card!

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#55by Rassilon » 15.11.2002, 19:52

Answer to 1> Yes you can if you like...but it 'should' work fine in the extras folder...You mention that this is the only files in the extras folder? so I take it you havent tried any other addons to see if they work as well? In the celestia root folder theres a file named celestia.cfg In that file there sjould be this line:

ExtrasDirectory "extras"

If you dont see that line add it in...

Answer for 2...Oops I forgot that...Download the PSR1257.zip located in my website (links in my signature) and unzip to the celestia root or your desktop and move them over manually to your celestia root folder...models go in models textures go in textures\medres...and ssc goes in the extras folder...The starnames.dat you will need to access the pulsar by name only...or append this to starnames.dat located in the data directory...

300001:PSR1257

In any case thats what you need for the pulsar...I will make sure to include it in ver 1.2 update when it becomes available...

btw Another point goes to making seperate addon folders lol...It will cut back on my missing files maybe by 1 % ;)
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#56by Rassilon » 16.11.2002, 03:31

SUCCESS!! Yippie!

10,000 stars
Image

Finally figured out all the bugs and other bs...Ill be doing up a few extra planet classes now and should have this thing up by tomorrow...hell I just did a cluster of 10k stars in under 20 SECONDS!!!...it fricken screams now...

There will be tons more added features like a config file to save your settings and the ability to save your logs to the HD...A bit more convenient...I only hope there will be no more bugs and we can put this proggy to rest...If not oh well...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

selden
Avatar
selden
Posts: 10014
With us: 14 years 10 months
Location: NY, USA

#57by selden » 17.11.2002, 19:41

Ras',

What's the status of the next release?

I discovered another bug in v1.1.
When I asked it to generate a cluster of 1 star, checked the box for "planetary systems" and set the value at the bottom right to 100%, both Sample.ssc and Sample.stc were empty :(

This is with all other settings left unchanged from the startup defaults.
Selden

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#58by Rassilon » 17.11.2002, 21:54

lol ill fix that...try two stars for now and see if that does it...you might want to set the planetary chance to something like 100% and make sure you uncheck cluster explicit in the options box...

Release is delayed due to the fact im trying to make sure there are absolutely no more bugs and Im adding a custom planet option where you can add in custom planets or named planets if you like...This can be used to add in planets that use models or the like...

btw test the holy crap out of that thing...try to trip it up as much as you can and let me know what other bugs you find...thanks selden...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!

selden
Avatar
selden
Posts: 10014
With us: 14 years 10 months
Location: NY, USA

#59by selden » 18.11.2002, 00:28

Ras',

Well, I seem to be able to get 1 planetary system if I specify 10 stars...

Another collection of bugs:

The title bar of v1.1 says "Global Cluster Generator"
I think that's supposed to be "Globular..."

The Cluster generator needs an "interrupt" button to make it stop in the middle of a run. Killing it from the task manager is rather inconvenient..

Apparently v1.1 has problems with its probabilities for new planets.
I'd expect a probability of 10% to put planets around 1/10
of the stars of the cluster, but it seems more like 1/100.

Part of it may be your choice for the default random number seed. You should use one that itself has random bits on and off in it. (I usually use Pi in some form.)

Suggestion: it'd be nice to be able to specify the average number of planets per system.

Sometimes it doesn't seem to create any new planets at all.
For example, usually when I just change parameters and press Generate again, the planetary output file is the same as the last time. (as when I reduced the number of stars, but the resulting planetary .ssc started at a star index number greater than than the number of stars I'd requested.) It should zero the output arrays and recalculate all new stars and planets from scratch. Even if you don't change any parameters, the results should be different each time you press Generate, since the random seed for the new sequence should pick up where the last batch left off -- with different planets areound different stars. (The stars seem to be randomized reasonably, but not the planets.)

I hope this helps a little.
Selden

Rassilon
Topic author
Rassilon
Topic author
Posts: 1887
With us: 15 years 5 months
Location: Altair

#60by Rassilon » 18.11.2002, 02:06

selden wrote:Ras',

Well, I seem to be able to get 1 planetary system if I specify 10 stars...

Another collection of bugs:

The title bar of v1.1 says "Global Cluster Generator"
I think that's supposed to be "Globular..."

I'll fix that...

The Cluster generator needs an "interrupt" button to make it stop in the middle of a run. Killing it from the task manager is rather inconvenient..

Will be in v1.2

Apparently v1.1 has problems with its probabilities for new planets.
I'd expect a probability of 10% to put planets around 1/10
of the stars of the cluster, but it seems more like 1/100.

Part of it may be your choice for the default random number seed. You should use one that itself has random bits on and off in it. (I usually use Pi in some form.)

Suggestion: it'd be nice to be able to specify the average number of planets per system.


Ill put the specifier in and random seed should be in 1.1 but maybe I skipped it in the options...regardless its in 1.2

Sometimes it doesn't seem to create any new planets at all.
For example, usually when I just change parameters and press Generate again, the planetary output file is the same as the last time. (as when I reduced the number of stars, but the resulting planetary .ssc started at a star index number greater than than the number of stars I'd requested.) It should zero the output arrays and recalculate all new stars and planets from scratch. Even if you don't change any parameters, the results should be different each time you press Generate, since the random seed for the new sequence should pick up where the last batch left off -- with different planets areound different stars. (The stars seem to be randomized reasonably, but not the planets.)

I hope this helps a little.


I think I got it to plot planets better...btw selden on 1.2 beta make sure you place it on the c:\drive...I will probably fix it so as to recognize the config file no matter what drive...in C++ I remember it was "//directory" tried that in VB didnt work well I used "\\directory" but does it matter?
Ill try it and see...

Off to work...
I'm trying to teach the cavemen how to play scrabble, its uphill work. The only word they know is Uhh and they dont know how to spell it!


Return to “Development”

Who is online (over the past 5 minutes)

Users browsing this forum: 2 guests