Live Progress #33 – On Recast navigation

Unit navigation is one of the core systems of the game which effect almost everything: terrain, passability, unit interaction, fighting, city planning, houses, gui, resource mining, and other things.

Since the dawn of ages we used so-called Tiled navigation. Terrain was made of square tiles (game engine treated them like squares irregardless of displayed shape) and each unit took exactly one tile at a time. Unit movement consisted of series of moves from one tile to another. Units could interact only when they were on a tile. Anything inbetween tiles could not happen (with just a few rare exceptions). Overall that resulted in clunky and unresponsive unit movement.

New Recast navigation is a step forward. It allows units to move around the terrain freely. Units walk and interact each tick. Changing direction and response to orders is almost immediate now.

Naturally the quest to rip it out and plant a totally new system in its place is huge. It took me several weeks to find a good starting direction to get to it.

This weekend I’ve been working on splitting the unit navigation code into two distinct branches. Legacy branch (Tiled navigation) and Recast branch (new free movement). Idea is to refactor the code to allow these two branches to co-exist. There are several benefits to that divide-and-conquer approach. That allows to rethink the code design to try to keep navigation code more compact and out of the systems that should not rely on its implementation details.

With that plan in works, NG is going closer to public announcement 🙂

This entry was posted in Live progress. Bookmark the permalink.

2 Responses to Live Progress #33 – On Recast navigation

  1. The Dark Lord says:

    I think it’s a good choice to leave the ’tile system’ for units. 🙂

    • Krom says:

      I’m thinking of keeping tiled system for town planning (houses and roads).
      Unit movement and interaction is better with free movement. It’s more natural and more fluid that way. More efficient as well.

      Maybe you can write a list of pros and cons of tiled vs. free unit movement, a sort of analysis? I’m interested to see the arguments 🙂

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.