Pathfinding routing structure and tile layout. More...
#include <typedefs.h>
Data Fields | |
byte | stepup [PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH][CORE_DIRECTIONS] |
byte | route [PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH][CORE_DIRECTIONS] |
signed char | floor [PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH] |
byte | ceil [PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH] |
Pathfinding routing structure and tile layout.
ROUTE Information stored in "route"
connections (see Grid_MoveCheck) mask description 0x10 0001 0000 connection to +x (height ignored?) 0x20 0010 0000 connection to -x (height ignored?) 0x40 0100 0000 connection to +y (height ignored?) 0x80 1000 0000 connection to -y (height ignored?)
See "h = map->route[z][y][x] & 0x0F;" and "if (map->route[az][ay][ax] & 0x0F) > h)" in CM_UpdateConnection 0x0F 0000 1111 some height info?
FALL Information about how much you'll fall down from x,y position? I THINK as long as a bit is set you will fall down ... See "while (map->fall[ny][nx] & (1 << z)) z--;" in Grid_MoveMark
STEP
0000 0000 Access with "step[y][x] & (1 << z)" Guess: Each bit if set to 0 if a unit can step on it (e.g. ground or chair) or it's 1 if there is a wall or similar (i.e. it's blocked). GERD THINKS it shows stairs and step-on stuff Search for "sh = (map->step[y][x] & (1 << z)) ? sh_big : sh_low;" and similar. "sh" seems to mean "step height"
AREA The needed TUs to walk to a given position. (See Grid_MoveLength)
AREASTORED The stored mask (the cached move) of the routing data. (See Grid_MoveLength)
TILE LAYOUT AND PATHING Maps are comprised of tiles. Each tile has a number of levels corresponding to entities in game. All static entities in the tile are located in levels 0-255, with the main world located in 0. Levels 256-258 are reserved, see LEVEL_* constants in src/shared/shared.h. Non-static entities (ET_BREAKABLE and ET_ROTATING, ET_DOOR, etc.) are contained in levels 259 and above. These entities' models are named *##, beginning from 1, and each corresponds to level LEVEL_MAX - 1 + ##.
The code that handles the pathing has separate checks for the static and non-static levels in a tile. The static levels have their bounds precalculated by CM_MakeTracingNodes and stored in tile->theads. The other levels are checked in the fly when Grid_CheckUnit is called.
Definition at line 185 of file typedefs.h.
byte routing_s::ceil[PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH] |
Definition at line 189 of file typedefs.h.
Referenced by CMod_LoadRouting().
signed char routing_s::floor[PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH] |
Definition at line 188 of file typedefs.h.
Referenced by CMod_LoadRouting().
byte routing_s::route[PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH][CORE_DIRECTIONS] |
Definition at line 187 of file typedefs.h.
Referenced by CMod_LoadRouting().
byte routing_s::stepup[PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH][CORE_DIRECTIONS] |
Definition at line 186 of file typedefs.h.
Referenced by CMod_LoadRouting().