1. Use a virtual grid (-> equidistant path nodes in grid style)
2. Calcualte a path on the empty route
3. Whenever a tower is placed, check if it intersects with the current path for the mobs. If so, recalculate it for the distance that the tower "cut".
4. you might apply a smoothing algorithm afterwards to make sure they don't run straight up to the tower and "move around it" if they could have approached it with a slightly different path before
As the path can only change when a tower is placed, this is a very simple, yet cpu time saving way ...
2. Calcualte a path on the empty route
3. Whenever a tower is placed, check if it intersects with the current path for the mobs. If so, recalculate it for the distance that the tower "cut".
4. you might apply a smoothing algorithm afterwards to make sure they don't run straight up to the tower and "move around it" if they could have approached it with a slightly different path before
As the path can only change when a tower is placed, this is a very simple, yet cpu time saving way ...