I’ve emerged from the cavern proc gen rabbit hole I entered at the beginning of August. Cavern structures are in good shape now that loops can be added in a few ways. Further improvements are possible by tweaking the cavern generator parameters and adding more quality control checks. For another day…
- Loop-generating cavern corridors. Unsatisfied with loops created by removing a single wall or adding a short, straight path, I implemented the ability to connect existing caverns by standard cavern corridors. This was pretty difficult for two reasons. First, it’s more complicated. When caverns and corridor blocks are initially generated, they only have to connect to an existing block, and their sizes and connection points are only constrained by the available space. Inserting corridors after the initial blocks are placed requires finding empty space where a corridor can be placed to connect two blocks, connecting the corridor to the two blocks, and forcing the random walk algorithm to create a path between the connection points and within the available space. The other difficulty was the code. The block placement code was complicated and not well organized. Also, it wasn’t designed to handle adding blocks after the initial blocks were placed. Reworking the code to support the new use case required massive mental energy.
- Made darkness darker. All of these subterranean environs – caverns, catacombs, dungeons, etc. – didn’t seem dark enough. It was too easy to see in the dark. I adjusted the darkness settings to increase the contrast of light sources and the surrounding darkness, and make it darker when the player doesn’t have a light source.
- Bug fixes
- Some caverns have unreachable areas. This was caused by a bug in the grid traversal algorithm, which is used to create paths between disconnected areas. When the slope was exactly 1, the algorithm
- Can’t take a potion off a table. A recent change to how multiple entities in a cell are sorted for interaction broke this.
- Can’t walk over an extinguished campfire.
A couple of months ago, in preparation for the next playtest, I decided to temporarily limit the scope of the Legend to a single level theme (Caverns) and class (Knight). With the four months remaining in 2023, I’ll continue working in this limited scope so that I can concentrate on core gameplay. Next week I’ll add more cavern content along with some bug fixing and polishing.