Thursday, 10 March 2016

Sprint Update - 9.3.16 - Mocappin’ and asset snappin’

Well… there has been a huge amount put into the game this month. In fact, it has been intense, a lot of hours, and at times pretty tiring, as things have had to be organised to hit some quite specific deadlines, but the outcome has been an amazing explosion of creativity and progress on the game. So… what have we been doing?

Mocap time

We had a A LOT of fun last week when we got to take up the opportunity of shooting mocap at Centroid Motion Capture Academy at Amersham College. These folk were incredibly generous and set up shooting the mocap for the intro to Off Grid as an excercise for their students. We brought in some professional actors, motion cature Director John Dower (of 007 Legends, Peter Molyneux’s Milo & Kate, and Republique fame to note but a few credits), stirred it all up, and out came an amazing day of motion capture goodness! This was all organised with the help of the Games Department at the National Film and Television School and so we have a lot of people to thank for making it happen. There was a great deal of prep work to do in the build up to the shoot itself, script and shot work, casting, aquiring props that the cameras would be able to capture actors through without obstruction, character setup for applying the animation, and a whole lot of discussion to iron out the process and the meet the needs of each department involved. For having so many moving parts, the day went amazingly smoothly and the majority of that was down to the supreme production skills of Neil Bedecker of Amersham College and his team, alongside the guiding hand of John Dower.

Modding support and user-made levels

We’ve always said we want Off Grid to be both moddable, and to offer an (at least relatively) easy way for people to make their own levels and tell their own stories, and then share them with everybody else. Great goal, but also a surprisingly complicated thing to do in some ways, and there really is no single answer how to make a game support all that.
However, we now have a solid plan for how it’s going to be done in Off Grid. And also pretty good start at implementing it all!

Unity as level editor
While having an in-game level editor is great, and makes the barrier for people to create their own content as low as possible, building our own editor that could make similar 3D environments to our own levels would be quite a challenge. So we spent a bit of time thinking about different options, including things like extruding 3D meshes based on simple pixel drawing “maps” people could make, or making an easy tool for placing the important rooms and then writing code that would procedurally generate and connect it all together with corridors and other spaces. And then we realised that we are trying to reinvent the wheel. Unity is already a great editor for building levels, and it’s available for free for anyone to download and play with. So we’ll just build our modding and level editing support around the very same tools we are using ourselves!

Here’s how it works: We’ll build loads and loads of modular building pieces, furniture, props, interactive items and whatever things you all will need to create your, and our, levels (and in the long run things we could never imagine - that you will inevitably request). Then we’ll convert all of them into prefabs ready to be placed in those levels, add our own scripts to help you package your level correctly, and of course provide instructions and our Lua-based API for writing missions, defining characters, networks, sending data around, and whatever. Then we’ll combine all these things into a UnityPackage, which you will be able to download from our site, and potentially Steam Workshop when we get there.

Anyone interested in making their own content will then be able to just download & install Unity from, grab the Off Grid Levelkit package from our website, and import it into Unity and they’ll have all the tools they need to make mods and levels for Off Grid right there on their desktop. Pretty much anyone should be able to use the 3D assets we provide to build levels that fit with the visual quality of our own stuff, while at the same time people also can import their own custom 3D models and textures and include them in the levels in the same way if they so wish.

To this end, some of this sprint has been dedicated to making a first pass at the modular 3d assets for this Levelkit. We have kept it basic for now (you know the old adage that constraints breed great design!) and it is a fairly crude execution to start with with all the hard edges and hacky bits you would expect an early prototype to have, buuuut it is already working and you can make a basic level with some nice variation just with our first pass kit! big up to our friend Rory Bedward who came in to help work up this fist kit. You can check it out here with this little clip of some very literal rapid iteration.

Level loading & AssetBundles, and restructuring pretty much everything…
So, every custom level is packaged into an AssetBundle file. How to get that in the game then? We’ve just rewritten our level loading code and main menu UI to deal with that!
Each level goes in its own folder, together with a simple JSON file describing the level and the AssetBundles it needs. (We’ll add a tool for creating that with the level editing kit). Then our level loading code just searches for all those things in our Levels folder & adds them into the level selection screen. Pretty simple!

Well, for players at least.

It got a bit more complicated for us, as we’ve had to make sure the user made levels only need to include the actual level, and all the complicated stuff the game needs to work has to be somewhere else. Thankfully Unity 5.3 added support for running multiple scenes at the same time, so we’ve been working hard moving the “smart” parts of the game into their own scene, as well as building the systems needed for the level scene and the utilities scene to connect together so that all the systems still work.

If the scenes only contain the actual level, then how do we get all the characters in the scenes, create networks, and build the story and logic behind the missions?

Lua scripting
Well… like we mentioned in last month’s development update, we’ve added Lua integration in the game. Lua scripts are (relatively) simple and human-readable, and with the Mission API we’ve been writing on our side, setting up missions, spawning characters, creating networks, connecting characters and devices to those networks, and then sending data and messages and everything around is pretty straightforward.

This is definitely something that will grow over time as we build the game, but our current Lua API already allows us to do everything we need for our current levels, and some more! And it’s quite a lot easier to deal with than setting up all that stuff on Unity side was. In addition to the mission system running Lua, we went crazy and added Lua support to every network-connected device in the game! So, any data sent around in the game can include it’s own Lua script, and that script can then talk with the mission system, or send data around. For example, a Lua script can be attached to a piece of data to send the player a text message if that data was sent to a certain character or device in the level. In the long run we’ll of course hook it to our AI as well…

All the mission stuff can be described in one single Lua file (or broken up into multiple files if you prefer), first defining characters, then items, data files needed for that level, networks, and finally any mission objectives (with hints, and text messages etc. needed to communicate all that to the player). But Lua is more powerful than that, so the same script can also contain the actual logic for running the mission! We’ll provide some nice examples of how to do it, but in the end anyone is free to build their mission as they feel works best, so I’m expecting to see some pretty clever stuff and surprising missions once the game is out…

Then you’ll just need separate Lua files for any data files you want, and some XML files describing your characters (we might convert those to Lua scripts as well, if nothing else it’s a lot easier to read than XML), and package the files together with the level.

Other changes

With all that work, plus plenty of boring admin stuff needed to keep our company running and game progressing we’ve definitely been busy this month, and looks like the next month will be the same… We did of course also do some usual bug fixing and polish here and there, changed our light & camera setup a bit, switched the game from gamma-corrected lighting to linear mode for smoother and better looking graphics, tweaked our sounds a bit, and did some work to make sure our user interface will be easily moddable as well. But we’ll probably talk more about all that next month!
We started working in a pre-alpha version of unity with some pretty cool features we have been allowed to experiment with by the development team, hopefully we will have more on that next month too!

As always, thanks for reading.
Over and out,
Pontus and Rich

No comments: