My dungeon generation is sure taking up a lot of time with all the additions I want to do. For example, I want to add some small “closet” rooms where I can have the player get a quick loot boost and just vary my dungeon a bit. It should take a few seconds to run in, grab loot, run out. Teh generator can just do a step for it:
I am extending my single room (goal, start) placing logic to have arbitrary amount of single rooms. And this nicely creates the rooms I want and connects them to hubs:
Now I need to fill them out with content. I’m going to call it trash loot for now and make it spawn in all closets:
Trash loot is defined as the collection of trash items, which is robot scrap for now:
And this work okay, but the problem is that the “amount” in my logic is the overall amount in the whole levels. That is, amount of 6 in 5 rooms means one room is getting an extra one. But this is a whole extra chest and that chest has exactly one item:
What I need for items is to specify in the item collections how many copies of the same item are dropped if that item is selected. In this cse, I might drop 3-4 scrap items:
And this now works how I want it to — single chest with multiple items:
I also finally want to make my start and goal rooms “proper” 2×2 big rooms. I only ever need them to have one exit, so I can skip the double-exit room layout. I do need the other three though (corner, corner with left exit, corner with right exit):
And after a lot of fighting with the generator, I made the rooms appear as I want:
And this means the player now spawns in a significantly bigger (empty, for now) room:
At this point I did a bunch of refactoring on my dungeon steps. I made all the step iteration logic common functionality, since my steps were just each doing it themselves and it’s a lot of maintenance. I can also now better specify that certain steps can run continuously until they find no more work:
Although this can end up in a basically endless loop (again), so I need a limit specified:
And also I need to specify that my dead end step doesn’t have iterations, as it’s a one-time pass:
I also consolidated all multi-room and their restriction logic parts into common base logic, so I can quickly add new ones without much work. I can’t think of any functionally-needed rooms to add right now. Most of my ideas are just variations of level themes and what sort of “cool” things could be there.
Also, I need to have my minimap use custom colors instead of custom sprites, since I am not using single-node rooms really:
And this ends up looking fairly nicely:
I’ve also wanted to add secret rooms for a while. I don’t know yet how exactly I am going to let the player access them. But I can at least add them. I’ll just do them as tiny single-node rooms for now. Since I’m not sure yet how secret access will be different, I’ll just block it off with a wall and tag it in the room as special secret wall.
And so here I go with adding the same “new room” pipeline with every other wire and feature. A dungeon generator step to place secrets from hubs:
A custom secret style for secret areas:
Custom tiles for the secrets (I only really need floor and wall):
And the secret is always last — most hidden:
And this finally generates a secret room:
Of course, the obvious problem is that it has a clear connection and a door — because the hall wants to “connect”. I’m not quite yet at a point where I know for sure what I will do with secrets, so I will leave it for now. I might just “lock” the door and require a key or make the player break it down or plant breaching explosives or something other. In any case, I’ll cover this when I do the actual explosives.