OBD:AKVA/0x24

From OniGalore
< OBD:AKVA
Revision as of 05:28, 24 January 2007 by 212.96.165.33 (talk) (my two cents)
Jump to navigation Jump to search
ONI BINARY DATA
AKOT << Other file types >> BINA
AKVA : BNV Node Array
switch to XML:AKVA page
Overview @ Oni Stuff
OBD.png

This is the pathfinding grid data, linked to from the BNV chunk of an AKVA.

The example below is the grid of BNV number 32 from level1_Final.

(chr_teleport 0 0 gets you there, and then you can use chr_show_bnv=1 and ai2_showgrids=1)

The example was chosen because it's a relatively small grid (45 bytes of data) and illustrates the format completely.

The pathfinding grid is aligned with the x and z axis. The size of the grid along x and z is specified in the DAT.

The grid data is stored in strips, each strip consisting of tiles of a certain type.

A strip can have any length between 1 and 255, and a width of 1.
A strip runs along z for fixed x, and can wrap around to the next x if it's longer than the grid.

Tile types are (appearance as visible with ai2_showgrids=1):

  • 0 : no cross, clear
  • 1 : light green cross, near wall
  • 2 : lightest blue cross, border 1
  • 3 : lighter blue cross, border 2
  • 4 : green cross, semipassable
  • 5 : blue cross, border 3
  • 6 : dark blue cross, border 4
  • 7 : dark green cross, stairs
  • 8 : orange cross, danger
  • 9 : red cross, impassable

Taken from *.exe

Strips can be stored in two ways:

Short strips (1 to 15 tiles)
are stored as one byte
XY (hexadecimal, with X > 0 )
stands for a strip of X tiles of type Y
Long strips (1 to 255 tiles)
are stored as two bytes
0YXX (hexadecimal, with XX > 0 )
stands for a strip of XX tiles of type Y

The leading zero tells you if you're looking at a long or short strip.

I'm not sure if short strips can wrap around grid borders or not.

Example (BNV 32 from level1_Final)
(offsets relative) (make them absolute if you like)
0x00:  00 FF 00 FF 00 E1 E1 70 E1 E4 11 50 11 E4 E9 14  °NONSENSE°ASCII°
0x10:  11 30 11 14 09 11 48 79 14 11 30 11 14 79 48 39  °°°°°°°°°°°°°°°°
0x20:  24 19 48 19 64 11 50 11 64 19 48 19 24 °° °° °°  °°°°°°°°°°°°°°°°


Here's the grid this corresponds to
(the grid's size is 26x35 as specified in the DAT)
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
01
02
03
04 255 tiles of type 0
05
06
07
08
09
10
11 255 tiles of type 0
12
13
14
15
16
17
18 225 tiles of type 0
19
20
21
22 14 tiles of type 1 7 tiles of type 0 14 tiles of type 1
23 14 tiles of type 4 1 5 tiles of type 0 1 14 tiles of type 4
24 14 tiles of type 9 4 1 3 t. of type 0 1 4 17 tiles...
25 ...of type 9 4 t. of type 8 7 tiles of type 9 4 1 3 t. of type 0 1 4 7 tiles of type 9 4 t. of type 8 3 t. of type 9
26 4 9 4 t. of type 8 9 6 t. of type 4 1 5 t. of type 0 1 6 t. of type 4 9 4 t. of type 8 9 4