Skip to content

Instantly share code, notes, and snippets.

@flagoworld
Created January 19, 2014 02:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flagoworld/8499755 to your computer and use it in GitHub Desktop.
Save flagoworld/8499755 to your computer and use it in GitHub Desktop.
Procedural galaxy generator
Procedural galaxy generator
1. Randomly create systems using algorithm that approximates the shape of a galaxy
⁃ If point is too close to the solar system, don’t add it
⁃ Choose a system type to add
⁃ Star type? Black hole?
⁃ Check for nearby systems
⁃ If system is very close to another system
⁃ Add up to a couple planets, some debris, and another star at the center
⁃ Or if it’s a black hole, suck the system into the black hole… any close enough systems should also be sucked toward it
⁃ Dual black holes? Tri?
⁃ Else,
⁃ Place the system
⁃ Name based on counter
⁃ Create the star
⁃ Choose some planets based on a few random distances from the star and the star type
⁃ Planet names based on system name
2. Add a bunch of systems in a point cloud at the center of the galaxy
3. Create the Solar System in the same place every time
4. Fill out human systems randomly around the solar system until all are used
⁃ Chosen system depends on distance from Earth, as some are border systems
⁃ In each system, add planets distances based on the type of the planet
5. Fill out olympian systems
⁃ Beginning at a random point around the inner perimeter of the human territory
⁃ Offset that point along the vector of earth to that point by the same distance of earth to that point
⁃ Humans and olympians expanded synchronously, so they are relatively equal in territory.
⁃ Repeat same process of adding systems as human systems
⁃ Do not protrude into human territory
⁃ Find the nearest system bordering human territory and create there instead
⁃ If a system is already created there, restart from the beginning
6. Fill out gate builder systems
⁃ Begin at the farthest corner of the galaxy from the human territory
⁃ Add gate here
⁃ Add systems around it
7. Choose random empty systems around the galaxy
⁃ Fill out with systems of smaller species
⁃ Fill out with planets of non-space-faring species
8. Add defense installations to border planets
9. Add defense buoys and outposts around perimeters
10. Add SARs to human territory and connect a few of them from border planets into olympian territory
11. Create a single pathway into the heart of olympian territory
⁃ Note to self: Certified traders are able to purchase the SAD from olympian territory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment