One Big Change Leads To Another

So I started out deciding to flesh out huts as part of my “fun arc”. (The fun arc has included some new items, changes in caves, total item rebalancing, and new animations.) Until now, huts were special tiles but not portals. They always held one level-appropriate human, hidden. You could engage the human in order to gain a human item loot-roll. That was all huts did, introduce humans as part of the game. Humans include the thief, barbarian, swordsman, and cat lady. They will soon include the spearman and wizard.

To improve them, I wanted to make them into proper buildings with interiors, randomly generates inhabitants, items, traps, and special things like beds. I wanted them randomly generated, but not using the current cave-generating algorithm. I wanted to lay the groundwork for a more organic randomized map builder, similar to the overworld itself but meshing with the tunnels and corridors of a dungeon. So that’s what I built, making it modular enough to reuse for different cave types later on.

When that was done, I gathered all the good spots for random contents (rooms around the outside of the hut) and placed a chest there. That resulted in items near the entrance of a portal, which had not happened before. I immediately started noticing ghosting of items from one world in another. The issue was pixi.js’ world snapshot failing to update around the exit point (origin) of the hut map, and carrying them over when the entry was nearby the corresponding overworld origin. Another problem was weird dragging of some offset graphics into the hut, this was happening because the snapshot passed post-move was passing not the outside of the hut (where the entry movement ended) but the post-teleport interior of the hut map. The answer was to capture a snapshot immediately after the movement ended but before the teleport had happened, and use it later in the game module when establishing the order of events to animate.

I’ve finally completed all that, prompting this missive. Now I have the blissful task of balancing the tweaking the contents of what appears in the huts, relatively amusing, following by a some new animations that I think will have a massive impact of playability of the game.

Leave a Reply