I am designing a grid based game, well 2-d, flat ... the grid is primary for the astar path finding algorithm. So i got to the part where i'm thinking how the units are going to move. My initial thoughts were this "unit step size" .. every server game tick a unit will try to move its full step size, I think of it as being the speed of the unit, the higher the step size, the greater the speed of the unit.
Anyway as it panned out, i came into some problems, since i have a path which a unit must follow (a list of waypoints essentially) .. i figured i need to make sure that the unit always moves the full unit step size (unit.speed) in each game tick. Okay so the problem arises when the pathing changes direction .. Example: 4 up, 2 right ... when it turns right ... .
I would divide the (4 up *grid.size) by unit step size (unit.speed). Some occasions(mostly) unit step size does not fit into that distance wholly.. so there is left over( remainder ) ... same like 20 / 6 = 3 remainder 2. Question is .. what to do with this remainder? of course im trying to find solutions but now its made me doubt the entire idea of moving a unit to an absolute position ( with floating point precision ) , and i'm wondering if i should be moving units only to fixed rigid points of a grid?
I have played games like warcraft 3, i made a test map in there , got it to print my position and i noticed that it seems to be using absolute positioning, if so, how has it done it ? .. i liked the idea of absolute positioning becaues i felt it would allow more control for the user .. but then realised that a very small/granular grid would be almost the same and un-noticable for the player.
help is much appreciated.! i've been searching for some guys talking of similar thing on internet for hours without any success. chhers!