Weekly Update – August 11, 2023

This update covers the past two weeks, since I was backpacking last weekend and unable to post. In short, the focus has been on improving cavern layouts. I’ll post some example maps next week; there are still some wrinkles to iron out.

  • Fixed cellular automata. Now that I’m focusing exclusively on the Cavern theme for the upcoming play test, I’m noticing more problems with cavern structures. Individual caverns were too small, so I increased their sizes. Then the map was too small to fit many of the larger caverns, so I increased the map size. Then I noticed that the larger caverns were too rectangular, which led me to discover three bugs in the cellular automata code. I haven’t looked at that code in three years. I had suspected there were some issues with it, but the issues weren’t apparent in the original caverns because these caverns were smaller and more compact. In addition to fixing the issues, I improved how disconnected areas within a cavern are handled. Very small areas are now filled in with walls, and larger areas are connected by creating the shortest direct path.
  • Fixed and improved random walk. As with cellular automata, the random walk code hasn’t been touched in years. In fact, it hasn’t been used in years; the two features that it supported, cavern corridors and rivers, have been disabled. Reenabling cavern corridors necessitated revisiting the random walk code. The original cavern corridors were built for the original map generator. It would have been more effort to update them for the current map generator than rewrite them from scratch, so I opted for the latter. I had a hard time re-learning how the random walk algorithm worked. Its complexity stemmed from rivers; there was so much logic to determine path direction to produce natural-looking rivers. I spent hours trying to get the algorithm to work with the new cavern corridors and got nowhere. It was mentally-intensive work because of the complexity. I decided to cut out the river logic to simplify the code. I’m not sure if I’ll even add rivers back in. Additionally, I modified the algorithm to use a bitmap rather than the map. This was necessary because the new map generator doesn’t know where a structure will be placed on the map when the structure is created.
  • Cavern corridors. Caverns were previously composed of directly connected chambers. This structure didn’t reflect typical real and fantasy cavern layouts, which consist of chambers connected by narrow corridors. A new Map Block Type, Cavern Corridor, was added to produce more realistic cavern layouts. Fortunately, I didn’t have to implement this feature from scratch. Cavern corridors were originally added a few years ago, but were never updated to work with the new map generator that was introduced in 2022. It took some effort to get them working with the new map generator. Namely, the random walk algorithm that is responsible for generating narrow, winding paths had to be modified to work within bounding boxes. 
  • Better caves. With the cellular automata fixes and addition of cavern corridors, cave layouts more closely resemble real caves.
  • Designer documentation – map configuration. A while ago I started documenting how to perform tasks using the design tools I’ve built in Unity. These tools are used to create new content such as actors, items, and history events, and modify various aspects of the game configuration. The main purpose of this document is to help me remember how to do these tasks. The tools and techniques are so vast at this point that I do forget how to do certain tasks. I also envision that this documentation will help if I bring on a designer in the future. This week, I added documentation on modifying the Map, Map Sections, and Map Blocks.
  • Bug fixes
    • Corpses appearing below some ground decorations instead of above.
    • Error when performing the Heavy Strike ability.

Next week, I’m refining and adding content to caverns.


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *