GaDeMo (Game Development Monthly)

Icon

Just another WordPress.com weblog

Happy Ninja Clan: Turn-based Battles

I’ll level with you. I’ve been waiting for an excuse to implement some good ol’ Dungeons and Dragons influence for a long time. It’s funny, because I’ve never actually played it. I’ve played games with tons of D&D influences, but I’ve never actually sat down with a group of like-minded weirdos and played through an adventure. I’ve recently learned that my next-door neighbor plays, so I’m hoping I’ll get invited soon. Until then, all I can do is research on my own.

One thing I like about this style of gameplay is that it’s turn-based. You’ve got all the time in the world to decide what you’re going to do (at least, if you’re playing against a computer). This really adds an element of strategy that couldn’t exist in a more arcadey-type game. I’ve always liked the Heroes of Might and Magic series for that reason. It’s totally not realistic, but it lets you really focus on each individual character and the effects of their actions.

Anyway, I’ve never really thought about how to design a turn-based system, but it seemed the next logical step after the stats system I posted a few days ago. Turns out there are more problems to be solved than are immediately apparent.

Considerations

Initiative
The D&D rulebook says that turn order is based on “Initiative,” which is a random roll added to your character’s dexterity. No problem. We’ll just make sure that every character has a DEX stat.

Parties
Typically, turn-based RPG games are all about party-on-party action. So, in addition to the character stuff in the system already, we need a Party system to keep track of everyone.

Death/Disabling
What happens when a character dies or is disabled? Take ‘em out of the order and move everybody else forward. A sub-point: what happens if they are revived, or if the disabling was temporary? Stick ‘em back in and rearrange accordingly.

Victory
This was an interesting one. How do we know if a Party has won? Well, assuming we’re battling to the death here, the battle can only continue if at least two Parties have active members. The system will handle as many Parties as the game requires, and will keep handing you the next member until only one Party still stands. If there’s no nextCharacter(), then there’s a winningParty().

Implementation

So now I’ve got a system. To use it, you:

  1. create your Characters
  2. create and populate your Parties
  3. create a BattleOrder and feed it all Parties involved
  4. call battleOrder.nextCharacter
  5. when the character’s turn is over, call battleOrder.turnComplete()
  6. repeat 4 and 5 until there is no nextCharacter
  7. battleOrder.winner is a reference to the winning Party

Conclusion
Even though I got the thing together, I’m not going to post it just yet. It integrates with some other stuff I’ve been working on, so I’ll probably keep it to myself until I’ve tightened up the API and made sure it runs perfectly. I just thought the process was interesting, and what better place to share game design thought process?

-Zack J.
Happy Ninja Clan

Advertisement

Filed under: Uncategorized,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Pages

Archives

Follow

Get every new post delivered to your Inbox.