Topic: question about diagonal distance  (Read 4544 times)


Ezhe

« on: December 31, 2022, 05:37:12 AM »
is diagonal distance of a tile 1.4 times of the horizonal/vertical distance or same with it? So, will going diagonal direction take more time than going horizonal/vertical direction each turn?

ineedcords

« Reply #1 on: December 31, 2022, 05:54:46 AM »
is diagonal distance of a tile 1.4 times of the horizonal/vertical distance or same with it? So, will going diagonal direction take more time than going horizonal/vertical direction each turn?
Conceptually, each move is 1 "effort", so rather than going 1 tile north and then 1 tile east, it is better to go 1 tile northeast directly.

Edit: I forgot to mention that, the terrain does matter. For example, if you have rock tile(s) in front of you, going around might be quicker/less tiring and possibly even safer, as climb action involves a risk.


Not something you asked here, but since you seem to have an efficiency interest, I will mention this one too, just as a FYI. When facing a direction, and wishing to face the opposite direction (i.e.: needing a 180-degree turn), you can do that via 4x 45-degree turns, 2x 90-degree turns, or 1x 180-degree turn.
These 45-, 90-, and 180-degree turn actions all have separate key bindings via left and right.
To see these, and many other key bindings, in game, press ? key to bring up the built-in help screen and checkout the MOVEMENT section at the very top.
« Last Edit: December 31, 2022, 06:03:17 AM by ineedcords »
This could be a good day to utilize your squirrels hides.

Tinker

« Reply #2 on: December 31, 2022, 10:30:57 AM »
There is a post https://www.unrealworld.fi/forums/index.php?topic=6353.msg18430#msg18430 by Erkka that seems to explain the diagonal distance thing, which is different when moving or using a weapon.

ineedcords

« Reply #3 on: January 01, 2023, 12:16:36 AM »
There is a post https://www.unrealworld.fi/forums/index.php?topic=6353.msg18430#msg18430 by Erkka that seems to explain the diagonal distance thing, which is different when moving or using a weapon.
That is about the flight path of a missile though. I am not convinced that applies to the character movement.

Perhaps @Erkka can help further clarify?



Edit: actually, in that linked thread, reply number 8 and 9 do clarify that character movement indeed does not care about diagonals as in the code calculation is integer based, and as we know diagonal movement is sqrt(2) based which is 1.41421356237; that value when rounded becomes 1, thus any extra cost magically disappears.
« Last Edit: January 03, 2023, 07:25:31 AM by ineedcords »
This could be a good day to utilize your squirrels hides.

Ezhe

« Reply #4 on: January 03, 2023, 06:40:05 AM »
I see, thank you all!

 

anything