We originally promised a game that takes place in an infinite procedural world yet consists of lots of hand-mapped areas. Today I have successfully tested the system that will make that possible, read more to find out how it’s going to work.
There are no borders in the universe of Zero Falls aside from the boundary between your current sector and the next one. Everywhere you look in our infinite galaxy you will find stars, planets, asteroids, and empty space, and that’s about it. That’s the problem with procedurally generated infinite worlds, you often end up with an infinite scrolling backdrop of the same stuff over and over.
So why are they so popular then? We’re seeing a lot of games these days with infinite procedural universes, so there must be something to it. Well it’s because the prospect of infinity is so compelling, almost as compelling as the idea of not making any level files. Indeed the often overlooked aspect of designs which focus on procedural generation is that you don’t create any actual maps yourself, usually because you can’t. That’s because when you have a procedural algorithm that determines the shape of your world, it is often difficult if not impossible to take part of that world and sculpt it by hand, the two systems aren’t easily made compatible. Game designers often see this as a positive byproduct, because mapping every level by hand is a difficult and time consuming task.
Since I apparently don’t have any interest in doing things that are easy, I’ve decided to build a system that allows manual mapping inside an infinite procedural universe.
In Zero Falls, and in any subsequent mods made for the Wayward Terran Frontier engine by the community we want the engine to handle a continuous blend from 100% procedural to 100% hand made at every level of detail and every order of scale across the entire game universe. A lofty goal. When perfecting the single player experience of Zero Falls, we will be using and improving this system, so effectively our goal is to make Zero Falls as if it were a mod for the Wayward Terran Frontier engine and as much as we can we are going to be trying to make our content using the same tools that will eventually be available to modders.
Our goal is to make every sector into an open canvas for anything to be created while retaining the convenience of procedural-by-default generation. We don’t want mod makers to worry about filling empty space, or how much texture memory they use, or how optimized their generation algorithms are, or comparability with other mods. We want them to be able to just create whatever they can imagine and have it show up in the world. In other words the universe will have infinite stuff in it already, and you can replace as much or as little of that as you like. Our hope is that different mods, campaigns, and stories can all coexist in the same universe by simply taking advantage of how huge it is. Just pick a spot in the galaxy and plop down your custom content.
Here’s what that would look like on each order of scale:
Almost all of the above is already possible in the existing extensions system. On loading, the game reads the data directory looking for map modifications which tells it what sectors to overwrite with what stuff. Each sector is simply given a unique value, (hint: it is a color) and then a series of extensions can be mapped to each color. So if you want a scary red sector with a scary red backdrop and scary red asteroids, you make your extension and map it to a color (like red) and draw it wherever you like across the galaxy. The result is those sectors will call up your custom extension any time the player goes into one of those red painted sectors, but sectors without any color will be generated by the procedural algorithm.
Today one of the final (and biggest) pieces came into place as I tested a prefab system which includes a custom prefab editor. I dragged some asteroid images into a folder that I wanted to use as brushes and using drag drop placement in the prefab editor I made myself a fancy arrangement in the shape of a beloved internet meme. I saved my work as a prefab file, and with a few lines of extension code I used the default terrain generation extension to randomly spawn my prefab across space. A mod maker would have to modify the following lines of code in their backdrop extension.
- Prefab myPrefab = new prefab(<name of file I created> <name of texture batch> <reference to texture batch>)
- SectorGenerator.minPrefabs = 5;
- SectorGenerator.maxPrefabs = 20;
To translate the above: I create a prefab object and tell it where to find the file I saved. I also tell it which set of textures will be used to render that file. These texture batches are already used by the backdrops so in my example I actually just passed the default texture batch that was already used by the existing extension. Note that in this case SectorGenerator is a built in class used by existing backdrops to create asteroid fields, so essentially I am just tweaking the parameters of a built in thing that mod makers will have access to. Then I tell the extension to place between 5 and 20 prefabs, and I give it my prefab as the only prefab to pick from when placing prefabs.
Here is the result.
Note that I used the same asteroids as would spawn in this sector naturally to make my prefab, but you can use any set of assets that you like including custom assets that aren’t part of the core game. The game builds a fancy manifest of the textures necessary to render everything in the sector so they can be automatically loaded as the player approaches, and automatically unloaded when the player leaves. Thus even with a very high density system full of large custom assets there should never be a loading screen, and nearly all of the machine’s memory can be dedicated to just the sector you are currently in.
This prefab system is a game-changer in terms of content creation. I have literally just built the map editor for the Wayward Terran Frontier engine, and it’s pretty easy to use. Maybe you aren’t too concerned about making mods yourself, but this is still exciting news because this is the tool we are going to be using to fill the game world with content and make space less empty and boring. As I seem to say with every big feature added to the game engine: Now we can add better content to the game, and we can add it faster and easier, so future patches should be more exciting. Yay!
Also we are certainly going to be using this system to include more content in the next patch, so expect us to be working on it for a bit (the next patch). We want the next patch to be a big improvement in overall content and gameplay depth. Prefabs was merely a prerequisite.
Note that all talk of mod API and modding tools such as map editors is speculative. We aren’t releasing these tools yet because they change every single day and are as yet very incomplete. I do enjoy ranting about what I’m working on though, and I’m willing to discuss potential future features with anyone who might be interested.