Difference between revisions of "Ability"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(Balancing (Cost, Cooldown, etc))
(More Q&A)
Line 188: Line 188:
  
 
Displaying those values results in very misleading information (e.g. while damage seems to be higher on one ability, the mitigation mechanisms and unique side effects of another ability will make it just as good or better - in certain situations) and it turned out to be better to provide the player with general guidance than the misleading information.
 
Displaying those values results in very misleading information (e.g. while damage seems to be higher on one ability, the mitigation mechanisms and unique side effects of another ability will make it just as good or better - in certain situations) and it turned out to be better to provide the player with general guidance than the misleading information.
 +
 +
 +
 +
''Q: Can we have the damage formula for abilities''.
 +
 +
A: There is no damage formula for abilities, as mentioned before, each ability follows their own rules.
 +
 +
In general, talent damage is based on the weapon being used (e.g. Assault does 3 melee attacks that deal weapon damage with some additional bonuses) and are modified by external cirumstances such as location, critical chance and ability to deliver a backstab and are mitigated by armor on the target.
 +
 +
Spells deal damage of different damage types following a rough rule of (Constant * (Spellpower / Variable)) / [Variables] ) + Modifiers but this only tells part of the story as actual damage is dependent on the target, it's resistances, rank and a number of other factors.
 +
 +
Some additional factors affecting spell damage are:
 +
 +
* damage resistance.
 +
* magical shields.
 +
* difficulty level.
 +
* elemental damage bonuses from spells or items
 +
* Environmental conditions (frozen targets take less damage from fire, etc.)
 +
 +
 +
''Q: What are the differences between damage types''.
 +
 +
A: Creatures have variable damage resistances based on their type and rank. Dragons might get 60% less damage from fire (60% fire resistance), other creatures will have different immunities. Additional effects are:
 +
 +
* Electricity: In addition to normal damage, these also reduce the targets stamina (but not mana) by the same amount, making them very effective boss killers.
 +
 +
* Fire: Cancels Cold based damage over time effects and applies damage over time.
 +
 +
* Cold: Cancel Fire based damage over time effects and often is accompanied by slow or slipping effects.
 +
 +
* Spirit: There are very few ways of increasing spirit resistance in the game, so spells dealing spirit damage are universally useful...
 +
 +
* Nature: Rarely found on spells.
 +
 +
 +
(This should probably go on its own wiki page)
  
  
  
 
[[Category:Scripts]]
 
[[Category:Scripts]]

Revision as of 23:14, 26 October 2009

Note: This page is in process of being rewritten.


Overview

The Ability System is used to handle Spells, Talents, Skills, and Item Abilities in Dragon Age.

Detailed Description

Spells, Talents, Skills and item abilities all use the same backend in the game, a mostly script implemented system relying heavily on two dimensional data arrays.

The most important 2da file for abilities is 'abi_base.xls', as it defines each ability and all aspects of execution and handling in both scripting and engine code.


Ability Design Notes

When creating an ability in Dragon Age: Origins, we generally stick to the following guidelines

  • Keep it useful.

Some constant benefits (such as an increase in Attack or Defense) stay useful for the duration of the game as the progression of the related properties are slow. For other effects, such as damage, a constant value would mean that the ability will become progressively worse through the game as damage needed to drop enemies increases from level to level. In such cases, the ability should be tied in some fashion to a Spellpower (for spells) or another relevant (such as cunning for rogues) to ensure they stay useful throughout the game.

  • No repetition.

Each ability in Dragon Age: Origins is unique. No incremental abilities such as 'fireball I, fireball II, etc.'. Skills are exempt from this rule. Remember that the Damage Types dramatically alter the actual effect of an ability (such as lightning always draining stamina alongside doing damage), so having similar damaging abilities in different trees is usually fine.

  • Thematic matching.

Abilities within the same chain should follow a common theme.

  • Avoid binary abilities. Design hit heavy.

Avoid abilities that are hit-or-miss. Generally, abilities should hit whenever possible and use target side mitigation of effects (resistance checks, damage mitigation) instead of 'hit or miss' mechanics. Melee abilities may use the normal attack resolution routines but should always perform their attacks at a bonus. Use rank based mitigation and resistances to allow for very powerful effects that do not trivialize boss battles.

  • Use meaningful effects

Abilities should always be worth it. Don't do minor effects (+1 attack). The player should always be able to see the effect of the ability in game (not necessarily visually, but at least through increased damage, etc.). The first ability in a chain should, whenever possible, be active. The fourth ability in a chain should always have the biggest 'bang-for-the-buck' factor. Abilities lower in the chain should have shorter cooldowns. Do not allow instant death on bosses and elite bosses.

  • Avoid 'zero-sum' abilities

When possible, avoid 'zero-sum' abilities that trade a penalty for a benefit (e.g. increase defense but decrease attack). There are a number of these abilities that are valid (such as aim), but balancing them and keeping them useful is hard and requires a lot of work. This obviously does not apply to drastic abilities such as blood magic.

  • No emulation of defining class capabilities

Never ever grant a basic class capability from one class to another class via abilities. This means no invisibilityor magical unlock spells for mages, as these are defining capabilities of the rogue class. No weapon talents for mages. No magic spells or large, targeted area of effects for warriors or rogues. Items might blur this line if the cost is balanced properly (e.g. grenades).


Basic Ability Types

There are 3 basic ability types in the game, defined by the field 'use_type' in abi_base.xls.


Passive Abilities

Passive abilities (use_type = 3) grant persistent or conditionally persistent bonuses or penalties to the creature that has the ability.

A passive ability may grant up to 3 modifications to creature properties (properties.xls). Those modifications are defined in the passive_abilities worksheet of abi_base.xls and linked to the ability through the passive_id column in abi_base.xls.

Additionally, the bonuses of an ability can be made conditional on the character's current 'wield mode' (2-handed, dual, weapon & shield, or universal) through the conditional integer field on the passive_abilities worksheet.

Finally, a number of passive abilities do not define any property modifications in passive_abilites but instead have checks coded against their Ids (e.g. HasAbility(oCreature, ABILITY_TALENT_LETHALITY)) directly in the combat resolution scripts. The mere presence of the ability on a creature causes a different code path to be taken in the scripts in those cases.

Note that passive_ability benefits are not limited to abilities with use_type 3. Some active abilities also grant additional property modifying benefits to the owner.


Sustained Abilities

Sustained abilities (use_type = 2) are turned on and off per character and, while turned on, grant effects or property modifications to the user. Most 'buffs' are implemented this way.

Only members of the player's party are using sustained ability as the code overhead required to track them is too expensive to be used on monsters that only exist to die in an encounter with the player's party. (These creatures use duration based effects to emulate similar abilities instead).

Most sustained abilities follow the same pattern:

  • They do not have any activation cost, encouraging tactical use of buffs.
  • They increase the users Fatigue property, therefore increasing the activation cost of all other abilities.
  • They reduce the users maximum available mana or stamina by a constant value.
  • They use cooldown to prevent the user from being too opportunistic with their use.
  • Some abilities shut down when the user reaches 0 mana/stamina. Very powerful abilities (such as Momentum) have an associated stamina/mana drain effect to limit their use to a short or medium period of time. Creative item / buff use can be used to increase the length such an ability can be sustained.


Some sustained abilities (such as Flaming Weapons) are active 'party-wide' - the caster not only sustains the ability on himself but on all his party members as well. This is controlled by the 'bPartyWide' flag in abi_base.xls. Due to implementation limitations, party members who die or otherwise enter/exit the current party will not be affected by these abilities until they are recast. (we put low cooldown times on these abilities for that very reason).

Gameplay Design Note
  • Unlike in games like Baldur's Gate, the system in DA: Origins is designed to encourage tactical use of buffs over strategical. We wanted to put an emphasis on the player making smart choices during an encounter vs. the player guessing which buffs might be useful ahead of time or having to employ save-die-reload to find out.
  • It is generally wise to run only one or two buffs all around and activate additional buffs only when needed.


Activated Abilities

Activated abilities (use_type = 4) are abilities that instantly execute their effect (see Targeting Behavior below). Most melee talents or targeted spells fall in this category. There are several sub-types of activated abilies, such as

  • Targeted, single target spells and talents (such as Winter's Grasp or Flurry)
  • Ground targeted abilities (such as Blizzard or various Glyphs)
  • Self targeted activated abilities.


Targeting Behavior

An abilities targeting behavior is controlled by several settings in abi_base.xls


AutoTarget is a boolean field that defines how the UI resolves targeting.

0 The UI will always bring up a targeting cursor.
1 The UI will only produce a targeting cursor if no suitable target is currently selected. e.g if the player currently has a hostile creature targeted and if the spells TargetType includes 0x4 (hostile), the ability will trigger immediately, not producing a targeting cursor. Most single target spells and talents use this setting.

Regardless of AutoTarget setting, the UI will never produce a targeting cursor if an ability is type 0x1 (self) -


TargetType is a bit mask derived from the following table and controls the behavior of the UI's targeting cursor.

Bitmask Effect
0x1 Self
0x2 Friendly Creature
0x4 Hostile Creature
0x8 Placeable Object
0x10 Area of Effect Object (deprecated)
0x20 Ground (see details)
0x40 Dead Body (deprecated)
0x80 Party Member


AutoDraw is an integer boolean field that defines how a character's weapons are handled when the ability is triggered.

0 The ability will not affect the player's weapon sheath status.
1 The engine will force the player to draw/unsheathe his weapon before executing the ability. This is used for most bow and melee weapon abilities.
2 The engine will force the player to stow away any non staff melee weapons before executing the ability. This is used to ensure that no inappropriate animations play with weapons drawn (e.g. the player conjuring with a sword clipping through his body) and to discourage switching between melee and spellcasting on the fly.


Balancing (Cost, Cooldown, etc)

Abilities in Dragon Age are balanced along several vectors, most of which boil down to simple 'use frequency'. As a general rule of thumb, the more specialized and limited the effect of an ability is, the more outrageously powerful an ability can be.

Use frequency of abilities can be adjusted by modifying the following field in abi_base.xls

  • Cost: This is the simple mana (spells) or stamina (talents) activation cost of an ability. It is subtracted when the conjure phase of the spell has succesfully completed (e.g. no cost for spell interruptions). Without sufficient resources to cover activation cost, the UI will not allow the player to execute the ability. The value is a constant integer and is multiplied with 1+(Current Fatigue) of the caster.
  • Cooldown: Cooldown is a constant float in seconds that defines how long the player has to wait after the successful activation of an ability until he can use it again. For abilities that apply duration based debuffs or effects to a target, cooldown is usually set slightly higher than the duration of the effect to avoid stacking by the same caster.
  • Upkeep: Defines how much mana or stamina is removed from the casters overall pool while a sustained ability is active. This naturally limits the number of sustained abilities present on a creature and ensures that the more beneficial buffs are active on the caster, the less mana is available for immediate use.
  • Fatigue: Fatigue affects use frequency only indirectly, but it prevents characters from stacking too many buffs on each other, as each sustained ability active usually adds around 5-10% fatigue to the caster.
  • Mana/Stamina drain: By reducing the mana/stamina regeneration rate on a creature, the duration for which a sustained ability can be used can be restricted. This mechanic is used only for the most powerful sustained abilities in the game, which are flagged to turn off when the caster sustaining them reaches 0 mana/stamina.


Other balancing vectors:

  • AoESize and AoeShape: Area of effect spells that deal friendly fire are location and situation restricted on normal+ difficulty (hard+ on the consoles). Since dropping an Inferno on your own party members is hardly a good idea in most cases, the usefulness of the spell becomes restricted to careful positioning and the earlier stages of combat.
  • Threat Generation: Abilities apply threat not just by damage but often by activation. Higher activation threat of an ability can balance out outrageously powerful effects by making it harder for the player to use the spell. The prime example is the Walking Bomb kind of spells which deal excellent damage, but, on higher difficulties, also make the targets very very angry at the caster. Using these spells effectively often requires a tactical approach by the player, thus limiting their universal usefulness and offsetting their very powerful effects.
  • Threat Removal: Some abilities are designed to only provide a short term benefit (Such as 3s stun on Mindblast) but offset their weakness by removing threat from the caster, often by reinitializing the threat tables on the target, causing enemies to randomly seek new targets.
  • Conjure time: Spells with a conjure time of 1+ (Speed in abi_base.xls) can be interrupted by damage, limiting their usefulness in melee situations or when only one party member remains on the battlefield. Many of the very powerful Area of Effect type spells use this feature.

Q&A

Q: Where do we find the exact formula for abilities.

A: Due to most abilities being unique, the only place to find the exact details on each spell is in the scripts. While a lot of data can be glanced from abi_base.xls, a lot of the detailed mechanics are very different between abilities and can only be found in the appropriate spellscript. The *_constant.nss files hold some basic values, but often get further modified in the scripts.

This is also one of the reasons why some elements of a talent are not displayed in the UI description in game. While we can calculate cost and cooldown based on the casting character and his fatigue and other properties (and consequently display it), we can usually not calculate damage or duration as they are mitigated on the target creature:

Displaying those values results in very misleading information (e.g. while damage seems to be higher on one ability, the mitigation mechanisms and unique side effects of another ability will make it just as good or better - in certain situations) and it turned out to be better to provide the player with general guidance than the misleading information.


Q: Can we have the damage formula for abilities.

A: There is no damage formula for abilities, as mentioned before, each ability follows their own rules.

In general, talent damage is based on the weapon being used (e.g. Assault does 3 melee attacks that deal weapon damage with some additional bonuses) and are modified by external cirumstances such as location, critical chance and ability to deliver a backstab and are mitigated by armor on the target.

Spells deal damage of different damage types following a rough rule of (Constant * (Spellpower / Variable)) / [Variables] ) + Modifiers but this only tells part of the story as actual damage is dependent on the target, it's resistances, rank and a number of other factors.

Some additional factors affecting spell damage are:

  • damage resistance.
  • magical shields.
  • difficulty level.
  • elemental damage bonuses from spells or items
  • Environmental conditions (frozen targets take less damage from fire, etc.)


Q: What are the differences between damage types.

A: Creatures have variable damage resistances based on their type and rank. Dragons might get 60% less damage from fire (60% fire resistance), other creatures will have different immunities. Additional effects are:

  • Electricity: In addition to normal damage, these also reduce the targets stamina (but not mana) by the same amount, making them very effective boss killers.
  • Fire: Cancels Cold based damage over time effects and applies damage over time.
  • Cold: Cancel Fire based damage over time effects and often is accompanied by slow or slipping effects.
  • Spirit: There are very few ways of increasing spirit resistance in the game, so spells dealing spirit damage are universally useful...
  • Nature: Rarely found on spells.


(This should probably go on its own wiki page)