News:

SimuTranslator
Make Simutrans speak your language.

A toy for people interested in space games and astronomy

Started by Spike, November 11, 2009, 03:46:22 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Spike

While last week I was very busy with pak.Excentrique, the one or other might have wondered why there are no news since a while. The answer is easy, I was busy with something else ;D

Long ago I had been working on an Elite II - Frontier clone. The project overall didn't succeed, but I had the galaxy and solar system generators mostly done, also a bit of the space flight and planet surface exploration parts.

I was reminded of this, and I tried to revive parts of the old code. Particularly the solar system generator was of interest for me, and so I started to port that to Java:

=> http://sourceforge.net/projects/solarex/

It's a Java Applet, and it needs the Java runtime version 5 or newer installed (the browser plugin should be installed and registered automatically with the Java runtime). I might port more of the old code and bring together something like a space exploration game some day. For the moment, you can generate any number of solar systems there, from random seeds, or seeds of your own choice.

If you experience oddities, problems, failures or have other, positive feedback I'm very interested.

Have fun playing with the solar system generator :)

Edit:

If someone has good ideas how to determine which planets should be bare rocks, or with an atmosphere, and then how dense that atmosphere should be, please let me know. Also, and linked to this problem, is, how to calculate surface temperatures for such planets. Currently the temperature calculation is really a very coarse guesswork.

Edit 2: Updated link to current project site.

VS

#1
I can't offer any help with the physics behind... how do you do the randomization now?

The one thing that caught my eye was lack of canvas to the right ;)

It's really funny, trying out all the various PINs that a modern man has to memorize to live... I can almost see it as a forum game - eg. what does it create from your phone number?

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Spike

#2
I'll add a scrolling area in the next version. I hope that should solve the problem of systems with too many planets being clipped.

The randomization is simple. With the seed a random number generator is seeded which is used for all subsequent steps, so a seed should always create the same system. It's been some years that I designed this, but if I remember right, first a sun type is chosen, then a sun size that fits to the type.

Then it's a normal distribution that is also randomized a bit - biggest planets use to appear in the middle, but there can be exceptions. Then a few rough guessing rules are applied what kind of planet might fit to the size and temperature of the chosen spot.

For each planet there is a number of moons rolled, and an optional space station. I had a version with moons for moons and stations for moons, but that caused problems. But I think such arrangements could exist in real, and will see if I can fix the problems.


Isaac Eiland-Hall

#3
I like that if you give a seed of "1", the sun is named "Zero".

This seems really neat!

VS

#4
Okay, I am hooked... I've been feeding it crc32 checksums of random text for some time... instead of doing schoolwork as I hoped ;D

Also, masses of these bodies are nowhere to be seen.

But it's fun already like this :)

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Spike

#5
Seems it was a good idea then to put it online :)

I still have dreams to make a space exploration game some day. The planets need to get resources then, and I must also port the galactical map code to Java. That shouldn't be too hard though.

I'll see if I can find references for the average densities of rock, ice and gas planets. With that it should be possible to calculate the masses. Surface gravity could be interesting for the next step, of planet exploration.

Updates for v0.12 since yesterday, v0.11:

- Added ring planet image
- Added scrollbars for systems with many planets
- Reduced download size by about 100kb

Now the jar archive is versioned, so browsers should recognize the new file and download it:

[link lost]

Quote from: Isaac.Eiland-Hall on November 11, 2009, 10:10:59 PM
I like that if you give a seed of "1", the sun is named "Zero".

This seems really neat!

Hehe :) These automated systems are full of surprises ;D

Ashley

#6
Quote from: Hajo on November 11, 2009, 03:46:22 PM
If someone has good ideas how to determine which planets should be bare rocks, or with an atmosphere, and then how dense that atmosphere should be, please let me know. Also, and linked to this problem, is, how to calculate surface temperatures for such planets. Currently the temperature calculation is really a very coarse guesswork.

Usually there's a band at a certain distance from the sun in a system where solar radiation isn't too high or too low to sustain life. This would depend on the intensity of the star. It will also depend on the composition of the planet in question, the strength of its magnetic field (to deflect radiation) and other things, like its rotational period and size and so-forth.

I think it'd be best to generate the size, distance from sun, rotational period, magnetic field, moons, rings etc. initially, then use those factors to determine how likely life is to exist on the planet. Some measure of chemical content for the planet and atmosphere (simplified of course) could also factor into this.

It'd also be cool to generalise this enough so that "strange" combinations could exist, e.g. life-bearing planets orbiting gas giants outside the normal habitable region of a solar system owing to additional energy from that large body. Or even systems with life-bearing moons orbiting a brown dwarf star in orbit around another star.

Dual-sun systems and so-forth would also be cool, and don't forget to add other forms of celestial phenomena to explore (e.g. pulsars, nebulae, black holes etc...)

I don't actually have Java installed here, so I can't play with it :(
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Spike

#7
Quote from: Timothy on November 12, 2009, 10:07:21 AM
Usually there's a band at a certain distance from the sun in a system where solar radiation isn't too high or too low to sustain life. This would depend on the intensity of the star. It will also depend on the composition of the planet in question, the strength of its magnetic field (to deflect radiation) and other things, like its rotational period and size and so-forth.

I've tried to improve the selection of such band. Actually this makes earth type planets even less likely, but will create some more venus type planets, with dense atmospheres.

I also fixed the creation of venus type planets far from sun. Those will now be ice bodies. I had an example of 7 Kelvin surface temperature, and surely most gas has condensed to fluid or ice even at that temperature.

I've also added "reverse temperature modifiers", so after the first step of temperature calculation, the base temperature will be modified by atmosphere (plus), ice (minus), and a few other factors. Seems to work good enough overall :)

Quote from: Timothy on November 12, 2009, 10:07:21 AM
I think it'd be best to generate the size, distance from sun, rotational period, magnetic field, moons, rings etc. initially, then use those factors to determine how likely life is to exist on the planet. Some measure of chemical content for the planet and atmosphere (simplified of course) could also factor into this.

Magnetic field and rotational period would be new attributes. But I guess both make good sense and I'll try to add those. The chemistry is on my plan too, but needs definitely some more planning, since if this will become a space exploration game some day, the question which minerals or valuable elements can be found on a planet will be important to the player.

Quote from: Timothy on November 12, 2009, 10:07:21 AM
It'd also be cool to generalise this enough so that "strange" combinations could exist, e.g. life-bearing planets orbiting gas giants outside the normal habitable region of a solar system owing to additional energy from that large body. Or even systems with life-bearing moons orbiting a brown dwarf star in orbit around another star.

Dual-sun systems and so-forth would also be cool, and don't forget to add other forms of celestial phenomena to explore (e.g. pulsars, nebulae, black holes etc...)

Brown dwarfs I had forgotten. Will try to add such. Pulsars I want to add too. Black holes seems fairly extreme, but it could be fun to generate one, rarely, just for variety.

I'm currently wondering why I never see systems where moons have moons again. The code should permit that if the parent moon is big enough, and far enough from the planet. Maybe the criteria is too narrow. But I suspect other bugs.

Quote from: Timothy on November 12, 2009, 10:07:21 AM
I don't actually have Java installed here, so I can't play with it :(

Nowadays flash is more popular, but I know Java pretty well and hoped it would be common enough so that a lot of people can use the applet ... ah well. maybe some day or on another PC you get the chance to test :)

Edit:

Update to v0.13!

I've started to work on a new feature, a "galactical map". At the moment it's only proof of concept to generate many systems on a map structure. Eventually I want to link the map and the system view so that one can inspect the systems from the galactical map in the system view.

Other than that, v0.13 has slightly improved planet generation rules, and creates less space stations than before.

=> [link lost]

Isaac Eiland-Hall

#8
I'm disappointed that seed 8675309 isn't named "Jenny" ;-)

Spike

@Isaac: Maybe some day ;) Just keep searching, maybe you find more funny matches.

A small update, v0.14 - Systems now can be clicked on the galactic map and will open in the tabular system view for inspection.

=> [link lost]

prissi

An extremely nice (and apart from space station not really unphysical time killer ... ) Well done!

Spike


Spike

I've compiled and uploaded a new version, 0.15

The biggest change is that moons can now have moons on their own, and that space station can orbit moons. This required a new system layout algorithm, and I'm not quite sure how well the new code will work. Also, I once had a failure in system generation during development, but the released version seems to work alright after adjusting some parameters. If you notice problems, please let me know.

Changes since v0.14:

- Moons can now have moons on their own if big enough
- Space station now can orbit moons
- More space station names
- Changed naming of planets slightly
- Changed number format to locale dependent formatting
- Info label will be positioned below the inspected column

=> [link lost]

In case something doesn't work alright I left the old version as a fallback:

=> [link lost]

vilvoh

One suggestion. The distances should be in AUs (Astronomic Units) instead of km. The figures would be smaller and clear.

1 AU = 1,495 978 70 × 1011 m .... http://en.wikipedia.org/wiki/Astronomical_unit

Some interesting improvements for future versions: comets and asteroids.

Escala Real...a blog about Simutrans in Spanish...

Spike

Ok, thanks for the suggestion. I'll do that, it will make the numbers more comprehensive :)

Does someone know where to find tables of the frequency of sun types - I mean something like "15 in 1000 suns are red giants" or such. Particularly I need to know how rare brown dwarfs, pulsars and black holes are, but it'd be good to have a more natural distribution of the other sun types, too.

Also, is it "white dwarf sun" or rather "white dwarf star"? I feel uncertain about the use of sun and star in this context.

What I want to work on next is mass, gravity and orbital periods.

VS

Quote from: Hajo on November 15, 2009, 12:16:24 PM
Does someone know where to find tables of the frequency of sun types - I mean something like "15 in 1000 suns are red giants" or such.

Sounds like the right question for mr. Wolfram. However, nothing solid comes out. This might be because
a) it's an astronomical taboo,
b) it makes no sense to do this for some reason,
c) I missed some important keyword,
d) it costs $$$.
(in order of increasing probability)

If you base your search on this, you might end up with some raw data...

http://www.wolframalpha.com/input/?i=star+temperature
http://www.astro.utu.fi/EG/encyclo/SpectralType.shtml
http://www.stellar-database.com/
http://en.wikipedia.org/wiki/Stellar_classification
http://en.wikipedia.org/wiki/Star_catalog
http://en.wikipedia.org/wiki/Main_sequence
http://www.ucm.es/info/Astrof/invest/actividad/spectra.html

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Spike

Thanks for the links, I'll check those!

At the moment I'm puzzled how to display planet mass. For example a planet with similar density like earth:

Radius=4929 km -> Mass=2.7663720020915305E21 t

It seems to be right, even, compared to earth weight from wikipedia (earth is a bit bigger than this fictional planet).

That's a number with 21 digits in normal notation, and tons are among the biggest measure for mass that people are used to ... I guess I need to make that megatons (mt ?) or use the scientific number format like above. Suns and such are even heavier :o

Does someone know how to calculate surface gravity for a planet from mass and radius?

Edit: Maybe give weight in multiples of earth weight? Like distance in multiples of sun-earth distance (au)? What unit should be shown there, "1.5 earth masses"?

Edit 2: Multiples of earth weight works and gives comprehensible numbers. So that problem is solved :) Still need to change to astronomical units, but the weight problem was more ... erm, heavy ;D.


prissi

The usual way planets and brown dwarfs are classified are in units of Me (mass earths) Mj (Mass Jupiter) and (Ms) Mass sun. (Apart from the official ones of course.) See the extrasolar planet catalogue: http://exoplanet.eu/catalog-all.php (here one could also get nice figures about distribution of the existing ones.

Spike

Thanks for the hints, Prissi :) The number of times that I mixed mass and weight in my last message must have been scary for a physicist. Sorry for that.

Those planets are mostly a bit on the heavy side, because we still have problems to discover lighter ones ... so until we know better, I'll use or system as an example for distribution.

Distances are now given in AU, also.

Did you miss a planet type in the simulation so far? There are no volcanic bodies, or molten ones yet. Also no brown dwarfs. But I don't know if there are other types that I should include.


skreyola

Quote from: Hajo on November 15, 2009, 12:16:24 PM
Also, is it "white dwarf sun" or rather "white dwarf star"? I feel uncertain about the use of sun and star in this context.
Star is the correct generic in English. I believe sun usually refers directly to Sol, though I have seen it used in a generic sense, but it sounds awkward.
--Skreyola
You can also help translate for your language with SimuTranslator.

prissi

I do not think there are molten planets (from rare exots apart), since for a planet to form it needs to be cold enough. Molten stone looks not like a good candidate for condensation (since it needs to be stable for aeons ...)

isidoro

Quote from: Hajo on November 15, 2009, 05:25:32 PM
Does someone know how to calculate surface gravity for a planet from mass and radius?

That's simple.  With Newton's formula:

   g=G.M/(R.R)

G is the gravitational constant: http://en.wikipedia.org/wiki/Gravitational_constant
M is the mass of the platet
R is its radius

9.8 m/(s.s) is the value for Earth, if you want to compare with it.

Spike

@Prissi: Ok, I'll leave molten bodies out. The only type that came to my mind was an ice body with atmosphere, such could exist I think.

@Isidoro: Thank you for the help. But I thought this formula assumes that all mass is located in one point, particularly that the distance "R" is void of mass. For a planet mass is (not really, but for sake of simplicity I want to assume so) uniformly distributed in the globe, so the mass fills all the distance "R", and even the negative "R" as well. I felt uncertain if the formula is still correct?

Quote from: skreyola on November 15, 2009, 10:33:42 PM
Star is the correct generic in English. I believe sun usually refers directly to Sol, though I have seen it used in a generic sense, but it sounds awkward.

I'll use star, then. Thanks for the help :)

The Hood

Hajo, with respect to the mass being located in one point, it turns out it doesn't matter how the mass is distributed in the radial direction, as long as this radial distribution is the same for all angles (a reasonable assumption for a planet/star).  If you are completely outside of the mass (or on its surface), it is equivalent to a point mass of M at the centre.  So yes, in short, the formula still holds true (derive the calculus for it if you want to prove it... ;))

Spike

My last math lesson happened 10 years ago or so ... I definitely won't try to develop such formula on my own ;) But it's good that this project refreshes some of the math and physics basics. Thanks for help and advice :)

I hope I'll have the mass and orbit questions solved soon, and can continue to work on the planet resources ides - space mining was always a dream of mine :)

Edit: Should red and blue giant stars have planets at all? Red giants should have eaten all the inner planets when they grew? So maybe only a few planets remained there? Blue giants don't live long (compared to other star types), and have very high radiation power. If there are planets, they need to be far away from such stars? I know this is a half-fantasy project, but I'd like to keep it sensible within some, admittedly very far, stretched limits.

Edit 2: Radiation power of a star is proportional to "star surface times surface temperature"? Surface temperature of a planet is roughly proportional to "sun radiation_power times distance from sun, squared"? Is that correct?

Atmospheric modifiers and albedo can be calculated after this coarse temperature guess, I think.

prissi

Well unitwise power/distance=Joule*speed (and is not Kelvin which could be converted to Joule). So I think there is something missing.

Spike

A real calculation appears very difficult for me, because the surface temperature seems to be the temperature where incoming power equals radiation power (since the planet is warm, it radiates). I've decided that for a toy/game an approximation that gives believable numbers is good enough.

Interesting effect: White dwarf stars have a very narrow band where earthlike planets can be, while the bigger suns have a much wider band.

I think I'll call the temperature solution "good enough" now and will dig into the orbit and orbital period questions next.

Edit:

I've uploaded a preview of the next version. I feel uncertain if it's good/stable. I tried to make star sizes more realistic, and it crashed a few times when generating real giant blue/red stars. The released version worked well for me though, so I keep hoping.

Changes since v0.15

- More realistic star sizes
- Orbits now given in au, unless distance is less than 0.0001 au
- Mass calculations for all bodies
- Planet masses are given in "earth masses"
- Star masses are given in "sun masses"
- Changed "sun" to "star" in a few places
- Changed surface temperature calculations. Seems reasonable, but I wonder if a gas giant at 40 kelvin should become an ice body rather. Suggestions are welcome :)

Preview:
=> [link lost]

vilvoh

About the star size issue, I've found this amazing video that shows a comparison of sizes between planets and knows stars of the universe.

Escala Real...a blog about Simutrans in Spanish...

DirrrtyDirk

Everytime I get to think about these numbers and sizes ... I just feel so... well... tiny.

Great Video you found there, vilvoh - thanks for the link!
  
***** PAK128 Dev Team - semi-retired*****

isidoro

Quote from: Hajo on November 16, 2009, 10:42:02 AM
My last math lesson happened 10 years ago or so ... I definitely won't try to develop such formula on my own ;) But it's good that this project refreshes some of the math and physics basics. Thanks for help and advice :)

In fact, it easily forwards from:
1) Gauss' law for gravity: http://en.wikipedia.org/wiki/Gauss%27s_law_for_gravitational_fields
2) Spherical symmetry assumption


Quote from: Hajo on November 16, 2009, 10:42:02 AM
Edit 2: Radiation power of a star is proportional to "star surface times surface temperature"? Surface temperature of a planet is roughly proportional to "sun radiation_power times distance from sun, squared"? Is that correct?

Atmospheric modifiers and albedo can be calculated after this coarse temperature guess, I think.

A first approximation may be to consider stars as black bodies (http://en.wikipedia.org/wiki/Black_body).
Then, apply Stefan-Boltzmann law: http://en.wikipedia.org/wiki/Stefan-Boltzmann_law
There are some examples in the latter page for the sun and other stars.

Surface temperature of a planet is more difficult, I guess.  Greenhouse effect plays an important
role in planets with atmospheres.  Light from the star pass through the atmosphere and
the black body radiation from the planet is kept.  Consider Venus, for instance.

Spike

Quote from: vilvoh on November 16, 2009, 11:46:31 PM
About the star size issue, I've found this amazing video that shows a comparison of sizes between planets and knows stars of the universe.

Because of those problems, my applet displays not the true size, but sizes proportional to sqrt(size). Thus smaller objects appear larger in comparison to bigger objects than they'd in reality.

@Isidoro: Thanks for the links! My current approximation used an "energy loss by radiation" proportional to T^2, but it's really T^4, so I might use that to adjust my approximation. I think that will help to keep inner planets cooler while the outer ones don't become so terribly cold. Must try and test :)

Greenhouse effect I have implemented very simply as a temperature multiplier for planets with atmosphere. At the moment the components of the atmospheres are not simulated, so only a very generic factor is used there, 1.1 to 1.5, depending on atmosphere density.




prissi

I think for most planets they could be most likely consider black bodies. Among our solar system only Venus shows strong deviations. (Earth is less than 25°C) While this make the difference between freezing or not, it is quite small given the other errors like internal heating from radiactive decay (earth radiates twice the erceived energy from the sun) or low level fusion (JUpiter) and HElmholtz contractions. Generally, the larger a planet, they "better" its internal heat source.

And I had a system with habitable moon so this works too.

Spike

Habitable moons are rare, but exist :)

v0.16 seemed good enough to be moved to the official place:

=> [link lost]

One problem is known: The info label for moons/stations can sometimes overlap with the name label of big gas giants. This will be fixed in the next version. Also I've made a better image for rocky planets with atmosphere, and once more reworked the temperature calculations. Not enough changes though to already release a new version again.

Planet preview - a dry, rocky planet with thin atmosphere and pole caps:

[link lost]

jonasbb

You see too much pixels at big stars

Could such a planet exist in real? A earth like planet with 3,2 times earth mass or with 351 Kelvin that are 78°C

Spike

I wanted to conserve download size, so suns only have a resolution of 256x256 pixels. And the red giants (also the blue giants) are sometimes much bigger on screen. Java scaling makes them look quite pixelated then. I decided to call that "good enough", but if needed I can supply a higher resolution image for the giant stars.

Such planets can exist, I think. Question is if it should be called earth-like. Water would still be fluid, gravity would be higher than earths, and atmosphere also more dense ... I think I made the classification of earthlike go up to 80°C.

Maybe a new planet type would be needed "rock body with dense atmosphere", in opposition to the venus type planets with "corrosive atmosphere", and be placed in between the earth and the venus type planets.