Implementing Custom Pathfinding: Bugs and Crashes
Hello there, for my project, I wanted to implement a custom Pathfinding that works without a nav mesh. The idea was, that I was making a solar system with space ships navigating in 3D. It is an RTS, the idea was to implement an algorithm, that draws a direct path from A to B and using avoidance in his close proximity for anything on it's way (maybe even through detour, haven't tested it yet). I thought this might be a good idea, as nearly anything will be somehow moving (even the planets), therefore I won't have static obstacles, and the ships can directly fly around everything (they can't get stuck in holes or similar). I have some coding experiene, but not much and am fairly new to c++.
Now to my actual problem: I was already able to implement my own pathfinding system through extending the ANavigationData class. I was basically following this tutorial, with the exeption of extending ANavigationData instead of ARecastNavMesh (as I don't want nav mesh, as explained). Have a look at the link under "Hooking Our RecastNavMesh Into The Engine" if you want to see how I hooked it up with my project. So far, my code works and I have no compiler errors, the path is simply one between the pawn position and a goal position. But I have to fight with some odd behaviour.
My conclusion: When adding the nav mesh bounds, somehow an (invisible?) NavigationData instance is generated. When adding the nav mesh bounds, one is generated for recast nav mesh, which doesn't match my pathfinding. In the tutorial it works of cause, as the A* pathfinding is derived from the recast nav mesh. When I therefore want to run my pathfinding, I have to add something, probably the NavigationData instance the visual logger is missing in case 2. But how? And where?
In general, this whole thing is a big pain in the ass, as there are a lot of classes, like Navigation System oder NavigationData, that are nowhere explained, not even the code has a comment at the start of each headerfile to explain what the classes' purpose is. This is a bit tiring.. the documentation is basicly just a collection of all functions, doesn't tell more then the code already does.
Thanks if you read so far, I hope someone knows the navigation system better then me and knows what I am missing.
Ok, here is the solution, in case anyone comes across this very same issue:
Important note: check the code yourself, I am currently getting crashes sometimes when using the visual logger, but the code compiles without errors.
Basicly, I am creating and the level begin my custom navigation data as an instance.
Follow this question
Once you sign in you will be able to subscribe for any updates here