Gaming Your Way

May contain nuts.

The good, the bad, the ugly ...

long time no post (but Squize has pretty much made it needless).

What happened so far ...

After a few days off from nearly everything except gaming (on my new shiny plasma) I finally got back to work on Calisto Eclipse. I decided to go the hard way and rewrite most of the menu code (before I even started coding on the game) and ended up with something I might just call the "ScreenFramework".

Basically I usually use the same style for coding:
1st there's a Singleton main controler class through which I can access all the low level stuff, because I hate having to post around references or "crosslink" classes.
This class also provides access to the ScreenFramework (name might change to something catchy), the SF class allows an easy way of switching screens using a predifined "transition".

So to get from "mcScreenMenu" (currently active) to "mcScreenMedal", it's just this (pseudo code):
SF.showScreen("mcScreenMedal", [optional transition code to use]);

... attach the new screen, perform transition, remove the old screen

All screens are "self contained" so before removing them I call the "dispose" method (did I mention that all screens use the SimpleScreen interface?), which cleans the mess the screen has caused in memory and might set a few things in the controler class.

As Calisto is also the testbed for another project we have been tinkering with for a while, it's not just developing the game but also a lot of backend server stuff, which is a pitty, because I really would like to share a good deal more of the development process for CE (although, after having the screen handling nailed I might just show that for the sake of it).


Thinking of catchy titles is getting harder. See what I mean ?


More in the world of X++

The final power-up, the pulse weapon, is in now. It's a big old powerful shot, slow to move, slow to reload, but two hits from that and anything is dead.
To try and make it bigger and give it a bit more wow, I've used the particles playfield too. The particles are just little images ( Not pixels, they look too small, and it's something a lot of Flash GWars style games do, either that or they add a big ol' blur effect onto them. Neither being very nice ) which are blitted into a canvas bitmap.
Every couple of frames I run a colorMatrixFilter on that bitmap canvas to fade the alpha down, all straight forward stuff we've all been doing since F8 came along.

With the pulse I just draw() it's image into the canvas bitmap so it creates a trail / thickens it up ( For want of a better term ). Draw() is a bit costly, but I'm only ever running at most 10 pulse bullets at once ( They were always going to be slow to reload, that's why I figured I could get away with doing this extra trail effect ).
I'm really happy with it, it's in keeping with the very glowy nature of the game. BlendMode.ADD is the best thing to happen to Flash for a long time.

Once that was all in and working I did even more tweaking to the difficulty curve, the flockers now get nastier as you go, which is based both on the current level and the number of lives you have left ( If you're not doing so well there's no need to make it even harder ).

Then back to the power-ups again, and the space bar now swaps between them, which works a treat.

It's all going to plan so far, and seeing how we're on what, around 12 ( Full days ) development time, it's pretty good. It'll be nice to add the final baddie type ( Did someone say bullet hell ? ) and then the biggest thing should be the sound, which I'm a little concerned about 'cause there's a lot of things going on, and it'll be easy to just overwhelm the player with sound and make it really jar. Some thought is going to need to go into that.
From there we're looking at presentational issues and then bugs, love and play testing.


Big update / big bugs

Things didn't work out as planned today, and I've spent most of the day hitting X again.

I think this is going to be pretty brief as it's just gone 2:50 am and I'm pretty dead on my feet. Main changes are the asteroids now use the bitmap technique as mentioned in the last blog ( Not final images, and the way they animate shows up the circle to circle collision checks quite badly, the final images will animate in such a way as to hide that ), the baddies drop an icon which can be shot to select your power-up ( Again placeholders. The final images will be a lot more colour coded to make it much easier ).

I've decided after a long think today, and some great ideas posted in yesterdays comments ( Vex, didn't reply there mate, but I really liked your timer based idea, but I think for a web game I have to strip away complications as much as possible. Too tired to go into depth right now why that idea could be complicated, bug me in the comments if you really want me to justify it  ), I've opted for something quite straight forward.
A power-up icon is dropped after killing 20 baddies. You can shoot it to change it to a power-up you want, and then collect it. Every time you collect one you boost it's power ( Shown by the 3 new indicators at the bottom left ). Tomorrow ( Today ) I'll add the option to press space to change what power-up you're currently using ( Space was being reserved for a possible smart bomb, but I figure the player is going to have enough fire power as it is ).
Also the pulse weapon hasn't been coded yet, so collecting the icon with a little star on will break things. Not every build I post was going to be nice and neat I'm afraid.

I've also played with the difficulty curve a bit, and it's coming together a lot more. I've got at least one more baddie type in mind, maybe two ( And a third has just come to mind, but I've got to draw a line somewhere ), and then I should really be able to have a big push to finalise when things are triggered, how many shots they take to kill, how much energy you lose etc.
Also the asteroids themselves may drop point based collectables, as there's no combo system in this game, and I do want to give the player an incentive to move rather than just spin on the spot.

Despite my bloodshot eyes it's coming together nicely now, I'm finally starting to get a real feel for how I want it to play. A couple more days of giving it a really big push and we should be looking at something a lot more final.


I can't believe the w/end is almost over already

I'm starting a reskin of the bowling game I was working on last year ( Working on a reskin of a game which isn't even live yet, that's weird ) tomorrow, the holidays are over so I've spent a good couple of hours this weekend working on X whilst I've still got time / energy.

Some minor things to start with... the credits have been updated slightly to reflect your input, there's a new section on the title screen called "Notes", which is basically just this blog repeated there. In an ideal world there would be a nice audio commentary but that would take an insane amount of bandwidth, so this is the next best thing ( Maybe a youTube clip with developers commentary at a later date ? )
It's a nice touch and isn't hard to do. It needs some love as I'm not a 100% happy with the presentation ( It's annoying that it's height > 2880 pixels, which means I can't cacheAsBitmap, which in turns means I can't use a gradient mask on it ), but I think it adds to the game overall.

Next up, the explosions are in their final state. Shoved into tilesheets and dropped onto the stage by directly adding the bitmap ( Rather than using a sprite or mc as a container for that bitmap ), which is a sweet tip that Pany posted here. They're animated by using scrollRect ( To just show a small "window" of the tilesheet ) and look pretty damn good. I've got to convert the player's explosion frames to a tilesheet ( It's painfully boring ), but I'm still mulling over exactly how to blow the player up, so that can be put on hold for a little while.

Along with doing the explosion tilesheets FireWorks was fired up and a lot of the existing final images were compressed as 8bit pngs, which dropped the filesize down a bit.

The homing missiles have been optimised too, seeing how no one flagged up any issues with them from the other build it wasn't really needed but it all helps.

Finally, the first baddie type is in. Nice and small "Flockers", which strangely enough are exactly the same as the Flockers in Orbs. Weird that.

They teleport in waves of 5 in a circle, and I'm pleased with them. I need to tweak triggering the player's shield if they teleport in on you, but aside from that they're pretty much done. Oh, the images are place holders before anyone asks.
( Also as I've stressed before over and over, the game play balance isn't done yet. So some levels you'll have cleared all the asteroids and just be sitting there waiting for the baddie waves to appear, other times all the waves will have been destroyed long before you manage to kill the remaining asteroids etc. ).

A good productive weekend for me, as you can see on the X Dev page.

Next up a bit of a tricky one, ideas are more than welcome. I need to allow the player to get power-ups one way or another.
My current thought is to just level up the power-up every level ( The power-ups will all max out at level 5 ), but I'm going to have 3 different types ( Spray, missiles and another one I've not quite sorted out in my head yet ). So how would the player pick which power-up to use ( The mouse wheel would be nice, but then Mac owners are left out in the cold ) ? I'm still in two minds about having a smart bomb, which means the space bar would be used for that.
My original thoughts were to have power-up icons dropped like in Polarity, and the player can shoot them to change the type before collecting them ( Think of the old 19xx shooters ). Perhaps that's the way to go, and just level up the weapon every, or every other, level.

I'm loathe to have a shop in there were you can buy upgrades to your power-ups. It's a lot of extra code and design, and will break the flow. This isn't a game of strategy and missions, it's pure score attack. Even with a shop, it would mean the baddies / asteroids dropping credits for the player to collect, and then there would still be the issue of being able to select the power-up you want to use.

The old style collecting tokens and then selecting a power-up from a list is out ( Nemesis and it's sequels ) because there just isn't the real estate on the screen for a list.

I need to play some old shooters and have a think, but really if you have any ideas please comment me up.


Homing Missile - Power-Up!

There's a newly posted update on the XDev page.

This isn't really a "I did all this last night" build, it's what I've squeezed in during the holidays, and is I guess around 8/10 hours work in total, so counts as a 1 day-ish. I'm not trying to be totally anal about how long each build takes.

Now I've actually got to remember what I did. The first main thing I managed to drop in there was the asteroids bouncing off each other. The small ones ignore each other as I think it'll be far too cpu tasking, and too much of a head fuck to be honest ( It'd be like pinball with 30 balls ).
It all seems to work quite nicely, it's pretty subtle, you've got to be watching for it, but I know it's doing it and that's enough for me.

In saying that, I think on later levels ( Level 6 seems to be the first real "kick off" level, around that level it feels pretty sweet ) I may have to drop the checks, or at least test for the number of objects running and skip them when there are too many to test.

Next up I added the "waves". Basically, not all rocks come at you at the same time, there's a trigger point where extra ones will be released. This will need some balancing ( Like all the gameplay, which for me is a long way from being done ) when the baddies are in there.

I guess the biggest thing, in terms of the blog title anyway, is the power-ups. Firstly I added the spray power-up ( I don't think I'm going to stick with that name, it conjures up images of dogs and lamp posts ) which is your standard weapon, plus friends. It looks really good when you've maxed it out at [ Weapon ] level 5.
For all the power-ups there's give and take. For example with the spray power-up, yeah you get 5 shots at once, but the reload time is increased to try and balance that out. It helps me as the coder because it means the games not running as many bullets as it would be if I didn't increase the reload time and will also hopefully bring some balance to the game ( If you max out your power-ups and you're as hard as hell, how do you still make the game fun ? Do you make the baddies that before died with one shot now take 5 shots to keep the challenge going ? If that's the case, you've not actually got a useful power-up, you've just got more sprites on screen. Do you increase the sheer volume of baddies ? Then you could slip into a grind if their easy to kill. It's always a tricky tricky problem ).

The spray PuP didn't take too long, so I moved onto the homing missiles ( Which I knew would ). I've optimised these quite heavily already, but I still think with 4/5 running with a lot of objects there's a performance hit, and that's why I've left them unlocked and maxed out in the current build, so if anyone whose got two mins could give the game a quick play ( 'til around that magic level 6 would be good ) and feedback on their performance and specs that would be great.
If they are generally running crap for everyone ( Fine here, but quad core machine. This baby could run seti@home on it's own, so testing a swf in a realistic enviroment is tricky at times ) then I've still got some ideas to try and claw back some speed whilst still keeping the same look to them.


I'll pass on that Turkey sandwich thanks

We're back, hurray!

Hope you all had a good Christmas and got lots of new things to play with ( Left 4 Dead was the best thing Santa gave me, it's the best marriage of "proper game" and multi-player I've ever ever seen. Everyone is going to copy that soon and just ditch the single player mode all together ).

I'm still in a holiday frame of mind, so the posts here may be sporadic as I alternate between working, and eating crap food / watching tv ( I think Olli's the same too ).

There's a new update to X. This is more of a "presentation" build, where I just can't be bothered to try and code anything clever.

The pause mode is in, which is always a nice thing to have done. To try and make it less drab, there's a bit of eye-candy in there, which is a Lorenz Attractor and was ported to as3 from the code at the always excellent Levitated ( I had played with this a couple of weeks ago using setPixel, and just wasn't happy with the results. Rather than let it go to waste I used the bubbles from the depth of field vector effect in 651 and a bit of blur and the add blendmode along with the old faithful infinite bob effect, and it looks ok-ish now. One thought that came to me was the code may be handy for running some types of baddies, could be quite a nice movement pattern and wouldn't require me to think of any more code ).
One thing is that I don't kill the animation during pause, so asteroids keep spinning, explosions keep exploding. This is because the use of movieclips is only a temporary measure, I'm going to wait til we've got final assets before ripping that code out and using tilesheets instead.

The other major chunk of work done is the stats / medals. The medals needs some images drawing for them, and then code to actually trigger them in-game, but all the internal guts is in there. The stats I think are done now, which is cool. Just don't get too attached to them, as every new build will reset them.
I've also added some stats to the level complete section ( I've been brainwashed waiting for things to load on the 360, where they display tips / stats to help you forget you're waiting ) which I'm really happy with.

Following on from a comment from Tonypa, the current level is now displayed, and a level progress bar. I've noticed a lot of casual games show the level progress ( Zuma, Luxor2 etc. ) and it's a simple nice thing to have. It's maybe not that useful now, but perhaps if the asteroids were to come in waves later in the game ( That's a clue btw ) ?


That game I've been working on, well, it's a game now.

Always a great milestone, when you can play a game, complete a level, die x number of times, read "Game Over" and start it all again.

This to me is when a game is a game, and X(++) has just reached that sexy milestone. Ok, it's not a great game yet, it needs a lot of balancing, and it needs some fun desperately, but it's a game.

Adding the asteroid to player collisions was pretty straight forward, just simple circle to circle checks. I wanted the player to be forced away from the impact, and it works quite nicely. Seeing how the code was written, I used the same bounce code again for when you're shooting an asteroid ( So your bullets actually push the asteroids away slightly ).
It's a little bit weird shooting an asteroid via the screen wrap, as you kind of suck it back towards you, but hopefully shouldn't be too much of a pain to fix.

Next up was making the energy bar decrease. Simple code. Looks nice. Just how code always should be. After that the next logical step was to blow the player up. It's a movieclip, it doesn't get any more straight forward.
That left me with the issue of what to do with the asteroids still on screen, and as I've done in what feels like far too many games, I've added a heat shimmer / wave to the explosion, which blows up all the rocks as it grows.

Another nice simple solution ( I'm not trying to get a rocket into space here ).

From there, it's not much more than


And we've got a game. Sweet.

I don't know how much work I've got in me before Christmas, a couple of days off eating like it's my last day on earth and sitting in front of the tv sounds just perfect right now. Even if I don't do anything tomorrow, we've got a really great guest article to post up, which we're really excited about.
It's nice and apt for this time of year too, I mean Zombies are good all year around aren't they ?


Procedurally generated backgrounds ?

Look at me using a term that'll be a hit with the search engines.

What's been happening in the world of X++ today then ? Very very little.

It's not for the want of trying, it's just been one of those days. Yesterday after posting I ran the game through the profiler as I wasn't happy with the performance, and I wanted to see what was being nasty.

It turned out it was the skybox. Lots and lots of calls to papervision classes, and they were taking the vast majority of the actual game's run time. I've had to remove the planet effect I really loved 'cause of performance, am I going to have to do the same with the skybox ?


Annoying as hell, but I can't let the game suffer for the background. If I've made the game good enough you shouldn't even be checking the background anyway, so losing a little bit of love isn't the end of the world. So so annoying though, what the hell can we use 3D in-game for if a couple of spheres make it gag ?

Today was meant to be the asteroids > player collisions, with the plan that you'd lose energy and therefore lose a life, and eventually lead to a game over. Once that's in, the game is a complete game, until then it's just a demo.

First step on this road was designing an energy bar. Firstly I wanted a lcd style display around the lives, where each element would "power-down" as you take a hit. Tried it, and it look toilet. Next was a plan about having some sort of arc around the lives and use a mask to show the energy being reduced. I just couldn't even face starting to design that, as I just knew I didn't have much art in me today. Next up was a simple bar effect, inspired by Wipeout Pulse's speedometer.
Looked crap. All the blend mode effects I tried on the score / lives numbers also looked crap.

Some days you could make Angelina Jolie look bad.

In desperation I ripped the energy bar out of Orbs and tinted it. Looks great. There's nothing especially creative about stealing ideas from yourself, but that's the way it goes some days.

After that, the collisions and all that goodness weren't really going to happen, my spirit has been broken. So instead, it was time to sort out the backgrounds after removing the moving skybox.
Without any movement I figured the way to go was to try and make them look as good as possible, like each one is a bitmap done in an art package, and yet make them random every time ( "Procedurally generated backgrounds" makes a much better heading than "Random backgrounds", and to be fair, I think the backgrounds are slightly more than just random ).

The 3D planet is used from the other day, it's spun on it's axis' so you're always looking at a random part of the planet texture, it's z value is also randomised for scaling, and I move the light source around slightly for the phong shader. Also another smaller planet is created, although it's not always shown.
After that, the skybox is spun around too.

We then grab that skybox and plot it into a bitmap ( ie, draw() ), on top of that is another bitmap with our planet(s) in. Depending on the size of the planet we add a blurFilter, a glowFilter and we tint it.

I really don't know what the odds of having two identical backgrounds are, they must really be vast, and aside from the odd "not as good as I would like" looking levels, for the most part I'm really pleased with how they look.

And... I think that's it til Monday, have a good weekend everyone,



The subject title is both the longest, and most perfect, variable I've ever written.

If I could do a whole game using vars like that, it would be like writing a book rather than a game. Bliss.

It seems build 4 was causing more people problems. I'm hoping it's 'cause I was a lazy boy and cut a few corners with the transition, which basically meant it was doing too much at once ( Although on all our test machines, not a single issue. Joy ).
Well that's been tidied up now so hopefully no more problems there.

The score is in, I think that was build 4 and I just forgot to mention it. It uses polling, so every x number of frames the game checks to see if the score actually needs updating.
The reason for this is that I'm using a dynamic text box for the score, which is really costly. Rather than update that more than is needed ( It's not the end of the world waiting a fraction of a second for your score to be updated ) I can just save up a couple of updates and then do them in one hit.
That's the theory, dunno if it makes any difference at all in real life ( ie, I don't know how often the score will increment when playing the game at the moment ).

Also today we've now got levels. Lazy, not tweaked at all levels, but you can complete level 1 and go to level 2 and that's good enough for me today.

One thing I've wanted since the start was a nice sexy rotating 3D planet in the background, that's partly why the skybox is there, so the planet has something to sit against.
Dropped it in today, and wow, it looks so cool. Slightly less cool was the massive hit on the fps. I'd added Gouraud shading because without it, it did look a bit of a pig, but the performance hit was too great.


Lots and lots of messing around later, and I had to call it a day on that idea, and look for a compromise. That came in the form of still using papervision to create a 3D planet, but to grab that into a bitmap and then overlay that on the skybox.
It's not as good as true 3D, and it's still not quite there, but it's going in the right direction.

As always, all the builds live here.


What a difference a day makes

Time for a recap on X development stories.

I posted a 3rd build the other day, but didn't bother blogging about it, as, well it didn't seem worth while. The main thing added was the player movement ( Arrows or wasd ) and targeting ( Mouse ) and shooting ( Guess ).
The particles from Orbs were re-cycled to show the bullets expiring ( They have a certain range before they expire. This is 'cause in asteroids the bullets wrap around the screen, so in no time you'd be over run [ With your own bullets ]. Also with a limited range it means you've got to go in perhaps a bit closer than you'd like to shoot up an asteroid ).
The effect is no where near as pretty as when it's running in Orbs, and it took a fair bit of tweaking to get it is where it's at now, but I'm ok sticking with it for the time being. Unlike Orbs, I think in terms of eye-candy the particle effects are going to be well down the list, so I don't want to pour over them for too long. Yet.

The movement is not the usual asteroids control system, of rotate and thrust ( tehehe ) as our good friend Mark at Blastone released a great Geometry Wars meets Asteroids game a while back ( The very sexy Vectoroids ) and when getting feedback on FlashKit games I was the sole voice of "Rotate and thrust" ( Still quite funny, but I'm 36, I've got to stop finding vaguely rude words funny ).
Everyone else acted like I was slightly mental, that those controls wouldn't work in a million years.

I could get on my retro defending soap box, but the retro way isn't always right. There were a lot of shit design choices back in the day, we just didn't know it back then because everything was new, and because we didn't have good design to compare things to. So, instead of me bitching at the kids for not understanding that it's the way it should be played, screw it, let's make it actually handle better than the original. That's not a bad thing to be able to put in place.

( Also it's how Orbs plays, and I like it, and I like to be able to copy and paste ).

One last thing about build 3, our old friend Phil @ has been a star and reported some issues with it, including a freeze during the transition and a pretty piss poor framerate. I'm hoping it's 'cause he's using FP9 on an old machine running the new IE beta, but I'm still going to have to look at it, the transition could be done better so a bit of re-coding there.
If anyone else is having similar issues, please pipe up and let me know. I remember the good old days of Flash, where it was only the Mac version that would play differently ( And no one really cared about Mac users back then ), everyone running Windows would get pretty much an identical experience. Now there seems to be a lot of "On my machine this happens..."

Build 4, this is more like it. The asteroids are in now. An asteroids AI isn't the most taxing thing to code ( A bit of atan2 and you're done basically ) so getting them in and moving didn't take long.
The current images are all greyscale, so a bit of colorTransform action is added to them to try and liven them up a little.

Three big asteroids moving around with a colour tint on them. Next up was to add the player bullet > asteroid collision checks. Again, Orbs was raided, and we've got distance based broadphase collisions in there ( Which is a perfect way to do the collisions in a game like this ).

Getting a trace saying "hit" is only so much fun, so next up was the ExplosionHandler class. Worked first time like a charm ( Tell me how rare that is ).
The large asteroids explode now after 5/6 hits, I should really add the medium asteroids. Tore through that too ( Almost the same code really, I'm not doing anything really clever here ) and finished it all off with adding the small asteroids.

After less than 4 whole ( ie, an 8 hour working day ) days working on this bad boy, we've got a ship you can fly around and asteroids to kill. That's pretty sweet, I'm more than happy with the way it's going.
The original X even to this day is one of my very favourite projects in terms of development, it took 2 weeks and I didn't plan a thing and yet it all fell into place. If I could turn this around in 2 weeks I'd be really pleased.

More whenever really, bye for now.