All typedefs for structs that were present in other header
files have been moved to here. (Except node_t because the
renderer and netcode both define node_t LOL.)
An alternative to the standard pathfind function. Instead of pathfinding to a specific waypoint, it always goes towards the finish line waypoint, but also won't stop when it reaches it. It only stops when it travels a far enough distance.
This is basically a cleaner, less hacky, and optimized version of the pathfinding I gave to the bots; instead of doing 1-2 full pathfinds to do this (depending on if they are near the finish line or not), it will instead always do a single small pathfind. I also need it for shrink laser behavior.
See notably the finish line. Basically respawning exactly on a line can let you
cross it twice, if you crossed it before respawning, or NOT cross it, depending
on which direction you drive after landing. So this just respawns very slightly
before the line so you can cross (or not cross) it normally.
Thing height refers to the index of FOF. FOF are sorted by top height, lowest
to highest. Set Object Flip to sort highest to lowest.
If the waypoint thing set Object Flip, it will be placed on the bottom of the
FOF. The sorting remains the same though.
Set Ambush to raise the waypoint to the same z position.
Mobjs get deleted and loaded from net save. The mobjs in the waypoints need to load into the correct waypoints again.
This doesn't save/load the entire waypoints, so they still cannot be edited/added/removed mid-game.
- Player direction value uses momentum angle rather than facing angle (fixes weird nextwaypoint/position flickering while drifting)
- Raise default radius to 384
Figure out the circuit length on map load
player->distancetofinish is now a total distance on circuit maps
some hacky alterations around circuit finish lines to correctly calculate distancetofinish
Network synchronised(?) nextwaypoint in player struct
Make the waypointheap actually a heap and not allocate memory for every individual waypoint.
No need to store id in the waypoint struct, since it can be gotten from the waypointheap now.
Includes some small refactoring of older functions - single return is a bit safer and easier to debug.
Still needs doing are: Finish Line Waypoint, Shortcut waypoints, disabled waypoints.
The actual A* method itself is a bit of a monster, but I can't figure out how to refactor it too much more.
Refactor some things to make slightly clearer code
Change comments to use completely tabs
Add extra error checks to methods for helpful debugging and safety
Use a heap of waypoints during creation to be able to search for them to make links, to not freeze the game
Add a way to clear waypoints so that the methods don't error after more than one map load
Flip the ambush flag so that adding it will make the waypoint unable to be respawned at when the feature happens
Temporarily disable K_UpdateKartPosition so that it doesn't crash on map load
Basically just copied what I planned out months ago and put it into code for now
Also changed waypointcap to be made from MT_WAYPOINTs and definitely broke position in this commit from that.