Attributes – How the Broken Staff CRPG System ‘Measures’ Stuff

Last modified date

This is the second in a series of posts where I will be outlining the Broken Staff CRPG system and giving an introduction of how it works.

In a previous post I covered effects, which if we use a human body as an analogy would be the skeleton. They provide structure to the system.

The next major element in the system is attributes. This handles the classics such as health points and stamina points as well as resistances and regeneration rates.

You can find the attribute information in two files: Attributes.xml and AttributeTypes.xml.

AttributeTypes.xml

There are currently 4 types of attributes used:

  1. Primary – The basic stats like strength, vitality, dexterity, speed, intelligence, wisdom, charisma
  2. Secondary – Stats like HP, SP and MP as well as hpregen, spregen and mpregen
  3. Derived – Saving throws and items like weight allowance
  4. Resistances – Stats the help resist damage or other ill effects

Here’s an example of an attribute type from the file:


<AttributeType>
   <Id>primary</Id>
   <Name>Primary</Name>
   <Description>Primary Attributes</Description>
</AttributeType>

There is really just id, name and description. Attribute Types could have also been called effect groups or categories, they are just a way of grouping similar attributes together.

Attributes.xml

This file lists all the attributes used by the game. Attributes have id, name and description just like attribute types but they also have group which is the attribute type and values.

For each value there is a corresponding series of effects. This was done so modders have lots of leeway in changing the system to suit their needs.

Here’s an example attribute, strength, will one value, 14, and the effects that go along with a strength of 14.


<!-- Strength = Damage bonus, attack bonus, weight allowance, jump skill, climb skill -->
<Attribute>
   <Id>strength</Id>
   <Name>Strength</Name>
   <Group>primary</Group>
   <Description>Strength is a measure of a creatures power. The stronger a being is, the more they can carry and the more damage they can inflict in hand to hand combat.</Description>
   <Values>
      <Value>
         <Id>14</Id>
         <Effects>
            <Effect>
               <Id>damagebonus</Id>
               <Value>3</Value>
               <Duration>Permanent</Duration>
            </Effect>
            <Effect>
               <Id>attackbonus</Id>
               <Value>3</Value>
               <Duration>Permanent</Duration>
            </Effect>
            <Effect>
               <Id>jumpbonus</Id>
               <Value>3</Value>
               <Duration>Permanent</Duration>
            </Effect>
            <Effect>
               <Id>climbbonus</Id>
               <Value>3</Value>
               <Duration>Permanent</Duration>
            </Effect>
            <Effect>
               <Id>weightallowancebonus</Id>
               <Value>15</Value>
               <Duration>Permanent</Duration>
            </Effect>
         </Effects>
      </Value>
   </Values>
</Attribute>

From the above example we can start to see the worth of effects, and why they are so important to the Broken Staff CRPG system.

A strength of 14 nets a creature +3 attack and damage bonuses, +3 to two skills and +15 to their inventory carrying allowance. These would all be permanent bonuses, if numbers were put there that would be the time in seconds the effect would last.

But say as a gamer you think that is incorrect. You can go in and add the effects and values you think are correct. Many attributes have values defined up to around 40. If you wanted to you could extend that into the thousands just by copying and pasting then modifying values.

There is a lot of customization on the data side using this approach and I’ve not seen a lot of other systems take this approach unfortunately.

Adding New Attributes

If you wish to add new effects to your game you need to:

  1. Add a relevant entry in the Attributes.xml file. This includes defining the available values for that attribute and any effects attributed with that value.
  2. Next you would include the attribute in any of the files that make use of it such as in: races, classes, characters, monsters etc
  3. In theory your existing attribute code should be able to handle the new attribute. But you would need to test it to be sure.

Any questions? Feel free to comment on this post.

Next time I will be covering skills, which are an important element in CRPGs.

Greg Caughill

Greg Caughill is the owner and creative director of Broken Staff Studios.

Share