Steaming Puppy pumps cool hot turrets!

Here’s an example of the colouring system we’re using in Titan Attacks 2 – Revenge of the Titans. In this case as applied to a cooling tower, a player building that cools down your overheating turrets. It’s a common problem. Building a load of these little fellas nearby though can increase their fire rate.

Here we have the cooling tower as it looks with colours applied in two schemes – night and desert. On the left we have the Colour Diddler which lets us fidddle away with the level palettes as the game is running. Neat eh?

So how this all work then?

The cooling tower is a collection of static sprites, animated sprites and emitters. The sprites, mostly white, can be coloured by the level palettes, and then this colour is affected by an attenuation colour and % the further from the center of the level they are – black in the case of the nighttime level, and a subtle red tint for the desert level colour scheme. Here’s the various sprites…

First of all we have the base. This defines the bounds of the building making it easier to tell where the player can build things and distinguishes player buildings from other stuff going on. All buildings and monsters and trees and things are drawn from the front, but the map is actually viewed from above which is perhaps a bit of an odd way to do things, but it’s a lot easier to draw poo like that. The next sprite, the shadow, also helps in making the flat front-on sprite look like it’s sitting on the ground and not just floating about in space.

That little black rectangle sits behind the main sprite animation. Inbetween these is an emitter that pumps out steam. This way the steam looks more like it’s coming out of the cooling tower rather than just from behind it. It’s hardly noticeable really. Maybe got a bit carried away there.

The main sprite, unlike the others, has two colours applied to it – a top and a bottom colour – applied as a gradient to the sprite. The top colour is specific to buildings, and the bottom is a general ‘floor fog’ colour which is applied to almost everything – buildings and monsters and trees etc. This helps in the illusion of the flat building existing in the world space wotsit. It also means if buildings overlap vertically there will be a bit of colour difference between them, making it easier to tell them apart.

Next up is the overlay sprite – this is about 50% transparent and is not affected by the level’s attenuation, meaning it’ll seem like it’s a bit glowy or reflective. Then finally on top of all that is the little glowing light animation that is synched up with the pumpy animation of the tower and the steam emitter. This sprite is neither coloured nor affected by the attenuation colour, so it’s always going to be a bright orangey red light thang.

…and if you’re really interested or just having trouble sleeping here’s how the cooling tower appearance is defined in xml…

<sprite layer="4" sublayer="1" colored="floor" attenuated="true" image="spriteimage.generic.2x2.base.01"/>
<sprite layer="4" sublayer="2" colored="shadow" attenuated="true" image="spriteimage.generic.cooling.ground.01"/>
<sprite layer="5" sublayer="1" colored="buildings" attenuated="true" animation="generic.cooling.back.animation"/>
<emitter offset="25,0" emitter="steam.burst.emitter"/>
<sprite layer="5" sublayer="3" bottomColored="floor-fog" topColored="buildings" attenuated="true" animation="generic.cooling.animation"/>
<sprite layer="5" sublayer="4" colored="buildings-alt" attenuated="false" animation=""/>
<sprite layer="5" sublayer="5" animation="generic.cooling.glow.animation"/>

Phew. Any questions? Anyone still awake?

12 thoughts on 'Steaming Puppy pumps cool hot turrets!'

  1. RoboSheep – well maybe Xmas, but only if you’ve been good.

    Simon – I had a quick look at making a gif but it gets a bit complex combining the different animations and getting the timing right. They’ll be a new video soonish tho, once I’ve got GUIs done.

  2. No thoughts on patents :) But the Diddler has just gotten a whole lot more powerful – every colour in the game can be now be updated in realtime with the sliders, and I’ved added an alpha slider too. If he were slightly more incontinent than he already is, Chaz would be wetting himself.

  3. That’s cool, you guys really pay a lot of attention to detail. How did you do the colour diddler, with Swing/AWT or some other GUI library?

  4. The diddler’s just ordinary Swing. Well, almost ordinary, it’s got the Alloy look ‘n’ feel. We have a particle diddler too – Chaz might do an article about particles if you ask him nicely :)

    Treasure Tomb is on indefinite hold. It was taking a lot of effort and we suspected that no-one was going to buy it, so we took the code and made a simpler game (Droid Assault) from it in the hope that someone would buy that… and no-one did. Monster Mash we just couldn’t quite put down though, and behold! It has become Revenge of the Titans. And no-one’s going to buy it either, but we don’t care! … er… actually we do care. Lots.

  5. Ok lets make a new name for this, to ask to see a particle diddler is a bit rude in my opinion lol. But it’d be great to hear about the particle effects

Comments are closed.