In this update8
Full notes
Full MENACE update
Read the full published notes in a cleaner layout. The original post stays linked below.
What changed
- Maps
- Compatibility
- Gameplay
- Fixes
- Performance
MENACE changes
Creating terrain that looks great and feels good gameplay-wise was always high on our list, and we always wanted to improve on that front. Now, finally, after a lot of research and development, we want to show you the result.
In this diary, we take a short look at how terrains were generated in the past and how they are generated now. The terrain update is currently being tested in the closed beta and will soon be ready for release!
Please note that this update will not contain new assets, only existing ones. We will soon have a dedicated 3D environment artist joining the team who will start working on textures, materials, and assets.
Generating, The Previous Approach
MENACE missions are all about having a procedural aspect to them. By changing the seed, you'll always get a new mission layout. While we have predefined layouts of building structures or objectives, so-called chunks, these get scattered "randomly" on the terrain, and the terrain has to react to it.
And that is a problem. A terrain is a product of its environment. Terrains are shaped by a lot of different factors, such as flowing water, temperature difference, wind, etc. Computing these natural effects is quite expensive and costs a lot of time computing-wise. Also, since we need to generate these effects during the game's runtime, a lot of shortcuts had to be taken, and the result always looked pretty much generated.
But even with these shortcuts, the time it took to generate the maps was quite long. In certain scenarios up to several seconds, that resulted in lags or loading screens.
Also, another big problem was that we had little control over art-directing the landscape.
The Old Pond
Terrains in games usually work with grayscale textures. Each pixel represents a certain height within a specified range. A value of 0 means no deformation; a value of 0.5, say, pushes the terrain up by 5 meters.
For lakes, the values at these positions were simply lowered to create a hole, and water was added on top. This works to a degree, but the lake never knew it was a lake. It was just a ditch in the terrain, and usually ponds have a much bigger impact on a landscape than that.
The shore should have wet sand, and reeds should grow around the edges. None of that was possible with the old system.
This had to be fixed.
Generating, The New Approach
As discussed before, creating terrains is computationally heavy. In external tools, computing really large terrains, even on beefy machines, can cost hours of computation time, and RAM usage easily climbs into the hundreds. Luckily, our terrain isn't that big.
The playable area is 336x336m, and we used a lot of shortcuts to speed up generation time significantly, which is what you experience right now when loading a mission.
But the result isn't what we were going for and something new had to be developed, fulfilling all the needs we have.
Long story, short
If it's so computationally expensive, why perform that work at runtime?
Instead, we can skip it entirely by precomputing everything ahead of time. We cache all the data and only assemble or modify the individual pieces during runtime.
Everything is generated in advance, but broken down into modular components that can be scattered across the terrain randomly. This gives us full control over the terrain features, allowing us to place and combine them however we want while keeping runtime costs low.
The New System
In summary, the system is fairly straightforward.
It introduces two types of primitives: Baseplates and Stamps. During the first pass, the baseplate is projected onto the terrain, and all of its finer details are applied (more on that later).
Once this step is complete, chunks and stamps are scattered across the terrain and placed and blended with the baseplate.
Done.
The Stamps in their identity are basically the same as Baseplates, but just a bit smaller in dimension. Both hold a lot of information. From the most basic ones, such as the description of which planet and biomes it belongs to, up to more specific data like dimension, orientation, blend type, etc.
The more interesting are the following; I want to explain a bit further.
Terrain Layer
Terrain Points
Terrain Meshes
Terrain Layer & Points
In the old system, the distribution of materials such as sand, rock, and grass was purely noise-based, completely random. It works, but terrains aren't random. They follow their own ruleset. Water flows, loose debris gets carried with it, and this shapes channels of little rocks. You might have seen this behavior yourself after heavy rainfall.
This information and more is now prebaked into the baseplate and stamps.
Also, with the new system, the surface type (screenshot bottom right) gets correctly assigned now. Every terrain layer comes with a type, and when the terrain is generated, each tile's surface type gets derived from the terrain layer.
Let's talk about terrain points. This might be a bit technical, but by "points" we mean positions in space with data attached to them. This allows, similar to terrain layers, more natural asset distribution. Around the small lake, reed now grows, and along the debris channels, assets get scattered as well.
This also solved the issue where units could occasionally get trapped inside a forest. Forests are now generated with a more advanced technique, prebaked into the baseplate as terrain points and altered at runtime. At their core, forests are denser and feather out toward the edges. And roads no longer cut through trees
Terrain Meshes
As mentioned before, terrains in games are basically just displaced planes. Greater pixel values deform the landscape vertically upward. Being able to deform it on only one axis is quite limiting. It works up to a certain threshold, but the steeper it gets, the more tricks need to be applied to make it somewhat believable. To counter this, a lot of games create a separate mesh to cover the problem. We do too. Boulders are no longer stretched planes, but authored and procedurally generated meshes.
Benefits of the New System
The benefits of the new system are wide-ranging. We gain more control over how the terrain looks, since we work with premade stamps and baseplates, but we don't lose the flexibility of proceduralism. Every mission and seed still generates a new layout and is chosen from a large pool of stamps.
The new system also gives us more control over how objects get rendered on screen, and it improves performance significantly. Especially on low-spec PCs, the gain is noticeable: in our measurements, we saw a performance gain of up to 250% in certain areas.
Also, when generating the mission, even before you enter the battlefield and plan your setup in the Mission Preparation screen, loading time is reduced significantly, and on most systems you won't notice any delay anymore.
Alright, that's it for now! Be sure to let us know what you think.
Engage, Explore, and Stay Informed
You can find us on Discord, BlueSky, Twitter, YouTube, Facebook, and Reddit for discussions, updates, and feedback. You can also subscribe to our monthly MENACE newsletter on our website.
MENACEstore.steampowered.comSource
Changelog.gg summarizes and formats this update. How we read updates.
