Friday, 15 November 2013

A "Dark Intelligence" - Part Three.

Hi Guys,

Welcome back to my three parter on the evolution of my Power-Up baddies (the hyphen appeared in the game's title when I submitted the game to XBLIG. Appologies for the inconsistency there. Hey, generic sounding titles: we live and learn).

By the end of the last part of this somewhat prolonged insight into Power-Up's enemy creation, I had basically hit the end of the game where it concerns standard enemies. I'd picked up a heck of a lot of tricks and was pretty much ready to pool my resources and apply them to five of the coolest, most visually enticing and distinctive level bosses you ever did see.

It was also a bit of a new chapter in the Power-Up production process on a number of levels. We were hitting December 2012 and having been made redundant from my Artist job of six and a half years (Lead Artist for the last three or so) I was finding it hard to get re-employed. An experience that's increasingly common in the games industry as even the biggest players are forced to make redundancies and re-think their strategies.

A Change In My Mindset...

...For some, long-term redundancy means re-training, for others, giving up on their dream career and stacking shelves once more. I didn't have the money to re-educate myself and I honestly don't think I'd have made it stacking shelves again. I decided to get pro-active... To move out of the back bedroom, and into the bigger, more suitable office room at the back of my house, surrounding myself with some of the more fitting office adhornments that my old employer happened to be getting rid of in the light of a much smaller workforce. This replaced the debris of house moving that had previously surrounded me in the back bedroom and gave me the sense that I was embarking on a career changing move.

I dedicated my mornings to the games industry job-hunt and in the afternoons I switched my attention to finishing Power-Up in the hopes of making a career out of that. I was living on what was left of my savings coupled up with the mortgage protection we'd thankfully had the foresight to take when we bought the house.

On one hand, time was ticking and there was a fire under my backside to get things done before Jo and I found ourselves on the street! ...but on the other hand my allotted time on Power-up had effectively risen from 8 hours a week to 20 and oddly, the overwhelmingly predominant sensation was that of freedom. A fresh start. I felt, for the first time since childhood like the master of my own fate.

...and it was a very good time to face up to the challenge of Power-up's final bosses!
I attacked it with gusto!!

(SPOILER ALERT!! - Want to keep these bosses a mystery? Then stop right there! ...Only venture on if you can't resist a peek).

Guardian 1: The Cleaner - Dreaming in Bosses!

I was on garden-leave over december 2011 which gave me time to get my studio in up and running. It was an arduous process which involved a lot of cleaning out and trips to the tip... and the whole time I was chomping at the bit to get on with Power-Up. It would be a fair understatement to say that I was obsessing over Power-up's bosses.

I'd go to bed at night considering how my first screen filling guardian would need a weakspot and a means of getting you wherever you hid on the screen, and I'd wake up in the morning from a haze of dreams in which a giant spaceship was squeezing me into abstract corners. I'd race to my office at 5AM and start scribbling the sketchy remnants of my dreams and became convinced that as much as I loathed the RAYCraft of previous posts, this was in fact at the core of what was going to become the Chapter 1 boss: The Cleaner.

In lore, The Cleaner was to be a huge garbage disposal unit which fired out a formiddable disintigrating ray, intended to wipe out the debris of a vanquished foe and cover the traces of the battle that took place.

Innitially making one slow forward progression, the Cleaner was to move everso slowly from right to left, giving the player a limited time to defeat it. The boss would charge up a monster white ray at its centre, a great white glow and charging sound effect, building in pitch to act as audio/visual signifiers, warning of the blast to come.

It would be up to the player to navigate up or down in order to dodge that blast, and while both directions offered refuge on the fringes of the great ray, that refuge was a tight space, and dogged by the cleaner's additional aimed-bullet firing cannons. Once the ray was discharged the coast was clear for another volley of shots at the Cleaner's weak spot. This, of course, was the barrel of its deadly ray cannon.

Soon, I realised that the cleaner's constant frontal movement was actually to the detriment of the battle, limiting the duration of the fight and raising minor issues when the great hulk was on screen left and no longer fighting. If it's ploughing relentlessly onward, having filled the screen and taken you out, why would it now reverse back to give you another go. Doesn't sound like much of a big deal here in print but in practice it actually seemed a bit silly.

This grated for a while, until I caved and improved the sequence. After adding the obviously required floaty-wobble (see previous posts), I then had the Cleaner crawl forward while its ray charged. on releasing the shot, I put extra emphasis on the weapon's destructive power by having it actually push the whole titanic Cleaner craft backward and toward screen right. This whole sequence of movements really brought the boss to life and gave it weight, substance and an organic, piloted quality, as though someone was carefully balancing the Cleaner's controls with its firepower.

Getting up close and personal with The Cleaner.

The Cleaner would sink toward the bottom-right of the screen on its defeat, while regular small explosions occurred all over its outer shell as it went, there was no need for multiple parts or multiple instances a-la RAYCraft.

Coupled with the fact that I was a good eight to nine months more experienced, the Cleaner looped its simple, but visually striking attack sequence nicely and went off relatively without a hitch.

Guardian 2: Orbital Defence 01 - The Humanoid Touch.

Since I'd committed to make my own space shooter, One thing I'd noticed was that unlike my own, a lot of these games were developed by shooter/SHMUP enthusiasts. Yes, these guys were developing other stuff, but for the most part, this was their genre and the thing they loved the most. I can relate to that. I sorta felt like that about classic brawlers since I was little.

Also though, I found that the majority of good enthusiast-developed shooters, especially on my chosen format of XBLIG were in the top-down, vertical scrolling sub-genre. What's more, while these games looked GREAT, in my view there was something a little generic in the traditionally Japanese-styled visuals. It's hard to put my finger on why but broadly, I was seeing those subdued metallic colour schemes, with future-computer UIs along with those big, synthesised over the top soundtracks. Don't get me wrong, all of this is brilliant, but it wasn't what I was trying to achieve. I needed to make something that came from my formative experiences as a gamer and developer.

The biggest generic element I noted while taking on bosses on a lot of these games was that each boss seemed to be a gorgeous, but admittedly nondescript spaceship, each with a different arrangement of beautifully complex attack patterns that any purist lover of the genre would truly appreciate. ...But again, this wasn't me, and by my second level boss, I was able to formulate the beginnings of a mission statement:

"Yeah, I've made a boss that would be best described as a massive nondescript spaceship. I'm calling that "The Cleaner"... but from now on, every boss I do is going to have a visual theme all of its own, and the Chapter Two guardian is going to beeeeeeeee......... A GIANT MECH!!"

As the game's story was taking us to the enemy planet's orbit, it seemed fitting that I call the mech Orbital Defence 01... but other than fly onto the screen, I had no idea what OD1 was going to do. I grabbed a sketch book and drew that bad boy.

OD1s attack patterns really came from my innitial scribbles. Instead of hands, I'd given him two very different types of guns. His far hand was some kind of cannon, suitable for firing something large, dangerous and at a slow rate..... ooooh, say, a homing glow-ball mine kind of thing. You know, like the ones I've already made work, while the near hand seemed to be some sort of spinning chain gun end, clearly suited for smaller close bursts of bullets or... hang on, clouds of the aimed bullets that I'd also already sussed out.

Man, this game was writing itself!

That said, just having this guy floating around on screen right and blasting bursts of aimed bullets coupled with the occasional homing glow-ball just didn't seem to cut it. I mean, The Cleaner had pretty much done the same thing but with the added strategic complexity of its charging ray. If anything, this was a slight step back from The Cleaner, and i wasn't having that!

I solved this with the addition of my first "mode" condition. While mode equalled 1, OD1 would indeed alternate its butsts of aimed bullets with the occasional homing glow-ball, forcing the player to dodge and swerve constantly, but when its mode-counter hit a certain duration, OD1's mode would switch to 2.

In mode 2, OD1 would sweep backwards, off screen right, and upon hitting a point off screen, the boss would switch to a flight pose, place itself at a random vertical position, then come screaming, forcefield on, accross the screen. Once off screen left, OD1 would repeat the move in reverse, sweeping from screen left to screen right at a pace that made the movement believeable while not taking so long as to slow down the fight.

Of course, due to the random vertical positioning of OD1 in this mode there was a small chance that the player would simply not have time to swerve to safety and a swift activation of the player's forcefield would be the order of the day, but this understanding took some skill from the player, and that comes with practice. Add to this the probabillity that when OD2 starts sweeping, it'll also leave behind a few rather durable homing glow-balls, and you've got yourself a boss who the experienced player can run circles around but who will probably wipe the floor with you on your first few goes. Oh look. A bit of replay value!

Dodging aimed bullet clouds from Orbital Defense 01.

I was happy with how OD1 had turned out, though it wasn't lost on me that visually, the darned thing had come out as Japanese-influenced as the games I was trying to distinguish myself from. It was basically a dog-legged humanoid Gundam, Guyver kinda thing, and I'd just have to accept it.

...But somewhere in the actual execution of the character, whether in the modelling, the coding, or the extreme use of its image in the indie press, who knows, ironically, the image of Orbital Defence 01 really helped Power-Up to stand out as rather a unique looking shooter experience when placed next to similar games. ...and I'm very proud of that.

Guardian 3: The Worm - Vomiting For My Art

Some peoople can do that thing where they suck air in while making a high pitched screaming monster noise. You know the one. Back in my day, kids in the playground would impersonate Tie-Fighters with alarming accuracy when making that noise. I always wanted to be able to do that. In fact, realising the value of such a sound for the voice of a particularly unpleasant screaming monster-vehicle-robot boss, I almost forgot what happens when I try.

That's right, the Worm started as a sound! I didn't know what I was going to do with it but I knew that the sound of me screeching inwardly would make a great voice for something ugly and monstrous... and so determined was I to have it that I disregarded what was likely to happen if I tried excessively to make that sound.

In a nutshell, I made myself sick! .....but it was worth it!!

Armed with a recording of me making some of the nastiest inward breathing noises on record (not to mention the accompanying bawking and spluttering noises that really, nobody needs to hear), I put my mind to designing some kind of ground dwelling metal monster. Co-incidentally, it was about this time that once again I came accross my old original pixel-popped Power-Up tests from what, 2002? - 2003? Anyway, it seems I'd pixel popped this wierd, coiled up, screen filler of a boss over a desert. It was all angular parts and was curled into some sort of a protective ball, a myriad of guns pointing across at the player.

I had to have it! What's more, I began to imagine what this thing would look like uncloiled... Why, a big, nasty WORM of course! I was inspired! The chapter was the aliens' desert planet, there was even a floor plane to exploit. This thing was perfect!

The next few days were a flurry of creative activity. Working my way around the confines of the chapter's environment and my own coding limitations, I came up with a mountain of possibillities. scrapped some of the less practical ones (though the repeated tail-stabbing up from the floor in random horizontal locations would have been cool in hindsight), and whitteld my way to a sequence that not only worked, but added another level of complexity when compared to the previous boss.

The Worm first appears as an invincible, rumbling hill of churned up dirt, rolling slowly from left to right. It pauses in front of the player, then kicks into its first fight mode, bursting from the ground in an explosion of dirt particles.

As it reaches for the sky, a huge metallic, towering pillar of level guardian, its attention (head) turns to the player. The bullet nodes all along its body kick into action and one long cluster of slow moving aimed bullets becomes its first wave of attack. There are a few techniques for easily dealing with this, but again, it takes a bit of experience to figure them out.

It's worth noting here that my biggest challenge was one of believeabillity, and the element most in the way at this point was this... the screen is scrolling, yet that worm is standing upright, half way out of the hard cracked surface of the planet. It makes no sense! ...until I put a bit of time to giving the impression that the hardened exterior of the worm is actually churning up the ground beneath it with ease. A little adjustment and the rumbling churning earth particles at the Worm's base seemed to sell it nicely, while emphasising the machine's power and purabillity... On to the next attack mode.

Here's where I borrowed from my early pixel-popped design mockup. Turning its attention (head) back up to the sky above it, the Worm now digs slightly downward into the floor before taking off at great speed. It's at this point that the first-time player spots the enormous rattle-like gun tower that is its tail-end, offering an unnerving hint of what's in store... and then its gone, into the sky.

I'd learned by now to give abscent, state-changing guardians a beat to believeably change state, after which, in this case the Worm heaves back down from screen left or screen right (randomly), but slowly enough to give the player time to react to its presence and to position themselves accordingly.

Each of these movements is punctuated by horrible, heavily post-produced monster screams and screeches (the aforementioned me making myself sick), again, this is to inform the player as to what they can expect next as much as it is for ambience.

If the Worm comes down in front, you've a selection of generally frontal-firing weapons at your disposal, if it comes down behind, you can whip out your backshot (provided you've powered it up suitably).

Then comes a barrage of aimed bullets and vertically homing missiles from the Worm's rattle-tail. a particularly potent mix I might add, and a combination that with practice, seriously levels-up a player's natural abillity to use their peripheral vision and to cope with vast numbers of incoming projectiles... essential for the chapters to come.

With a parting volley of tough homing globes, the worm boosts itself up and off to screen left. The player is left with just enough time to despach the homing globes, when the earth starts to rumble and the cycle begins once more.

The Worm tears through the terrain.

Again, this is simply a cyclic approach to a level boss, but this time around, there's definitely something about the left/right randomness in the Worm's flight mode that adds to the tension.

Guardian 4: The Walker - Finally Mastering The Multi-Faceted Baddie.

I suppose it's a bit sad in its way that I only sussed out how to successfully break an enemy up into functioning parts just two baddies away from the end of developing Power-Up. The upshot of that is that this discovery makes the Walker a real stand-out enemy in the game.

I was DETERMINED to draw from the wonderful ED-209, AT-ST armed pod on legs heritage at some point in Power-Up. But let's face it, it was always a given that this guy couldn't be animated as straight frames. As a screen-filling walking enemy, he's just too big, and any reduction in frame count to accommodate his sheer size was always going to result in jerky, unbelieveable rubbish.

I bit another bullet (of many, admittedly) and broke the process down. The first task, even before working out an attack pattern, was to work out which parts needed to be seperated for dare-I-say-it, programmed movement. Again, I started with a drawing of my ideal in action, working out that I'd need x1 body element, x2 legs, an overlay strip to appear to hold the legs on, a front bolt, plus a peek at the back holding strip and perhaps some between legs inner workings.

Once I had all the parts drawing to screen in the right order, I surged The Walker in from behind the player. It was about time a boss attacked from behind and in my mock-up this boss seemed well suited to it.

I treated the main body as the main controller for the Walker's physical movement around the screen. Once it was comfortably on screen, I had the entry mode stop there so that I could work on getting the finer details into its movement.

first, I added the bob of the body. When each leg took a step, the body would need to bob. Then I alternated between two metallic stamping noises at the end of each bob (the sound was me dropping a few pans on the floor in a variety of ways, then messing around with the sound in Adobe Audition). I was now also able to start the Walker off -screen and have it bob its way on, into its start position, fading in the sound of the slamming metal steps as it came. Nice!

Next, I added an extra bob to the near leg, making it arc higher than the body and moving it forward in a trial and error fashion so that it stayed within the confines of the supporting strip in front, then with every alternate bob of the body, the leg would cease to do any bob arc, but instead, slide horizontally back to its starting position in relation to the body.

I had the far leg to the same thing, but moving forward with its extra upward bob while the near leg slid back, giving the impression that the Walker was taking steps.

Then the finer details. The cog followed the front leg's horizontal values, so as to appear vertically static within the front strip, shunting left and right in a piston-like manner.
 Meanwhile, all the extra inner and back parts followed the movement of the body, but sat at their respective draw order in relation to the moving legs. The illusion was complete!

Finally, I had the Walker cycle two modes. Quite simply, it moved to the right of the screen, paused for a bit, then it moved to the left of the screen, paused for a bit... and looped that sequence. This allowed me to get an idea of how well grounded the feet were with the floor... they weren't.

Obviously, in relation to the scrolling of the floor, the Walker's feet were sliding about all over the place. for a few moments I was at a loss as to what I should do about it, but soon I realised that through a combination of adjustments to the Walker's physical movement speed accross the screen and the left/right speed of its legs, I was eventually able to get the Walker grounded. With an appropriate speeding up and slowing down of these variables at the right points, the Walker's  movement had become believeable... Now it was just a case of working out a fight pattern.

Something I noticed with the walker was that in a strictly 2D sense, the machine filled the screen. When it moved from left to right and back again, surely there would be no way to avoid it. However when looked at in the context of the game world, that big chunky body is sat in between two legs. Those legs are situated at the sides of the monster and it doesn't take too much latteral thinking to discover that the player can fly directly between the Walker's legs unharmed. Initially this was something of a happy accident which turned out to be a really effective latteral touch. When I initially demoed the Walker for my Kickstarter audience I got a very positive response from that between-the-legs touch and knew I was onto a winner.

The Walker - A multi-faceted monster.

The Walker's armory was comparitively simple. In my designs, I'd provided it with a huge aimed bullet module that pretty much permanently dispensed aimed bullets. Additionally, when the Walker was stationary on the left or right of the player, it would blast out homing red glow-balls in short bursts, giving the player just enough time to get through the destructible weapons and have a bit of a blast at the Walker itself before the guardian swung into action, shifting again to the player's other side. Throughout this shift, the homing glow-balls would stop, to be replaced with comparitively fast moving, fast repeating, but on balance, highly visible new, larger aimed bullets to shake things up a bit and keep the player on their toes.

While the Walker offers little in complex attack cycles when compared with previous bosses, it does boast some seriously smart little flourishes and plenty of seat-of-the-pants challenge. It was also a bit of a technical victory for me personally and really represents a big step forward in my baddie-coding confidence.

Guardian 5: The Mastermind - Putting A Bit of Yourself Into Your Work.

During production, I'd gradually formed this vision of what the last boss was going to be. As I developed more and more little skills within the confines of coding my game, the possibillities opened up. Recollections of influencial games from my past came-a-calling and one particularly weird and wonderful final boss that sprung to mind was the crazy floating head that came grinning at you in the popular early 90s platform shooter, Midnight Resistance... Well I loved that game and after taking down a host of tanks, planes and generally millitary based opponents, I recall being initially a bit taken aback by the appearance of this surreal and abstract final boss offering. It had just the right level of uncanny to put me off my guard and has stuck with me ever since.

Looking at Power-up, so far I'd bossed-up with a giant ray-ship, a humanoid mech, a monster worm and a big stomping walker. I wanted to complete my collection of distinctive and memorable bosses with my very own angry-face-type final boss! What's more, I wanted it to animate!!

I mocked up a series of sharp toothed giant lizzard/human faces on paper and started painting the monster up in Photoshop. I'd decided to give the boss four waves of attack, each increasing in difficulty, each with its own key facial expression to act as something of a quick reference for the player to monitor their progress with. However, with the size of the sprite and the timescale I'd given myself for the task, I realised I'd need to do something akin to modelling, rendering and post producing spaceship frames. Sure, I could make it in 3D... or I could just play the dude myself.

My fevered little ego liked this idea. It was like facing off against the game's creator on one level... on a more practical level it was a quick way of getting the exact frames I needed so that I could stop wasting days on unecessary art and concentrate on making the boss work! I took out my camera-phone, got myself side on to it, and took the pictures I needed, making the facial expressions myself, then consistently post producing them in Photoshop, I added the lizard skin, sharp teeth and sideways blinking eyes I'd envisaged him with.

It worked a treat, not to mention that it only took a day to do!

I built the rest of the boss' surrounding structure in 3DS max, opting for a closing wall from the rear, combined with a closing top/bottom wall as secondary and tertiary attack modes. This combination would make the use of full powered back and side shots an absolute must in order to get through the fight, and after each cycle of these closing walls, the Mastermind himself would come back at you, stronger, faster and more desperate as you piled the damage onto him.

This really made for edge of the seat stuff. On the harder difficulties those bullet streams became fast and erratic, some coming directly for you while others targeted invisible moving reference points to create some intense and beautifully symetrical patterns... deadly all the same, and a last minute little innovation I was particularly pleased with.

Taking it to the man with the Mastermind.

The Mastermind demands dry palms, 20/20 peripheral vision and a practiced focus that none of its predecessors could compare with. I really threw all of my acquired coding skills at this one. Vertically homing missiles, all-round goming globes, several variations on the aimed bullet, multiple moving parts, forcefields, patterned projectiles and more besides.

Sometimes, to this day, I fight the Mastermind and ponder to myself "How on earth did an unemployed, novice developer like me do THAT??"

And there you have it.

As I said earlier, this piece wasnt about alienating you with my badly written code. It wasn't about showing off, and it wasn't about giving the impression that there's some kind of black art to what I achieved with Power-Up. Compared to most industry professionals, I'm really just a novice, bedroom coder. When it comes to programming games, I'm untrained, unemployed and just doing my level best with the skills I've gleaned from the internet.

Sure, I've got a good sense for how things look and sound, how they're paced and how to generally get them from my head onto the screen, but all of this comes from my love of the medium, and all of it was hard earned by trying and failing, then getting up and trying again. These are all practiced skills, and with practice and a bit of grit when things get tough, anyone can do it.

You might ask why would anyone want to learn to be multi-skilled and independent when they could just get educated and employed?...

It seems we're coming off the back of a time of safe-bet mediocre AAA console titles and safe-bet freemium/pay-to-play mobile experiences designed to accumilate money, often with a disregard for the quality of the gaming experience. People aren't stupid. As players we've become wise to this sort of simplistic manipulation. It's a real turn-off  and end-user faith in my industry is dwindling.

Companies big and small are seeing revenues falling. Redundancies are being made everywhere. Talented people are being lost to other industries and it's been a very bad time for creatives overall, but I for one believe that the old way of doing things isn't the only way.

With my ongoing blog, my hope is that by giving you a quick, brainstormed insight into some of the thought processes, the organisational coping mechanisms, the fun design ideas and the overall gradual improvement in my understanding of how to actually implement this stuff while developing my games, I can help other aspiring game developers who also love games and have an underlying desire to make something good to realise that with a bit of work and yes, plenty of headaches, you can do this stuff too.

Over the next few years, I'd love nothing more than to see a great wave of inspired and inspirational indie games coming from independent, self-empowered people who's first motivation is the love of the games they discovered in their formative years, reviving and evolving video games into something with the magic and electricity of the industry I remember growing up on. What a golden age that would be.

Anyway. That's quite enough of that. Better put that soapbox away before I fall off and hurt myself.

Thanks again for sharing in my development experiences. If you have any thoughts or questions about my work, do drop me a comment or a tweet @psypsoft. Community is quite important to me and I'd love to hear from you about you and your projects too.

See you next time.


Monday, 9 September 2013

A "Dark Intelligence" - Part Two.


So when we left off I'd just started telling you about the processes involved in coming up with the baddies for my game PowerUp. If you remember, I was attacking them in chronological order, my logic being that as my understanding of coding for enemy AI improved, so would the intelligence of my enemies... a logic which, as it happened, more or less made sense.

So where were we?

Well, in looking at the first two Chapters of the game, we've pretty much covered the basics of blind enemy movement around the screen. That's to say enemies who's movement is not based on where you, the player are positioned. Sure, their movement is well paced, gracefully animated and generally makes sense as far as nice solid moving enemy elements should, but the thing is... those early baddies can't see you. They're blind.

And I was sick of em! I wanted baddies that could litteraly challenge me. I wanted baddies that could see!! And that's what was foremost in my head when I started PowerUp Chapter 3. "Cracked Planet".

Enemy: The PINCraft - Pincery, Insecty Squirmy and Smart!

For the most part, I was finding that the process of coding my game was relatively smooth. Generally, As I concocted new and wonderful enemies, I'd just build on the ideas and the code that I'd developed in earlier enemies, twisting things a little perhaps, in the hopes of prompting a change in player tactic and most importantly, a change in optimal player weapon.

As I say, for the most part this was doable by evolving a bit of code I'd already written, saaay, making an enemy's right to left movement speed a bit less predictable by instead of having it initialise with a speed of 3.0, having it initialise with a speed that was randomly between 3.0 and 4.9.

Boom! Immediately, you've got a baddie type with considerably less predictabillity than it's predecessor. Add to that, a vertical floaty-wobble from another previous baddie and you've got something that's more unique still... Finally, add a random directional bullet from yet another predecessor and... you get the idea, right. I was able to swap and change mechanics between enemies.

However, sometimes there were bits of code that I'd have to go looking for... Well, I suppose that applies to almost every bit of code the first time you use it, even when you're in a rythm, you occaasionally need to stop to gather clues on what comes next.

...And that's exactly how it worked with sighted baddies. It sounds simple in theory, but it took me the best part of a four hour coding session to locate the snippets of tutorial and example code I needed in order to find the syntax I required to do what seemed so simple in my head: And in this case, that simple task was to refer to the player's hotizontal and vertical position. It's Vector, if you will.

I'd messed with this stuff when doing the player's movement... I'd familliarised myself further with it all while dealing with baddie movement. But getting one class to refer to another's position, at first was hard work! However, when I cracked it I was like a kid in a sweetshop!

...and to begin with, I applied a bit of code to the creepy looking PINCraft that set it's intelligence a cut above the rest. It said that if the player was above the PINCraft, move the PINCraft slowly up. If the player was below, move it down. Simple, but effective. This had two effects...

Firstly, the PINCraft became that little bit more deadly, or at least, it appeared to. Homing in on the player. Then attacking in huge numbers, the PIN gave the impression of oppression! An overwhelming force that was closing in on the player from in front, above and below. Choking and confining any freedom of movement. .....Ace!

But most importantly, the effective antidote battling to a PIN wave was to switch weapons. There were a lot of PINs, but they were physichally weak. Bullet-power asside, what the player needed was A LOT of bullets, and switching to the fast- repeating Plasma cannon while watching my step, I was soon cutting great gaps through PINCraft assault!

Closing in - In coding the PINCraft's collision, I was careful not to make those splayed pincers collideable with the player. Imagine how impregnable this wave would have been if they were.

But ultimately I had sussed the issue of aiming at the player... or so I thought. As it happens, for a baddie, aiming ones self at the player is one thing, but it turns out that aiming a bullet was something else completely, and something I'd have to face soon enough...

The RATCraft: Biting the Aimed Bullet

I had been pretty determined that when I reached the enemy planet and the dealing with locations that had floors, I'd have to take up the challenge and create a few grounded enemies. Early in the "Cracked Planet" Chapter seemed like a good place to start and my first land dwelling baddie was a heavilly armoured, armadillo-like little ATV called the RATCraft.

It was pretty obvious that a grounded baddie was no threat without the abillity to throw a few projectiles our way and supplying the RATCraft with a handy orb firing tail, I gave it just that abillity.

however, emboldened by my experiences with homing my PINCraft in on the player, I decided not to rest until I had RATCraft aiming it's arsenal directly at the player.

First attempts were thwarted by the simple fact that I hadn't thought this through.

The PINCraft had been written in such a way that it was forever checking its vertical position in relation to that of the player and updating it, constantly homing in.

With the bullets, however, what I actually wanted was for the baddie to aim, shoot and forget. The bullet would then take the trajectory it was sent on, and just go with it... Trying to get a coherent google search out of that one was a bit of a mare, I can tell you!

It took a few nights of searching and blindly tapping possible solutions in before I found something that worked. What I  did note was that the territory I was entering was no longer that of clean cut solutions, of code that you could just copy from a  tutorial and paste into your game, changing graphics, speeds, etc. I was now entering the oblique territory of clues!

...Little bits of code, similar to that which you're looking for, but not quite it. Bits of code that hint at the kind of variables you should be thinking of using, maybe something that alludes to the possibillity that I'd need to acquire the enemy's position as a startPoint, then the player's position as a targetPoint, then work out a line between them just on the frame of the game that spawns the bullet, basing the speed of the bullet on the distance between the two points so that even close up, the player has a chance to see it coming and to move out of the way.

Desert Rats - This term is actually where the RATCraft originally got it's name, but the Armadillo look it ended up with was based on a totally random design scribble I took a particular liking to.

I know that for an experienced, seasoned programmer this is obvious, but for a non mathematically minded sort like me, this was really new territory and the sort of thing I would have attempted simplistic workarounds for on my earlier games... but I had a feeling about PowerUp. The game was worth the extra effort. Not only that, but PowerUp itself now seemed to be pushing me on. Daring me to try new and dangerous ideas.

I stuck with it! ...and after a few more headache-laden coding sessions, I had a bit of code that targeted the player! I did it!!

Feeling cocky, I even used the PIN's position detection code on the RAT. The RAT would come in from the right, driving to the left. On passing the player's horizontal position, it would skid around, 180 degrees and start chasing the player until it was innevitably outrun by the scrolling of the screen.

The RAT's movement was a flourish of the non-necessary kind, but I was determined that it was this sort of flourish that would make my PowerUp baddies stand out as being just that little more alive.

Shades of Red

I was approaching the middle of Chapter three, the halfway point of the game, and became accutely aware that the creation of more and more new baddie types was going to seriously slow down PowerUp's production. The use of more difficult variants of the growing library of enemies at my disposal was becoming a more and more realistic solution here. With my new baddie homing and bullet targeting skills, I resolved to investigate this properly.

Specifically, I revisited the FABCraft, the DEFCraft and even the dreaded RAYCraft!

The new FABCraft variants, or the "RedFAB" were bigger, slower and stronger against the player's firepower. the RedDEF shared similar properties when compared with their earlier predecessors, although now with the abillity to fire off infrequent, aimed shots at the player's ship.

Heat Rising - The inclusion of Red variants of previous PowerUp enemies turned out to be a great way to visually reference the raise the game's difficulty gradient without losing too much time or straight-repeating too many previous enemies.

The RedRAY were small, fast and difficult to take out as they came from the rear and their vulnerable spot was soon protected when their devestating ray weapon charged... much faster thn their predecessor, I might add. The red variants all worked really well in hiking up the pace of play while their familliarity alowed the player some expectation of what was to come. This approach also served to give me some respite from the gruelling task of forever concocting new and time consuming ship models.

...That RedRAY was still a little swine for bugs though!!


Enemy: MisCraft - Almost A Titan.

It was becoming apparent that the PowerUp was getting a bit heavy on the fighters and fighter size/class ships. The BATCraft, DEFCraft and FABCraft (While more of a mine, the current incarnations of FAB were more or less fighter sized) were beginning to outnumber the slow and lumbering forms of the likes of BUSCraft and RAYCraft. Even REDRay was closer to a fighter than a large-class ship.

As I'd started Chapter 3 with some new smaller offerings and proceeded to hurl red variants of familliar ships at the player in it's mid section, I thought it was about time I rolled in one of the big boys... You have to bear in mind that at this point, I'd barely even considered what I was going to do about bosses, so these larger ships were as big as my imagination was currently allowing me to get.

I heaved in the MISCraft. MIS was basically to be a missile launcher. I realised that I'd managed your basic homing capabillities with the PINCraft and was beginning to wonder how well that code would translate to what was essentially an arc-based homing bullet. Of course, the answer to that was that it would translate just fine.

My modelling was speeding up now and after a little break to work on Red ship variants, I was only too eager to get back to a bit of original 3D art. I was also becoming a much tighter, faster modeller of ships, and found myself modelling far fetched but vaguely functional ship parts into MISCraft, the large funnels at its rear would be the source of the ships screen-right to screen-left homing missiles and I particularly took pleasure in dictating the precise starting-source of the missile in relation to the enemy firing it, as opposed to just firing it roughtly from the central area of the baddie as I had with the RedBAT and RedDEF ship classes. The MISCraft had an all together less chaotic, more deliberate feel to it.

At first, MIS also simply moved in from right to left, but I soon came to realise that I could experiment a little with this one. After plenty of earlier encouragement for the player to use their Plasma cannon, what with the weaknesses of the Cleaner, the RAYCraft and the PINCraft, I settled on a mechanic in the MISCraft that would limit the player's use of that particular weapon... A huge flickering lightning-like shield which extended from the front of the ship and spelled instant death on contact with the player. The shield was also long enough that anything but the very highest levels of plasma would simply not breach through to the craft behind.

I had the ship tank it's way on screen then pause for a while with a menacing demeanour while it's missiles swooped off toward the player. I wrote in an extra bit of code which had the missiles count down their vertical speed to zero when changing direction, then count up again when finding the player, giving them the impression of arcing around the player, as though dragging their own weight.

It worked wonderfully, the elasticated flight paths of the homing missiles as they came toward the player, weaving vertically up and down toward their target became a very effective distraction. After they had passed, I left another pause for the player to battle the MISCraft, then if the hulking enemy was still surviving the onslaught, MIS itself would kick its engines in, accellerating toward the player and finally off screen left. Very cool, and ever more complex than what had come before.

Hulking Mass - The MISCraft could take one heck of a pounding and with it's complex shielding and intelligent homing missiles, it was the baddie that really started me thinking about my options for the Titanic level bosses to come.

About now, I was really seeing the benefit of combining a large enemy with a wave of small ones. While a player was able to handle MISCraft on its own, MIS alongside a herald of chaotic, screaming BATCraft became another story completely. With every new enemy or Red enemy variant I was creating, I was also creating another batch of great enemy combination scenarios to play with in my balancing of the game overall.

Enemy: Infantry - Litterally Taking down An Army!

You read that right. Wouldn't that be ace? Just to be able to unleash hell on hundreds of (obviously inherently evil) ground troops using some seriously chunky firepower? Well that was the plan.

I was thinking, "Hang on... All this talk of fighter class ships and titan ships and here we are in Chapter 4, "The Cityplex", essentially one of the enemy species' major cities, and we haven't seen a single ground troop!... Hmm, would they even have ground troops??... This is MY game, and I say of course they would!!"

And do you now what?... They did.

Mountains of em'.... erm, but not so many as to make the wave impassable. That goes without saying though, right? I toned down where I felt I had to and threw a load of very easy to kill, little silhouetted reptile men at the player, earning a mark for violence on XBLIG indie games in the process, but hey-ho. It was SO worth it!

Death from below - While the reptillian soldiers posed little threat on their own, they became a cunning distraction when coupled up with large enemies like the RedBUS.
The soldiers shared the RATCraft's basic left right code and I made adjustments causing them to visibly skid to a halt while aiming at the player ship as it passed overhead, then chasing after it and ultimately, once again being left behind by the game's scrolling. to the trained eye, one soldier alone would have obviously been something of a copy of the RATCraft code, but thirty or forty on a screen at one time was a frantic wave of troops, desperately defending their homeland against an unknown and very powerful assailant.

...It was all quite pretty too.

The soldiers fired off aimed bullets at the player from their little glowing firearms and became particularly treacherous when paired up with bigger threats.

Enemy: BOLTCraft - A Big Baddie That Can See??

It's probably worthy of note that while I was no longer populating with as many unique new ship shapes at this point, between the soldier and the BOLTCraft I had included a great many new Red variants, all exploiting these new tricks.

The BUSCraft and PINCraft had now recieved the Red treatment, improving on their speed, homing senses and aimed firepower while the SLOBot had been upgraded for the smaller, sighted REDBot, equipped with a wicked experimental fast repeating aimed shot that served to spray bullets in deadly squiggly lines across the play area.

It's safe to say that by this point, my two crowning achievements were definitely in creating baddies with the abillity to locate the player's X and Y positions, then adjust it's own position accordingly, and in creating baddie projectiles capable of establishing it's own position and the player's position on being fired, then creating a trajectory between the two... And I was exploiting both of these techniques to the full!

Dodge THIS! - RedBOT sends off a naughty little squiggle of aimed bullets your way as the bullet blasting RedPIN Craft home in on the player.

One thing I was yet to try was in putting these two properties together. That's where the BOLTCraft came in.

By now, I was exhausting the RedCraft available to me so I concluded the fourth chapter with another upgrade... a particularly nasty flurry of new BlackBAT ships. Yes, that's right, The BATCraft had just upgraded a second time and it's level 3 variants were getting really deadly now. Smaller, faster, and firing of irregular successions of aimed bullets at the player, BlackBAT might be weak, but attacking in sudden bursts of great numbers, they were filling the screen with screaming doom in no time and creating slow moving clouds of aimed bullets.

Of course, a nicely powered-up player ship could handle their brittle little frames easily with a well placed round of Spread-Shots... But not when they were joined by the BOLTCraft!!

I was particularly pleased with the physique of the BOLT. It had something of a letter "C" to it's shape, and in the open space at its front, a huge, clearly fatal lightning bolt thing was happening, which matched the resounding characteristic of the previous MISCraft ship.

Like the PIN, the BOLT would move from right to left, aiming vertically toward the player, when it's Horizontal location met that of the player, insterad of turning and chasing as the RATCraft would have done, a surviving BOLTCraft, gave up the chase, fired up its engines and shot off to the left, dignity intact.  (This was actually a characteristic also shared with the pin. Clouds of those things attempting to turn around and chase would not only have made for an undignified display, it would most likely have slowed the Xbox version to a grinding crash).

...However, unlike the PIN, BOLT was slow, lumbering but durable. It also fired aimed bullets in fast succession, essentially providing the player with windows between attacks before a dodge manouvre was required. As an early enemy, it would have been tricky enough on its own, but with waves of angry BlackBAT ships, the ground rules were being set for a higher standard of player.

The first batch of BOLTCraft were to be fair, a little too small to make full use of their frontal lightning feature, but I rectified this with the opening of PowerUp's final chapter, "Into Terranus"...

With it's entourage of BATCraft and RedBAT fighters, the RedBOLT slowly eases into view. In a movement pattern almost identical to it's small predecessor of the precious level, RedBOLT's seemingly only difference is in it's threatening slow approach and its seriously durable armour... and the fact that there only needs to be one of them!

It's only as RedBOLT creeps close that the horrible reality of the situation dawns and as the mighty goliath kicks in its engines, you come to realise that it's too late! If only you'd ignored all those accompanying BATs and focussed your frontal firepower cleanly on the impending RedBOLT.
By now, RedBOLT's sheer size makes it a particularly difficult enemy to evade!

Creeping Death - Under the pressure of a powered up player, RedBOLT bears down regardless. By now I was really getting a feel for how effective Titans would be as bosses.

While it's not a new baddie, I felt that RedBOLT had enough about it that was unique to make it worthy of an exclusive mention within this BOLTCraft section. It seemed that just a shift of size and a few subtle changes to the code were enough in this case, to completely put the emphasis of this enemy on a frantic, against-the-clock, frontal assault!


Enemy: Red GLOWBall - Somewhere between a Baddie and A Bullet.

So, I'd made a baddie that could detect and find your vertical position via the use of detremental integers... You know, that thing I was on about in an earlier blog where when a baddie goes past it's target, it starts taking 1 off it's speed, making for an arc, until it's moving in the opposite direction. Remember?... Right.

Well, in a nutshell, it's the thing that I used in older games when I wanted to make things jump in arcs as opposed to sharp up/down movements... which suck! Anyway, back to the point. This worked well horizontally with RATCraft and the ground troops, and it worked well vertically with PINCraft, BOLTCraft, etc when homing in on the player.

...So it was really just a matter of time before I tried experimenting with something that did this horizontally AND vertically... and what better enemy type for the job than one which, when animating, was non-direction-specific... something that I'd used before maybe... something like a GLOWBall mine??

If you cast your mind back to the previous part, you'll remember that the GLOWBall was a durable enemy from the first level that mostly made for a dodge distraction while taking on other enemies. Well, on Chapter 5, when the player was powered up to a level best described as "Well 'ard", those things popped like baloons when they even vaguely considered coming within a hundred feet of the player's ship.

Sure, they'd be just as deadly when touched, and for that reason would still make a good minor distraction at this point, but what if the real danger came from the much advanced Red versions of them?

The Red GLOWBall enemies were actually similar to the GLOWBalls in art only, at about half the size of their counterpart, the Red variant spawned at a random horizontal position across the screen-top and the screen-bottom, checking it's own horizontal and vertical position in relation to the player's, then it would accellerate toward the player at speed. Upon missing the player ship, Red GLOWBall would then arc to a halt using a countdown of it's speed variable (or a decremental integer), pass zero, then promptly start counting the other way. This would happen for horizontal and vertical movement!

Forcefield at the ready - It's the unnerving beginnings of a massive Red GLOWBall attack.

The result was a rotating GLOWBall mine which soared and wheeled around the player, constantly seeking our hapless ship until one or the other was destroyed. It's destruction would take a few shots of a powered up weapon, prefarably the Side-Shot, but the rate at which these things spawned was to make things difficult for anything less than a level 9 power up, urging the player to start thinking about getting all their guns to a full power of level 10. Pronto!

The Red GLOWBalls turned out to be a simple, but particularly effective enemy, and a bit of white-knuckle fun too.


Enemy: TENTACraft - Only Backshots Can Save Us Now!

It seems that the PINCraft really opened the pandora's box of wierd and freaky baddies, and TENTACraft was to follow in the same vein. While TENTA's head section was a fairly simple spikey-jawed, chomping mouth affair, it's rear section was quite a slick collection of parts which came together to make rather a hypnotic impression that I was very pleased with.

As for it's moves however, TENTA simply came up behind the player, homing slightly as it did and blasting the MISCraft's very own homing missiles at the player's rear end. It was a fighter class ship whose design was based mainly around encouraging the payer to utilize their Back Shot. This was one of those weapons I'd found myself skimping on up to this point in development, so the inclusion of a relatively durable rear-attacking fighter was intended to have the player thinking ahead and powering up accordingly.

...As it happened, this powering up the Back Shot thing wouldn't prove to be too much of a problem as the Chapter four boss I was to concoct later on would really help to fill that gap... but I'm getting ahead of myself.

Watch your back - The Tentacraft's first appearance is supplemented almost immediately with it's Red upgrade!

TENTACraft was joined later in this wave by it's Red variant (We are on the last level after all) which was a slightly larger, stronger, faster version of TENTA. However, instead of firing aimed bullets, Red TENTA loosed the dreaded Red GLOWBall mines, this time as a weapon.

...It was so effective, that this was far from the last time that a Red GLOWBall mine was weaponised. but again, more on that in part 3.

Cranking Up The Nasty

I liked those BlackBAT ships from the end of Chapter 4... and now that I had the core coding skills for some seriously tricky baddies I wanted more level 3 enemies in black. Over the course of the final chapter, great big BlackBUSCraft ships began to make an appearance, free-roaming and barely penetrable, pumping out highly dangerous, slightly-faster-than-expected aimed bullets at a rate which simply refused to allow the player to get into a comfort zone while attempting to pummel the enemy with everything they've got.

Then there was the Black FABCraft, huge variants of the floating bombs with unpredictable firing patterns.

FABCraft by the dozen - Even powered up to the teeth, the stakes get high with these particularly well armoured last-level enemies.

There were also the nasty masses of Black DEFCraft, sweeping by en-masse and dangerously close in their abillity to home in on your location.

Not forgetting the vast armies of Black PINCraft, sticking tightly to your vertical position while unloading in your general direction.

And the sleek BlackBOTs blasting huge, tightly packed lines of aimed bullets, creating walls of floating death, impervious to anything but the perfectly timed activation of a carefully preserved forcefield.

The MISCraft even got one more outing in the form of the REDMis, based on the lightning shield and homing missile combination of it's previous incarnation, this is a seriously well equipped bull of a ship! Even powered up to full, a player stands little chance of taking these down once the accompanying wave of hardcore BlackBAT fighters strike and distract! This places the player repeatedly in tight corners, changing the dynamic of the gameplay once again.

The big guns - Even at full power and cheating my backside off, I stil break a sweat fighting off these guys.

Suffice to say, if you made it this far, you'd be earning your victories!


Enemy: Gun Turret - Just One More Thing...

You're tired, you're battle ravaged! You haven't stopped playing PowerUp for hours now. Look, you need to eat! ...Sleep! Just tear yourself away for sanity's sake..... but, you've made it this far.

Pick yourself up, Pilot! you've still got to run what I lovingly call The Gauntlet!! That's right... a nice long corridor of Gun Turrets! And these aren't just any gun turrets. These bad boys will be changing pace constantly... one moment it's manageable... the next, they're coming at you in fours! Fast-firing and furious, above and below.

...and just when you're getting into a rythm... I crank it to 11 and throw in some more baddies for good measure!


If you make it to that final boss you'll be catching your breath and calming your nerves first least, that's what I have to do, and I designed the flippin' thing!!

Running the Gauntlet - Some sections of the final level would require fast changes between weapons to counter unexpected attacks, all while weaving between Gun Turret bullets!

(Obviously, the last level/Chapter of PowerUp was all about throwing everything, including the kitchen sink at the player, but I was sure to keep it fair. With a bit of practice, you'll be able to do this on Easy... with a bit of skill, you'll manage Meduim too... I won't lie, it's going to take a really good run to beat it in Hard, and as for Psychotic... Let's just say if you make it, please have the cameras running and send me the vid. I'd love to see someone manage that!)



There I was with a game full of enemies. I'd mastered the moving of baddies and bullets around the screen. I'd managed the generation of said bullets and various shot, impact and death effects. I'd even sussed out how to code things to happen in relation to the position and state of other things. Nifty!

By now I'd spent many a sleepless night coming up with the bosses I'd need to do this game justice, ensuring that each and every one was visibly distinguishable from the others and loaded up with it's own brand of bullet-storm.

I was sure that If I were to start at the beginning of the game, and code these things thoughtfully and with the reverence they deserved, starting with the simplest and working my way to the most complex, I'd be able to do them all justice.

.....and I'll tell you all about that next time.

Thanks for following my blog this far guys.
See you in the next one.


Tuesday, 4 June 2013

A "Dark Intelligence" - Part One.

Hello again,

So I'd just like to start by conceding that scripted dialogue is not my strongpoint.

I tried to make a few films back in my student days and they were, let's face it, pretty hammy... pretty bad! Still, I tried and resultantly I learned something about myself... Mainly that I'm better at drawing stuff than writing compelling stories, witty dialogue and believeable characters.

With that in mind I've been writing, re-writing, then RE-re-writing dialogue for my game, PowerUp. I know I'm not particularly good at it... but I've had some practice now, and thanks to that I'm not particularly terrible at it either.

Sure it's all an obvious mishmash of my sci-fi influences, piled up high with every "invasion" cliche in the book... but when PowerUp's HATI (your Holographic Artificial Tactical Intelligence) piped up that there was a "Dark Intelligence" at the heart of our reptillian enemy, it began to dawn on me that I might have a great subject for my next blog.

Let's find out if I was right, eh. Because in today's ramble, I'm going to tell you about...


PowerUp - The Evolution of Enemies

Yep. That's right. I've decided to let you in on snippets of the process I encountered when creating enemies for PowerUp!

I don't mean that I'm going to bore and alienate you with reams of badly-written code (this is my first attempt at a C# game, after all), instead I thought that as I pretty much coded PowerUp chronologically, I'd go through a load of the baddies from beginning to end in the hopes that any fellow aspiring coders, designers, artists, sound technicians and musicians who follow my shenanagans might feel that little bit less intimidated by the seemingly vast complexities of this aspect of making their game.

I can only really speak for my own experience, but once I'd mastered the control mechanics, scrolling backgrounds and pop-up dialogue of my game, I personally became sick to my stomach at the idea of populating PowerUp with challenging and engaging baddies.

I found that coming up with enough variety in visual design and attack style just knocks on to too many of  the game's other facets, which in itself can make it all seem pretty daunting... not to mention the technicallities of actually making it happen! All that said, once I stopped with the panic, broke the workload down and approached it in a calm, realistic manner, I began to see some light at the end of the tunnel.

I also began to see the process for the profoundly fun, rewarding and prolifically creative outpouring that game development is supposed to be, and that the creation of my baddies actually really was.

...That sort of thing is why we wanted to make games in the first place, right?


A Place To Begin

So there I was. My player ship, now universally known as "Weapon-F" worked! She ducked and wheeled around the screen with grace and poise. Her arsenal was formiddable, her finer functionallity all but complete. The environment soared by in thick paralax, jumping to the next silent, abandoned game segment on cue, tracking my progress through the game as I closed in on the empty screenspace that was my first level boss. It was beautiful. It was promising... it was boring!

It was time to bite that bullet and start thinking about baddies!

I generally go quite a while between my blogs, I put most of my time and efforts into the game, so admittedly I forget what I've written in previous blog installations. still, I'm pretty sure that regular followers will remember me mentioning that while PowerUp was inspired by certain classic games I played growing up, my decision to actually try to make PowerUp was mostly inspired by the advice of a good friend and a good tutorial that piqued my interest in creating my own XNA shmup. Alongside basic controls, the tutorial introduced me to the concept of thowing instances of an enemy at the player... Just a simple animating sprite that moved from right to left while the player dodged it, shot it, or was killed by it.

So far I was coping nicely...


Enemy: Space Debris - Non-Sentient Moving Targets

After some head scratching and a spot of umm-ing and aaah-ing, I realised that with a little modification, I could turn this simple tutorial object into something just slightly more complex. I decided I'd start with a bit of space debris, rolling through space from screen right to screen left, but essentially mimicking what I'd learned.

Every second or so, my space debris would spawn another instance of itself, just off the right of the screen. It would then run a rotation animation (yes, animation. there was no mention of rotation in my lessons so I simply didn't have the nerve to even attempt it in code), while updating itself to move a few pixels to its left every frame of the game..... I say a few pixels, but I'd actually learned how to do this in vectors rather than real pixels. Vectors basically allow you to apply a decimal point speed, like say, "1.2" to the baddie rather than telling it how many pixels to move by. believe me, it makes things much easier later on.

Now it was just a question of what happens next... I decided that it I wanted to avoid being overwhelmed, I'd better deal with this enemy one action at a time. I started by looking at what happens when it goes off the left of the screen. The last thing you want is your game to crawl to a crashing halt half way through because over the course of a half-hour play of it, every single baddie is still running its code somewhere off the screen! Obviously, once my debris had reached and exited screen left, it was done with. I removed it without ceremony. Blink. Gone!

Next, it was a question of what happens when the debris collides with the player... Simple! I wanted the player to run its death sequence, and I wanted the enemy to remove itself. I tend to add whatever is needed as and when its needed so it actually wasn't until this point that I wrote the beginnings of the player's death sequence. It began as a take on the arc-up,-then-drop-off-the-screen death of many shmups of the retro era, but then I realised I could maintain a little control over the ship and even do something of a "parthian shot" death! Nice!!... hmm, but I digress and that's probably a story for another blog post. But what was evident was that there would need to be an explosion when player and enemy hit one another.

Adding an explosion was much the same as adding a baddie, except where the baddie was being added on a timer, the explosion was being added on a prompt. Later I went back and garnished my explosions with sparks, chunks and other bits of loveliness, but to start with, I had my explosion. And that was just fine by me.

I gave the debris the same outcome on collision with all of the player's projectile types... quite a time sink which I'm sure there's a better way of doing on my later projects, but in the meantime, a lot of player collision was copied and adapted for all of the player's projectiles, and now the player was able to shoot the debris right out of the sky.

And there it was! A fully functional piece of space debris with all of it's possible outcomes covered. 1. Hit player - remove with a bang and kill player.
2. Hit player's projectiles - remove with a bang and kill player projectile.
3. Bypass both player and bullets and get to the other side fo the screen - remove.

Upon playing the game through I came to realise that things were looking a touch repetitive. At the very least, I needed to add a few different variants of debris to this section of the game. Not only that, but I wanted to give each piece of debris some slightly different qualities of their own. I looked at what variables I had to play with and came to the conclusion that I could change the size, strength and speed of the debris pieces... so I did just that.

I made a few copies of my debris code and after creating a few graphical variants in Photoshop, making a few changes to the size of each debris' collision detection, and fiddling around with that decimal-point speed variable, I was able to forge several more bits of debris. The bigger they got, the slower they moved and the more shots they took to destroy.

Space Debris - as simple as baddies come.

Finally, I topped the attack-wave off with a nice big, tough monster chunk of debris... something of a little sub-boss.

A few of my actual design ideas were beginning to bear fruit, mainly the need for focussed powering-up of the player's weapons... but I'd also seen how once created, a solid bit of code could easily be re-used and adapted for the next enemy.

And that's exactly what I intended to do...


Enemy: The Batcraft - Screaming, but Dim-Witted

For me, the most sleepless nights are caused by two emotional states, accute anxiety, or wild creative excitement. Over the course of PowerUp I've had great cause for both, but for now I was happy to be feeling the pleasurable pangs of the latter.

I had just created a baddie for my game!!

Suddenly it didn't seem like such a black art. The possibillities were opening up and if nothing else, I'd be able to create a game with simple enemies that move in a straight line... not quite what I aspired to but certainly better than nothing, and definitely cause for celebration. Over the course of nights on end I lay awake in the darkness for hours before sleep finally caught up with me, pondering, visualising, reasoning, planning out a potential means for the creation of so many complex enemies.

There was so much that I had absolutely no clue how to do, but my mindset was changing. I was beginning to trust in my future self.

I'd learned this much. I'll learn more... but I was determined not to bite off more than I could chew, and for a while, I stuck firmly to this rule.

With the debris came the beginnings of PowerUp's storyline, and the next logical step for that story included a nice simple, but suitably threatening wave of enemy fighters. I looked to my debris code and made my alterations.

These were the "BATCraft"... and it's probably important to state that there was no complexity, time investment or higher thinking to their concept. They were to look a bit like bats, the name sounded cool, and I wanted to quickly get through the conceptual side of things and into the meat of making it happen.

I scribbled a five minute sketch of a streamlined little cylon-like fighter (that ended up not really looking much like a bat at all), blasted out a model in 3DS Max, textured it, rendered it and applied it to a variant of my space debris code.

Up until now, I'd been drawing everything in Photoshop. I hadn't put much thought into the visual style of PowerUp as I was totally engrossed in learning some coding basics, but now the visuals were naturally surfacing. It was occurring to me that I'd need to rotate some of my ships, and doing that in 2D would be time consuming and much less visually convincing than modelling and rendering my ships in 3D... BATCraft would become my test subject.

So far, the BATCraft was a sliver of a ship, it moved from right to left just as the debris had done. I began to wonder if I could make the BAT do some kind of attack formation... perhaps a barrel roll off the screen or at the player, while showing off it's curves a bit... Yeah!

After a couple of frustrating evenings (I was working as a casual games artist in the day at this point, so PowerUp was getting a few hobby-hours, two evenings a-week), I was just not getting my head around how I was to make the BATs actually aim themselves at the player. "Well, it's early days" I thought. "Maybe I should keep them simpler than that". I did.

Instead of attacking the player directly, which I vowed to make baddies capable of later, I decided to set a mark exactly half way down the play area. The BAT would move slowly on from the right , then at a certain "go" point on the screen, it would assess whether it was above or below that half-way-down mark. If it was above, it would roll down, if it was below, it would roll up.

I did this by having the BAT spawn with a vertical speed (much like the horizontal speed inherited from the debris) of zero. At the "go" point, the BAT would play a firework-style scream and both it's horizontal and vertical speed would start counting. I'm told this is known as an "incremental" or "decrimental variable" depending on whether it counts up or down and while there's much more effective ways of coding its behaviour, apparently it's very good for stuff like jumping or falling through the air when a character is hit... and for a ridiculously naive and self satisfied moment (it turns out you have a lot of those as a beginner in anything), I thought I'd invented it... div!

Anyway, I applied the BAT's newly rendered frames of rotation as the craft counted up (or down)  it's vertical speed and once the BAT was vertically off the screen, I applied the same bit of remove code that I'd done to it's horizontal exit and everything was pretty much tied up.

Screaming stupidity - BATCraft are the kamikaze grunts of the reptile race. At this point, each enemy took about 4 hours to design and model, then another 4 to texture and render. At 8 hours a-week, this constituted a week's work on PowerUp.

It was at this point I noticed the flaw in my BAT-plan... No matter how I fiddled the speed numbers, all of the ships in the wave were attacking one area of the screen. there was always somewhere you could hide in a bid to pretty much avoid any fight whatsoever. The solution was fairly obvious...

I created two more sets of BATs, each with fiddled numbers, each designed to attack areas of the screen in which the player was likely to take refuge. I now had medium range,  long range and short range BATs. I even segmented the attack waves so that the medium range ones attacked first, lulling the player in to a false sense of security, before hitting out with the long and short range assailants.

The overall effect on myself as a player was just as I'd intended... to force a fight. I quickly found myself seeking out my most effective weapon for dealing with BATs and then using it in abundance. again, my weapon-swapping design ideals were being validated nicely in a way that I was capable of manipulating as I created more of PowerUp's enemies.


Enemy: The BUSCraft - "They Came From... Behind!"

I'll leave it for you, the player to discover the best weapon for the job when it comes to the vast majority of my PowerUp baddies, but with some, I make it pretty obvious. Looking at my weapon selection order, the next in line for early demonstration was the Backshot.

As the last of my BATCraft screamed out of view, it occurred to me that a further attack of fighters would look straggly and un-memorable. What the game needed next, was something big and chunky. Something akin to a flying bus... with guns!

I grabbed my sketch book and scribbled up the BUSCraft (no, really. That's what I called it... and that was why).

Another evening's work and I had my BUSCraft modelled, textured and ready to go into the game. A further batch of sleepless nights and I'd pretty much figured out how it was going to work.

This time, instead of spawning screen-right and moving left, I would spawn three on screen-left, in set positions. They'd move slowly right, hang around for a while, then if the player hadn't destroyed them with a flurry of well placed backshots, the BUSes would roll back off to the left. Once off screen, they would remove themselves and the game would carry on.

There were a few complications I hadn't accounted for here. Previous waves had spawned at random vertical positions making for an unpredictable barrage of baddies. That worked for them but these big guys needed to appear in formation, even with slight delays in their appearance if possible. It took a bit of extra work... fiddly work too, but eventually I had little timers going off at the right intervals to make the BUSCraft roll on one at a time, hang around, and roll off...

Next up was to make them a threat and give the player a reason to want them dead!

I was hoping to figure out the mystery of getting baddies to aim for the player at this point, but it just wasn't ready to happen for me, so after losing a few more nights of work to my attempts at it, I looked for an alternative... There's a lot of this sort of compromise early on. Thankfully less and less later.

I decided that if I couldn't aim directly at the player's current position, I'd create a bullet that shoots in say, eight random directions... though mostly forward so that projectiles are more likely to hit the player. I then adjusted the frequency of the BUS's shots to add to the challenge element of this slow and lumbering craft.

It's probably worth noting here that as I hadn't sussed rotation, I opted not to go with line shaped lasers, missiles, or anything like that for my multi-directional bullets. Instead, I created a perfectly round enemy projectile, glowing white for clarity. This way, an enemy bullet would be able to travel in any direction with just one animation and it could rarely be argued that an enemy bullet was unfairly hidden. the round bullet is far from an original concept, but its usefulness is worth a mention, I feel.

I was expecting to be able to move onto my next attack wave, but playing through, there was this wierd sense of static about the BUSCraft. As the three rolled on-screen, they looked oddly robotic and stunted in their movement. Quickly, it dawned on me exactly what was needed to bring these single framed golliaths to life... Floaty-wobble!

Yes, you read that right. These vicious monster-master race types, sent to wipe out humankind in the most brutal unfeeling manner were in desperate need of a bit of floaty-wobble.

Let's say I add one of those incremental integers I mentioned earlier to the vertical position of the BUSCraft... just a little one, that counts up slowly. The count-up might start at -2.0, then count up by 0.01 per frame of the game, passing zero and continuing to count up until it hits 2.0. What we get when we add this number to the BUS' vertical position is the impression that the BUS is jumping slightly, in slow motion. Arcing, if you will.

Now, if we wait until the BUS's vertical floaty-wobble speed hits 2.0 then make it switch to an identical bit of code that tells it to count down from 2.0 to -2.0, we'll get it doing the same slow motion jump thingy, but downward... With me?


Once it's done that, I'd switch it back so that it effectively loops the sequence and Voila!! A nice up/down floaty wobble for the BUSCraft! ...One swift copy of that code and a little adjustment so that it does the same thing horizontally, and before I knew it there were three big BUSCraft floating on the screen in a much more convincing and satisfying manner than I'd even hoped for before.

Things are escallating now: Taking on  multiple enemies with the BUSCraft and some GLOBalls.

Even by now, you can probably see how with each baddie I was adding another bunch of tricks to PowerUp's host of enemies. I'd decided to go chronologically through the game, creating enemies which drew on the skills of the previous enemies while adding a few moves of their own... and it proved to be quite an effective way of going about things.


Enemy: GLOBall - Filling The Cracks

After some prolonged testing with the BUSCraft, I came to realise that the static feeling I'd picked up on before wasn't just coming from the baddies. The linear paths and slow movement of the BUSCrafts' bullets meant that  the player was able to hang around in one place far too readily in order to kill a BUSCraft. It seemed that even at this early stage in the game, the BUSCraft would need some additional distractions to keep the player on their toes a little more.

For this purpose, I concocted the GLOBall. A big, slow, floating mine which spawned ahead of the player and whose toughness against early projectiles put an emphasis on avoidance rather than on attack, this emphasis was made especially potent considering that at this section of the game, the player would be focussed on taking out three BUSCraft with the Backshot!

...It may have looked like an enemy craft, but as far as the code was concerned, the GLOBall was basically a very sturdy piece of space debris which borrowed the floaty-wobble code from the BUSCraft. Alone, it would make for an ineffectual and flatly, boring attack wave, but as an additional distraction for already populated areas of the game, the GLOBall worked a treat and took me out a few times, I don't mind admitting!!


Enemy: HAILCraft - Combining Functionality and Nifty Afterthoughts

So yeah, I'd definitely killed it with that "use-the-backshot, stupid!!" thing when I rolled on those BUSCraft, and now I was getting a taste for variety. I started to turn the first chapter of PowerUp into a quick showcase of the five weapons at your disposal and the next one was to be the Sideshot!

I wanted my next wave of baddies to come from the top and bottom of the screen. I wanted them to make it relatively obvious that you need to find the right weapon. I DID NOT WANT any kind of game slowing dialogue to explain the functionality of your game mechanics. A good game of my era would never stoop t that level. Instead, it would intuitively explain everything you needed to know by encouraging you to think latterally and experiment accordingly...

I sent in the rockets.

I'm sure I don't need to explain how I re-applied the spawning point of the debris to being just off the top/bottom of the screen with a random horizontal position... blah, blah, blah. You get it, right? I took the code I'd learned and adapted. Cool. Let's skip that.

First off the bat, I needed to slow things down! The player needs time to react. The shorter the space before impact, the slower the baddie needs to be. It sounds obvious, but there are a lot of barely playable games out there missing the rule that making an obstacle hard to dodge by simply making it too fast to react to really isn't the way to boost difficulty. First and foremost, you need to make your game fair!

Let's see. My debris was coming from screen right on a screen with 1280 pixels across. Even if we place the player one third of the way into the screen, accounting for where the player would be expected to spend most of their time and giving them ample looking room, we've still got a good 853-ish pixels of screen width for the player to see stuff coming at them.

With a height of 720 pixels and attack waves coming from both the top and the bottom, I was looking at a reaction area of around 360 pixels. that's less than half the warning space, though we do have plenty of horizontal area for those random spawns to happen over.

I'm not going to start doing any maths or anything here. I just wanted to hive you an idea of how different things are when you're spawning from the top and bottom of the screen. The only way to get your game feeling right is to play it... to trial and error the heck out of this stuff. I've worked at places where games are desinged by comittee, sat at a boardroom table with no room for diversion, then are produced without the afterthought they deserve. Then I've worked at places where the games have been crafted and improved as the need arose in an organic, evolutionary process. The latter is always the best way.

...and for the rockets of this section, trial and error was definitely a factor.

There was something that bothered me greatly though... something that shouldn't come up when creating a game like PowerUp, but it was a question of plausibillity: Where were these rockets coming from? Were they remote controlled? Were they floating out of shot, waiting for you to come by? It just didn't look right... and it bothered me!

I put the question to the back of my mind along with plenty of other implausibillities I'd picked up as I went along. Some remained ignored, some really grated on me. It might have been because I came up with this simple little baddie so early on in the game, but this one continuously grated!

...So much so that later on I came all the way back around and created the HAILCraft. Two giant floating arsenals which dwarfed a BUSCraft, heaving in from top and bottom to unleash their rocket-ey badness on you, then like the BUSCraft, at the end of the missile wave, they heaved away.

After I made the obvious further adjustments necessitated by the further loss of looking room, the job was a good un.

The HAILCraft's rockets are easily despached with a few well timed Sideshots: I would generally try to limit coding time for simple enemies like this to about 8 hours each. Another week's work in my 2-nights-a-week of free time.

...but in turn, HAIL was forming another little plausabillity issue at the back of my mind. In a bid to make the source of the rockets a bit more believeable I'd included the HAILCraft. In order to make this attack wave about the rockets and not about the HAIL, I'd put a very distinctive flickering, turquoise forcefield around the HAIL. This made the craft invulnerable, while the rockets were fair game.

As the HAIL was a ship I'd come back to add, the flickering, turquouse force field had already become a staple across the game. It popped up quite a lot as a functional thing, creating challenges for the player in focussing firepower on certain areas of bosses, and avoiding certain types of baddie, rather than shooting at them... The question forming in my mind was this:

"If the enemy forcefield is completely impervious to Weapon-F damage, and if some of the baddies use it... why wouldn't all of the baddies use it?"

A valid question, and I suppose that in terms of the story, the question can be answered by explaining that Weapon-F is a new and particularly powerful Earth-created fighter prototype. Therefore, the enemy would not have prior knowledge of the ship and no time to create specialist, totally shielded ships to counter it.

Alternatively, perhaps the aliens' forcefield tech is particularly rare or risky stuff and will only work under certain conditions.

Ultimately though, it comes down to this... who in their right mind cares? Here I was, wasting precious time trying to come up with a justification for enemy technology. I might as well ask how Weapon-F's reactor core actually works or why the player's ship isn't designed to be already fully powered up at the start of the game. These things are accepted as part of shmup lore. They make for a better game.

So if you're honestly asking yourself stuff like that, and for a while I was too... it just does! It just is! There's a line in plausabillity justification for a game like mine, and I'm drawing it there.

Let's get back to designing cool baddies!


Enemy - RAYCraft - Biting Off More Than I Could Chew


RAYCraft, is it?... I was hoping we could sneak quietly around this one.

See, I knew how to make a wave of baddie instances come and go. I could even get multiple types happening at once, but this early in the game, maybe a multi-part enemy was a little ambitious.

Here's what I wanted to RAYCraft to do...

On it comes, from the right, you know, the old simple right-to-left movement. I created three instances of them too. One that had a slight vertical up movement, one with a bit of down movement and one that went pretty much straight. There were to be generally two or three on the screen at any one time and the vertical movement variants just randomised things a bit. So far, so good.

The RAY was to be all about just that. As it travelled, a big white light would build up at the front of the craft along with a menacing charge-up sound which would climax in a big explosion of light from the front of the ship, crossing the entire horizontal screen and taking out anything it touched.

I won't get too lost in the details as I shudder to remember it, but the ammount of trouble I had getting that glow to stick to the RAY's position, getting it to charge and not influence the other two instances of the RAY, and in getting the actually ray it fired to just flippin behave itself was enough to steal weeks from my meagre development time (two evenings a week, remember?)

Oh, but that's not all... after that there was the casing. See, I wanted RAYCraft to have a sweet-spot. You could kill RAYCraft but you had to focus all your firepower into that light on the front, balancing risk with reward. See? Nice idea... absolute nightmare to implement.

I'd opted to create the RAY itself in two pieces, a front image of the ship in good, working order, and a back image of the ship, horribly battle-scarred, damaged beyond function, but with its forcefield miraculously intact so that while it could no longer shoot, its hulking form still made for a dodge-hazzard... Really, don't ask what I was thinking. At first it all made sense, but I think there was some element of coding compromise there in the end which started raising all those plausibillity questions.

...incidentally, it was also the first baddie I designed to use that accursed flickering turquoise forcefield. Nuff said.

Now throw all that into a big messy baddie and then include that fact that I STILL hadn't figured out how to make a baddie spacially aware and able to recognise the player's position, or for that matter, the position of IT'S OWN PARTS... and you get an idea of how delicate that particular house of cards was.

The infamous RAYCraft looks deceptively sturdy, but was an exception to my 1-week rule, taking closer to 3 weeks to iron out the worst of the kinks. It was months until I was able to consider this one "stable".

The RAYCraft was a baddie, figuratively held together with sticky tape. It's amazing that it actually works as anything other than a harsh, long winded lesson in humillity.

Let's never speak of it again!


End of Level... Whatnow??

Shaken to my core by my experiences with multi-faceted baddies, I decided to skip over the boss. My reasoning was that if the RAYCraft was such a shambles, who knows what a mess I'd make of an attempt to create a level boss.

I decided that instead, I'd leave gaps for bosses and finish the bulk of the game, hopefully while gaining some much needed experience in making baddies and their AI. Then, when I came back around for the boss cycle, I'd have some good Boss ideas and the means to make them happen... It was a good call. I wasn't wrong about that.


Enemy: DEFCraft - Back to Basics

So it's fair to admit that my pride was somewhat wobbly when I hit the second Chapter of PowerUp. I'd lost weeks to that RAYCraft and I wasn't convinced that I'd ever fully understand the tight and tangled knot that was it's code.

For the sake of my own confidence, I needed to do some fighters! Stat!! Some simple, stupid, but noteably, rewardingly different fighters. I went back to my 5 minute sketches and within a couple of evenings I'd modelled, textured and rendered the slick and deadly DEFCraft. At least my design and modelling was becoming a reliable, textbook process.

I wanted to start the Second Chapter by again, excercising the player's Backshot projectiles so I spawned the DEFCraft accordingly. At first it sort of worked, but then I found that the random vertical positioning of the DEFs, coupled with their speed actually made the sideshot a more valuable weapon here... Still, targeting DEFCraft was fun, and when I decided to have the DEFs double back with a decremental swing and a cool little rotation animation, they became more fun still.

After the swing, I even added a little random up or down movement which made them a little less predictable and I suddenly found myself with a particularly nice fighter for accompanying larger, bulkier ships.

A change of scene had blown out the cobwebs and now, with the DEFCraft, I was starting to have fun again.


A Pause for Re-evaluation

Now, I'd lost so much time to the RAYCraft that I was beginning to wonder if I should keep all the normal baddies simple like the DEF to cut down on the risk of the project running away with itself. I wanted the game done by Spring/Summer 2013 and after a bit of rough scheduling it was becoming clear that in order to meet the deadline I'd imposed (basically, when our money was due to run out as things were looking dicey with my day-job), I'd have to cut down on either the overall ammount of ships or on doing difficult, experimental ships.

I settled for a compromise. Instead of going all out as I had with the RAY, I'd try to innovate within my comfort zone, bearing in mind that I'd need to keep my boss designs within the skill sets I'd have learned by the time I reached those bosses, so some push was necessarry.

On the other hand, instead of completely culling the enemies and repeating the same ones in angrier patterns, I decided I'd keep repetition to a minimum, committing to create a few completely new ships per level.

The real solution presented in this compromise was that in place of making too many new ships, I would create a RED type and a BLACK type of previously designed and coded ships. These would be introduced throughout the game alongside the completely new designs and would add new attributes to the current standard versions.

For example, a RedBAT might shoot a straight forward bullet before it takes off into it's "go" routine. I'd also increase their spawn rate, speed, durabillity, etc to match up to the player's weapon power by that point in the game. This would all combine to make RedBAT a bit more deadly than it's standard counterpart.

Then a BlackBAT might ramp up the odds further still. Appearing later in the game, a black bat might be tougher, smaller, faster, stronger, and capable of firing aimed shots at the player... If I ever figured out how to actually make that happen... Up to now, I still hadn't.

Still, things were getting back on track. I had something of a plan and it was time to put it into action...


Enemy: FABCraft - More Simple... but Effective

Despite the campy name, I really wanted something in a floating, automated bomb. Something that looked different to the bulky BUSs and RAYs, but nothing like the streamlined fighter style of the BATs and DEFs. I had a nice visual motif scribbled out for the FABCraft. Something of a spinning umberella with a camera-laden engine compartment underneath. Something that edged slowly upscreen but was tough to kill and spawned en masse.

I wanted early appearances of the FABCraft to give the player the impression of being pushed upward into a tight space, to put the pressure on the player to focus their firepower on clearing a path before taking a breath. In impact, I wanted the FAB to have a slightly startling explosion, bigger than it's smallish stature gave credit for... after all, it was a essentially a bomb!

All of this came together well and this very simple enemy actually made for a nice change of pace. After a bit of balance in the FABCraft's spawn rate, speed and durabillity, I was able to introduce other enemies with it, making for a nice fight that turned up the heat slightly as Chapter 2 progressed.

The pressure was on with the explosive, and rather hypnotic, rotating FABCraft.

Again, Red variants and later, Black variants of the FABCraft made for very effective advances on this particular baddie design.


Enemy: SLOBot - The Last "Blind" Baddie?

As Chapter 2 unfolded, I went for combinations of the above enemies and began to introduce their more dangerous Red variants, but I did save one new baddie for the end. Again, fairly simple in design, the SLOBot sported another unique look. This time, instead of a ship, SLO was... well, a bot, and yes, there's definitely something of Atomic Robo-Kid to his design.

Even so, I was still shying away from ambition and had decided that any attempts at my next logical progression: identifying the player's current position and acting accordingly, would not take place until at least chapter 3.

SLOBot may be slow, simple and utterly blind to the position of the player, but with a little code-play, I managed to achieve something of a nice unpredictable, random fire rate in three set directions which made SLOBot somewhat dangerous. Add to this, the bullet offsets caused by his more intense floaty-wobble, and a wave of raging RedBATs from behind, and the difficulty level was feeling about right for this point in the game.

By the time I was done with the SLOBot, I was again feeling the urge to push my boundaries, push my luck and make something that could actually "see" you.


But Still...

...I was feeling a little anxious. I really needed to start pushing for more intelligence in the next level. I scoured my sketchbook for an enemy design that said "Evil", "Intelligent", "Intimidating", and found it in the form of what was to become the PINCraft.

If I could make this ugly little critter smart enough to see the player, then in Chapter 3 things would really kick off!


To be continued...