You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This page combines previous information from other locations into one source about tileset pathnodes.

In Game Pathfinding Usage

The tileset pathnodes are used to do cross-tile click-to-walk and ActionMoveToLocation/ActionMoveToObject and related commands used via. scripting. If a location is outside the objects current tile (10x10 meter divisions in the map) then a path node specifies if one tile can reach another tile, and also if they were to move onto that tile would they then be able to move onto other tiles past it.

All a pathnode says is "You can/can't go from this exit to that exit". It is used in the first pass of finding a path, after which it'll use the actual walkmesh and other methods (and check creatures, doors and placeables being in the way when they are close enough).

You can view the tile path nodes in game using the debug panel, selecting the rendertpn option. Tile links are with the blue and green links between tiles. Example from the Prelude, shows three rooms with the various TPN values, and a big room with TPN between each part.

Note that WASD movement does not use the tile path nodes so if you are testing a new tileset or a broken old one, this is an easy way to check if things work correctly (barring other things like doors blocking pathfinding).

Pathnode Table

This is all the pathnodes in the game, visually represented. The reason they are defined as base ASCII is since they are stored in ini files it maintains maximum compatibility.

Note the names are case sensitive and put into the SET file as each tiles PathNode option.

Note the ASCII art is not to be considered authoriative, nor are the pictures, until the code has been better reviewed (see further on).

Tile Path NodeASCII ArtPictureNotes
A
---------
[   |   ]
[   |   ]
[---+---]
[   |   ]
[   |   ]
---------


B
---------
[   |   ]
[---+-+ ]
[     +-]
[-+   | ]
[ |   | ]
---------


C
---------
[  | |  ]
[  | |  ]
[--+ +--]
[  | |  ]
[  | |  ]
---------


D
---------
[ |   | ]
[-+   +-]
[       ]
[-+   +-]
[ |   | ]
---------


E
---------
[ |  |  ]
[-+  |  ]
[    +--]
[-+  |  ]
[ |  |  ]
---------


F
---------
[  | |  ]
[  | |  ]
[--+-+--]
[  | |  ]
[  | |  ]
---------


G
---------
[  | |  ]
[  | |  ]
[--+++--]
[   |   ]
[   |   ]
---------


H
---------
[       ]
[       ]
[---+   ]
[   |   ]
[   |   ]
---------


I
---------
[   |   ]
[   |   ]
[---+   ]
[   |   ]
[   |   ]
---------


J
---------
[     | ]
[     +-]
[       ]
[-+     ]
[ |     ]
---------

NOTE: this is wrong in the ASCII need to amend
K
---------
[ |   | ]
[ |   +-]
[-+     ]
[   +---]
[   |   ]
---------


L
---------
[   |   ]
[   |   ]
[   +   ]
[   |   ]
[   |   ]
---------


M
---------
[  | |  ]
[  | |  ]
[  + +  ]
[  | |  ]
[  | |  ]
---------


N
---------
[   |   ]
[   |   ]
[   +   ]
[       ]
[       ]
---------


O
---------
[ |   | ]
[-+   /-]
[   +   ]
[-/   +-]
[ |   | ]
---------


P
Deleted definition

"Removed" so unused so don't use it (who knows might be at somepoint reused). Instead use T for a total pathfinding blocker (eg all black wall tiles in interior areas)
Q
---------
[ |   | ]
[ |   | ]
[-+  /--]
[   +   ]
[   |   ]
---------


R
---------
[   |   ]
[   +   ]
[-+  \--]
[ |   | ]
[ |   | ]
---------


S
---------
[ |   | ]
[ |   | ]
[-+   +-]
[       ]
[       ]
---------


T
---------
[       ]
[       ]
[       ]
[       ]
[       ]
---------

A blocker pathfinding node, use for all black wall tiles in interior areas or areas of sea or similar no-pathingfinding tiles
U
---------
[   |   ]
[    \  ]
[-+   +-]
[    /  ]
[   |   ]
---------


V
---------
[   |   ]
[   +   ]
[     --]
[    /  ]
[   |   ]
---------


W
---------
[   |   ]
[   +   ]
[--     ]
[  \    ]
[   |   ]
---------


X
---------
[   |   ]
[   +   ]
[-+     ]
[       ]
[       ]
---------


Y
---------
[   |   ]
[   +   ]
[       ]
[   +   ]
[   |   ]
---------


Z
---------
[   |   ]
[---+   ]
[   +-+-]
[-+/  | ]
[ |   | ]
---------


a
---------
[  | |  ]
[  | +  ]
[--+++--]
[   |   ]
[   |   ]
---------


b
---------
[  | |  ]
[  + |  ]
[--+++--]
[   |   ]
[   |   ]
---------


c
---------
[ | | | ]
[ | | | ]
[-+-+-+-]
[   |   ]
[   |   ]
---------


d
---------
[ | | | ]
[ | + | ]
[-+   +-]
[  \ /  ]
[   |   ]
---------


e
---------
[   |   ]
[---+-+ ]
[---  +-]
[-+ | | ]
[ | | | ]
---------


f
---------
[ | | | ]
[ | | | ]
[-+ + +-]
[ | | | ]
[ | | | ]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
g
---------
[ | | | ]
[ | | | ]
[-+-+ +-]
[ | | | ]
[ | | | ]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
h
---------
[   |   ]
[---+-+ ]
[----/+-]
[-+ | | ]
[ | | | ]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.

Similar to e only with two of the areas connected.

i
---------
[---+---]
[   |   ]
[-+ | +-]
[   |   ]
[---+---]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
j
---------
[---+---]
[       ]
[-+   +-]
[       ]
[---+---]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
k
---------
[ | | | ]
[-+ | | ]
[---+ +-]
[-+ | | ]
[ | | | ]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
l
---------
[ | | | ]
[-+ | +-]
[---+---]
[-+ | +-]
[ | | | ]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
m
---------
[ | | | ]
[-+ | +-]
[   +   ]
[-+ | +-]
[ | | | ]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
n
---------
[ | | | ]
[-+ + +-]
[       ]
[-+ + +-]
[ | | | ]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
o
---------
[ | | | ]
[-+ | | ]
[   + +-]
[-+ | | ]
[ | | | ]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
p
---------
[ |   | ]
[-+   | ]
[-+   +-]
[-+   | ]
[ |   | ]
---------

Added in later Bioware patches so may not be used in the earliest tilesets.
q
---------
[ |   | ]
[-+   | ]
[-----+-]
[-+   | ]
[ |   | ]
---------

Added in 1.87.8193.35.
r
---------
[ | | | ]
[-+ + +-]
[-+   +-]
[-+ + +-]
[ | | | ]
---------

Added in 1.87.8193.35.
s
---------
[ |   | ]
[-+   +-]
[-+   +-]
[-+ + +-]
[ | | | ]
---------

Added in 1.87.8193.35.
t
---------
[ |   | ]
[-+   +-]
[   +---]
[-+ | +-]
[ | | | ]
---------

Added in 1.87.8193.35.
u
---------
[ | | | ]
[-+ | +-]
[   +---]
[-+ | +-]
[ | | | ]
---------

Added in 1.87.8193.35.
v
---------
[ | | | ]
[-+ | +-]
[-+ +---]
[-+ | +-]
[ | | | ]
---------

Added in 1.87.8193.35.
w
---------
[   |   ]
[   +   ]
[-+   +-]
[   +   ]
[   |   ]
---------

Added in 1.87.8193.35.
x
---------
[ |     ]
[-+     ]
[       ]
[-+   +-]
[ |   | ]
---------

Added in 1.87.8193.35.

Technical Engine Definition

The game hardcodes the pathnode definitions - Bioware added several post-release as have Beamdog covering the majority of tile connection possibilities. The code defining them has been provided by the developers but is hard to parse (Although the comments do show a rough outline of which each one is defined as):

Pathnodes
         case NWTILE_PATH_FINDING_TYPE_A:
        {
            //    ---------
            //    [   |   ]
            //    [   |   ]
            //    [---+---]
            //    [   |   ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_B:
        {
            //    ---------
            //    [   |   ]
            //    [---+-+ ]
            //    [     +-]
            //    [-+   | ]
            //    [ |   | ]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 2.5;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_C:
        {
            //    ---------
            //    [  | |  ]
            //    [  | |  ]
            //    [--+ +--]
            //    [  | |  ]
            //    [  | |  ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_D:
        {
            //    ---------
            //    [ |   | ]
            //    [-+   +-]
            //    [       ]
            //    [-+   +-]
            //    [ |   | ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 2.5;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 2.5;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_E:
        {
            //    ---------
            //    [ |  |  ]
            //    [-+  |  ]
            //    [    +--]
            //    [-+  |  ]
            //    [ |  |  ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 2.5;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_F:
        {
            //    ---------
            //    [  | |  ]
            //    [  | |  ]
            //    [--+-+--]
            //    [  | |  ]
            //    [  | |  ]
            //    ---------

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_G:
        {
            //    ---------
            //    [  | |  ]
            //    [  | |  ]
            //    [--+++--]
            //    [   |   ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_H:
        {
            //    ---------
            //    [       ]
            //    [       ]
            //    [---+   ]
            //    [   |   ]
            //    [   |   ]
            //    ---------

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_I:
        {
            //    ---------
            //    [   |   ]
            //    [   |   ]
            //    [---+   ]
            //    [   |   ]
            //    [   |   ]
            //    ---------

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_J:
        {
            //    ---------
            //    [     | ]
            //    [     +-]
            //    [       ]
            //    [-+     ]
            //    [ |     ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_K:
        {
            //    ---------
            //    [ |   | ]
            //    [ |   +-]
            //    [-+     ]
            //    [   +---]
            //    [   |   ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 2.5;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_L:
        {
            //    ---------
            //    [   |   ]
            //    [   |   ]
            //    [   +   ]
            //    [   |   ]
            //    [   |   ]
            //    ---------

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_M:
        {
            //    ---------
            //    [  | |  ]
            //    [  | |  ]
            //    [  + +  ]
            //    [  | |  ]
            //    [  | |  ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;

            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_N:
        {
            //    ---------
            //    [   |   ]
            //    [   |   ]
            //    [   +   ]
            //    [       ]
            //    [       ]
            //    ---------

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_O:
        {
            //    ---------
            //    [ |   | ]
            //    [-+   /-]
            //    [   +   ]
            //    [-/   +-]
            //    [ |   | ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfRegionNodes)[i++] = 0;
            (*pfRegionNodes)[i++] = 0;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 2.5;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 2.5;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_P:
        {
            // Deleted tile
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_Q:
        {
            //    ---------
            //    [ |   | ]
            //    [ |   | ]
            //    [-+  /--]
            //    [   +   ]
            //    [   |   ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 1.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_R:
        {
            //    ---------
            //    [   |   ]
            //    [   +   ]
            //    [-+  \--]
            //    [ |   | ]
            //    [ |   | ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 1.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_S:
        {
            //    ---------
            //    [ |   | ]
            //    [ |   | ]
            //    [-+   +-]
            //    [       ]
            //    [       ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_T:
        {
            //    ---------
            //    [       ]
            //    [       ]
            //    [       ]
            //    [       ]
            //    [       ]
            //    ---------
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_U:
        {
            //    ---------
            //    [   |   ]
            //    [    \  ]
            //    [-+   +-]
            //    [    /  ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_V:
        {
            //    ---------
            //    [   |   ]
            //    [   +   ]
            //    [     --]
            //    [    /  ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = -1.25;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_W:
        {
            //    ---------
            //    [   |   ]
            //    [   +   ]
            //    [--     ]
            //    [  \    ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = -1.25;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_X:
        {
            //    ---------
            //    [   |   ]
            //    [   +   ]
            //    [-+     ]
            //    [       ]
            //    [       ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_Y:
        {
            //    ---------
            //    [   |   ]
            //    [   +   ]
            //    [       ]
            //    [   +   ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_Z:
        {
            //    ---------
            //    [   |   ]
            //    [---+   ]
            //    [   +-+-]
            //    [-+/  | ]
            //    [ |   | ]
            //    ---------

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 2.5;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_a:
        {
            //    ---------
            //    [  | |  ]
            //    [  | +  ]
            //    [--+++--]
            //    [   |   ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_b:
        {
            //    ---------
            //    [  | |  ]
            //    [  + |  ]
            //    [--+++--]
            //    [   |   ]
            //    [   |   ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_c:
        {
            //    ---------
            //    [ | | | ]
            //    [ | | | ]
            //    [-+-+-+-]
            //    [   |   ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_d:
        {
            //    ---------
            //    [ | | | ]
            //    [ | + | ]
            //    [-+   +-]
            //    [  \ /  ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_e:
        {
            //    ---------
            //    [   |   ]
            //    [---+-+ ]
            //    [---  +-]
            //    [-+ | | ]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_f:
        {
            //    ---------
            //    [ | | | ]
            //    [ | | | ]
            //    [-+ + +-]
            //    [ | | | ]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_g:
        {
            //    ---------
            //    [ | | | ]
            //    [ | | | ]
            //    [-+-+ +-]
            //    [ | | | ]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_h:
        {
            // Similar to NWTILE_PATH_FINDING_TYPE_e only with two of the areas connected.
            //    ---------
            //    [   |   ]
            //    [---+-+ ]
            //    [----/+-]
            //    [-+ | | ]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_i:
        {
            //    ---------
            //    [---+---]
            //    [   |   ]
            //    [-+ | +-]
            //    [   |   ]
            //    [---+---]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_j:
        {
            //    ---------
            //    [---+---]
            //    [       ]
            //    [-+   +-]
            //    [       ]
            //    [---+---]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_k:
        {
            //    ---------
            //    [ | | | ]
            //    [-+ | | ]
            //    [---+ +-]
            //    [-+ | | ]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;
        case NWTILE_PATH_FINDING_TYPE_l:
        {
            //    ---------
            //    [ | | | ]
            //    [-+ | +-]
            //    [---+---]
            //    [-+ | +-]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_m:
        {
            //    ---------
            //    [ | | | ]
            //    [-+ | +-]
            //    [   +   ]
            //    [-+ | +-]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_n:
        {
            //    ---------
            //    [ | | | ]
            //    [-+ + +-]
            //    [       ]
            //    [-+ + +-]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 5;
            (*pnTileExitRegion)[k++] = 5;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_o:
        {
            //    ---------
            //    [ | | | ]
            //    [-+ | | ]
            //    [   + +-]
            //    [-+ | | ]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_p:
        {
            //    ---------
            //    [ |   | ]
            //    [-+   | ]
            //    [-+   +-]
            //    [-+   | ]
            //    [ |   | ]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_q:
        {
            //    ---------
            //    [ |   | ]
            //    [-+   | ]
            //    [-----+-]
            //    [-+   | ]
            //    [ |   | ]
            //    ---------
            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_r:
        {
            //    ---------
            //    [ | | | ]
            //    [-+ + +-]
            //    [-+   +-]
            //    [-+ + +-]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -5.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = -5.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 5.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 5.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 5;
            (*pnTileExitRegion)[k++] = 6;
            (*pnTileExitRegion)[k++] = 6;
            (*pnTileExitRegion)[k++] = 7;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_s:
        {
            //    ---------
            //    [ |   | ]
            //    [-+   +-]
            //    [-+   +-]
            //    [-+ + +-]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -5.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = -5.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 5.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 5;
            (*pnTileExitRegion)[k++] = 6;
            (*pnTileExitRegion)[k++] = 6;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_t:
        {
            //    ---------
            //    [ |   | ]
            //    [-+   +-]
            //    [   +---]
            //    [-+ | +-]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 4;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_u:
        {
            //    ---------
            //    [ | | | ]
            //    [-+ | +-]
            //    [   +---]
            //    [-+ | +-]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_v:
        {
            //    ---------
            //    [ | | | ]
            //    [-+ | +-]
            //    [-+ +---]
            //    [-+ | +-]
            //    [ | | | ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = -4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -4.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 4.0;

            (*pfTileExits)[j++] = 4.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 3;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 4;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 5;
            (*pnTileExitRegion)[k++] = 5;
            (*pnTileExitRegion)[k++] = 0;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_w:
        {
            //    ---------
            //    [   |   ]
            //    [   +   ]
            //    [-+   +-]
            //    [   +   ]
            //    [   |   ]
            //    ---------
            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = 4.0;

            (*pfRegionNodes)[i++] = -4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfRegionNodes)[i++] = 0.0;
            (*pfRegionNodes)[i++] = -4.0;

            (*pfRegionNodes)[i++] = 4.0;
            (*pfRegionNodes)[i++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = 0.0;

            (*pfTileExits)[j++] = 0.0;
            (*pfTileExits)[j++] = -5.0;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 3;
        }
        break;

        case NWTILE_PATH_FINDING_TYPE_x:
        {
            //    ---------
            //    [ |     ]
            //    [-+     ]
            //    [       ]
            //    [-+   +-]
            //    [ |   | ]
            //    ---------

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = 2.5;

            (*pfRegionNodes)[i++] = -2.5;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfRegionNodes)[i++] = 2.5;
            (*pfRegionNodes)[i++] = -2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = 5.0;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = 2.5;

            (*pfTileExits)[j++] = -5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pfTileExits)[j++] = -2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 2.5;
            (*pfTileExits)[j++] = -5.0;

            (*pfTileExits)[j++] = 5.0;
            (*pfTileExits)[j++] = -2.5;

            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 0;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 1;
            (*pnTileExitRegion)[k++] = 2;
            (*pnTileExitRegion)[k++] = 2;
        }
        break; 

Technical Explaination

An explaination of the code for those who want to understand it perfectly:

They're grouped in pairs, which is {x,y}, and the center of the tile is (0, 0). Bottom left is (-5.0, -5.0), top right is (5.0, 5.0).

ASCII art shouldn't be considered authoritative

Short explanation is: First you define different regions (paths not connected to each other). Then you define all exits of a tile. And lastly, for each exit, you specify which region it belongs to. Exits belonging to the same region are considered linked

AFAICT it doesn't really matter where the region node point is set, but it's usually done at some cross between two paths (i.e. the plus)

Let me explain for A:

    case NWTILE_PATH_FINDING_TYPE_A:
    {

        //    ---------
        //    [   |   ]
        //    [   |   ]
        //    [---+---]
        //    [   |   ]
        //    [   |   ]
        //    ---------
        (*pfRegionNodes)[i++] = 0.0;
        (*pfRegionNodes)[i++] = 0.0;

        (*pfTileExits)[j++] = 0.0;
        (*pfTileExits)[j++] = 5.0;

        (*pfTileExits)[j++] = -5.0;
        (*pfTileExits)[j++] = 0.0;

        (*pfTileExits)[j++] = 5.0;
        (*pfTileExits)[j++] = 0.0;

        (*pfTileExits)[j++] = 0.0;
        (*pfTileExits)[j++] = -5.0;

        (*pnTileExitRegion)[k++] = 0;
        (*pnTileExitRegion)[k++] = 0;
        (*pnTileExitRegion)[k++] = 0;
        (*pnTileExitRegion)[k++] = 0;
    }

Because everything is connected, there is only one region. The node is set in dead center of the tile, at {0.0, 0.0}. It has four exits, at center of each edge. Each exit belongs to region 0 (only region)

Now C: 

    case NWTILE_PATH_FINDING_TYPE_C:
    {

        //    ---------
        //    [  | |  ]
        //    [  | |  ]
        //    [--+ +--]
        //    [  | |  ]
        //    [  | |  ]
        //    ---------

        (*pfRegionNodes)[i++] = -2.5;
        (*pfRegionNodes)[i++] = 0.0;

        (*pfRegionNodes)[i++] = 2.5;
        (*pfRegionNodes)[i++] = 0.0;

        (*pfTileExits)[j++] = -2.5;
        (*pfTileExits)[j++] = 5.0;

        (*pfTileExits)[j++] = -5.0;
        (*pfTileExits)[j++] = 0.0;

        (*pfTileExits)[j++] = -2.5;
        (*pfTileExits)[j++] = -5.0;

        (*pfTileExits)[j++] = 2.5;
        (*pfTileExits)[j++] = -5.0;

        (*pfTileExits)[j++] = 5.0;
        (*pfTileExits)[j++] = 0.0;

        (*pfTileExits)[j++] = 2.5;
        (*pfTileExits)[j++] = 5.0;

        (*pnTileExitRegion)[k++] = 0;
        (*pnTileExitRegion)[k++] = 0;
        (*pnTileExitRegion)[k++] = 0;
        (*pnTileExitRegion)[k++] = 1;
        (*pnTileExitRegion)[k++] = 1;
        (*pnTileExitRegion)[k++] = 1;
    }
    break;

It has two regions that are not connected to each other. Six exits (two top, one left, two bottom, one right). Three exits belong to region 0, three belong to region 1.

As the nodes get more complicated it gets a lot harder to follow, but that's the basic gist

  • No labels