Archive for the ‘Deathspuds’ Category

Keeping Busy – Deathspuds, Animation & Painting

So I’m hoping to make “things I’ve been up” to a more regular thing on my blog. It has been pretty hard finding time to write and revise some good useful articles which I’m hoping to post soon. But until then, rather then writing something useful. I figure I’ll just write what I’ve been up to. At least that way this thing gets used and maybe some of the stuff in it may be useful, and/or even interesting!

So what’s been happening recently.

I’ve recently completed Milestone 3 for DeathSpuds. 

This milestone saw the implementation of Enemies which can melee and/or shoot projectiles at the player while moving through a level. The behaviour was a little bit whacky at first, mainly because I tried to condense the melee and Projectile shooting into a single Attack State but it just made it as confusing as the AI was behaving.

I ended up splitting the Melee and Projectile shooting into 2 separate AI States. It made more sense considering the Enemy would either do one or the other or both. And it was easier to determine when to switch between or leave these states by checking per state, rather then all in one.

The enemies also avoid walls now to. The also find a way out when they get backed into a corner.

Enemies that also just specialize in shooting projectile will also maintain there distance, running away when you get to close. Ones that can do melee will move in if you get to close to them. At the moment it’s set to be 3/4 of the closest possible firing distance. I’ll probably end up tweaking this or even making it an available factor in the Unity inspector to get better control over this distance.

This milestone also saw the implementation of enemies spawners, such as enemies spawning from a point and out of the ground. This presented a small problem with Unity’s Mecanim, which is handling all of our animations. It just doesn’t give you much control over using a single Mecanim Animator Controllers which defines the animation behaviour of a character given certain values, at an initial starting state. Forcing you to duplicate the controller file, renaming it, and setting a different starting state.

For example, one of our enemies can spawn out of the ground and also just be standing idly in the scene. But in order to do that, your need to define 2 specific Animator Controllers for the 2 different types of starting states. The controllers are basically identical, accept one has it’s initial starting state as “Idle” and the other as “Spawning”. It would be nice if it were possible to force a particular state onto the animator for purposes such as this.

I know it doesn’t sound like much but imagine making adjustments to one and having to duplicate and set the starting state. Now imagine doing that a hundred times with just minor adjustments over a long period of time. It would get quite annoying.

In all the Enemies are pretty fleshed out and it’s going quite well. I can see some issues popping up which I’ll probably address if and when they arise, such as line of sight  of projectile shooters with enemies blocking the way. But it could just be a matter of making them simply move their position, I doubt it… but here’s to hoping it is.

There was a whole bunch of other things which went in. A lot of which was for to improve performance at run-time for the first level. Which Josh has made to look damn awesome. But I’ll leave it that for now.

Today, I also integrated some core animation components into my flash framework. It hasn’t been much of a priority before because most of what I was doing with flash was being driven by code or physics. Since I’ve been working on point and click / hidden object engine, having a means to control animations and animatable things has become pretty important.

My goal was to have an item you clicked from the scene move themselves into the foreground, and spin and fade into your inventory. I ended up implementing an Animation Manager that let you pass in Animates, basically animations that define a particular behaviour, such as spinning and fading. Basically setting values on this animates and passing it to the Animation Manager will cause the animation to occur.

I also had to make sure that it was pretty easy and straight forward to do for people who may end up using this engine the future. Mainly Elise. The way you use it was kind of inspired by how you use [UIView beginAnimation] in the iOS Core Animation Framework. Of course what I’ve implemented is nothing compared to how Core Animation actually works. But I based my design purely on it’s ease of use, minus the static call.

I’ll most likely be tweaking this over time and adding more features to it and even more animate types but overall I’m pretty happy with how it turned out.

I’ve also been doing some digital painting for the backgrounds in our game.

Point and Click Background 1

Elise did most of the line work for the painting. I’ve just been colouring it in. It’s a work in progress. We’re still working out the final look of some other areas, so some things are likely to change.

And that’s what I’ve been up to lately.