Robbers, Mazes and Portcullises


I was off work this week, so I had lots of time to make big progress on the game. This includes:

Before now I hadn't bothered to use any form of data compression for saving maps. A single sector of the overland map is 128x128 cells and would save to approximately 100 kilobytes. I would consider a small world map to be 40x40 sectors, so a small world could become about 160mb if the player visited every single sector. However, I added a simple run length encoding algorithm, which brought this down to about 15kb on average per sector (with a lot of variance), which means the same sized world might be 24mb. Maps usually contain broad expanses of the same tile type, such as grass or sand or water, and even though every cell has a height value, many areas are very flat, so there was a lot of potential for compression.

Added a new monster called the "erminid robber" with a new set of behaviours. This monster will throw sleeping darts at the player, but if the player is put to sleep, instead of trying to kill the player, it will just steal their stuff. Once the monster has stolen everything it wants or the player wakes up, it will try to run away. To implement this, I added that the monster can keep a memory of who it has already robbed.

While working on monster memory, I started to add that monsters can also remember the immunities of enemies. If, for example, a dragon breathes fire at the player, but the player is magically immune, the monster will not continue to waste turns breathing fire, but will rely on other attacks.

Some doors to reward vaults may now be replaced with portcullises. To open them, the player will have to operate a winch, which is always found at the end of a short tunnel behind a secret door somewhere in the vicinity of the portcullis. The player can also lower the portcullis again, and if any creature is caught below, it will take a massive amount of damage and get pinned, so it is possible to weaponized these. However, since the winch is usually out of sight of the portcullis, the player would need some kind of divination magic to do this.

Continuing on the vein of mechanical traps, I added sliding panel and hatch traps connected to pressure plates. When the pressure plate is stepped on, the panel or hatch will slide open, revealing either a single space closet containing a monster (usually a skeleton), or a tunnel containing a row of up to four snake or insect enemies.

I also added some algorithmically generated minimaze rooms that appear in dungeons as a new kind of reward vault. In these rooms the reward is always placed at the first deadend found on the side furthest from the entrance door.

Added a banker NPC to the town, to whom the player can deposit or withdraw money.

After a lot of trial and error, I think I finally eliminated a bug whereby shopkeepers would wander away from their shops and not come back. It turned out the coordinates of their shops were not properly getting shifted when the map was shifted.

Added potion and scroll shops to towns. I did not originally plan to have these since I wanted these items to only be found exploring dungeons, but I finally changed my mind as I saw that there needs to be more things that the player can do with their money. Still, I made it so that these shops are fairly rare, only generate in small buildings and charge steep prices. For now, all potions and all scrolls have the same price to avoid price id'ing.

Started resolving the edge cases that can occur inside of shops. These are nethack style shops, so I have to think about questions like: what if the player the player drinks the unpaid potion inside the shop? What if the player throws an item outside the door of the shop? For this, the shopkeeper has to keep track of the value of the items used and insist that the player pay before leaving.

One corner of the interface shows all the keyboard controls. I just added that controls are shown deselected when the player is not in a position to use them. For example, if the player is not standing next to an open door, the close door command is deselected. If the player is not standing next to an NPC or monster, the interact command is deselected. If there are no items on the ground where the player is standing, pick up items is deselected. If the player is not carrying any items, the inventory, equip item, throw/fire, apply item and take off commands are all deselected. This I hope will be helpful to new players learning the controls.

Also, on the sidebar just below each monster's health bar it will now show all items that the monster has equipped.

Finally added daylight cycles to the surface world, so it slowly becomes light and then darker as the days pass.

Because of all the new stuff added to the dungeons lately, I'm including here some new screen shots. With these shots I'm in debug mode, so the whole map is visible and lit up, even though it wouldn't be in a normal game. All traps and secret doors are also visible. The bright red tiles are traps and the light blue ones are secret panels, wall hatches or collapsible walls.

Leave a comment

Log in with itch.io to leave a comment.