The last couple of months have had a pretty steep learning curve but, at last, something vaguely game-like is beginning to take shape. This is what I’ve been working on:
- Basic camera moves and cuts
- Various types of animation control
- Custom cursor with different animated rollover states
- Real-time and baked shadows with toon-shading
You can see a video on YouTube here. Unsurprisingly, it’s still my lack of general scripting experience that’s slowing me up. All too often I find myself going online to “quickly” look up a reference, only to encounter basic terms I’ve never heard of and having to spend hours/days down tutorial filled rabbit-holes…
For instance, while working on the light switches I was trying to find out how to access culling-masks/layers via script, I came across numerous examples that look like this:
var cullingMask = 1<<8|1<<9;
If, like me, you’ve never heard of a bitwise operator how do you go about deciphering the above? Googling << isn’t even slightly helpful so it comes down to looking though forum posts for clues and relevant terms before piecing together a solution. Eventually I established that Unity references its layers as bits in a 32-bit integer, so in a list of 0’s, each one representing a layer, a 1 indicates a layer is active, essentially it’s a series of check boxes with a 1 instead of an x. In order to convert the layer number you see in Unity to this format it has to be bitshifted, with the help of Wikipedia I learn that that’s what the << does, and the | is an or operator. The above code essentially checks the visibility box for layers 8 and 9.
This may seem like a ridiculous way of learning how to develop a game, stopping and starting constantly, and I certainly find it very frustrating at times, but to be honest I don’t think I could do it any other way. This goes back to my previous entry about the context of learning; if I’d been taught this in a CS101 class I would’ve fallen asleep. In this case I wanted to stop the moon from lighting up the kitchen when I switched the light on, this is just the convoluted way the software makes me do that and, as a 3D artist, if there’s one thing I’m comfortable with it’s convoluted solutions to straight forward problems.
As for the rest of the scene, I’m slowly pushing towards a look I like, still aiming for something like a vector illustration, at the moment I’m using a combination of Unity’s built-in Lighted Toon Shader with a few different constant ramps, the Basic Toon Shader with a cube map and several textures with shadows baked in Softimage. So far, after much trial and error I’m getting reasonably consistent results.
Next step now is to replicate the click-to-move and inventory system functionality of my last prototype, only with an animated character. I had more than a few issues getting simple animated transforms working so it should be interesting to see how I get on with a whole hierarchy of bones and a skinned mesh. Really looking forward to trying out the new animation features in Unity 4, until then I’ll be looking at Locomotion, from what I can gather Mechanim wont be supporting quadrupeds from launch so I’ll need to get to grips with the latter anyway.
If you have questions, suggestions or happen to know where I can get cheap, brand-name clothing, feel free to leave your words in the box below.