Ideas:chad3f:SkillsSystem

From Arianne
Jump to navigation Jump to search

Skills System

Some of these ideas may have already been mentioned in some form, but this will cover my ideas as a whole.

Acquired Skills

Instead of limiting skills to general attributes such as atk and def, create itemized skills that map to realistic real-world skills (where possible, as a few synthetic ones may be needed).

  • Attack/Defense placement
    • Range
      • Close
        (fists, hand dagger, knife, short sword)
      • Medium
        (long sword, thrown dagger)
      • Extended
        (arrow, ice/fireball)
    • Elevation
      • High
        (head)
      • Medium
        (torso, arms)
      • Low
        (legs, feet)
  • Enemy experience
    • General type
      (elf, dwarf, orc)
    • Specific type
      (archer_elf, leader_dwarf, hunter_orc)
  • Enhierent skills
    • Agility
    • Strength
    • Speed
    • Endurance


Except for Enemy experience, all of these skills would also be assigned to creatures. And with persistent non-player storage support, even specific player experience could be a factor for creatures. So the more you fight a specific create (or maybe type in an area), the better it is against you, as if it learns to anticipates your combat.

Item Skills

Like general learned skills, items (like weapons and armor) also have common properties that can be mastered over time.

  • Experience
    • General Type
      (sword, dagger, hammer, club, shield, armor)
    • Specific Type
      (great_sword, war_hammer, wood_shield)
  • Use styles
    • Stab
    • Slash
    • Throw

Item Definitions

Items would then be defined as a [weighted] list of skills that makes up it's use. Here is a rough example of some hypothetical items/skills:

<item name="short_sword">
 <skill name="attacking" weight="10"/>
 <skill name="sword" weight="20"/>
 <skill name="short_sword" weight="20"/>
 <skill name="slash" weight="10"/>
 <skill name="stab" weight="3"/>
 <skill name="range_close" weight="10"/>
 <skill name="range_medium" weight="2"/>
 <skill name="agility" weight="5"/>
 <skill name="strength" weight="5"/>
</item>

<item name="long_sword">
 <skill name="attacking" weight="10"/>
 <skill name="sword" weight="20"/>
 <skill name="long_sword" weight="20"/>
 <skill name="slash" weight="10"/>
 <skill name="stab" weight="3"/>
 <skill name="range_close" weight="5"/>
 <skill name="range_medium" weight="10"/>
 <skill name="agility" weight="2"/>
 <skill name="strength" weight="10"/>
</item>

<item name="knife">
 <skill name="attacking" weight="10"/>
 <skill name="knife" weight="20"/>
 <skill name="slash" weight="5"/>
 <skill name="stab" weight="15"/>
 <skill name="range_close" weight="10"/>
 <skill name="agility" weight="7"/>
 <skill name="strength" weight="1"/>
</item>


The method for applying these attributes is to calculate the proportion that each is of the whole (this can be done up front in the code). The reason for using weights instead of raw percentages is so a person doesn't have to adjust all other values to total 100 just because they add/remove/change a single skill.

For the sake of calculations, all current player skill values are converted to a number in the range of 0.0 to 1.0. How this is done should remain independent of this portion of the skill system, but the values are assumed to be a linear value where 0.0 = complete novice, and 1.0 = perfect expert.

The proportional skills from the item is then scaled (multiplied) against the player's current value for the corresponding skill. All of these values are added together, which have a maximum total of 1.0. This total is then use to apply/scale the item's normal potential (like atk, or whatever might replace it) and applied as needed. As skills are gained from use of an item, the gain is divided up based on the proportion each skill's weight and added to the player's skills (based on it's independent implementation).

To allow externally defined/gained skills (like those that may be taught by an NPC) which shouldn't be implicitly increased by using them, another option could be added to the [xml] description for those skills. In this case, gained skills could either be distributed as normal (skipping updates for those skill(s)), or calculate update proportions as if those special skills didn't exist.

Example Case

Given a new player, that has no skills except the default attacking skill that has a value of 0.5. The player has a knife and preceeds to use it, over time gains skills related to it. The maximum atk potential of a knife for this example is 10.

Here are the calculated proportions for a knife, along with the player's skills and scaled result:

             portion  player   final
attacking    0.147    0.500    0.074
knife        0.294    0.000    0.000
slash        0.073    0.000    0.000
stab         0.220    0.000    0.000
range_close  0.147    0.000    0.000
agility      0.102    0.000    0.000
strength     0.014    0.000    0.000
                             + =====
                               0.074


In this case the total skills applied are 0.074 (or 7.4%). There are several ways this could be applied to the weapon (possibly even using item specific algorithms). In this case, a simple attack value +/-20% random chance (even novices get lucky hits).

The final atk value is computed as:

effective_atk = (10 * 0.074) +/- (10 * 20%) = 0.74 +/- 2.0 = [0.00 - 2.74]

In this case, let's assume the the number 1.60 was generated. And assuming this was enough to kill something (or accrue per-hits xp), with the total xp earned being 20, the amount of xp given to each skill is:

             portion  skill xp
attacking    0.147    2.94
knife        0.294    5.88
slash        0.073    1.47
stab         0.220    4.41
range_close  0.147    2.94
agility      0.102    2.06
strength     0.014    0.29

These dived xp points are then added to each skill (this example assumes skill is stored as xp and converted to [0-1] skill values when needed). The next time the weapon is used, the new skill values contribute to it's potential as before, only this time resulting in a slightly better use (statistically speaking, given the random factor and other optional external effects [like karma]).

Now let's say that many days (or weeks/months) have passed with the player constaintly using only their knife and improving their associated skills.. so much so, they have maxed out all those skills to their full potential (1.0) and finally decide to upgrade to a short_sword with a full atk of 20.

As before, here are the calculated proportions/player skills/totals for the sword:

             portion  player   final
attacking    0.118    1.000    0.118
sword        0.235    0.000    0.000
short_sword  0.235    0.000    0.000
slash        0.118    1.000    0.118
stab         0.035    1.000    0.035
range_close  0.118    1.000    0.118
range_medium 0.024    0.000    0.000
agility      0.059    1.000    0.059
strength     0.059    1.000    0.059
                             + =====
                               0.507

In this case all the common skills have been transfered, but the ones not related to a knife as still their untrained defaults. So the final scale is 50.1%, or an effective atk of 10 +/- 4.

Now the values shown may not be very realistic, as they were just needed to demonstrate the algorithm.




Other pages