## Movement improvements

*December 15, 2017*

on the last movement post I mentioned some of the improvements that I would be making to the ship movements. Here is the demo video of some of these improvements. There are still some rough edges as can be seen (like ships passing through each other) which I will fix later. There are a few options about fixing colliding ships, I’m thinking of elevating the ship in the +Z axis so it will fly over the other ship. Another option would be to select a different route. Current the way of selecting the hex cells to reach the target is done like this:

the yellow line is a direct line between the source and target cells. In the
previous movement videos ship were taking this direct route. To rasterize the
this route, I select N+1 equally distanced points on the line. N is the hex
distance between the two points calculated as `Math.max( x1-x2,y1-y2,z1-z2)`

.
These points are the green dots on the yellow line. Each of these points will
fall into a cell on the grid and these are the cells that the ship will follow
to reach the target, as I highlight them in white. So here is the video of the
ship moving along the grid:

*Tags:
#hexarategy
#gamedev
*