Notes 

(0002946)

matex

160815 21:28


The old formula was like:
TICK_PER_SEC is 10.
iTickNext = TICK_PER_SEC + Calc_GetRandVal( (100iDex) / CONST ) * TICK_PER_SEC / 10;
This was then scaled like iTickNext = (iTickNext * MOVERATE)/100
The new formula is:
iTickNext = TICK_PER_SEC + Calc_GetRandVal( (100(iDex * MOVERATE) / 100) / CONST ) * TICK_PER_SEC / 10;
I need more feedback on how this is a problem for you.
You cant just scale between 0  100% of the Dex Value. You can scale to 150% too. Naturally there is a limit where the npc wont become faster if you hit 0 Ticks between steps.
Before you were scaling the result of the above formula, and now the Input value (Dex) is scaled. How's that a problem in your case? 


(0002947)

nolok

160815 22:30


The main problems that make this formula uncomfortable are 2:
1) Every monster has different dex from the others (not the same mob, but the others, like between ogre and zombie). So, as example, in order to obtain the same movement speed for these two monsters i need very different values of MOVERATE. A MOVERATE value does not mean a precise speed or a speed "range" of values, so i need to do multiple tests with different values for every single npc to get the speed i want for each of them. That is boring and long to do, while having a 0100% variable (like the new "formula" i suggested) or a formula not so relieving on dex (like the old one) would be simpler and faster, and that become significant with lots of npcs to check and adjust.
2) I may want to have npcs with very high dex (800+) or very low dex (like < 50). In these cases, high variations in MOVERATE results in very tiny variations of the speed, and i can't have a monster lightning fast with 50 dex, or the opposite.
Other related issue, even if i don't think it's caused by the formula: an npc with MT_WALK but not MT_RUN, 800 dex and 130 MOVERATE will still do short pauses between two consecutive steps. Isn't it supposed to walk without pauses, at full "walk speed" (like a player walking)? 


(0002956)

nolok

010915 09:57




(0003003)

nolok

291215 14:19


Apparently, the problem isn't about the formula itself, but inside SetTimeout (called in CChar::NPC_WalkToPoint, from CCharNPCAct.cpp) or in OnTick stuff. Bypassing the formula by using SetTimeout(1), which should be the minimum value, makes the NPC run at somewhat like 95100% the speed of a player running without horse. In the past, a SetTimeout(1), so max speed, made the char move a lot faster (even 4 tiles per tick? i can't remember), so the solution would be to have again a higher tiles per tick cap. 
