Wednesday, October 6, 2010

Ability Checks... you know like a saving throw.

I've been lax in posting updates recently. I have been doing a lot of thinking. So much that's keeping me excited. There's been some things that I have had people help me work through. The question of abilities, I think is settled for now after much discussion with James and Stu. Here are the "fab five" attributes that all spells, hit points, mana points, and abilities will be based on:
Strength (Str)
Dexterity (Dex)
Perception (Prc)
Will Power (Wil)
Intelligence (Int)


Players rating can expect to vary between five to twenty.

The first thing I propose needs discussion is the ability checks. [i]Ability checks[/i], as the name implies an ability check is the chance to perform an ability. These might be spotting a thief, resisting a spell, climbing a wall, etc. All ability checks depend on one of the fab five attributes.

Rather than following the D&D d20 checkes, ability checks will be based on this formula:


This very easily turns into a percentage. The numbers on the top -numerators for those of you remember math- is were all the work will be done. "a" will always be the player's attribute that is used for the check. The penalty, which will have to be at least '1' is the difficulty of the check. The higher the number, the greater the difficulty. The bonus, which will normally be zero, is something spell or item that gives the greater chance of sucess at this ability check ("break door") without affect the attribute that affects the particular check ("Str")

Example Galstaff, Sorcerer-of-Light, is trudging through a dungeon. He has a Perception (Prc) of 12 and is about to walk near a trap. Galstaff has no special equipment to catch traps. The trap is well hidden, so the penalty is 10. Galstaff's check to spot the trap is calculated like this:


Galstaff then has a 16.7 percent chance of spotting the trap. *Roll 2d10* Galstaff fails the check, springs the trap, and half a dozen scorpions fall comically on Galstaff, Sorcerer-of-Light's head.

The next Galstaff returns to the dungeon after learning a new spell called "foresight." Foresight gives Galstaff a +3 bonus to detect traps and stealth. Galstaff agains nears an undetected trap. This time his ability check looks like this.



Galstaff now has a 41.7 percent chance to detect the trap. *roll dice* Galstaff fails to detect the trap. He slips into pit trap, hurts his foot, and curses his crappy, public-school, magical education.


This is fairly simple check. This is a great way for an ability check is a character versus environment check. But in order to cover character versus character interaction, more things are needed. If defending player is attempting to resist or counter the ability of an opposing character, the difference between those two characters' level should be taken into account. Hence this formula:



Now obviously, when you calculate level-of-defender minus level-of-attacker you can get a negative number. The result then would be just further penalty.

Example He-man, a level 10 warrior, has Will Power of (Will) of 13. Skeletor, a level 8 Warlock, is attempting to cast "fear" on He-man. Skeletor is a half-wit wizard, so the penalty is only 5. The calculation is done this way:


He-man has a 76% chance of success. *roll dice* he does. Skeltor casts Fear on Cringer to feel better about himself.


A second character vs. character comparison is a comparison of the attributes of each character. The defending character is always the one who will make the check, but the following formula takes the difference between the defenders attribute and the attacker's attribute:


ExampleCheney, the hunter, has a Perception of 14 and is checking to catch a stealthed Rogue with a Dexterity of 17. (Since a rogue's stealth is depended on dexterity, that is that attribute compared) The penalty is 8. The forumla then looks like this:


Cheney has a 21.4 percent chance to notice the Rouge. *roll dice* fail. Cheney shoots a deer instead.


That then, is my introduction to Ability checks.

Concerns? Questions? Please, anyone who is confused, please let me know.

6 comments:

  1. To get some terminology out of the way, I would call the result of your calculation "Event Damage" and the randomly generated number, "Event strength"
    That said, for your second trap example, I think it would be easier to modify the characters attributes. This makes less sense in your example (when spells are used,) but more sense for equippable items (for example if you had a character, say a tinker with poor eyesight and he therefore had very low perception, You could have an equippable item such as glasses, which then raises his Perception)

    Example:

    definefunction castforesight()
    {
    PRC = PRC +3
    }

    definefunction uncastforesight()
    {
    PRC = PRC -3
    }

    castforesight()

    if ((a - p) < RND)
    Then
    ...
    else if if ((a - p) == RND)
    ...
    Else
    ...

    I would argue for this because, more often then not, I think event damage would normally be modified by items, not spells. I should think that more often than not, the spell would be the event itself, not an even modifier.

    uncastforesight() //Would this be needed? I was unclear on how long foresight would work. One event? forever?


    For your example of He-Man Vs. Skeletor, is the penalty 5 because He-Man only has an intelligence of 5? I would also think that This would apply to Cheny Vs. the Rogue, but I would use the formula from He-Man Vs. Skeletor:

    (Ability(Cheny Perception, 14) - Difficulty(Rogue Dexterity, 17) + (Cheny Level - Rogue Level)) / a

    Lastly, why are we necessarially dividing by the character's ability. Why not Ability + level (experience?)

    ReplyDelete
  2. James, thank you again for posting. Believe it or not, I think I understand most of the little code you wrote there. Maybe you can clarify if((a-p)==ran)? I don't know what the double "=" means.

    First, it may be entirely possible that spells and equipment will never make sense to affect anything but character attributes (fab five). However, I wanted to make sure that the bonus to a specific check ("spot trap") that does not affect the used relevant attribute ("per") could happen in theory. This is because many other character stats will depend on the attributes. It would be great to have a ring that helps you resist sleep spells (a check on Will Power) without otherwise give you rapid mana regeneration and spell damage (which also would depend on will power).

    How long "foresight" lasts is no needed for this example. Though I'm happy to see you already are thinking of how this might be programmed. :-)

    The integer for "penalty" in both the He-man vs Skeletor and Cheney vs the Rogue were arbitrarily chosen for the sake of example. The need for a separate variable -rather than just a comparison of attacker's level/attribute vs defender's level/attribute is the need to have some control over how often a check will fail. Obviously, someone playing mage would be really upset if their fear spell never worked unless they put developed will power at the expense of everything else.

    The denomintor is the character attribute only (Str, Prc, etc) for a couple of reasons:
    1. If we added level to the denominator that chance of success would get lower with higher levels. If I subtracted levels, there could be a chance of "divide by zero."
    2. There needs to be some constant which everything else is "balanced" around. Hence, why all variables, comparisons, and such are done in the numerator.
    3. Higher level characters will have higher attributes. So the variable in "level" is already accounted for. In what the variable "a" will be.

    ReplyDelete
  3. sorry, I just looked back at that example and it was really ugly. Here would be a better example:

    definefunction castforesight()
    {
    PRC = PRC +3
    }

    definefunction uncastforesight()
    {
    PRC = PRC -3
    }

    castforesight()

    if (((a - p)/a) < RND)
    Then
    ...
    else if if (((a - p)/a) == RND)
    ...
    Else
    ...

    Where RND is a random number between 1 and 100

    Once this makes more sense, then the penalty is not needed in your examples to "have some control over how often a check will fail" is no longer needed because you just compare the percentage to the randomly generated number.

    And for the record "==" is different than "=" in some programming languages because "==" means "equivelent to" (a comparison operator) while "=" is an assignment operator. Thus a=b would always be true because we successfully assigned the value of b to variable a. Sorry a bit confusing, but a habit I have picked up.

    As for
    1) This makes sense to either go for one or the other to prevent divide by zero
    3) Why have levels at all then, why not just adjust attributes in order to increase level?

    ReplyDelete
  4. James,
    Thank you for explain "=" and "==".

    I'm confused as to the a penalty (p) is not needed in your examples as a penalty is already there.

    Comparing the formula to RND(1-100) makes complete sense. (Though it would have to be 100 * [(a-p)/a] compared to RND(1-100)) That is where the "roll" comes in. Did I miscommunicate? Did you think that the penalty was a random variable? Without a penalty (a-p)/a is just a/a and "==" 1 ;-)

    Levels are still needed because base hit/mana points will depend on level, they serve to unlock character spells/abilities and give the players a sense of accomplishment.

    ReplyDelete
  5. Makes sense with the levels. I don't think that p is unneeded per se, what I meant is that the p is not needed to influence the failure or success in example 4. In example 3 and 4 the penalty appeared to be random. In examples 1 and 2, the penalty simply represents the difficulty of the environment (Eg, the trap is a complex or well hidden trap). I would suggest however that in examples 3 and 4 p should simply be the ability of the attacher (in example 4, p=y), This would mean that example 4 could just become (a-y)/a. Even then though, I can see few examples where example 4 would be used instead of 3. I should think that you would always want to factor in the level of the characters...

    ReplyDelete
  6. Okay! Now everything is clear.

    When working with stealth or casting fear or similar. Characters with the equivalent level, and equivalent attributes, the chance of success, I feel, needs to be fairly low.

    Can you imagine trying to play a game in which you cast a spell on an opponent it had a 90% chance of failure? hahaha

    You're right at "p" could very simply be the ability of the attacking character in some examples, but I will have to think on that some more.

    I'll open another post on this subject soon.

    ReplyDelete