Blog 738: The Final Foundation

It’s the most productive time of the year! That means it’s time to tackle those big problems that put the fear into you at in any other season. But with a couple weeks of holiday? Oh yes.

Over the weeks leading up to crimbo, I was dancing around, adding little new features and refining systems. I put decorations into the bunkers, added vending machines and guard posts, deleted the crap code that was failing to do these things before — the level generator is, dare I say it, looking pretty damn good.

The next step, then, is to take this mishmash of content and make it… into a campaign.

The Final Foundation

The way Unity works (superficially at least) is actually distressingly similar to Warcraft III. A Unity game only exists inside “scenes”, each only roughly analagous to the self-contained world of a Warcraft map. Things can only exist beyond and between scenes if you deliberately force them to.

Since my levels are procedurally generated, my game has so far consisted of a single scene. Rather than loading a new level and dealing with transferring the persistent character information, I have simply been wiping the level content and replacing it with fresh stuff.

Needless to say, this is untenable. Eventually, I want to make campaigns, stories that progress over multiple hand-crafted levels. These cannot be shuffled so readily.

When going down is actually staying on the same level.

I’ve been juggling with how to manage this sort of stuff beyond a single scenario for a while, and have finally come up with this three-layer system:

  1. The imaginatively-named GameController handles utterly foundational information; loading new levels, holding onto the user interface and other shared components and data. It has been around a while.
  2. The second layer is totally fresh, the Campaign layer; this manages data that pertains to a given scenario. The important thing that I was missing before is that a narrative scenario can (and will) occur over more than one map — the Campaign layer will handle that. Only when you start a new campaign can this information be flushed away.
  3. The third layer was previously doing most of the Campaign work, the Level layer; this handles data and logic that is global within, but specific to, a given level and doesn’t touch anything beyond that. When I was just flushing the environment and building a new one, this layer was able to hold onto “transitional” data because there was no transition actually occurring.

These stacked barrels represent the layers of my code… or something.

Needless to say, implementing this required unpicking a lot of old logic and shaving off more than a few old mistakes. I needed a small and safe testbed to work out the kinks, which I found in… a menu fly-by.

It’s no secret that I idolise Unreal and Deus Ex. Both games present their players with 3D scenes that the camera whooshes around, waiting for them to press a button to open up the main menu and get started.

You’re right, this is hardly a “campaign”, but it is an utterly distinct pseudo-level that shares basically no logic with the main gameplay. If I can transition from this dud scene to a new game, and back again, then I can confidently say that everything is working as intended.

Totally not riffing off Deus Ex, no sirree. Does the tacit leaking of this symbol mean I’m closer to a name? It’s hard to tell.

With that all seemingly in place, the next step was one I’d been looking forward to for a long time — the character creator.

Dress-Your-Own-Mech is here at last! The Epsilon mech has 21 paintable elements, some of which can be replaced with different physical variations too. This is likely “a bit much”, so I’ve added in the global colour schemes that will set your mech up more coherently — each of the paintable parts knows whether it should use the main, accent or camouflage texture of a given scheme. Then you can override little bits of the main scheme to taste.

This is only the beginning.

The character creator screen is actually pretty special in structural terms, so it was still important beyond the aesthetic.

This is where everything begins — where the campaign parameters are set, where the player takes control of their avatar. Rather than throwing you straight into a new game with no preamble, this is your moment to get warmed up. This is the final piece of the puzzle: which means that the game’s foundations are now… complete.

That means it’s time to double down on fine-tuning and content. I need to add more levels, flesh out that campaign structure, add more units, more equipment… Ahhh, but that’s for the rest of the year. 2018 is going to be the one!

Have a new gameplay video to celebrate!

Advertisements

2 thoughts on “Blog 738: The Final Foundation

  1. This is a game on its own designed in Unity based on your w3 project right? If it is, it’s amazing all the things you’ve been able to accomplish on your own. I follow your job since When Freedom Slips Away, will be looking foward to this project. Also loved the one in w3 I couldn’t believe someone by himself could do something that amazing with the editor and all the addons etc. You’re amazing.

    Like

    • Yep, it’s all built from the ground up in Unity. It’s loosely based on the stuff I did in WC3 but it’s more of a reboot, I’m going off in some directions that WC3 wasn’t capable of so hopefully the results will be much improved. ❤

      Like

And you tell me...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s