Hi!
I am trying to precisely predict how long it will take for a character to walk from a point a to a point b on a straight/diagonal line. I found the `character_running_speed` property of the character which is equal to `0.15`. This leads me to believe that the character will move exactly `0.15` tiles per tick.
I am setting the character's moving state every tick and printing its position and from my testing it seems like the character is actually moving exactly `0.1484375` tiles per tick instead when moving along a straight line. Are there any other modifiers that I should account for?
character_running_speed inaccuracy
Re: character_running_speed inaccuracy
Many positions are in multiples of 1/256, and the closest multiple of that to 0.15 is the number you have found, which is 38/256.
I'm not sure how this will affect diagonal speed, but if it's preserving speed then you would travel 27/256 of a tile in each axis.
I'm not sure how this will affect diagonal speed, but if it's preserving speed then you would travel 27/256 of a tile in each axis.
Re: character_running_speed inaccuracy
The game only stores positions as 1/256 of a tile,
So then it moves the 0.15, it rounds to the nearest valid position
0.15 = 38.4 / 256
0.1484375 = 38 / 256
So then it moves the 0.15, it rounds to the nearest valid position
0.15 = 38.4 / 256
0.1484375 = 38 / 256
Re: character_running_speed inaccuracy
Ok that makes sense. Thanks!
Re: character_running_speed inaccuracy
What if the speed is less than 1/256 tiles per tick? No movement at all or the movement will be accordingly accumulated?
Re: character_running_speed inaccuracy
There is no accumulation, all rounding errors are discarded.