STR/DEX Gains

General assistance and guidelines for editing the server side of Soma.

STR/DEX Gains

Postby Viscis » Thu Dec 21, 2017 11:57 am

I could not find this information anywhere so I did a little research myself!

Some terms used in this research;
1. str_inc - The amount STR is incremented by per tick.
2. dex_inc - The amount DEX is incremented by per tick.
3. tick - The formula used to calculate when to gain str_inc/dex_inc

--------------------------------

1. STR/DEX ticks happen at the same time. This means the value in str_inc and dex_inc is added to the total str and dex of the player at the same time. For str (default) this is 90,000 and dex (default) 180,000 (sword 90% of inc value for both)

This is evidenced by the first str gain (to be shown in-game) taking two cycles of str_inc. The first cycle gains you 90,000 str, the second gains you another 90,000 totalling 180,000 - enough to trigger the (0.1 gained message). 0.1 in soma world is 100,000 in the database (STR only). DEX is larger by a factor of 10, you need 6 dex_inc gains to reach the 0.1 gained message. (6 * 180, 1080000 dex_inc). In soma world 0.1 DEX is 1,000,000 in the database.

For anyone curious as to why this is, floating point operations (i.e. 10.1123542 + 0.00001 are more complicated that simple addition. Therefore if you times the numbers by 1000000 you can do simple maths and simply divide the number before displaying it to the user.

2. STR/DEX ticks happen each 1000 experience gained (at early levels). In memory there is an unknown counter which ticks up from <unknown value> to <unknown value>. This counter resets to zero at exactly 1000 exp gained, else the experience is carried over.

At early levels is possible to gain 1000 experience exactly and see the counter reset. STR/DEX are always gained when the counter resets.

3. STR/DEX gains are based on experience gained, which itself is based on damage. The formula for experience is already documented as, which is proven to be correct.

(Damage / NPC_MAX_HP) * NPC_MAX_EXP * 100

4. I have found no correlation or evidence so far to support the theory that sStr and sWStr (from monsters table) or any of the other stats plays a role in STR/DEX gains.

5. Experience rolls over each tick (if possible). If you gain for example 1043 experience for a str_inc tick, the remaining 43 experience is carried over to the next tick. Starting the hidden value from non-zero. I believe this means all xp is cumulative - potentially meaning if you hit a monster for >2000exp you would gain multiple str_incs.

6. As experience is hit based, misses do not count towards changing this number. Or gaining stats.

Below:
1. Damage = damage hit (as seen ingame with GM)
2. Experience = experienced gained for the hit (proves the above 3. calculation if you use tyt bric stats)
3. Culm EXP = experienced gained over cycles
4. mystery number = odd ticker in memory that resets when you gain str_inc and dex_inc
5. gain = calculated offset between the ticker number. The number is effected by exp gained and is diminishing the close it gets to 1000 experienced.

Damage Experience Culm Exp (This level) Mystery Number Gain
10 222 222 1070363079
9 200 422 1071318448 955369
8 177 599 1071854387 535939
9 200 799 1072273817 419430
9 200 999 0
45 999 rounding error?

9 200 200 1070176665 70176665
9 200 400 1071225241 1048576
9 200 600 1071854387 629146
9 200 800 1072273817 419430
9 200 1000 0
45 1000

9 200 200 1070176665 70176665
9 200 400 1071225241 1048576
9 200 600 1071854387 629146
9 200 800 1072273817 419430
9 200 1000 0
45 1000

10 222 222 1070363079 70363079
8 177 399 1071225241 862162
9 200 599 1071854387 629146
10 222 821 1072320420 466033
10 222 1000 1067893100
47 1043

9 200 243 1070549492
10 222 465 1071504861 955369
8 177 642 1071947593 442732
9 200 842 1072367024 419431
10 222 1000 1068568849
46 1021

9 200 264 1070666001
9 200 464 1071504861 838860
9 200 664 1071994197 489336
7 155 819 1072320420 326223
10 222 1000 1067893100
44 977

All of the above tests were done from a fresh character with +3 charisma and basic 10 all stats. A training sword/dagger was used and the "mystery number" recorded after each hit.

The number starts from 106xxxxxxx and ends at 107xxxxxxx. When you first load the game the number is zero (in 1p1 memory).

Theories (to be tested):

A) With a new character, attacking an enemy once - then restarting 1p1 and logging in fresh for each successful hit. The theory is that this magic "tick" number is in 1p1 memory ONLY and not stored in the database. Therefore if the server crashes or we force restart between each hit we will never reach the 1000exp counter to gain 1 str_inc and 1 dex_inc.
Viscis
 
Posts: 8
Joined: Wed Oct 22, 2008 5:26 pm

Return to Server Development

Who is online

Users browsing this forum: No registered users and 5 guests

cron