New Metasweeper Terrain System

August 4, 2020

Somehow I got it in my head that I should use a terrain system for Metasweeper. But Unity’s default system, makes very little sense for Metasweeper (where everything must conform to the grid). So I spent a couple days trying to talk myself out of making my own terrain system and failed. As you can see in the gif below, I set up control surfaces that you can select just like another other Unity game object (since they are game objects) and when you move these around it communicates to the terrain system “back end” to regenerate the entire ground mesh. You can also change what type of surface a grid square is and it automatically changes appearance (for the technically minded, I generate a texture where each pixel maps to a grid square then interpret the color of that pixel as the type in the terrain’s shader).

I also got stuck in my head the idea of Trees that move at right angles, so of course I ended up making a whole procedural tree system, that even talks to the Terrain system to make the roots conform to the ground.

All still works in progress naturally, but there’s a lot of potential all around. It ought to make level design not only easier, but more enjoyable. And because these are custom systems, I can do all sorts of little things that wouldn’t be very easy otherwise, like add a little bit of noise to meshes in order to make them feel rougher, or bevel the edges of walls.

As always, let me know what you think!


Sign up to get the next Metasweeper update fresh in your inbox.