Planet Builder 1.0

The place to discuss creating, porting and modifying Celestia's source code.
Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #21by selden » 12.11.2002, 18:38

Ras',

If you aren't already doing so, I'd suggest generating all of the random positions and orientations (and motion vectors?) in x,y,z (or r,theta,phi) coordinates with the origin at the center of the cluster. Only translate into RA, Dec and parallax as the very last step (as deltas from the origin), after deciding (manually? randomly?) the position and orientation of the cluster. Varying the cluster's orientation is irrelevant for random spherically symmetric clusters, but I'm rashly assuming that the generator could be persuaded to generate other shapes (galactic shapes, maybe?) intentionally.

If you're already doing it this way, then it could be that the translation from x,y,z to RA,Dec,parallax is at fault.

Does this help?
Selden

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 10 months
Location: Altair

Post #22by Rassilon » 12.11.2002, 19:24

Thats a brilliant idea but sadly my problem lies in finding out the position the points are being placed afterwards to be coded into the stc file...Not to mention it already takes 30 minutes to plot 10k stars...Another pass through a 10k loop of variables would surely double that timeframe...Time to break out the assembler...bah thats what C is for all praise asm {} hehe!

like how many degrees in Ra is 1 light year? or in Dec? and it being relative to distance makes it a bit harder...if I find the formula for this then I will be back in business...Unfortunately my luck in finding this on the net has been far from successful...I will research more into this and try to figure out a better method...I suggest that Celestia allow for a better plotting method alternate for such programs as these which is a given as someday it will be needed as the further out (yes chris now I think I understand the problem) stars are plotted the more inaccurate they become...but then my specialty 'usually' is finding a way to 'cheat' the system :mrgreen:

Ill keep you posted...

edit - hmmm... http://image.gsfc.nasa.gov/poetry/ask/a11833.html...I guess Im blind or getting old...I think its the latter...All this math is burning out my synapses :P
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!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #23by selden » 12.11.2002, 19:46

Ras',

Determining the (Earth centered) RA and Dec of a star that's a member of a cluster is a problem in spherical trigonometry. It's actually been a long time since I even thought about such things, so I can't state the relationships without looking them up. Given the name of the problem category, perhaps you can find an appropriate textbook in a local bookstore or library (or even online :) ). I'm sure I have some at home, but I'm at work now.

The CPU time needed to do the arithmetic of the coordinate transforms should be unnoticable compared to the time needed to write the output file, so it shouldn't matter what language you use for that part of the program. The code needs to be readable and understandable (i.e. debuggable and portable), so I strongly urge you not to use assembler. Anyhow, most of the time in the numeric calculations would be spent in trig functions, which you probably cannot write better than are provided in the math library accompanying your compiler.

I hope this helps a little.
Selden

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 10 months
Location: Altair

Post #24by Rassilon » 13.11.2002, 07:01

never mind I found the files I needed...this will be the last release using VB I suspect...
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!

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 10 months
Location: Altair

Post #25by Rassilon » 13.11.2002, 07:59

Ok heres the files:

Win32 exe 1.2 megs...linux etc users I promise to make some clusters for you to play around with...
http://www.shatters.net/~rassilon/Generator.zip

http://www.shatters.net/~rassilon/gc_tex.zip

All you really need is the top file for the program to work...If you want the planets to work however you will need the 25 meg gc_tex.zip file...

I will update the website manyana...right now I need a break...peace people...
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!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #26by selden » 13.11.2002, 12:49

Ras',

Thanks, a lot!

I think the easiest way to handle your Web site is to rename the 'index.html' (or whatever it's called) to a non-default name like 'readme.html'. That way visitors to the Web site will see a directory of the files instead of the html page but still have the option of reading your descriptions of the files. You won't have to update the readme every time you upload something new just to keep it from being hidden.
Selden

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #27by selden » 13.11.2002, 13:08

Ras',

When I try to run cluster.exe, I get the error popup "unable to find RICHTX32.OCX"

This is on under WinXP Pro sp1. I don't have MS Office, Word or Visual Studio.

In general, you don't need to copy OCX and DLL files to system directories. The program will find them if they're in the same directory with the program itself. Replacing libraries that are in system directories is a big no-no, since they may be quite different (older, newer or completely different but with the same name) and other packages may depend on whatever's different about them.
Selden

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 10 months
Location: Altair

Post #28by Rassilon » 13.11.2002, 16:28

Yeah the program calls for them on my system but not the richtext control...I'll update it later...or just rewrite it in something else...any suggestions? Java was mentioned but the thing is will it allow you to build a GUI?

Heres the control: http://www.shatters.net/~rassilon/RICHTX32.zip

Generator zip also has been updated to reflect the changes you mentioned...
http://www.shatters.net/~rassilon/Generator.zip
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!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #29by selden » 13.11.2002, 16:45

Java libraries are available to implement GUIs. I don't think they're included as part of the JDK, though. See http://java.sun.com/products/jfc/

Who needs a steenking GUI, anyhow? ;)

I could imagine the GUI development being a *lot* more work than porting the cluster and planet creation algorithms. Maybe somebody can suggest something that's easy to adapt?
Selden

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #30by selden » 13.11.2002, 17:28

Ras',

it seems to run fine under WinNT4 sp6a!
(But this system has a full Office environment, so I might not notice other missing files.)

There are some trivial things I'd suggest:

In the About window, put the program name and version on a line
separate from the URL of shatters.net

Add a few usage notes to the readme file:

mention that one should add an entry of the form
4000000:NGC104
at the end of /data/starnames.dat

Mention that the output file spec isn't requested until everything has been created.

Say what the system resource requirements are.

Related to that: where are the star (and planet) definitions created?
Are they all kept in memory until the end when it prompts for a destination filename, or are they written to a scratch file somewhere? If the latter, where is the intermediate file written?

Thanks again, this looks like a fun toy!
Selden

HankR

Post #31by HankR » 13.11.2002, 20:04

Rassilon,

Where's the source code?

- Hank

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 10 months
Location: Altair

Post #32by Rassilon » 13.11.2002, 20:25

lol looks like there will be a version 1.1 soon ;) I also found another glitch today...the center star isnt being placed in the center...the one thats supposed to be a black hole that is...

The portability bit doesnt suprise me...What I need is a fresh install of Windows to test these before I release them that way I can make sure I have all the required dll and ocx files available at the time of release...

Hank...Ill be releasing the source code here as soon as I work out all the bugs...
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

view clusters

Post #33by bh » 13.11.2002, 23:54

Rassilon...

How do I view the stc file in Celestia. It's in the extras folder at the moment. Do we have to modify stars.dat and others...?

I'm really looking forward to see what I've created.

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 10 months
Location: Altair

Post #34by Rassilon » 14.11.2002, 00:01

What HIP number did you start with...if it was 400000 then hit Enter, type HIP 400000 and Enter again then 'G'...
I think Im going to add a small editor window into version 1.1 so you can see the code you generated but for now the best thing to do is locate the file you saved according to filename and directory and load it in Wordpad not notepad...For some odd reason linefeeds and carriage returns arent working well in notepad...maybe I can get that figured out but I doubt it as it worked for a while then all the sudden didnt...go figure...Anyways I just started sorting all the fixes and should have a new version up for grabs tomorrow...
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!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #35by selden » 14.11.2002, 02:17

Ras',

The appearence of the text file in Notepad suggests that only the line-feed character (which also is defined as the "newline" character and is what Unix uses) is being written to the file as the line terminator. DOS and Windows traditionally want to see a pair of characters: <carriage-return> followed by <line-feed>. I don'tknow how you're spedifying the output, but a slip of the finger might have accidentally deleted whatever indicates that a <carriage-return> character needs to be included.
Selden

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 10 months
Location: Altair

Post #36by Rassilon » 14.11.2002, 04:21

Yup thats what it was seldan...forgot chr$(10) ;)

Well heres the next version 1.1...It has a bit more features and runs a bit better as well...Make sure you read the README! file to see all the new changes...

http://www.shatters.net/~rassilon/Generator.zip
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!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #37by selden » 14.11.2002, 11:49

Ras',

Here's a list of trivial bugs:
1) The Abut popup still says v1.0 in 1 (of 4) places.
2) minor English usage problems in tooltip popup
a) "Also the HIP number specified will also..."
only needs one "Also"
b) "...is to specifying..." should be just "... is to specify..."
3) I think there may still be some problems with the random values.
I'm not absolutely certain, but NGC 104 seems to be not quite spherical.
(One goal, if it isn't already, might be to make it look as much as possible like the real thing while still using random values for all its parameters.)

Suggestions:
1) Specify the RA, Dec & distance to more digits to reduce the quantization of star locations
(don't be shy: use the full range of the exponential field width)
2) Add luminosity classifications to the SpectralTypes
3) Supply the source code in "plain text" format, too. I don't have Visual Basic, and most of the files seem to be in some kind of binary that can't be read with a text editor.

NotABug:
Did you use multithreading on purpose?
It actually makes some use of the 2nd processor on a dual-iprocessor system! Although only uses 50%, most programs don't at all.



I hope this helps.

Thanks!
Selden

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 10 months
Location: Altair

Post #38by Rassilon » 14.11.2002, 14:04

selden wrote:Ras',

Here's a list of trivial bugs:
1) The Abut popup still says v1.0 in 1 (of 4) places.

oops :P

2) minor English usage problems in tooltip popup
a) "Also the HIP number specified will also..."
only needs one "Also"
b) "...is to specifying..." should be just "... is to specify..."

ok well ill fix those for v 1.2

3) I think there may still be some problems with the random values.
I'm not absolutely certain, but NGC 104 seems to be not quite spherical.
(One goal, if it isn't already, might be to make it look as much as possible like the real thing while still using random values for all its parameters.)

You can adjust this manually by messing with the R, D and d labeled text boxes... R = Ra adjust, D = Dec adjust, and d = distance adjust...Ill play a bit with that myself at some point...One suggestion when doing this is use only 1000 stars, decrease the base magnitude to 10 or something and generate. When messing with those increment by what the tool tips state...Too big will be flying saucer shaped ...

Suggestions:
1) Specify the RA, Dec & distance to more digits to reduce the quantization of star locations
(don't be shy: use the full range of the exponential field width)

chris is using single variables for those...I suppose single variables will make use of the exp abbreviated system at some point but I believe double still is far superior to that in accuracy...One of the reasons why we dont have stars past the 16k barrier is I believe chris mentioned he used single variables... They only stand out as 0.0000 in the decimal placement dept.

2) Add luminosity classifications to the SpectralTypes
3) Supply the source code in "plain text" format, too. I don't have Visual Basic, and most of the files seem to be in some kind of binary that can't be read with a text editor.

Ill copy and paste into notepad all my code them for v 1.2 but as far as luminosity class...this is the 0-9 correct...yes I will fix that for 1.2

NotABug:
Did you use multithreading on purpose?
It actually makes some use of the 2nd processor on a dual-iprocessor system! Although only uses 50%, most programs don't at all.


Visual Basics multithreading command is DoEvents I believe...I suspect most leave it out in thier programs...why I havent a clue...Probably cause they rush out the first version and never make a second :P

Also I noticed last night the orbits of the planets still arent that great...As rare as earth like planets are in the generator I came across one out of 100 or so that was 500 kelvin...granted this may just be a limitation of the random process...theres always one that slips by...I also did notice that it never makes more than 1 planet preceeding an earth type...and the program is too limited in specifying bodes law on moons...I believe its bodes law...remember Im trying to remember all this stuff I used to know as a kid...I am getting old hehe...

To the point I will be also fixing that in release 1.2...and will probably include another texture pack in addition to the first...and maybe a few other suprises...like more planetary classes...any suggestions there?
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!

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #39by selden » 14.11.2002, 14:33

Ras',

By "luminosity class" I meant one of
I-a0, I-a, I-b,II,III,IV,V,VI

e.g. G9II or G9I-a0

Celestia's default is V

See http://physics.njit.edu/~dgary/321/Lecture6.html

The number after the first letter is the spectral sub-class.
Selden

Topic author
Rassilon
Posts: 1887
Joined: 29.01.2002
With us: 22 years 10 months
Location: Altair

Post #40by Rassilon » 14.11.2002, 16:36

No matter I ended up adding them both in as random...Now the stars are a bit more variant...Now Im wondering... if the central star isnt chosen as a black hole would it be a supergiant of 1000-5000 suns or is this a bit much? Thats the default btw...Now theres also planets...Would planets be pretty much exclusive to class V stars or would they reside in other classes...well in theroy anyways...

Also I hope your not the only one using this selden...If not I want more feedback dammit :mrgreen: Trust me it gives me the modivation to add more...nah I have enough modivation for 2 where Celestia is concerned...it just helps alot ;)
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”