Flanking

Flanking is a concept in the combat system that encourages tactical positioning on the battlefield.
== Dragon Age: Origins ==
Whenever a combatant is located in within 120 degrees of an opponent's back, he receives a flanking bonus. With the Combat Movement talent, available only to rogues, the flanking angle increases to full back 180 degrees of the target. Flanking is only personally active, i.e., it only grants benefits to the combatant in the flanking position, not to anyone else fighting the target. A successful backstab changes the character's attack to a "stabbing" movement.
The magnitude of the flanking bonus is calculated off the relative positions of the attacker and the target. Attackers that are directly behind their target will receive the full flanking bonus. The bonus is proportionally reduced the more the attacker moves towards the side of the target. The bonus is applied to both ranged and melee attacks.
The following diagrams illustrate different flanking conditions:
Normal flanking 		With Combat Movement
 		
Flanking angle: 120 degrees Flanking bonus: up to +15.0		Flanking angle: 180 degrees Flanking bonus: up to +20.0
=== Effects ===
Receiving a flanking bonus triggers the following benefits for the attacker:
* The flanking bonus is added to character's attack rating. Please note only rogues receive full flanking bonus, all other classes get half the value.
* 20% of the flanking bonus is applied as a bonus to critical chance.
* A rogue that receives a flanking bonus while attacking will always backstab.
Note: The toolset version of the combat script multiplies critical chance by up to 2.5 for non-rogues and by up to 5.0 for rogues, instead of adding some fraction of the bonus.
These benefits emphasize the importance of tactical positioning in combat. A full flanking bonus of +15.0 to attack negates the equivalent of 15 attribute points invested into dexterity by the target—that is, 5 full levels.
=== Mitigation and negation ===
Letting enemies move into a flanking position will increase their chance to hit and to inflict critical hits significantly, especially early to mid-game. A number of ways exist in the game to mitigate vulnerability from being flanked:
, a passive ability grants flanking immunity on the left side.
, a passive ability grants full flanking immunity.
, which grants full flanking immunity.
, which grants full flanking immunity.
== Bugs ==
There is actually a bug in the code where Shield Block is taken into account:
 if (!bShieldBlock || fAngle < 180.0 || (bShieldBlock && !bUsingShield) )
 {
 fFactor = (fFlankingAngle - fabs( 180.0 - fAngle))/fFlankingAngle;
 }
The conditions check if the target does not have Shield Block, OR has it but is not using a shield, OR if the angle between the target and the attacker is less than 180°. If any of these returns TRUE, then the flanking multiplier fFactor is >= 0 (if all are FALSE then it is just 0 which means backstab won't happen). The angle here is defined to be the angle (in degrees) between the direction the target is facing and the vector from the target to the attacker, measured counterclockwise. So an angle of less than 180° returning TRUE means that the attacker is behind the target and on the left side (shield side) of the target. To sum it up, if the target has Shield Block and is using a Shield (first and third conditions return FALSE), the attacker would actually be able to backstab the target (second condition must return TRUE) if the attacker is on the left side of the target, which is the opposite of what is intended. Images on Shield Block's page.
== External links ==
* Flanking script on the DA Builder Wiki
Category:Talents
Category:Dragon Age: Origins gameplay
Category:Game mechanics