Hi all,
What follows is a documentation of my design and solutions to creating a procedural universe system for Space Marmalade. I hope it'll be of interest to any following development of the game. This technique can be broken into 3 parts.
- Randomish Seeding
- L-Systems (kinda)
- Planitification
This gives us a pretty planetoid visualiser, which I plan to translate into a space exploration system.
(For the purposes of this article, I'll be referring to "Stars", "Planets", "Moons", etc as Planetoids to save from repeating)

1. Randomish Seeding
An essential component in Space Marmalade for me, is a deterministic procedural generation tied into the character creation system. That is to say, "if someone creates the same spaceship, that spaceship should be in the same 'universe'." To me, this is a solution to the "Inattentional blindness" problem that rogue-like games develop over time. In these games, because the game is different every time, the differences begin to feel less and less significant to the player as they grow accustomed to the formula that generates these worlds. The player is rarely given time to properly familiarize and develop an attachment to a procedural level, and once left it can become lost forever.
Instead, we can hash the choices a player makes when creating a ship into a seed value. Since these choices are largely aesthetical and difficulty selections, this creates a lot of personal significance and depth to making a seed. As the player builds an understanding for that solar systems "map", they can also share the combination of ship selections to another player and collaborate their exploration.
2. L Systems (kinda)
Once a seed has been determined, we can store this value in a string. My concept is to build an L-system that could convert strings into a solar system-like structure. When designing the system, I took inspiration from existing file path systems (eg: User/Documents/text.txt). I can use the "depth" of the path to determine the type of planetoid in the system (eg: the path Seed/Galaxy/Planet/Moon is a Moon).
One advantage of this pathing approach is that it is easy to traverse, by simply adding and removing '/'s. Another advantage is that saving the players position in this structure is as simple as recording a string.
3. Planetification
Once we have a path to the planetoid we want, we can hash this value to give us a deterministic random number. Using this value, we can determine the colour, size, and sprites of the planet. By removing the planetoids name at the end of the path, we can visualise the "parent" of the planetoid. We can also calculate the number of "children" the planetoid has, append their names to the path, and visualise those planetoids.
This approach allows us to explore a near-infinite star system with a small amount of computing and without any costly memory overhead.
I hope as the game nears completion, the advantages of this system will become more and more apparent.
Thanks for reading!

