Modular mission design (or building an awesome dynamic level)

I was around 12 when I first saw Wing Commander at a friend’s. He got it from an aunt that went to the US (which was a rare event in early 1990’s Brazil), but never really got into it. I remember been so transfixed by it that my friends forgot about me playing on the PC and went out to play soccer. I became a real fan, buying every space sim that came out since.

Just to make things clear, “buying” a PC game in the ‘90 was also a rare event in Brazil. I don’t think I remember many friends who actually bought their games back then, if you know what I mean. That shows you how fascinated I was about the whole idea.

When I decided to make my own space sim 10 years ago (which I mentioned in this article), I had lots of ideas I wanted to play with, many based on this 20+ years experience as a player, some because I saw ways to improve on the formula.

Now I finally reached that moment in which I’m building levels for Strike Squadron Caracará, and, after a few tests with simple missions, I decided to tackle something more complex.

What I wanted was to not only create an example of the gameplay I wanted for the game, but also find out what I was missing on the design and art sides.

Spoiler warning: I’ll be dissecting what will be one of the missions of the final game. Of course there may be changes and I won’t get in details about plot, but by looking under the hood you’ll probably know some of the tricks of how that mission works.

Planning started with a basic idea (a branching pirate base attack mission) and a piece of paper. I thought first of the experience I’d love to have in the game: a linear mission structure in which missions and the story changes depending on what I did now and previously, resulting in an unique playing experience. I took notes of everything cool that could happen and saw what made sense coming in here.

I did a lot of research on what people thought of previous space sims through reviews and online forums. One of the things people complained most often about the Wing Commander series was how most missions were basically patrol 3-4 points, shoot enemies, land back. That was probably what made Freespace a bigger game to a lot of people: diversity.

The first plan came down to this sketch on paper:

So there is a pirate base with some early-warning security. Let a patrolling ship escape ou trigger the network of space buoys and the base goes on alert, launching fighters, calling for reinforcements and having their leaders escape on 4 freighters.

Meanwhile, there was a timer running: you had to deal with defenses fast, because a troop transport would jump in soon to try and land on the base to capture it. If the shuttle was destroyed, bombers would come in to destroy the base. Failing that, the fleet would come in and finish it off.

At first things looked complex. But the trick here was splitting things in pieces.

Years ago I worked on a big project for an online game that was too static (like every other online game at its time). I didn’t like that, so I worked on an idea to change that concept. Around the same year that idea was shotdown Guild Wars 2 came out with a concept of dynamic world that was exactly what I had in mind.

You see, when you build a whole level as a single flow of triggers and actions, things can get very complicated. It’s not just about building it all, but testing it and making sure the whole thing works as a single beast.

But what if you broke the monster into smaller, independent pieces?

Once each piece because its own flow of triggers and actions, programming and testing because a lot simpler, and the final experience because far more diverse.

The first part of the puzzle was defining what each event flow was, coming up with a sketch like this:

While at first that looks confusing, here is the thing: there is a single flow on the right side that represents the mission itself: orders sent by “high command”, reactions to what happens in the world.

So a timer indicates how long you have to deal with the bases defenses before the troop transport jumps in. Codewise it is independent from anything going on on the mission. If could choose to ignore base defenses and the shuttle would have a hard time reaching it.

The triggers them go from there: if the shuttle is lost, if the bomber is lost, if the base is destroyed, etc.

And that’s it.

The base has its own set of independent flows. Each defense platform has a similar one: destroy the power generator and those turrets go offline. (Bonus points: there is a random chance that the crates in that area are loaded with ammo and may go off if you hit them).

The base itself has 3 independent event flows triggered by the base alert going off. The hanger launches fighters every minute until it’s destroyed; the comms dish tries and send a message asking for reinforcements unless destroyed; the four freighters loaded with weapons make a run for it unless disabled or destroyed.

That gave the player options on how to deal with the mission: take out the power generators? The hangar? Stop the freighters from escaping? Prevent the base from calling for help? Each on the fly decision affects how the mission plays out.

Of course, things could get more interesting. For instance, what triggers the base alert?

The network of early warning buoys because an event flow in itself. Move in quickly and you may prevent the alarm from been triggered, giving you precious seconds as you approach the unaware base. What if during previous missions you had the chance to talk to a smuggler and, depending on your choices, he told you one of the buoys was defective? Then maybe you know of a way in without the risk of detection (something that can still be identified by an attentive player).

What else could I bring in as consequence to previous actions?

What if in a previous mission you had the chance to destroy some minelayers? What if you let at least one escape? Well, let's add a minefield here! (but only if you failed that mission).

What if the number of troop transports was limited throughout the campaign? It was as simple as adding a variable. Now if you lost too many shuttles during the game you might get to this mission with no shuttle at all, skipping straight to the bombers (and no chance of capturing the base intact). There could even be that you still had one troop transport, but the pilot knew your reputation and made it clear his fear of been escorted by you.

More ideas came in and, while not all would fit this mission, I took notes to test and maybe add to other missions: a ship with a cloaking device, one with an EMP generator, etc.

Out of this mission also came features that could be used in other parts of the game. The sensor buoy, for instance, because a feature. Large ships became event flows themselves: destroy the engines and it stops moving; destroy its radar and the turrets stop shooting; etc. Also came improvements, like fixing patrol and escort behaviour for AI and redoing turret and missile coding to get more independence from them.

While building this level took time (around 2 weeks), by the end of it I not only had a cool dynamic mission, but also several new or improved features for the whole game. It also came out way easier to test thanks to its modularity.

Now it’s time to work on some of the visual effects and finish the capital ships event flows, and see how it all works out on its own. I STILL want this game out before Steam’s end of the year sales!

Who knows? Maybe somewhere out there there is a 12 year old kid who’s just waiting to be transfixed by this game.

Comments