Godot tech bits #2: Level Arranger
Reasoning behind the Level Arranger
When working on a game with a sequence of numbered levels such as CROPSMARE! I often find myself rearranging the level order a lot, be it to space out a sequence of similar levels or to keep the difficulty curve in check.
One thing I devised that I found particularly useful is a Level Arranger that allows me to reorder the level sequence graphically.
The whole thing consists of 2 parts, a scene and an addon.
Level Arranger Scene
The Level Arranger Scene contains all the game levels as children.
Levels are rearranged through the Scene dock, and a tool script automatically adjust the levels position according to their child index.
I also added some code to crash the game in case I accidentally try to run the arranger scene directly as I suspected that it could have hanged my pc.
Level Arranger Addon
The Level Arranger Addon opens programmatically the LevelArranger Scene and saves the filenames of the children nodes into a JSON file. This is done automatically whenever I build or export the project, so I can rest assured that the level list is always up to date.
The code of both Level Arranger Scene and Addon is available on GitHub.
It would be cool in the future to have some kind of “tag/filtering system” to highlight only levels containing a certain mechanic.
Leave a comment
Log in with itch.io to leave a comment.