Tunnels Guide
| Author :: Zero Angel |
|
To work with and understand tunnels, you will need to open the shift-F9 view. If you have base buildings set up, you will see a teal background with a lot of grey squares (objects), yellow lines (cliffs), and blue rectangles (building tunnels).
AI in BZ2 treats all buildings as obstacles (but allows some space for AI to maneuver around the edge). So if you create any building, AI will avoid its center by default. The only way to get AI to pass through a building is to define tunnels for it in its ODF.
As an example, The large Bridge segment (about the same size as an ISDF Factory) has 2 tunnels defined for it.
 |
ibbseg1.odf
[BuildingClass]
tunnelCount = 2
bldEdge = "wwww"
tunnel01X0 = 1 // start point from the left of the building
tunnel01Z0 = 0 // start point from the top of the building
tunnel01DX = 6 // width from left to right
tunnel01DZ = 8 // width from top to bottom
tunnel01Edge = "fwfw" // linked-wall-linked-wall
tunnel02X0 = 0
tunnel02Z0 = 2
tunnel02DX = 8
tunnel02DZ = 4
tunnel02Edge = "wtwt" // wall-tunnel-wall-tunnel |
The above entries define the positions of the tunnels from the orientation of the building when first placed in the editor.
The first tunnel is linked from north to south. AI will not pass through this tunnel unless it has been linked to another tunnel with an entrance/exit (ie: the bridge entrance 'ibbstr01').
The second tunnel is the 'underpass' tunnel with an entrance/exit to the east and west. AI will pass through this freely.
You can create your own tunnels by copying the following values and adding/changing them to suit your needs. Do not use bldEdge where you want AI to pass over an underground tunnel.
Tips and Notes
- Shift-F9 view is very useful for quickly checking whether AI will path through your tunnel or ignore it.
- Tunnels can be linked to each other in the same ODF, allowing for some flexibility if the tunnel you want to create is not exactly rectangular.
- Tunnels are independent of each other unless they are linked (F). As an example, AI wont usually enter from the east and exit from the north of a bridge segment unless you link the tunnels to each other somehow.
- Tunnel entrances must have bldEdge specified, or AI will ignore it.
- You should set a small collisionRadius value for any building that uses tunnels, otherwise a large grey square will obscure your view of the tunnel in shift-f9 view.
- You cant use the insides of underground tunnel segments for staging, the AI will interpret the go-to as a go-to for the above terrain. You can issue attack orders to enemy forces inside tunnels, and AI will move through the tunnel to attack.
- Logically, specifying bldEdge for a tunnel segment should allow AI to stage inside there (but prevent them from passing over the tunnel), but I haven't tested that.
- 'Terrain' and 'turret' (guntower) classlabels cannot have tunnels set up for themselves.
Demo Files
- Mire Ruin
Alternate version of [mbruine3]. Demonstrates the use of multiple linked tunnels in the same ODF.
|