I'm trying to build my first game, a really simple RTS like Age of Empires but I have a question about pathfinding.
When do this kind of games usually do pathfinding?
I've read some games do a global pathfinding once at game start but I'm not sure if that will fit this kind of games.
Do they usually calculate pathfinding each time a game entity starts a new task and has to move?
How do they handle when a obstacle suddenly appears on the path? Do they re-calculate pathfinding on every step? Or do they check if the current path is clear on every step? Or they just walk the current path until they actually hit the unexpected obstacle?
Actually if you know a link to a source code of pathfinding on some RTS game I would really appreciate it.
Thanks in advance