• Advertisement
Sign in to follow this  

Equations for RTS combat systems

This topic is 3492 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm writing an RTS game and I would be interested if anyone can recommend any articles or explain to me what kind of equations are used to calculate attack damage for these types of games. I've already found this site which explains Warcraft 2's combat equation: http://artho.com/warcraft/combateq.html Any other recommendations would be much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Usually you might have a few different damage types that each unit can deliver, as well as a few damage types that they are particularly susceptible to. Each unit may also have offensive/defensive buffs/nerfs depending on whether they're wearing armor, have upgraded cannons, are cursed, etc. The equations themselves are no more complicated than what you've read about in the Warcraft 2 article, however in modern RTS games there are a lot more variables that factor into those equations and they can relate together in more complex ways. The exact equations very from game to game of course, but you typically won't see anything beyond the basic arithmetic operators. This makes the damage systems easier to design, and faster as well. Just imagine performing complex Calculus on a few dozen units in an AoE attack...

Share this post


Link to post
Share on other sites
The starcraft system is basically:

There are a few weapon types in the world: Projectile, Explosive, Magic?
Each unit's armor has resistance to the weapon types.

So:

actualDamage = incomingDamage * myArmor.getResistance( weapontype );

Startcraft also adds the complexity of shields which are basically a secondary hitpoint store that obeys the rule: damage is first applied to shield and then to health. This allows unit combos such that one unit can completely nullify shields and another then easily take the unit down since it is unshielded.

-me

Share this post


Link to post
Share on other sites
Thanks, those are some useful pointers. I'm planning on designing a rock-paper-scissors style of strategy where cavalry beats infantry, infantry beats pikemen and pikemen beats cavalry with archers thrown in for good measure.

Any bright ideas for the best (simplest) implementation of this?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement