mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-28 01:51:46 +00:00
## About The Pull Request [cleans up poor namespacing on light debugging tools](93cc9070d5) [Implements a pathfinding visualization tool](ed91f69ac4) It holds a set of inputs from the client, and uses them to generate and display paths from source/target. Left click sets the source, right click sets the target. Pathmap support too, if no target is set we display the paths from every turf in the map to the source, if one is set we build a path TO it from the source. I had to add COMSIG_MOB_CLICKON to observers to make this work (tho idk why it didn't exist already), I also removed the everpresent colorblind datum from admin datums, only needs to exist if they're using it. [Adds a mutable_appearance helper that dirlocks them, wallening port which I thought might be useful here, and will likely be useful elsewhere in future](87f752e7c3) [Fixes an infinite loop in pathmaps if we tried to pull a cached path to an unreachable target, && not || 4head](10086a655d) [Fixes JPS not dealing with border objects properly. They violate some of the assumptions JPS makes, so we need to backfill them with checks. These basically read as (if the thing that should normally take this path can't reach this turf, can we?)](f56cc4dd43) ## Why It's Good For The Game Maybe deals with #80619? Adds more robust testing tools for pathfinding, should allow people to better understand/debug these systems. I added this with the idea of adding multiz support but I don't have the time for that rn. JPS will work around thindows better, that's nice. https://file.house/IrBiR0bGxoKw1jJJoxgMRQ==.mp4 ## Changelog 🆑 fix: Fixed our pathfinding logic getting deeply confused by border objects admin: Added clientside displayed pathfinding debug tools, give em a go /🆑
27 lines
1.3 KiB
Plaintext
27 lines
1.3 KiB
Plaintext
// Define set that decides how an atom will be scanned for astar things
|
|
/// If set, we make the assumption that CanAStarPass() will NEVER return FALSE unless density is true
|
|
#define CANASTARPASS_DENSITY 0
|
|
/// If this is set, we bypass density checks and always call the proc
|
|
#define CANASTARPASS_ALWAYS_PROC 1
|
|
|
|
/**
|
|
* A helper macro to see if it's possible to step from the first turf into the second one, minding things like door access and directional windows.
|
|
* If you really want to optimize things, optimize this, cuz this gets called a lot.
|
|
* We do early next.density check despite it being already checked in LinkBlockedWithAccess for short-circuit performance
|
|
*/
|
|
#define CAN_STEP(cur_turf, next, simulated_only, pass_info, avoid) \
|
|
(next && !next.density && !(simulated_only && SSpathfinder.space_type_cache[next.type]) && (next != avoid) && !cur_turf.LinkBlockedWithAccess(next, pass_info))
|
|
|
|
#define DIAGONAL_DO_NOTHING NONE
|
|
#define DIAGONAL_REMOVE_ALL 1
|
|
#define DIAGONAL_REMOVE_CLUNKY 2
|
|
|
|
// Set of delays for path_map reuse
|
|
// The longer you go, the higher the risk of invalid paths
|
|
#define MAP_REUSE_INSTANT (0)
|
|
#define MAP_REUSE_SNAPPY (0.5 SECONDS)
|
|
#define MAP_REUSE_FAST (2 SECONDS)
|
|
#define MAP_REUSE_SLOW (20 SECONDS)
|
|
// Longest delay, so any maps older then this will be discarded from the subsystem cache
|
|
#define MAP_REUSE_SLOWEST (60 SECONDS)
|