[Under The Hood] A Closer Look at Items
In this column that I call “Under the Hood”, we’re going to dig deeper into how items work in Dragon Age: Origins. We’ll take a look at items both in the toolset,but also dig deeper into 2da files, and scripts.
Items in Dragon Age are pretty much anything you can have in your inventory. They may or may not be equippable, but they can always (as far as I can tell) be put into your inventory and carried around with you.
Base Item Types
Every item in the game extends from a base item type. There are approximately 70 base item types defined in the core game resources. You have things like “Armor – Light”, or “Weapon – Sword”, or even “Other – Herbalism Item”. You even have “Money – Copper”. Yes, money is still an item.
The important thing to understand about items in Dragon Age is that for most items, there is a generic version of the item, and that generic version is auto-scaled by the game when your character acquires it. In other words, a longsword doesn’t exist in lots of different versions for different levels. There is a simple basic Longsword, and that is then scaled to a tier appropriate for your character when you acquire it. This is not the case with every item in the game, but it does cover many of them including most all weapons and armor.
The base item type defines the base properties of the item. This includes things such as appearence, both 2d and 3d, as well as attributes such as how much damage a weapon might do, or how much defense a pieceof armor might give. These are all defined by the base item type, and any item created will inherit these values. So we have the basie item type, and the properties given by it, but how does the game scale these to the character? It all has to do with Material Tiers.
Items that get scaled by the game all have what is called a Material. For example, a longsword might be Iron. These materials define what tier the item is. Higher tier items are more powerful. Remember how we said that the item inherits certain base attributes from its base item type? Well the tier further modifies those attributes by applying a multiplier to them. So the game scales an item up by assigning a certain material tier to it, and then the item’s base attributes, multiplied by the tier’s modifier gives us a scaled item.
We’ll talk about 2da files in more detail later, but understand that 2da files are basically spreadsheets that the game uses to define muchy of the raw data in the game. Items are all defined in these files. If you take a look in the Dragon Age/tools/source/2da folder, you can see these raw files. They are in fact Excel spreadsheets. If you go one level deeper, into the Rules folder, you will find BITM_Base.xls. This is the 2da file that defines the properties of those base items we talked about.
We can see here, for example, that a longsword has a base damage of 7. So any item created with the base item type of “Weapon – Longsword” is going to do a base 7 points of damage. If you then open up “materialtypes.xls” you can see how the material tiers work.
Notice how the higher the tier, the higher the damage modifier. So an item with a base item type of “Weapon – Longsword” and a Material of “Iron” would do 7 points of damage (7 * 1), but one that is of the Dragonbone material would do 11.2 points of damage (7 * 1.6). This is how item scaling works.
Now that sort of stuff is all well and good for things like armor and weapons, but what about other items like potions? Looking at the table there isn’t any values for “healing” or any such thing. how the heck do these work?
Well the first thing we can note, by looking at the items in the toolset, is that in this case there are multiple versions of the ptions, one item for each “level” of potion. So no auto scaling here. Now how does the healing work? If you look at the item’s “Item Properties” you can see that it has a [S] type ability on it. [S] means special and goes with the dropdown at the bottom of the window. This has an ability “Flag: Is Healing Potion”. In addition if you open the “_Ability_Scripts”, under Items, you will see “item_singletarget” and in there there is a seperate case handling each level of potion to create its healing effect. But how do the two things tie in? This is where it gets interesting. Useable items that have effects, like health and mana potions, appear to bridge between two worlds. They are items, and they are also “abilities”. If you open up ABI_base.xls you will find all the various spells, skills, and talents in the game. You will also, down near the bottom, find item effects. This 2da ties these things in with the script that handles them.
So when a healing potion is used, the script “item_singletarget.ncs” is called, and sent the ID of the potion, 200010 for less potion for example. The way its tied together i’m not sure the “Flag: Is Healing Potion” really does anything, but it might be used for some other purpose as a way to identify it as such.
Well I hope this little look “under the hood” gave you a better idea of how items work in Dragon Age: Origins. At this point in time we’re all still learning the ins and outs of the toolset and the game, but hopefully this helps get people thining and helps grow the community!