Monday, January 21, 2019

Ragnarok Online use number of Squares to count distance

This is something very weird with Ragnarok Online
the distance check in straight line and diagonally are the same value

both return 5 !!
even though the 2nd one should return 7

and this causes some problem when we try to count the time needed to move from point A to B

Here is a script that you can test

let's say input 5, go to the right takes 827 mili-seconds in-game
go to the down-right actually takes 1123 mili-seconds -> means longer

to actually make the travel time same for straight line and diagonal line
the straight line needs 7 cells distance to match the 5 cells distance diagonally - 1123 mili-seconds
same, straight line takes 14 cells distance to match 10 cells distance diagonally - 2168 mili-seconds

There IS a circular check in the source code where you can enable it
however, the circular check, I'm not so sure about its accuracy
that formula is taken from here


All 3 gave different answer. When test in-game however,
the straight line needs 11 cells distance to match 8 cells distance diagonally - 1747 mili-seconds
means the formula encode inside our emulator, it might calculate the distance wrong ??
well ... I think this is minor though, because I think nobody actually compile with CIRCULAR_AREA enabled


PS: Currently this feature cannot test on Hercules server because Hercules mob controller is still broken


See also :

Previous -> The meaning behind the value of movement speed
Mathematics - Phythagorean Theorem
next article -> Units move diagonally then move in straight line

No comments:

Post a Comment

Linux compiler error that never shown on Visual Studio

let's just admit Visual Studio sux ... ok ? right now, if you want to host a Private Ragnarok Online server, its just better to choose...