Better procedural generation, more variety


I've been working on tightening the procedural generation of the game. There were cases where the procgen could fail to generate maps before and, eventually, give up. There were generation errors where chunks were not lined up correctly. The code was messy and didn't have enough test coverage.

That's all changed, now. The algorithm that generates the tilemaps is now fully backtracking and will fully explore its available space before giving up. In hundreds of live runs (and maybe a couple thousand unit test runs) I haven't seen it fail to find a tilemap yet with the chunks that I have now; adding more variety will just add more certainty that it will generate.

Unfortunately, that means that level generation takes longer than it did before as the algorithm wanders around the space placing chunks and pulling them out. So I ended up adding a small system for async jobs that need multiple frames to finish and coroutined-up the tilemap procgen without too much trouble. Thanks, Lua! I'll probably end up blogging about the algorithm more on my personal site.

It's not that there aren't already async processes in the game, but this is the solution I probably should've added a long time ago to make it easier to do per-frame tasks until done than littering flags and counters in other systems. Oh well.

All this to support more variety in chunks. Before, I was relying entirely on an automapper to place tile images in chunks based on their physics geometry; if something was solid and had solid tiles to its left and right it was probably a platform, so stick a platform there, etc. After adding rules and chunks and playing around with the visuals I finally surrendered and put in more manual control. The dream of the fully automapped chunk was nice while it lasted, but the game is easier to make prettier now. That's a good thing.

The next bunch of changes will include more chunk and art variety as well as more core loop enhancements around making buildings and cleaning up sectors. 

Files

gemini-rising-windows-alpha.zip 4 MB
Version v0.0.34 Apr 10, 2020
gemini-rising-osx-alpha.zip 6 MB
Version v0.0.34 Apr 10, 2020
gemini-rising.love 576 kB
Version v0.0.34 Apr 10, 2020

Get Gemini Rising

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.