Heresy RTS combat system basics
In the last entry of my blog I discussed the inspirations for the combat gameplay of my current project – Heresy RTS. This time I will go into details about the combat system that drives the game.
Combat system basics
To quickly reiterate my previous post, combat system in Heresy RTS draws inspiration from three different sources:
- Micromanaging distinct units (think of Warcraft 3).
- Dynamic and reactive combat (think of Total War real-time unit interactions).
- Managing equipment and resources (think of Company of Heroes/Men of War or basically any RPG game).
Each unit in Heresy has an AI system which governs their behaviour. Using special sensors they detect potential targets and choose a specific target that becomes their focus. Now, based on their AI type and equipment several scenarios occur:
- Non-combatant units might choose to flee, workers will drop their work when attacked.
- Ranged units will fire at chosen targets and engage in melee if the targets get too close.
- Melee units will pursue their main targets and engage in melee.
- Any unit that is afraid, loses combat or gets a specific order may start retreating to their home location.
Let’s now look at more details of the combat procedure.
Melee combat mechanics
Let’s assume that two units are finally in melee range. They perform their first attack with their equipped weapon and initialize an attack animation. When an attack animation starts it cannot be interrupted. This was introduced after some testing. If every animation can be interrupted, this results in a jittery, and possibly buggy, experience. After the first attack a cooldown is introduced based on the equipped weapon (and other factors in the future, e.g. Initiative statistic, weapon/armor weight). When the cooldown finishes, the unit can attack again.
During the attack animation a deal damage event is fired. If a suitable target is in range a test is performed. The attacker’s Attack skill is compared to the defender’s Dodge skill. Depending on the roll result a Hit or Dodge animation may be initiated. But now comes the fun part: each attack may target a Low, Mid or High area of the body. To achieve this, attack animations are synchronized with hit/dodge animations using special damage wrapper methods added to animations. This allows for customization of each animation.
Damage dealt is a flat number based on weapon stats. It is then reduced by the target’s armor in a percentage based manner. After the damage is dealt the game plays sound and particle effects. The blood particle effects are also roughly adjusted to hit location.
On-hit effects are the final piece of the puzzle. Each weapon has several slots for possible effects a hit can cause. Examples include poison, bleeding or knockdown. Every weapon can apply several different effects, but on hit only one of the available effects activates at random.
The following clip shows two rounds of combat between two units with identical stats. One has a dagger equipped (faster attack, lower damage). The other one has a mace (slower, higher damage, knockback).
Ranged combat mechanics
For ranged combat I wanted to diverge a little from most RTS titles. I wanted a high impact, risk vs reward system. A system that rewards positioning and allows for unexpected tactics. To achieve this I decided to go for a physically based system for projectiles. Each projectile is a physical object which can be blocked, intercepted or can even cause unforseen collateral damage. There are no arbitrary hit rolls, nor does the game provide “aim assist”. The only way a player can influence accuracy is to invest in the, aptly named, Accuracy statistic. This is a percentage based stat that mitigates the effects of forces applied on projectiles that are fired from weapons. This means that the higher the Accuracy percentage gets, the closer the targeted point the projectiles will land.
Projectile weapons in Heresy RTS have quite a high damage compared to other games. This is offset by two factors:
- Each weapon has a limited ammo capacity which needs to be replaced in the base or gathered from the environment.
- Friendly fire exists. Heresy is not designed with “fire and forget” philosophy. Positioning and timing is key.
Just as in real historical settings, ranged weapons might only be usable in specific situations: at the start of engagement, from an open flank, from a defensive position. This does not mean that ranged soldiers are worthless when melee starts. Every soldier will be able to fight in melee. Throwing knives, axes and spears are also potent melee weapons, but a crossbow stock can also be used to bash. If a ranged weapons has no practical use in melee, the soldier might resort to kicking and punching.
The clip below shows a ranged AI behaviour set. The unit will acquire target, shoot all the remaining ammo and then proceed to fight in melee. Please note though, that for testing reasons the target’s AI script has been disabled.
It’s nearly impossible to find experienced people in this particular subject, but you seem like you know what you’re talking about!
Thanks
It’s really a great and useful piece of info. I’m satisfied that you just shared this useful information with us.
Please stay us up to date like this. Thank you for sharing.
Woah! I’m really digging the template/theme of this site.
It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and appearance.
I must say you’ve done a fantastic job with this. Additionally, the
blog loads extremely fast for me on Opera. Superb Blog!
It’s a pity you don’t have a donate button! I’d definitely donate
to this superb blog! I guess for now i’ll settle for
bookmarking and adding your RSS feed to my Google account.
I look forward to fresh updates and will talk about this website with my Facebook
group. Talk soon!
First off I would like to say great blog! I had a quick question in which I’d like to ask if you do not mind.
I was curious to find out how you center yourself and clear your head before
writing. I have had a hard time clearing my mind in getting my thoughts out there.
I do take pleasure in writing but it just seems like the first 10
to 15 minutes are wasted just trying to figure out
how to begin. Any suggestions or hints? Thank you!
Excellent post. I used to be checking constantly this blog and I am inspired!
Extremely useful info specially the remaining part
🙂 I maintain such information a lot. I used to
be looking for this particular information for a long
time. Thank you and best of luck.