… | |
… | |
193 | @enum MAX_CACHE. If you want to optimize "down deep" this is the way |
193 | @enum MAX_CACHE. If you want to optimize "down deep" this is the way |
194 | to go. MAX_CACHE determines the number of adjacent nodes cached by |
194 | to go. MAX_CACHE determines the number of adjacent nodes cached by |
195 | MicroPather. If your nodes generally have 8 or 3 neighbors (common cases) |
195 | MicroPather. If your nodes generally have 8 or 3 neighbors (common cases) |
196 | changing this may increase performance, sometimes dramatically. |
196 | changing this may increase performance, sometimes dramatically. |
197 | */ |
197 | */ |
198 | MAX_CACHE = 4 |
198 | MAX_CACHE = 8 |
199 | }; |
199 | }; |
200 | // If there are 4 or less adjacent states, they will be cached as *nodes*. |
200 | // If there are 4 or less adjacent states, they will be cached as *nodes*. |
201 | NodeCost adjacent[ MAX_CACHE ]; |
201 | NodeCost adjacent[ MAX_CACHE ]; |
202 | int numAdjacent; // -1 is unknown & needs to be queried |
202 | int numAdjacent; // -1 is unknown & needs to be queried |
203 | // 0-4 adjacent is known & in 'adjacent' |
203 | // 0-4 adjacent is known & in 'adjacent' |