3/03/2012

combat system progress

so, the basics on the combat system.

the game is going to have relatively simplistic combat, with three separate actions: strike, feint, and guard.  guard beats strike, feint beats guard, and strike beats feint.  ten points if you already understand the ages old mechanic behind all of this.  for now, it will probably display results like, "you strike.  your opponent feints.  you push their weak first strike aside and connect, dealing X damage" or "you strike.  your opponent blocks.  their defense puts you off balance, and the enemy's counter attack deals X damage", but this may be expanded to be more verbose in the future, since things like the opponent's stance, demeanor, behavior, etc can be used as tells for what their next move is going to be.  ties will probably have differing results based on the individual action - block vs block might just result in both parties circling each other and not even making a single offensive move, feint would be a few cautious lunges and probing strikes with (maybe) half damage done to both parties, and strike might be both people taking full damage.  it might be nice to have them all have unique effects, but there's still something to be said for efficiency (and i don't want to end up with a situation where everyone opens with, say, strike, because it has a 2 in 3 chance to deal full damage to an opponent, as opposed to block, which only does damage 1 in 3 times).

the basic formula is going to be [attackers strength + weapon damage - defenders armor = damage].  first group to reach 0 health loses the fight, but isn't necessarily killed.  health is a bit of an abstract representation in this game, although to be fair, if i want to keep saying that it might be good to change it's name (stamina? heroism?).  it's a combination of experience, endurance, ability, smarts, and so forth, a concrete measure of how much you can put yourself through before you make a mistake that allows your opponent to connect with a solid shot to put you out of the fight.  high-level characters aren't necessarily physically more durable, but they do fight better, which justifies the hp increase.

i'm not going to include randomized elements, like dodges or critical strikes.  in fact, i'm not even going to randomize the opponent's responses.  maybe - maybe - for the opening move.  i want enemies to have recognizable patterns in terms of how they respond to you; it creates a neat sort of situation, i think, where the player can encounter the same antagonist several times, eventually learning their patterns and using this to flawlessly beat them even though they're (relatively speaking) on equal terms.  on the other hand, i don't want players to memorize these and then get into a situation where they say, "oh, another greater demon?  block-feint-strike-strike, flawless victory" and go through the fight without actually bothering to check what their opponent is doing.  again, this goes in to the amount of text that gets displayed - there can be tells (like an opponent shifting their weight to their back foot when they get ready to strike, or raising their shield slightly when they're getting ready to block) that would give the player an idea of the best way to attack, but still allow the opponent to respond randomly.

i have an idea on how i want group combat to work, although i'm not entirely decided on it yet.  my preliminary idea is that, first, the melee on each side squares off.  the teams split off into either dueling pairs, or goes two on one if needed.  if it's 1v1, combat works normally.  if it's 2v1, then the side with more uses the most advantageous of the attacks from it's group (so, if the players use strike and feint, and the enemy uses block, the feint gets used instead of the strike).  you can't have 3 melee attacking the same opponent, since that would make combat next to impossible to win/lose (depending on if you're the 3, or the 1).  ranged characters from either side get to choose to attack whoever they like, doing (weapon damage - armor) per strike.  obviously, there's a benefit to having a melee character hold the line while a companion shoots from the back row.  if a ranged character gets forced into melee, they have to rely on a 'backup' weapon (which will be listed by weapon, such as "bow with dagger"), which will have a markedly decreased damage than real weapons do.

with regards to the actual programming, i spent most of tonight organizing how the game is going to store things like enemy health, writing simple functions to make sure that you can't set an opponent's current health to a number higher than their maximum health, making sure the right event runs when an opponent gets defeated, that sort of thing.  i didn't want to make a massive array with dozens of entries for how enemies respond to different attacks, so instead i'm making a simple file reader that will open up a file, search for a string of letters (lets say, "THIEFHU" for human thief or "THIEFOR" for an orc thief), and get the next ten characters after it, and then parse those ten to fill in the responses for when a block, strike, or feint succeeds, fails, or ties.  it keeps the game from holding 10 numbers in memory for every individual enemy (which should dramatically decreases the game's memory footprint, seeing as how i already have around 90 enemies i need to fill out for various races of bandit, civilian, and soldier, not to mention the handful of npc's), and it lets people who really just don't give a damn go in and edit all of the numbers to 1's so they can just spam one button and get through the damn irritating combat and get straight to the hot, juicy troll-on-elf rape if they want to.  really, everyone wins.

No comments:

Post a Comment