Happy upcoming holidays to everyone! Crawling along with the work… Bugs are becoming a major hassle.
I implemented monster and mob movement, which have been disabled for quite some time. This created a perplexing bug where suddenly the game would just screeching crash for no apparent reason… it turned out my NPC mobs were moving onto my player and trying to trigger themselves! This didn’t work because a return stack wasn’t aligned for it.
Another bug happened after I cast a mass heal spell, and the game locked up. It turned out my “generate ally unit” list was including non-existent units, which caused all sorts of unexpected side effects and crashes. I suspect there are further bugs here because I’m still having the odd crash when a monster starts their turn.
And I haven’t even tested all the spell effects yet!
The program is big and complex enough now that small changes can cause regressions in other places I didn’t expect. This is a pain in the neck, to say the least… I want to get the engine to a complete enough state I can start getting some help with play balance testing instead of engine testing.
I was noticing that my party was wiping the floor with most of the monsters, so I increased hit points across the board. I think I may have gone a bit too far that direction, but I think I’ll wait for independent confirmation before any further changes. Rations are super-effective in recovering fatigue, almost TOO much, so they may need to be slowed.
There are plenty of lower-priority bugs as well. I noticed that monsters are spawning in spots they can’t get out of, many NPC’s are missing a “Leave” option so you’re trapped talking to them forever, map exits don’t come out where they are supposed to, and so forth. Content is relatively easy to fix, fortunately.
At some point I’ll also go back through the sound library and rework some of the sounds. I removed the original victory tune because I really wanted something different from Tunnels of Doom.
I also expanded the amount of sound memory available to 8K from 4K, so I actually have more space for complex sounds than I did before. For example, the lightning bolt sound from Tunnels of Doom takes over 360 bytes because it’s an unrolled loop of subtle frequency and volume changes. I don’t think I’ll do anything quite that large, but I definitely want to revise some sounds which I lifted from other TI games and make them my own.
The scariest bug, incidentally, is one on the hardware. I noticed when testing the game engine there that suddenly my party wasn’t able to hit the monsters in melee at all, and the monsters were hitting my characters and critically striking every single time. A very curious behavior… which does not repro in the emulator. I have a suspicion that the timer clock I’m using for the random number generator MAY be skewing things, but I haven’t had time to dig deeply into it yet.
Santa won’t be putting the game in your stockings quite yet, 99’ers… but we’re close!
Some updates…
I think I found the cause of all the random crashes in combat. In several places, it was trying to access monster stat data but the memory page that contained it wasn’t necessarily IN memory at the time. This can cause all sorts of random issues. I’ve explicitly put page sets around where the stats are used, even if it’s redundant, to ensure it does so and so far the game has stabilized.
I also found that I had bugs in my attack/defense routine that meant the monsters actual statistics weren’t getting used at all. 🙂 That means most of my perception of my monsters being too “weak” were absolutely wrong. This is why you finish engine work before doing play balance changes! I’ll have to go back and “reduce” monsters back down, otherwise it will be one very short beta test…
Another update…
Decided to create a new spell and clean-up and tighten another one! Some data and code changes involved but not too hard to get done.
I also finally found the source of crashes in combat… My “identify all units in a given area of effect” code was creating duplicate entries and also including units that were already dead, which caused some serious breakage elsewhere.
I think I fixed the hardware issue as well with my focus on making sure monster stat data was available; emulation always has zeroes in empty pages but hardware can have unpredictable values. That would explain why monsters hit all the time and my players kept missing. I’m just relieved it wasn’t the random function breaking!