Closed dille12 closed 2 years ago
I saw you pushed a temp fix. Will take a look. Had started to add some debug features to start isolating this issue.
The issue happens because over longer distances there are factorially more routes, and in certain starting conditions it couldn't find a route in time, so I just randomized the order of routes and made sure that it finds at least one route. The solution would be to add some algorithmic stuff to filter out some of the routes.
If you enable dev tools from settings and press middle mouse in game 4 times you can test out the navigation system
nice - I have yet to investigate what that 'dev tools' option enables :D
If this is sufficiently resolved for now [no longer game breaking] - I'll likely move on to something else.
Yeah I think it's enough
The function does not work properly, since it finds infinite routes for some reason, so I just break the loop after certain amount of time. Usually it finds some route, but in certain spots (in Manufactory in top right corner) the zombies don't find any route so they try to calculate a new route every tick, grinding the game in to halt.
`def calc_route(start_pos, end_pos, NAV_MESH, walls): """ Calculates the shortest route to a point using the navmesh points """