Order of Battle
I’m working on the combat option system. So far, it’s not quite done, but debugging all the code I’ve written over the last week or so hasn’t been as bad as I feared. Generally, writing code is like building a house of cards… one bad one at the bottom causes the whole thing to come tumbling down.
The first bug I ran into was a regression; the statistic screen for player spells caused the VDP to go “wild”, switching modes and going into psychedelic colors. When this happens, it’s usually means you have a runaway video write going on, usually with a totally illegal value. The top two bits of a word are used to indicate VDP write modes, so even a negative value can cause it to go off quite spectacularly. An investigation quickly showed that I was using an archaic method to generate the spell lists, and I was able to leverage some new routines to do the job quicker and faster.
The other problem was the command going back to travel mode while still on the combat screen, among other bugs… this I traced to having subroutine returns in the wrong places. I use a stack tracked by a static register to store return addresses, allowing me to branch and link in multiple layers rather than just one. This works pretty well, but it’s easy to lose track of where you’re at. Then I found a bunch of problems with the sprites, such as them not being in 16×16 size mode. This was occurring because the contents of VDP register 1 are set to the value in the scratchpad at address >83D4. Every time you call the ROM routine to scan the keyboard, it does this replacement. Why I don’t know… fortunately it only needs to be done once.
As you can see on the screenshot, I finally have a working target cursor. You can’t see it, but it is blinking, courtesy of a sprite animation routine I have in the system. Unlike Tunnels of Doom, you do not move the cursor around until you are on an enemy; instead it lets you cycle through the targets. Only area-effect spells allow free targeting anywhere on the screen.
Right now, I’m still debugging each command one at a time until it’s perfect. I added a cancel routine so you could remove the last order given, or all of them. Unfortunately, I can’t provide much in the way of tracking what each order was; I don’t have the icons to really show a complicated command with only one or two letters. Attack or move in a direction, easy. Attacking THIS unit or casting THIS specific spell is quite another. For now, I use single letters, like ‘M’ for move or ‘C’ for cast spell. It will be up to the player to remember what he ordered.
Why so much trouble, tracking actions? Well, my goal here is to not have your actions occur in a sequential order by player. Instead, each individual action will be given a speed, based on the action taken and a bit of randomness. Monsters actions are determined in a similar fashion. This means that you’re not certain most of the time WHEN your actions will occur.
I got the idea for this from a reading of the old AD&D 1st edition books. In that rules system, combat was divided into strict segments. Initiative wasn’t the only determination for when things happened. Weapons speeds were a factor, and spells never went off quickly. This allowed things like interruptions and granted advantages to faster weapons. As far as I know, very few people actually played the rules this stringently… AD&D was notorious for being over-complicated, and most players house-ruled a lot of things in, or ignored what didn’t work well. (For example, critical hits are NOT in the original rules, but most players add them anyway.)
I don’t know yet how fun this system will turn out to be. I’ve reduced the randomness quite a bit from my first design; I realized that since players would be blind to the exact numbers most of the time, too much randomness would make it seem arbitrary and chaotic. Hopefully it makes the tactical system more interesting than frustrating.

Good read, man…. and right now, very applicable to my current situation. Your copious documentation is well-constructed and very helpful. I wish someone would pay you a million dollars and say “Stop working for a living, take this million dollars and do whatever you need to do to finish this game by Christmas.” =) It would be a great Christmas gift in my stocking this year. =)