Page 1 of 1

Max tunnels?

Posted: Thu Jul 11, 2013 8:44 am
by bigbadbogie
Is there a maximum number of tunnels that a single building can have?

Re: Max tunnels?

Posted: Thu Jul 11, 2013 1:55 pm
by Red Spot
As in how many does the game allow, or as in does the AI use them?

In case of the AI, it may be inclined to use the boundries, but it will never be forced to use them.
I once used an 'invisible tunnel' to create borders around lava to 'stimulate' the AI in not going over/through the water, which works, but in a dogfight/cramped space/... the AI feels very comfortable to go straigh over what is set as a tunnel and for some reason isnt to forced going back over it again without anything stimulating it to get back on land.

How many the game will take in a single building should be easy to test.

Re: Max tunnels?

Posted: Thu Jul 11, 2013 3:00 pm
by General BlackDragon
Not sure, Most I've done is like 14. Could be 16, or more. Just keep going, use Shift +F9 to see if they work, or if the game crashes, you know you hit the limit.

Re: Max tunnels?

Posted: Thu Jul 11, 2013 3:14 pm
by GSH
Tunnels are a gross hack for BZ2 that works only kinda-sorta well with AI. And it's probably going to remain that way.

The history of BZ2 is that it has AI and gameplay source code mostly descended from Mechwarrior 2, Interstate '76, and Battlezone 1, with some non-gameplay source code from Dark Reign 2 and Heavy Gear 2 (less sure on the last one). For MW2, I76 & BZ1, there were no tunnels. Those three games are 2D terrain patches with heightfields for elevation baked on top. All the AI for MW2, I76, BZ1 & BZ2 is 2D. Interstate '76 was cars driving over terrain, where all vehicles were -- by gravity -- very close to the ground, or falling right back down to it. BZ1/2 add hovercraft to reduce the cost of terrain heightfield lookups, but they were still meant to be close to the ground. The BZ2 shift-F9 view of pathing and paths is 2D and what the AI uses. Look at a BZ2 ascii save - AiPath data structures store only an X & Z component -- 2D -- the height (Y axis) is implied by the terrain heightfield. By history from the MW2, I76 & BZ1 engines, AI just follows a 2D path. Tunnels utterly break that -- there are connections other than just the 2D heightfield.

Note: it's not "realism" that keeps craft close to the ground in BZ2. The game is simply not built for infinite flight. By default, things don't shoot up because there wasn't supposed to be anything there except for bomber/APCs in transit. The AI is not 3D. That is why infinite flight is a game-breaking bug that causes systems to break. Making the BZ2 AI use tunnels, 3D, etc would require a major re-architecting that I don't see as worthwhile.

-- GSH

Re: Max tunnels?

Posted: Thu Jul 11, 2013 4:35 pm
by Zero Angel
I've made a 16 tunnel building once. The building was a multi-level building which AI infantry was meant to be able to go inside to attack the player. It worked well for the most part. The setup of the tunnel would allow the AI to go upstairs sometimes just enough for the AI to not be really exploitable. It works somewhat for multilevels so long as you never let linking tunnel edges overlap with other linking tunnel edges and if you use simple ramps instead of spiral stairs or other complex mechanisms (remember the AI cannot tell if you are on floor 1 or floor 2 when pathing, so you must keep that in mind when designing multi-level tunnels)

Re: Max tunnels?

Posted: Fri Jul 12, 2013 2:43 am
by bigbadbogie
Cool. Thanks. I probably wont get over 16.

Hey. I just had a thought. Would it be possible to add a new feature in 1.3 to see tunnels in regular editor mode, and even add pathpoints?

Shift-F9 is still extremely annoying as it tends to obscure objects on dense maps and you can't see pathpoints behind objects.

Re: Max tunnels?

Posted: Fri Jul 12, 2013 2:15 pm
by Red Devil
agreed about path points behind objects