Files
2025-02-05 06:19:18 +00:00

7 lines
3.6 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>code/__HELPERS/path.dm - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="code/__HELPERS/path.html#define">Define Details</a></header><main><h1>code/__HELPERS/path.dm <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__HELPERS/path.dm0"><img src="git.png" width="16" height="16" title="code/__HELPERS/path.dm0"></a></h1><table class="summary" cellspacing="0"><tr><th>/proc/<a href="global.html#proc/get_path_to">get_path_to</a></th><td>This file contains the stuff you need for using JPS (Jump Point Search) pathing, an alternative to A* that skips
over large numbers of uninteresting tiles resulting in much quicker pathfinding solutions. Mind that diagonals
cost the same as cardinal moves currently, so paths may look a bit strange, but should still be optimal.</td></tr><tr><th><a href="code/__HELPERS/path.html#define/CAN_STEP">CAN_STEP</a></th><td>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.
Note that this can only be used inside the [datum/pathfind][pathfind datum] since it uses variables from said datum.
If you really want to optimize things, optimize this, cuz this gets called a lot.</td></tr><tr><th><a href="code/__HELPERS/path.html#define/STEP_NOT_HERE_BUT_THERE">STEP_NOT_HERE_BUT_THERE</a></th><td>Another helper macro for JPS, for telling when a node has forced neighbors that need expanding</td></tr><tr><th><a href="datum/jps_node.html">/datum/jps_node</a></th><td>The JPS Node datum represents a turf that we find interesting enough to add to the open list and possibly search for new tiles from</td></tr><tr><th>/proc/<a href="global.html#proc/HeapPathWeightCompare">HeapPathWeightCompare</a></th><td>TODO: Macro this to reduce proc overhead</td></tr><tr><th><a href="datum/pathfind.html">/datum/pathfind</a></th><td>The datum used to handle the JPS pathfinding, completely self-contained</td></tr></table><h2 id="define">Define Details</h2><h3 id="define/CAN_STEP"><aside class="declaration">#define </aside>CAN_STEP<aside>(cur_turf, next)</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__HELPERS/path.dm#L47"><img src="git.png" width="16" height="16" title="code/__HELPERS/path.dm 47"></a></h3><p>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.
Note that this can only be used inside the [datum/pathfind][pathfind datum] since it uses variables from said datum.
If you really want to optimize things, optimize this, cuz this gets called a lot.</p><h3 id="define/STEP_NOT_HERE_BUT_THERE"><aside class="declaration">#define </aside>STEP_NOT_HERE_BUT_THERE<aside>(cur_turf, dirA, dirB)</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__HELPERS/path.dm#L49"><img src="git.png" width="16" height="16" title="code/__HELPERS/path.dm 49"></a></h3><p>Another helper macro for JPS, for telling when a node has forced neighbors that need expanding</p></main><footer>tgstation.dme <a href="https://github.com/evilew/GS13-Citadel/tree/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e">e8e0068</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.9.0</a></footer></body></html>