MedievaLands Forums

Friday Fix: Combat Mechanics

Back to Forum
ZaneDubya

Two opponents square off in the dungeons of Yserbius. Whether this is a new adventurer taking on a wolf in the Mines, a grizzled veteran engaging the fiends in the Wind Knights Tomb, or two heroes duelling in the Dungeon Entrance, the same formulas determine what happens in each combat round.

But I'm getting ahead of myself. At the outset, it's important to note that combat in Yserbius is divided into rounds. Each round, every combatant that is not paralyzed or petrified will choose an action. Actions can be physical attacks, or the use of a spell, skill, or item. Players generally get to choose what action to take, unless Controlled, in which case they will choose a random ally to attack with a physical attack. Monsters will either make a physical attack or cast a spell.

But again, I'm getting ahead of myself. There are two types of combatants in Yserbius: Player Characters (Characters), and Monster Stacks (Monsters). The basic Character attributes are Strength, Defense, Agility, Initiative, and Dexterity, which are defined in part by the Player's choice of Race and Guild for that character, in part by the Player's choice in how to allocate statistic improvement points granted on level up, and finally in part by visiting various stat boosting places throughout the dungeon. The basic Monster attributes are defined by a Monster Template, which has Strength, Defense, Initiative, MagicalDefense, and Dexterity. All monsters built from a template will have the same exact stats. Note that two monsters in the same map may have the same name, but will be built from different templates!

Now that we know the attributes in play, we can walk through the mechanics to determine what happens when a physical attack is in play.

The first thing that is determined is whether attacker hits the defender. The game calculates a "HitDiff", which is equal to the Attacker's Strength minus the Defender's Defense, plus 14, divided by 2, and clamped to a range of 0-14.

The final HitDiff value is used to select one of 15 rows in the HitResultTable. Each row has a different chance of three results occuring: Miss, Hit, or CriticalHit. Row 0 (used when the Defender's Defense value is +14 or higher than the Attacker's Strength value) always misses. Row 14 (the Attacker's Strength is +14 or higher than the Defender's Defense value) will hit 60 percent of the time, and CriticalHit 40 percent of the time. So having a high Strength will help you not just hit more often, but critical hit more often!

If the result in the HitResultTable was a Miss, the physical attack simulation ends here, and the combatant will be informed of their ineffective attack. Otherwise, we continue to damage calculation!

Now we calculate Base Damage, which is equal to the Dexterity of the Attacker minus the "Armor" value of the Defender. Armor for Characters comes from equipped items and skills. Armor for Monsters comes from the Template (ranging from 0 to 200 in Yserbius). If the base damage is equal to or less than zero, then the attack has been Parried, the attack simulation ends, and the combatant will be informed of the Parry.

Now we randomize the Damage. Characters will have a randomized damage between 75-125 percent of the base damage. A single Monster will have the same randomized damage range. However, if a Monster's template allows multiple attacks, and there are multiple monsters left in the Stack, then the monster can attack more times! Each additional attack adds a random value between 0-50 percent of the base damage value. The maximum number of additional attacks in the Yserbius monster template dataset is 2.

If the attacker is an Undead type monster and the defender is a Character with a protection against undead buff, the damage will now be reduced by half, three quarters, or seven eighths, depending on the strength of the defense buff.

If the attacker is a monster, then it will check its template to see if it should inflict a debuff state if it hits. Monster attacks may inflict any one or more of the five debuff states (poison, petrify, paralyze, backfire, and control).

Finally, if the attack is a critical hit (as determined by the HitResultTable), the game will choose a random critical hit type from the CriticalHitTable. Each critical hit type has a damage multiplier, and will inflict a reduction to the Defender's defense and initiative values.

Well, that's it for calculation of physical attacks. If you have any questions about how this all works, or questions about other mechanics, please let me know!

Reginald

This is a great synopsis on how damage calculations are done; I had no idea that additional units in a stack contributed to overall damage of a monster unit; I was under the impression that only the front unit was doing the damage.

It definitely helps in regards to changing up my tactics a bit; I'd want to neutralize the most threatening damage dealer before whittling my way down the ranks.

Silver

In this version, I've been seeing a lot more critical strikes done by monsters to the player character, which can make for significant frustration when a creature that normally does scratch damage or cherry taps suddenly rears up and kills a PC in the middle of their dungeon run. (And sometimes does this even with the protections afforded by Shield, which makes lower dungeon runs aggravating to a solo player who is just trying to get through, rather than having to start again and again because they had the misfortune of running into a random encounter that simply overpowers them and they have no more space to put stat points into and no way of stacking Shields on top of each other until they can absorb enough damage.) Am I misremembering in thinking monster crits didn't happen quite as much in the original games?

Seeing this calculation and explanation of how attacks are figured is helpful in figuring out who to prioritize with damage-over-time and attaempts at melee attacks. Thanks!

Grobrak

I would honestly like to see the critical damage being less seemingly randomized. I mean being able to strike a creature from between 50 to 750 damage is insane! Possibly a limitation to critical damage caused by players and monsters, along with some way to increase that cap (Skills? Strength?) would be a good way to balance it out.

ZaneDubya

Thanks for the input here. I agree that damage is too spikey and too random.

I'm reducing the randomness of the critical hit damage as of tomorrow morning. As long as your defense is relatively high compared to your foes, you should never see the top of the CriticalHitTable. Those of you who are less strong may still find your foes very tough, but even for the weakest among us, critical hits will be more survivable.

1 of 1


Terms of Service - Privacy Policy - Rules of Conduct

Made with love in MPLS. Write to me at [email protected].