Once something was working for basic path drawing, issues came up due to how slow it can be to make a path across the map, and the fact that new path requests are added to a queue every fifth of a second or so. Luckily, some solid optimization and the a workaround that could let requests "decay" in the queue made the problem significantly more manageable.
Once this basic path drawing worked for drawing anywhere on the map, a bizarre issue would pop up where the entire pathfinding system would freeze up. Some research led the team to believe that the problem might not be on our end, but an issue with the library (since it is fairly new and untested, and similar issues were mentioned on the forums).
After extensive debugging and attempts to fix it (it wasn't even easy to reliably recreate the problem), the executive decision was made to incorporate another pathfinding system we had used in a previous project, which we already knew had its own set of problems. Given that this system is significantly more robust and popular, I was confident that any third-party issues would be fixed faster with this library then the other. Work was done to keep the game unchanged since a unified API for pathfinding was made, so the changed were largely restricted to a few code files. Both systems were left in for testing, and it is trivial to switch between the two moving forward, so right now the only cost we are paying is additional resource consumption by running two fairly taxing systems at once, but it's simpler then having to port over between the two should something go wrong again.
The gist of it is that only basic path drawing was implemented instead of having some of the nice features like detours and notifications about invalid paths, but it's not been implemented in two separate systems and the framework is in place for improving and iterating easily.
Accomplishments
- Demystifying Apex Pathfinding's utter lack of documentation on anything but the simplest use case (3 hours)
- Hacked together Apex implementation (6 hours)
- Apex optimization (3 hours)
- Debugging Apex to find the root cause of the freezing (3 hours)
- Hacked together Arongranberg Pathfinding implementaton (7 hours)
- Assorted art direction work (1 hour)
Next Steps
- More pathfinding and pathdrawing stuff
Ryan Daugherty
No comments:
Post a Comment