As part of the "Create Game" logic, we need to generate a randomized galaxy to play the game in. The initial version of Galactic Usurper had this happen on the server side, but we decided that people would want to "play with" the generators a lot. To allow this without bogging down the servers we decided that offloading it to the client seemed like a good idea.
Therefore, we spent some time porting our old generation code from Java (what our back end is written in) to C# and getting it to run in Unity3d. Then we added a game creation screen to show off the various generators.
I've only got 7 generators at the moment (links go to pictures of the results):
- Random Generator - Just selects one of the below generators and runs it.
- Spiral Generator - Creates a spiral galaxy with variable number of arms and rotations.
- Star Field Generator - Creates a randomized (noise like) pattern of stars.
- Circle Generator - Creates a circular ring of stars.
- Wave Generator - Creates a sine wave of stars.
- Mandelbrot Generator - Takes a section of the Mandelbrot fractal as the stars.
- Julia Generator - Takes a section of the Julia fractal as the stars.
All the generators back down to the "star field" generation logic if they try to place a star in the same place as an existing star (or if it tries to place a star off the boundaries of the galaxy!) Therefore, you'll see a randomized pattern of stars filling in space along with the primary generation.
Enjoy playing with these at Galacticusurper.com