Sorted Out
Another quick update…
I have my orders getting sorted into actions, with randomness and base speeds all added in. It was one of those kinds of jobs where the only way to really tell it had worked was by using the debugger in Classic99 to view the memory areas where the array was populated to see that it was correct.
Now on to the first of the fun but frustrating parts… turning those actions into actual on-screen results!
Action results are split into two forms, the effect (the change in the unit’s state) and the FX (the audio and graphical changes on-screen). I’m putting off the FX portion until all the effects are finished. The reasons are:
- Effects are the most “crunchy” part, like calculating which units are affected by an area spell, how much damage each unit takes, and so forth.
- Graphics and effects are a different kind of design, involving timing, dramatic effect, and other more “artsy” metrics. Better to do them on their own from the actual results.
- I may end up sidetracking into audio/graphic updates as part of FX design
My current order of implementation for the combat engine is as follows:
- All action result effects, like moving, casting spells, attacking (melee and ranged). Includes feedback text and appropriate delays
- All FX for spells, attacks, items, etc.
- Monster AI
- Combat start/ending (Battlefield preparation, unit placement, mob updates, return to travel mode)
As far as “code” goals go, my main concern is that the game’s total engine fits in the upper 24k RAM on the TI. As of this moment, before effect implementation, I’m standing at about 15,200 bytes. Better than expected! I figure I’ll cross the 16k mark (and have three E/A #5 files) by the time I’m done with #1.
If for some reason I get close to the 24k mark, I can still finish the game, but it gets burdensome. I’ll have to start moving dataspace around in the lower 8k RAM to make room for code, which hopefully will be only a little spill-over. I do have some space there, but we’re talking less than a kilobyte at best. I hope it doesn’t come to that; I’d rather hunt down ways to optimize the code.
After the combat engine is finished, I still have the quest and NPC interactions, and the inventory management, both personal and buying/selling. There’s some open design issues here to solve as well, but I don’t expect them to be overwhelming.