Optimal settings: Dynamic navmesh generation on a simple road

I’ve got a straight road, which is mainly empty. I want to spawn traffic on this road and for the space occupied by each car to be area class: null, so that pathfinding AI cannot travel in spaces occupied by a car.

I’ve modified the collision of my traffic (using the method shown here: https://youtu.be/7LaazCv4rB0?t=680) and I’ve reduced the tile size and increased the cell size.

I’m finding that only the area around my player is being updated, and the area is very small so AIs around me often do not reach an updated section of the navmesh and so trespass into the traffic.

What I’m after is a really simplified dynamic navmesh generation. There’s some conditions that might simplify the matter:

  • Traffic is always the same size.
  • The player only travels forwards (some steering is allowed but it’s confined to a narrow road).
  • Once the player has passed a section of navmesh, it is no longer important.

Are there any methods I could use to affect only the area around my Player and generate very quicly?

Might just be my PC but nav generation always takes a few seconds to update so if everything is moving I don’t think it’d ever be current.

What are the AIs supposed to be doing and how do they move? If they are cars too then maybe write a custom tile-based path finding system.

Another idea is you could use a static navmesh, and use line traces out the front of your AI to test whether they’re about to hit a car, and tell them to move sideways before resuming their movement. Really depends on the exact result you’re trying to achieve.