So my level content (enemies, loot) distribution across the available rooms isn’t working quite the way I want it to. I often encounter stuff like this:
Basically, the distribution ratio across the rooms alone is insufficient. What I need to add is for entries, such as boss or artefact loot, to spawn the exact amount of times that I want them in separate rooms (distribution here is set to match the amount that gets spawned):
The problem here is that entries can still end up together with other separated items. So I need to organize my entries into super-entries that know the placement for all their child items (placement field is now common between all selection entries):
This way I can make sure that items that require a separate spot do not get bundled together with randomly distributed items. And I can specify this for my distribution options:
Yes, this is all very confusing and convoluted and I am having hard time tracking it all myself. But it all makes sense as a straight-forward step-by-step process without hard-coding any absolute numbers for stuff I don’t care about. Anyway, it ends up something like this:
In short, it doesn’t do stupid things like loot or artefact without guards or empty rooms, or multiple enemies, or whatever.
I’m also specifying in rooms where exactly the bosses and artefact chests should go:
I also need to duplicate everything enemy selection does and do the same for the items.
And have it specified along the enemy selection:
One difference though is that items spawn from chest and not get directly placed on the map. So I actually need to specify which (chest) prop I want to spawned:
I can even add some new (properly sized and pivoted) sprites so it’s more obvious:
Then the items will get passed to the prop, so it can distribute them when opened.
And these work well enough:
I guess besides the fact that artefacts and loot got spawned in the same room. I can fix this by specifying a content group for my entries and then also specifying (for another entry) which content groups to avoid:
Yeah, this isn’t the best, as I’m adding yet another custom rule for these. But it’s fairly flexible in excluding only the exact stuff I want.
While I’m fixing my dungeon layout, let me also finally add some goal room content, namely the level exit:
Something like a hatch, may be:
And I can create a prop for it, animation, and link it in the level’s theme:
It also needs a custom player trigger interaction:
Another issue I want to avoid is overly vertical levels:
The reasoning here is that the monitors are wider than they are tall. Which means, more gameplay can be seen sideways. So it makes sense to design a game to account for this. Even with my camera tilt, the player sees less in vertical distance. And moving mouse horizontal feels more natural. Plus, there are less sprite issues with horizontal stuff.
I can penalize these by adding dungeon generation scoring penalty for every vertical unit exceeding the threshold (here, it starts at 5 less than horizontal):
This makes most maps either squarish or horizontal rectangles.
Now that I have played the game a few dozen times, the layout is still pretty boring. This is to be expected and I was expecting to expand. One of the things I want to do is have generation steps that can produce various room shapes. For now, I will just standardize area-placing steps, like arena so I can reuse the code. Then I want to make a 2×1 area that I will call a “cubby” that is like a special little room for something.
It basically looks like this:
The entrance room is essentially just a door leading into a 2×1 inter-connected area.
So I only need two assets for this:
I will not be connecting anything to these, so they can remain “self-sufficient” and don’t need many different variations, like arenas. Now I can add a new step to the layout generator:
And some finicky coding later, I have cubbies generated in the level:
The reason I am doing these as two-node rooms is so that they give an appearance of not being exactly two nodes:
Very few things actually broke when implementing cubbies and I am glad I kept it all well-organized and modular. Of course, there are a few odd things here and there:
For example, I want a restriction to space cubbies out:
And I also want them to spawn not just from arenas, but also hubs (so they are not as preditable):
I also need to add it to the minimap (this is how all my features are becoming, needing many wires):
I had to add the sprites for the rooms with a single “connection” (since my rooms were all corners). But now I can use that for the future. There aren’t any special sprites for these yet, because they don’t have a purpose yet. I might add icons, like “boss” or “treasure” later. In any case, the multi-room logic appears to work and I can use it for other things.
I can also generate content for cubbies same way as I do for other stuff. First, I need to rename my arena content stuff to “large rooms”, so that I can have “small rooms” for cubbies:
Then I can specify the small rooms should get cubby stuff:
I also specify in the room where the content is spawned, like with everything else:
And it gets generated in the live level (though I don’t actually place anything):
I have some ideas what to place in these, but now I have a better pipeline to add new multi-node rooms and different potential content, which I will likely be using more of. My dungeons are currently very neat, but also very boring when it comes to different individual room layouts.