shawn's blog

Breaking Floors Pt. One

Posted in Other by Shawn on January 14, 2011

In the popular zombie shooter Left 4 Dead (PC version) you’re given access to the Source SDK, as well as the ability to develop your own custom maps/campaigns/etc. While I’m not directly using the Source SDK, I am taking advantage of the Left 4 Dead Authoring Tools. Here you can create the aforementioned maps/campaigns/etc with out having to deal with ‘programming’ per se.

I actually have the beginning of a campaign here. While it was fun, and not 100% finished, it still needs a ton of polish. However, being so close to the end, I started working on designing the next level.

In the actual game, there are breakable walls which are designed to surprise the players and potentially cause havoc.  As soon as I added that into my level, I started thinking about breakable floors. Brief conversation with others who frequent L4D confirmed my initial thoughts – there were no breakable floors. So I decided to make one. But it couldn’t be boring (Subject walks on floor —> Floor breaks). It had to be interesting and ‘meaningful’. At least, that’s what I told myself.

A view of the breakable floor with triggers

With breakable walls, there are three types of categories which dictate who can break walls – Everyone, Infected Only (just the zombies) or Tanks. Because I wanted this floor to break on its own (no stray bullets/zombies breaking the floor by accident), I selected ‘Only Tanks’. Currently, in the map above, the breakable floor is located between two doors, one of which is still raised. This is to seal off both sides, not allowing any spawned Tanks to find their way to the floor and break it before it’s supposed to.

Next, I needed triggers to tell the floor to break. With many map editors such as these, it’s not that hard implementing triggers. Press Button –> Door closes. Triggers usually can also have multiple outputs. Press Button –> Door closes & Alarm goes off & Horde is summoned. My initial thought process was to have a button pressed and the floor break shortly after that. There were some problems however.

Unless you constantly play this game online, you will be forced to play with AI. They’re usually smart, but they can only go where you tell them to when you are building a map. Enter the Nav Mesh(map). Using this, you can tell the players where they can/cannot go, where zombies will spawn, where players start, etc. It would be simple to say “Walk here“. However, breakable walls are placed in their own special categories, or entities. And unless you’ve made friends with a radioactive spider, most people cannot walk on walls. The AI in L4D were no exception. I couldn’t just draw a nav map on the floor to say “walk on the wall(but pretend it’s a floor!)”.

Breakables are special

The solution was actually easier than I thought. Do not call the floor a breakable wall just yet. Leave it as a floor. That allowed me to draw the nav area over the floor. Alternatively, but much more annoying, I could have drawn the map before I added the floor. But the breakable floor has it’s own separate nav area, which means I’d be drawing on nothing, and leaving things possibly incorrect.

That’s it for now. There’s much more that actually went into this, which I will detail subsequent parts.

Tagged with: ,

Comments Off on Breaking Floors Pt. One