It’s been some time since I’ve posted anything. Not for a lack of trying mind you. I actually started writing a few posts over the past few weeks, but I just didn’t get around to finishing any of those articles. Anyway here’s one now. And enjoy the walking hat animation while you’re at it.
You know, every once in a while you start wondering what your game is going to need to become better or more impressive. Because of that, I took a page from Team Fortress 2 and started working on the implementation of a hat system. ( I’m not kidding by the way ), I intend to add different kinds of hats that people can choose from. Their impact is purely cosmetical for every player for the time being. But they will factor in the new scoring system I’ve come up with.
The idea is simple. “For every hat you carry, you get a point when the round ends”. If you die, you’ll drop your hat , other players can pick up that hat, and if they win the round. They’ll get an extra point for carrying that hat as well.
This will tie in nicely with the knockback system as well. If a player hits you, you’ll be launched and lose the topmost stacked hat on your head. That way players cannot only launch others into the deathball. They’ll also be able to score extra points by doing so. This will incentivise players to wack at eachother as well.
Wether or not you can lose your own hat is still in dispute, as the hat is also an indicator of team colors.
As to why I’ve decided to put some effort in a purely cosmetical issue. There are a few reasons that justifiy it.
First, I wanted to give my game a bit more character. I’m getting really tired of looking at capsules going around waving out their yellow bricks.
Second, because I’m not that accustomed to Unity’s Mecanim system, I wanted to take an intermediate step to learn the ropes and possibly prevent me from having to reconfigure the more complex aspects of say a Rigged Character. Turns out it was a good idea to do this because I bumped my head into a wall while importing the rig from blender as well as setting up animation blending in Mecanim.
Note that the rig is also rather crummy, I’ve used blender’s automatic envelope weights, but they seem to work well enough for what I wanted ( hurray ).
I’ve also taken the liberty of creating ( read: cut/copy/paste and write custom stuff that forms ) a shader that allows me to mask out areas of a texture that can be colored to a player’s color value. So for the hat example. I can change the color of the fabric in game, without changing the color of the leather ring and straps. It’s very ad-hoc, but it really gives the game some much-needed flair.
On a different note, I’ve been playing some portal 2 recently. I’ve made some levels in the editor and want to share some lessons I’ve learned doing that. Actually, I’ve already been working on that post before this one, but I just haven’t finished it. ( It needs some screenshots to make and examples really ). So there’s something to (maybe?) look out for?
PS: I might add in some more images and code. No promises though..