It was a solid week.
- AI State and Game Event Detection. One of the planned Release 3 features was to display icons next to enemies based on whether the enemies had seen the player. In addition to displaying the icons, I needed to fix some long-standing AI issues that cause enemies to react too soon, or not soon enough, when seeing the player for the first time. I also needed a way for enemies to respond to events other than seeing the player, such as a door opening, and to respond to events that are heard but not seen. To handle all of this, I implemented a simple finite state machine to manage enemy state. I added listeners to enemies that receive all game events, determine whether they are able to perceive the event, and trigger state transitions based on perceivable events. The solution is working well with the first set of test cases; I now need to apply it to all game events.
- New Decor Map Elements: Braziers, Bookcases, Tables. These Map Elements place these objects in logical patterns (for example, in corners, in a grid, in a rectangle, in the center) in a specified area, typically a room. They are used by different room types such as Libraries and Shrines.
- Procedural generation improvements. I changed the basis for some enemy/item quantities from a percentage chance per cell to a random number within a range. This prevents situations in which a large room has too many enemies or items. I reduced the number of combat encounters in a level (too much combat nade the game overly difficult and tedious to play).
- Finished implementing treasure chests. Chests contain random or specific items now and chest contents get transferred to inventory. It wasn’t as straightforward as it sounds. Some odd bugs were introduced (and subsequently fixed). For example, the player started getting two copies of each item in the chest. I spent a few hours trying to figure out what was happening. It turned out that when the chest changed from an open chest to an empty chest in the process of taking the contents of the chest, the chest was being destroyed and dropping its contents (routine behavior).
Next week, I’ll finish the AI State / Game Event feature. I’ll add a few more Map Elements as well (my goal is to add at least a few each week).
Leave a Reply