Page 1 of 1

Raising skills beyond 100%

Posted: Sat Apr 01, 2023 2:35 am
by Highfather
Is there a way to have player skills continue to rise beyond 100.0? A way to lift the skill cap for each skill or even just some skills? I'm trying to create a couple of supervillains and I want their skills to continue to grow to ridiculous levels.

Re: Raising skills beyond 100%

Posted: Wed Apr 05, 2023 9:31 pm
by Xuri
The answer to that question right now is "yes and no". 😅

Whether you can gain skillpoints from successful use (or failure) of a skill basically boils down to two things in UOX3:
  • The SKILLPOINT entries in dfndata/skills/skills.dfn
  • The skill check
By extending the list of SKILLPOINT entries for a given skill in skills.dfn, you could extend the max cap for how many skillpoints a player could reach in that skill. For example, here's a modified setup for the hiding skill, which only cap the player after reaching 125.0 skillpoints in hiding, but with diminishing chance of gaining skillpoints on successful use the higher the skill goes:
// Hiding
[SKILL 21]
{
NAME=HIDING
STR=0
DEX=80
INT=20
SKILLPOINT=0,75,50
SKILLPOINT=100,60,30
SKILLPOINT=200,45,25
SKILLPOINT=300,40,20
SKILLPOINT=400,35,15
SKILLPOINT=500,30,5
SKILLPOINT=600,25,5
SKILLPOINT=700,20,0
SKILLPOINT=800,15,0
SKILLPOINT=900,10,0
SKILLPOINT=990,5,0
SKILLPOINT=1000,4,0
SKILLPOINT=1050,3,0
SKILLPOINT=1100,2,0
SKILLPOINT=1150,1,0
SKILLPOINT=1200,0,0
SKILLDELAY=10
}
The second part of this, which allows the player to actually reach that new skillpoint cap, is the skill check. If you open js/skill/hiding.js, and look for "CheckSkill", you'll see the following, which by default restricts the player from gaining any more skillpoints after reaching 100.0 (aka 1000) skillpoints:
else if( !pUser.CheckSkill( 21, 0, 1000 ) )
If you change that line to the following instead, players can continue to gain skill in Hiding until reaching 125.0:
else if( !pUser.CheckSkill( 21, 0, 1250 ) )
So for fully scripted skills like Hiding, this is relatively easy. However, for skills that are still hard coded in UOX3's source - like Stealing, combat skills, Magery, Magic Resistance, Mining, et. - this requires changing the source and recompiling UOX3.

There's also currently a max harcoded cap for how high ANY skill can get, which is limited by the type of integer used to store the player's skills. This cap is in theory 65535, aka 655.35 skillpoints. Beyond that, the integer type for skills would have to be changed to allow higher values. Hower, in practice, there are a couple of cases in UOX3's code where it looks at the skill using a different integer type that only allows values up to 32767 (aka 327.67 skillpoints), so maybe that's the effective cap? 🤔

Update: It should also be noted that increasing the max skill value used in a skillcheck also makes it harder to succeed at using the skill in general. For instance, if you do a skill check for a player's Hiding skill using 0 as minimum value and 1000 as max value, the player's skill needs to be higher than a threshold generated using a random number from 0 to 1000 in order to successfully use the skill. So if the randomly generated number for a given attempt at using the skill is "735", the player would need 73.5 or higher Hiding skill to be successful in their attempt.

However, by increasing the max value in the skill check to 1250, the random number will now instead be generated from 0 to 1250, increasing the overall difficulty of player's skill being higher than the generated number.