OBD:AKVA/0x24: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (very hot stuff)
 
m (contrary to Windows' claims, these are not "DAT" files)
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{OBD_File_Header|align=center|type=AKVA|prev=AKOT|next=BINA|name=BNV Node Array|family=Level|onistuff=akva}}
;Overview
----
This is the pathfinding grid data, linked to from the BNV chunk of an [[OBD:AKVA|AKVA]].


The example below is the grid of BNV number 32 from '''level1_Final'''.
The pathfinding grid is made of equally sized tiles and it is aligned with the x and z axis. The size of the tile and the number of tiles are along each axis are stored in the [[OBD:AKVA|BNV]]. Grid rows corespond to the x axis and grid column corespond to the z axis.
:('''chr_teleport 0 0''' gets you there, and then you can use '''chr_show_bnv=1''' and '''ai2_showgrids=1''')
 
A tile can have one of the following types (appearance as visible with '''ai2_showgrids=1'''):
*0 : '''clear''' (no cross)
*1 : '''nearwall''' (light green cross)
*2 : '''border1''' (lightest blue cross)
*3 : '''border2''' (lighter blue cross)
*4 : '''semipassable''' (green cross)
*5 : '''border3''' (blue cross)
*6 : '''border4''' (dark blue cross)
*7 : '''stairs''' (dark green cross)
*8 : '''danger''' (orange cross)
*9 : '''impassable''' (red cross)


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.
;Storage


The grid data is stored in strips, each strip consisting of tiles of a certain type.
The grid is stored compressed in .raw files and it is decompressed on demand (when an AI needs to find its way through a BNV).
:A strip can have any length between 1 and 255, and a width of 1.
The used compression algorithm is a form of [[wikipedia:Run-length_encoding|RLE]]:
:A strip runs along z for fixed x, and can wrap around to the next x if it's longer than the grid.
:*a sequence of tiles that have the same type form a run
:*a run can have a length of up to 255 tiles
:*runs of length 1 are treated as any other length runs
:*runs of up to 15 tiles (short runs) are stored in one byte:
::XY (hexadecimal, with X > 0 ) stands for a run of X tiles of type Y
:*runs of more than 15 tiles (long runs) are stored in 2 bytes:
::0Y XX (hexadecimal, with XX > 0 ) stands for a run of XX tiles of type Y
::the leading 0 is used to differentiate between short and long runs


Tile types are (appearance as visible with '''ai2_showgrids=1'''):
*0 : normal ground (no cross)
*1 : close vicinity of a wall (gray cross)
*4 : even closer vicinity of a wall (green cross)
*9 : wall (red cross)
*8 : forbidden zone, e.g., inside a column (orange cross)
I didn't document the other tile types (yet): the storage format is the same anyway.


Strips can be stored in two ways:
;Example


;Short strips (1 to 15 tiles)
The example below is the grid of BNV number 32 from '''level1_Final'''.
:are stored as one byte
:('''chr_teleport 0 0''' gets you there, and then you can use '''chr_show_bnv=1''' and '''ai2_showgrids=1''')
:XY (hexadecimal, with X > 0 )
:stands for a strip of X tiles of type Y


;Long strips (1 to 255 tiles)
The example was chosen because it's a relatively small grid (45 bytes of data) and illustrates the format completely.
: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)
:(offsets relative) (make them absolute if you like)
{|cellspacing=0
{|cellspacing=0
{{HexRow|0x00|
{{HexRow|0x00|
Line 48: Line 48:
{{HexRow|0x10|
{{HexRow|0x10|
|11|30|11|14|09|11|48|79|14|11|30|11|14|79|48|39|
|11|30|11|14|09|11|48|79|14|11|30|11|14|79|48|39|
|C0|88|C0|00|FF|C0|FF|FF|00|C0|00|C0|00|FF|FF|FF|
|C0|88|C0|00|FF|FF|FF|FF|00|C0|00|C0|00|FF|FF|FF|
|C0|FF|C0|FF|00|C0|A5|00|FF|C0|FF|C0|FF|00|A5|00|
|C0|FF|C0|FF|00|00|A5|00|FF|C0|FF|C0|FF|00|A5|00|
|C0|FF|C0|00|00|C0|00|00|00|C0|FF|C0|00|00|00|00|
|C0|FF|C0|00|00|00|00|00|00|C0|FF|C0|00|00|00|00|
}}
}}
{{HexRow|0x20|
{{HexRow|0x20|
Line 62: Line 62:


;Here's the grid this corresponds to
;Here's the grid this corresponds to
:(the grid's size is 24x35 as specified in the DAT)
:(the grid's size is 26x35 as specified in the instance file)
{|border=1 cellspacing=0 STYLE="empty-cells:show;"
{|border=1 cellspacing=0 STYLE="empty-cells:show;"
!||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||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
Line 120: Line 120:
|-
|-
!18
!18
|bgcolor="#00FFFF;" colspan=35  align= center|255 tiles of type 0
|bgcolor="#00FFFF;" colspan=35  align= center|225 tiles of type 0
|-
|-
!19
!19
Line 126: Line 126:
|-
|-
!20
!20
|bgcolor="#00FFFF;" colspan=35|
|-
!21
|bgcolor="#00FFFF;" colspan=35|
|bgcolor="#00FFFF;" colspan=35|
|- align=center
|- align=center
!21
!22
|bgcolor="#C0C0C0;" colspan=14| 14 tiles of type 1
|bgcolor="#C0C0C0;" colspan=14| 14 tiles of type 1
|bgcolor="#88FFFF;" colspan=7| 7 tiles of type 0
|bgcolor="#88FFFF;" colspan=7| 7 tiles of type 0
|bgcolor="#C0C0C0;" colspan=14| 14 tiles of type 1
|bgcolor="#C0C0C0;" colspan=14| 14 tiles of type 1
|- align=center
|- align=center
!22
!23
|bgcolor="#00FF00;" colspan=14| 14 tiles of type 4
|bgcolor="#00FF00;" colspan=14| 14 tiles of type 4
|bgcolor="#C0C0C0;"|1
|bgcolor="#C0C0C0;"|1
Line 140: Line 143:
|bgcolor="#00FF00;" colspan=14| 14 tiles of type 4
|bgcolor="#00FF00;" colspan=14| 14 tiles of type 4
|- align=center
|- align=center
!23
!24
|bgcolor="#FF0000;" colspan=14| 14 tiles of type 9
|bgcolor="#FF0000;" colspan=14| 14 tiles of type 9
|bgcolor="#00FF00;"|4
|bgcolor="#00FF00;"|4
Line 149: Line 152:
|bgcolor="#FF0000;" colspan=14| 17 tiles...
|bgcolor="#FF0000;" colspan=14| 17 tiles...
|- align=center
|- align=center
!24
!25
|bgcolor="#FF0000;" colspan=3| ...of type 9
|bgcolor="#FF0000;" colspan=3| ...of type 9
|bgcolor="#FFA500;" colspan=4| 4 t. of type 8
|bgcolor="#FFA500;" colspan=4| 4 t. of type 8
Line 162: Line 165:
|bgcolor="#FF0000;" colspan=3| 3 t. of type 9
|bgcolor="#FF0000;" colspan=3| 3 t. of type 9
|- align=center
|- align=center
!25
!26
|bgcolor="#00FF00;" colspan=2| 4
|bgcolor="#00FF00;" colspan=2| 4
|bgcolor="#FF0000;" | 9
|bgcolor="#FF0000;" | 9
Line 177: Line 180:
|bgcolor="#00FF00;" colspan=2| 4
|bgcolor="#00FF00;" colspan=2| 4
|}
|}
{{OBD}}

Latest revision as of 14:02, 17 July 2014

Overview

The pathfinding grid is made of equally sized tiles and it is aligned with the x and z axis. The size of the tile and the number of tiles are along each axis are stored in the BNV. Grid rows corespond to the x axis and grid column corespond to the z axis.

A tile can have one of the following types (appearance as visible with ai2_showgrids=1):

  • 0 : clear (no cross)
  • 1 : nearwall (light green cross)
  • 2 : border1 (lightest blue cross)
  • 3 : border2 (lighter blue cross)
  • 4 : semipassable (green cross)
  • 5 : border3 (blue cross)
  • 6 : border4 (dark blue cross)
  • 7 : stairs (dark green cross)
  • 8 : danger (orange cross)
  • 9 : impassable (red cross)


Storage

The grid is stored compressed in .raw files and it is decompressed on demand (when an AI needs to find its way through a BNV). The used compression algorithm is a form of RLE:

  • a sequence of tiles that have the same type form a run
  • a run can have a length of up to 255 tiles
  • runs of length 1 are treated as any other length runs
  • runs of up to 15 tiles (short runs) are stored in one byte:
XY (hexadecimal, with X > 0 ) stands for a run of X tiles of type Y
  • runs of more than 15 tiles (long runs) are stored in 2 bytes:
0Y XX (hexadecimal, with XX > 0 ) stands for a run of XX tiles of type Y
the leading 0 is used to differentiate between short and long runs


Example

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.


(offsets relative)
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 instance file)
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