Ability/ru

From Dragon Age Toolset Wiki

Jump to: navigation, search
Способности
Начало / Русская DA Builder Wiki
Scripting

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

Contents

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 trait (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 invisibility or 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

Abilities are divided into 4 subtypes, as defined in the 'abilitytype' column in ABI_base.xls:

Note: Talents do not show up on mages and spells do not show up on rogue or warrior characters, so to create abilities that can be used by all classes, abilitytype 3 (Skill) must be used. To define under which heading an ability shows up on the character's talent/spell page, the field 'guitype' is used. It resolves against guitype.xls which lists all known headings.


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 directly in the combat resolution scripts (e.g. HasAbility( oCreature, ABILITY_TALENT_LETHALITY )). 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:

The benefits from sustained abilities are calculated when the ability is activated. So if a character levels up or otherwise changes stats that influence the magnitude of a sustained ability, they will not update until the ability is reactivated the next time.

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

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.

Value Effect
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.

Value Effect
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


Other balancing vectors:

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: What is Spellpower and how does it interact with abilities

Spellpower is probably the most important stat for a mage character (and only exists on mage characters). It is calculated as max(Magic - 10,0) and therefore increases by one point for every point a mage spends on his Magic attribute.

Most mage spells benefit directly from higher spellpower by increased damage, effect magnitude and duration. It also plays a role in a mages ability to overcome mental or physical resistance on a target (where applicable). The actual impact of spellpower on an ability varies from spell to spell but the most common construct equates to something like 1% increase in spell potency per point of Spellpower. Thus, items and spells that increase spellpower are very powerful as they increase the potency of every spell the mage can cast.

Spellpower is the only factor that causes an increase of a spells potency over time, so a level 20 mage with neglected the Magic attribute would be much less powerful than a mage that didn't neglect Magic.

Some examples:

Note that these formulas only list the raw damage potential and do not take into account the effects of damage types, difficulty, rank, resistances, magical shields and any other mitigating factors on the target or enhancing factors on the caster. This means that just comparing the numbers will not give you an idea which spell is better or worse.

For non-mage spells and abilities, spellpower is often substituted by an appropriate other construct (such as max(Cunning-10,0) for rogue abilities).

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:

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:

(This should probably go on its own wiki page)

Q: Are sustained abilities mutually exclusive ?

A: There is a very limited number of sustained abilities that are mutually exclusive, usually because it makes sense. Mutually exclusive abilities cancel each other upon activation.

Technically, all abilities in ABI_base.xls that share the same 'condition_group' value are mutually exclusive.

Q: What are the rules for stacking effects and damage ?

A: The general rules of stacking for abilities are:

For equipment and item based effects, the game usually stacks within the minumum and maximum clamp values of a property (properties.xls). This means that you can accumulate a lot of +damage or +critical critical chance effects, but for some stat types there is a point where you are no longer gaining any benefits (e.g. speed modification - animations can only be sped up to a certain point before breaking, so stacking momentum, haste and a weapon with a speed based effect will not result in a -3.0s attack time, sorry :p)


For almost all effects, the total result of all property modifications on a creature are visible on the main character UI by hovering over the individual stats.

Q: How does game difficulty affect abilities ?

A: Our approach to game difficulty dictates that the effect of your chosen setting are

The game is balanced so that Hard mode is challenging for a Baldur's gate veteran.

Based on these guidelines, you can expect the following ability behaviors in game:

Q: What is spell affinity ?

A: Spell Affinity was a design we toyed with for a while during development but decided not to implement.

Q: How does Rank Based Mitigation Work ?

A: In line with Dragon Age: Origin's asymmetric approach to rules, the game uses creature ranks (instead of levels) in addition to stats and resistances to define how creatures get affected by abilities. In short: Boss monsters get affected differently by abilities and effects than Lieutenants or Critters.

The rank system is the primary balancing vector for the games difficulty levels and profoundly affects all aspects of combat. The gory details of this system are defined in creature_ranks.xls and difficulty.xls.

Rank mitigation affects not just damage in- and output of a creature, but also the duration that hostile effects persist on it and is different for each difficulty level of the game. Note that party members have their own rank in this system and are handled differently from other creatures in some cases.

Below is the formula used for rank based effect duration mitigation:

// sys_resistances_h
// @brief Returns an effect duration scaled by rank of oCreature and game difficulty
// @author Georg
float GetRankAdjustedEffectDuration(object oCreature, float fDur)
{
 
    // -------------------------------------------------------------------------
    // Georg: This deserves some explanation:
    //
    //        One of the core issues when designing the combat system was always
    //        the fact that the story called for sequences during the game in which
    //        your main character acts solo.
    //
    //        Characters reliant on special abilities, such as rogues, would require
    //        them to be very effective in order to beat enemies that a standard tank
    //        can plow through. However, if these abilities would maintain the same
    //        effectiveness in a full party, most encounters would turn into a stunfest.
    //
    //        The solution is to add 1 second flat to each detrimental effect duration
    //        lasting at least 1 second for each unoccupied slot in the party - before applying
    //        rank and difficulty modifiers. This also makes solo play a bit more viable.
    //
    //        This is in addition to the diminishing returns on quickly successive stuns.
    //
    // -------------------------------------------------------------------------
    if (!IsPartyMember(oCreature))
    {
        float fPartySizeModifier = IntToFloat(Max(0,4 - GetArraySize(GetPartyList())));
 
        if (fDur >= 1.0f)
        {
            fDur += fPartySizeModifier;
        }
    }
 
    float fRankDurMod = Diff_GetDurationModifier(oCreature);
    if (fRankDurMod >0.0f)
    {
        return (fDur * fRankDurMod);
    }
    else
    {
     return fDur;
    }
}

Q: What does 'asymmetric rules system' mean ?

The goal behind Dragon Age: Origin's rule system was to create a fun and challenging video game experience first and foremost.

We describe the rules as 'asymmetric' because a subset of the game rules treats player controlled characters and monsters differently, which is a deviation from pen and paper rule design that often require player and opponents to be treated exactly the same.

Notable Examples:


Язык: English  • Русский
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox