Sign in to follow this  
Hyunkel

Star locations in a galaxy.

Recommended Posts

Hi,

I'm searching for some reading material about how stars are positioned inside different types of galaxies.
My ultimate goal is to create a procedural galaxy generator, but to do so I first have to understand the physics behind galaxies.
I don't really need a physically correct galaxy though, I just want something that looks good, so I welcome any other suggestions on this matter as well.

Cheery,
Hyu

Share this post


Link to post
Share on other sites
In a spiral galaxy they're in the arms so I'd probably start by generating a graph with a center and a random number of arms. Then generate more stars at the beginning of arms and less as you go to the ends. The spiral galaxy wikipedia article has pictures.

Also ysaneya on the forums did what you might want already. Might give you some inspiration.

His octree method is probably the best idea.

Share this post


Link to post
Share on other sites
I'd do like the previous poster said. Just hard-code the basic types of generation algorithms like spiral, barred spiral, elliptical, etc. Randomly generate based on a few parameters.

Trying to model actual physics is far more complex than you're gonna need. Getting into density waves and such is overkill if you just want it to look like a galaxy.

Share this post


Link to post
Share on other sites
Quote:
Original post by sporff
I'd do like the previous poster said. Just hard-code the basic types of generation algorithms like spiral, barred spiral, elliptical, etc. Randomly generate based on a few parameters.

Trying to model actual physics is far more complex than you're gonna need. Getting into density waves and such is overkill if you just want it to look like a galaxy.


Plus (a few years ago, at least) the physics is not even fully understood of all types. I mean, okay gravity, but some of the shapes weren't described well.

This statement definitely needs clarification.

Share this post


Link to post
Share on other sites
Thank you for the replies.
I always thought ysaneye did his generation physics based, however, in his dev journal he states:
Quote:
To generate the spiral arms, the probability is looked up from a "density map" ( similar to a grayscale heightmap ).


So basically, I'll need a density map for each type of galaxy I want to use first. (which I can either base on imagery of real galaxies, or generate it procedurally as well)
Then I will need a function that calculates the density for a given position, using the density map, the distance to the center of the galaxy, the distance to the closest globular cluster etc...
The density then tells me how likely it is that a star is in this location.

I can then create stars at random positions, test them against the density, and add the ones that pass a probability test to the scene.

Am I on the right track?
Sounds good so far, so I'll probably go with that.

Thanks for the help!
Hyu

Share this post


Link to post
Share on other sites
I read somewhere that the increased stellar activity (e.g. supernovae) in the spiral arms may sterilize planets on a regular basis. The Solar System is in one of those darkish regions between the arms. You could have the generator put all the alien civilizations in the dark regions to make the map less homogenous. Homogenity is boring.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hyunkel
I can then create stars at random positions, test them against the density, and add the ones that pass a probability test to the scene.


You might be better off testing a uniform grid of positions against the density and only use the randomness in generating the density map. This should give you more control on how many stars actually appear in the scene; with random positions you'll have extreme cases where there simply are no stars at all. Another plus is that it should give you repeatable results; a given density map will always look the same, which is probably a good thing if your player decides to visit a galaxy again at some later point in time.

For some random rambling, it might be surprising to see how many stars actually make up a galaxy. The number in our galaxy alone goes into the hundreds of billions. In a little toy project, I've rendered 100k well known (and prominently visible) stars surrounding earth from astronomical data and this already looks quite crowded, but it doesn't even approach looking like a faint outline of a spiral arm. I just find this fascinating, but it also might be somewhat useful to keep in mind when determining the scale and the desired accuracy of your simulation.


[Edited by - remigius on October 12, 2010 3:06:08 AM]

Share this post


Link to post
Share on other sites
Hey remigius,

Thanks for your input.
After some initial testing I quickly realized that seeding with random points is a bad idea.
A uniform grid such as you suggested works much better, and it is also much easier to create a galaxy that looks the same way every time you visit it.

As for the total amounts of stars, yes, it's crazy.
I'm not really sure how high I want to go yet.
I suppose I'll either go with a much lower number, or I'll use some sort of culling based on the distance and size of the stars.

We'll see, at first I want to get it to look decent, and I'll just go from there :)

Share this post


Link to post
Share on other sites
Quote:
Original post by JoeCooper
I read somewhere that the increased stellar activity (e.g. supernovae) in the spiral arms may sterilize planets on a regular basis. The Solar System is in one of those darkish regions between the arms. You could have the generator put all the alien civilizations in the dark regions to make the map less homogenous. Homogenity is boring.


Sol lies smack in the middle of the Orion arm, actually. [url=http://www.atlasoftheuniverse.com/nebclust.html]This web page[/url] has some rather interesting maps showing our surroundings. One of the more interesting on it is [url=http://www.atlasoftheuniverse.com/2000lys.html]this 2kly Sol neighbourhood one[/url], which shows some of the macrostructure of the arm - in particular, the nearly empty dark "bubbles" of space thought to be places where supernovae exploded and pushed other star systems away.

Share this post


Link to post
Share on other sites
I've experimented with uniform grids a bit, but I've run into a bit of trouble.

It works very well together with density testing, but the grid structure remains visible unless the max density is very low ( below 0.5% ).

So if I want a total of 100k stars for example, I need to create a grid containing over 20 million points.
This is obviously quite slow to compute.
I'm not really sure what the best approach is to tackle this problem.

I'm playing with the idea of using a non-uniform grid, but I'm a bit afraid of running into problems at a later time.


Just wondering if anyone has another idea how to approach this?

Cheers,
Hyu

Share this post


Link to post
Share on other sites
I think you may be doing something similar to me :)
I am making a game much like the old Elite / Frontier games. I have been very interested in how those games were created given that they modelled a realistic galaxy with millions of stars. There is a good website which explains how it was done for those games [url="http://www.jongware.com/galaxy1.html"]here[/url]

I've used a very similar system in mine although on a larger scale. Using a grey scale image of a modified picture of the milky way (1000x1000 pixels) I get all of the data I need to create then entire galaxy via procedural generation (The entire data set for the galaxy is stored in a file which is only 978 KB). Basically my galaxy is 1000x1000 sectors and each sector can contain anywhere upto 1020 star systems. That gives me 75,771,716 star systems (couldn't sleep one night so I counted them ;)) I do that taking the color value of the pixel (0-255) and multiplying it by 4 to get the amount for that sector.

The 3d engine I have which displays all the stars only displays the sector I am looking at and the 8 others around it. So I only need to show 9080 stars at any given time. Seeing as that there is only a maximum of 1020 stars in a sector (each sector is 512x512x60 units) the chances of any 2 stars overlapping is highly unlikely. I was concerned about this so left my pc on for 2 days to check each and every sector and the closest any 2 stars were to each other was 4.7 light years :P

Anyway hope that helps, sorry I havent had time to read the whole thread so I may be going over old ground. Any some pics to illustrate what I mean...

One whole Sector with 1020 stars...
[img]http://i1117.photobucket.com/albums/k597/daveyrobinsonuk/11.jpg[/img]

Zoomed out with a full 9 Sectors (9080 Stars). Note only the central Sector generates star system names....
[img]http://i1117.photobucket.com/albums/k597/daveyrobinsonuk/10.jpg[/img]

And just some others showing what it is all like close up....
[img]http://i1117.photobucket.com/albums/k597/daveyrobinsonuk/5.jpg[/img]
[img]http://i1117.photobucket.com/albums/k597/daveyrobinsonuk/3.jpg[/img]
[img]http://i1117.photobucket.com/albums/k597/daveyrobinsonuk/6.jpg[/img]
[img]http://i1117.photobucket.com/albums/k597/daveyrobinsonuk/8.jpg[/img]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this