Building levels from scratch with the in-game editor


Today I will talk about how I use create levels for the game.


There is an in-game editor which I can access when in the developer environment. The first screen allows me to select a map to edit, containing level -1 which is a test level, 0 which is the tutorial, and then maps 1-30 that are used for the actual game. Each map file is simply a list of objects and their X and Y positions.


I start off every map with the player spawn tile loaded in at position (0,0), and a menu which allows me to select which kind of changes to make to the map.


I start by placing walls to make the general outline of the map. There are different selectable wall types that can be scrolled through, and then placed with left click and removed with right click. The walls will tile automatically when placed.

I can also place objects into the level with a similar menu. The list of objects can get very long so I will trim this down to only show the objects that are relevant to what I'm currently working on. There probably is a better way to organize this than to show a long list with every object but it works well enough for now. The most important objects to place down first is the doors that separate each individual room in the map.


Here you can see the outline of the map, three rooms separated by doors.


I then decorate each room with a floor type. These tile automatically when placed down. Due to the way the game is coded I leave a gap between different floor types, as otherwise we can get some strange-looking results when different sprites try to tile with each other.


Next I place down enemies. There are no options or different enemy types here, just an X and Y position for them to spawn.


Changes to the enemies are actually made at this point by placing down items next to them. For instance, when a weapon is placed next to an enemy character, the enemy will change their facing direction to point to the weapon, and then equip it. This allows us to set the enemy's equipped weapon type and viewing direction just by placing one object.


Other changes are made with further object placements. Some changes will only apply to enemies when a specific modifier is enabled in-game, such as extra enemies or enemy armor. These are applied by placing the relevant objects in the editor, which will simply be ignored if that modifier is not active. Enemies with the "Add Enemies" object placed in their vicinity will only spawn when the "Add Enemies" modifier is active during a playthrough. If the relevant modifier is disabled then shotguns will be treated as pistols, and both snipers and grenade launchers will be treated as machine guns.


The last step is to place down some objects to bring the map to life. Furniture, wall hangings, decorations and so on are all placed within this menu. Once everything is finished, I can load into the level to play through it with one button press, and choose which modifications I want to have active for the purposes of testing. Here I play through the map I just built, with enemy armor, extra enemies, better reactions, and shotguns enabled.


I can then press a key to load back into the map editor to make changes, playtest again, and so on until the map is good.

After the game is released, I might consider a way of allowing players to build their own maps and load custom maps to play.

Get Raid30

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.