Ready, set, action!

Okay, I got my new system figured out in my mind… actually re-configuring the code base to use it is a long arduous process I probably won’t start for awhile, but at least I know what I’m going to do.

All the pre-processing of actions is going away. When you move your characters in combat, you take all your actions then and there. Just like Tunnels of Doom. But how to track things like haste and speed? How does fatigue figure in? I was wracking my brains on a solution when it came to me unexpectedly.

Each character has “action points” which renew every turn. These points are used to take actions, such as move, attack, fire a bow, cast a spell, use an item, etc. Once all your action points are gone, your turn automatically ends.

So, here’s how it works: If you take an action that takes you to negative action points, you take that difference in fatigue damage. Fatigue serves as the first kind of “damage” you take, which recovers over time outside of combat, or through use of potions. If you are at maximum fatigue, any additional action damage becomes wounds instead. Maxed out wounds renders your character unable to do anything. Guarding takes any remaining action points as a defensive bonus and ends your turn.

Example: Eric Seablade has 5 action points. He’s wearing mail armor, which makes movement cost 3 points. He has a sword, which he can swing for 2 action points. So he can move once and attack for 5 points, ending his turn. Alternatively, he could move twice for 6 action points but he would also take 1 fatigue. If he moved once and then just guarded himself, he would end his turn with a +2 bonus to defense.

When I had this epiphany, it just worked across the board for everything. Weapon attacks, heavy armor slowing you down, expensive spell casting? All covered! There’s a slight bit of confusion with spells that can be cast in both combat and travel mode… the high cost of them should technically be less outside of combat. I may have to subtract standard action points from spell costs to reflect this difference.

The nice thing is this will greatly simplify the code as well. It may reduce the combat code base by as much of a kilobyte, which will be much more efficient. Processing actions immediately instead of storing them up for later solves other issues as well, such as tracking item types used.

Unfortunately, the retcon of the code will be murderously difficult, as many things in many places have to change. On the plus side, it would serve as a quasi review of the code for me to refresh my memory about what’s all in there.

This entry was posted in Coding, CRPG, Design. Bookmark the permalink.

3 Responses to Ready, set, action!

  1. Stu says:

    Sounds great. I have not touched my CRPG in a long time. Last time I did I nearly doubled my main overworld map size heh.

    • Adamantyr says:

      Yeah, I noticed your updates stopped awhile ago. šŸ™‚

      • Stu says:

        I am working on it sporadically. I’m in the middle of rewriting my event system to make much better use of Tiled’d object properties, so all my map exit events disappeared. Once i rework the map template code it will be much better.

        I also tried to ‘grow’ the world, after some playtesting, it felt very small overall.. I’m also junking my target hardware, I dont care about homebrew on the PSP, GP2X anymore.. the world has passed them by, so I’m left with ripping out the ‘console’ interface and turning it into a PC interface, which is just a script so its not so bad.

Leave a Reply

Your email address will not be published. Required fields are marked *