Apologies for the title of the game; I have a tendency to make working titles so bad they force me to rename them before shipping; sometimes it even works. Also, this project isn’t public yet, so consider this a sneak peek, in the form of documentation for potential level-makers. All of this is subject to change, especially if I can get multiple meshes to load into the same navmesh.
Set up terrain nodes
Create a new inherited scene from the “world” scene.
Add an HTerrain element to your level. Make sure it’s collision layers are 1 and 8.
Create a data directory in the levels folder
Apply a tileset to your HTerrain by dragging tileset.tres into the texture set slot, or making a new one from scratch.
Edit the terrain to your heart’s content using the generator and the tools.
You’ll need to repeat the next steps each time you edit the terrain mesh
From the “Terrain” menu up top, select “Generate mesh (heavy)” and select an LOD of 4. At least that’s what I’ve been using.
It will create a node called “HTerrain_fullmesh.” This is the node that the pathfinding library uses to actually determine where AIs can go. Hide this mesh; if you need to see the navmesh turn on “visible collision shapes” and you’ll see it (and it may lag real bad!)
Note that the flattened areas have nice clean navigation, but the more sloped areas don’t. You can use the flatten tool to cut paths across the map. Make sure you enable “pick” on it, it’s much nicer that way.
The prefabs folder has enemies with preconfigured weapons you can just drop right into the scene. You’ll want to drag them a bit closer to the ground though.
You can also place buildings this way. Careful not to accidentally parent stuff to random entities you’ve already placed – entities in OWTD expect to be parented to the world.
You can set up objectives by adding the “ObjectiveMarker” component to an entity.
When all of the entities with objective markers are destroyed, the player has won the level. You can add the objective marker to any enemy or building.
The incursion spawner will spawn the entity you provide in “spawn” whenever there’s an incursion with the selected severity. Put one of the monsters in there by dragging its tscn file in to the spawn field (only monster at time of writing is our friend Kochab)
Add your level to the list
Add an entry to the big literal with all of the levels pointing to your level’s TSCN file, give it a name and a description, and it should show up in the dropdown in the main menu.