Thursday, December 04, 2008
Our first project with Brandissimo is finally live, and sitting on the NFLRush site.

Just to caveat the excitement a little, the NFL site requires ( At the very least ) a sign up, and I'm sure it may be a subscription service ( Read: You've got to pay ).
Which is a real pity, as I'm guessing no one reading this right now is a paid up member or is going to be any time soon.

To compensate for this, I'm just going to post some screen shots, a couple from the intro movie, and one in-game one. Then in conjunction with the development posts ( For some joyous reason I can't look back at old posts and be logged in at the same time, which means I can't just simply give all the dev. posts a GMM category and then just refer you to the tag cloud. Cosmic. So instead, the development ran from the start of Sept '08, to the 1st Oct. Cutting edge blog technology in all it's glory ) you can use your imagination to play the game.
That's got to be better than actually playing it hasn't it ? I mean you can imagine any old mental things. For example, I'm imagining that I had the time to scroll the screen rather than just making it flick...

gmm_grab1.jpg

gmm_grab2.jpg

And a little something in-game...

gmm_inGameGrab.jpg


A really enjoyable project, some great assets to work with ( I'd never have opted for that art style in a million years ), some great people to work with at Brandissimo and quite a nice little game at the end of it. All good.

Squize.

Thursday, December 04, 2008 11:59:41 AM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, December 03, 2008
December already, it really does fly.

I was chatting with our mate Jeff @ 8bitRocket the other week about function pointers / state machines and I thought it may be useful to quickly write something up about it here, as so much of my code relies on them and they do make life easier.

private var mainFunc:Function;

That's pretty much it.

I'm guessing all your routines have some sort of mainloop. Either you're old school and that's running on an enterFrame on each mc you're moving about or it's a public method in an object which you loop through and call every frame.

Let's take a space invaders mainloop as an example ( Psuedo-code ahead )

function mainloop():void{
  if(thisInvaderIsDeadFlag==true){
    return;
  }
  if(areWeDyingFlag==true){
    if(sprite.currentframe==endOfExplosionsFrame){
      thisInvaderIsDeadFlag=true;
    }
    return;
  }

  moveInvader();
  testForShootingAtPlayer();
  testForBeingHitByPlayersBullet();
}


That should hopefully be straight forward enough. In real life we wouldn't want to be testing for thisInvaderIsDeadFlag every time, we'd just remove this invader from our array of active ones, but this is just an example.

Now check this out,

mainFunc=mainloop_normal;

function mainloop():void{
    mainFunc();
}

function mainloop_normal():void{
    moveInvader();
    testForShootingAtPlayer();
    testForBeingHitByPlayersBullet();
}

Here we've set up our function pointer to point to mainloop_normal, and then we just call that one method in our mainloop() method. Cool so far ?

Now we're not checking to see if the invader is dead, or if it's exploding. That's good, because by default the vast majority of the time neither of those are going to be true, so it's a waste to check ( It's like waking up every morning and seeing if it's your birthday ).

At the moment it's more of a function pointer than a state machine as such, so next up is why doing it this way is so sexy...

function testForBeingHitByPlayersBullet():void{
    if(playerBullet.hitTest(thisInvaderSprite)){
       thisInvaderSprite.gotoAndPlay("firstExplodingFrame");
       mainFunc=mainloop_waitingToDie;
    }
}

Here's our testForBeingHitByPlayerBullet method from the main loop. Imagine that's just doing a hitTest, the invader to the player bullet. Bang, it's a collision, but instead of having to set our areWeDyingFlag from the original example, we just change the state machine.

function mainloop_waitingToDie():void{
  if(sprite.currentframe==endOfExplosionsFrame){
//Kill this invader totally, ie remove the mc
      mainFunc=null;
  }
}

In effect, no extra checks are needed every frame, we're only running what we need. We've got the advantage of a slight performance boost, but far more useful than that is the flexibility this gives us.

Say for example you want your invader to teleport in now, at the start instead of:

mainFunc=mainloop_normal;

we can now alter it to,

mainFunc=mainloop_waitingForInvaderToTeleportIn;

And run the code there waiting for your cool teleport effect to finish, and then just alter the mainFunc to carry on with our flow.

Running your code this way means you can chop and change states without having to have lots of extra conditionals in your code ( If the player is teleporting in, but that teleport tween isn't at frame 10 yet, then don't test for collisions with the player bullet etc. etc. ).

Any questions just hit that comment button,

Squize.

Wednesday, December 03, 2008 9:16:54 AM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  |  Trackback
 Friday, November 28, 2008
Irony irony irony, you don't have to be so heavy handed. Subtle irony is better. It's funnier. Hell it's the English way.

Big nasty smiling in your face as it twists the knife in your stomach irony isn't good. Unless it happens to someone really bad who deserves it, but then you're treading on Karmas toes a little.

Two days after writing the post "Xbox, we love you", just after the 3 year extended warranty has expired, just as I'm building up to some quality down time with a clutch of new games for my baby, just as the NXE has come out, we've had a death in the family.

deathInTheFamily.jpg
"Jede dritte stirbt den Hitzetod"

My beautiful, fault free lump of gaming heaven has passed away. Bastard.

For those of you who don't know, that's known as the "Red Ring of Death". It's the Xbox's way of saying "You're going to need to buy a replacement for me, that's money you could do without spending just before Christmas isn't it. That'll teach you to finally do a blog post about me. Irony, that's what that is."

If this has taught me one thing, it's to never write a blog about how great my prostrate is feeling or that I'm glad I've never caught my testicles on razor wire.

Squize.
Friday, November 28, 2008 9:40:14 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [12]  |  Trackback
 Wednesday, November 26, 2008
I know there wasn't a lot of love for the Mii360's when it was announced, if you own a 360 by default you're a hard core gamer. Leave the avatars to Nintendo.

But... they're kinda more-ish. Here's what Olli and I look like when made of polygons.

avatar-body_nGFX.pngavatar-body.png

Obviously Olli isn't a child who's only been fed salt sandwiches for 6 months, nor am I a giant whose only eaten cake for 6 months ( I didn't realise the difference in size until 2 seconds ago when I uploaded them both. It looks like I could, and possibly will, eat Olli ).

Because we like looking at strangers who we don't really care about, here's how to link to your avatar,

http://avatar.xboxlive.com/avatar/YourGamerTag/avatar-body.png

So feel free to post a link in the comments, just so we can be surprised at whose's actually bald, or wears a dress, or is nothing like how we pictured them.
Or even better, if you've made your avatar look like some one famous, and not just the usual staples ( Mr. T, that's the avatar equivalent of going to a fancy dress party as the fucking Blues Brothers ) but the likes of Jesus, Charlie Mansion, the midget from Fantasy Island, John Wayne Gacy in his clown outfit. The more twisted the better actually.

Also if you just want the smaller gamer pic version, link to

http://avatar.xboxlive.com/avatar/YourGamerTag/avatarpic-l.png

Although that only works if you've taken / saved a snap shot of your new avatar as your gamer pic ( It won't link to the pre-NXE gamer pics ).

( Here's me again, trying to get my gamer pic to look like the last person in the world you'd ever want to be stuck in a lift with

avatarpic-l.png

Mental Mii ).

Squize.
Wednesday, November 26, 2008 11:09:00 AM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [3]  |  Trackback
 Tuesday, November 25, 2008
So I'm a little behind the times with this post, but to be fair I've had other things on.

Adobe have released Alchemy, which is a c/c++ compiler that outputs to Flash byte-code. Sweet.

I guess most people reading this remember when news of F10 broke and there was a video clip of Flash playing a native version of Quake that blew everyone anyway ( Better font rendering in FP10 ? Who gives a shit, that's Quake dude! ). At the time there were very few details about it, and it seemed to just disappear from view.

Well it's back and has a new poster boy, Doom. Runs a little dog rough for me when there are a couple of baddies on screen but hell, it's Doom ( I think it's the sign of a platforms maturity when someone ports Doom to it ).

How does this all work then ? Basically it relies on LLVM ( Low Level Virtual Machine ). This takes your source code, or "Front-end", currently  c/c++ but there's support coming for other languages, and compiles it down to a very simple byte-code.
With the byte-code in place you can then add your own "Back-end" which converts that code to run on your cpu of choice. Basically it's converting a high/mid-level language to an ultra low-level language ( RISC like ) which is then easier to port.

Because Flash uses a virtual machine model a back-end has been written to support that, so it goes c++ > RISC code > AVM2 byte-code and we're left with either a swc to include or a standalone swf ( Not sure how much use that'll be in real life though ).

My first thoughts ( Even after seeing the Quake demo ) was that anything written using this is going to run like poo. I mean as3 isn't the fastest language in the world. But there's a couple of reasons why it works and works well.

Firstly the LLVM compiler is really good. It optimises the pants out of the code, which reduces some of the percieved overhead.

Next up, the system works by allocating a byte-array in memory which the alchemy code uses for pointers / stacks etc. as well as storing it's own byte-code in there. In FP10 additional byte-codes have been added to the avm2 to deal with byte-arrays much quicker ( Allowing this to work at a good speed ), the haXe guys have done some amazingly quick work to figure these out.

Finally 'cause the alchemy converted code ( Is there a proper name for that yet ? Something catchy and slightly rude sounding ? ACC will do for now ) runs in it's own little byte-array "enclosure" it can access memory ( ie a location in it's own enclosure ) and call functions really quickly ( It's like coding in assembler on the old 8-bit machines ).

You lose performance when your action-script has to call / recieve data from the ACC ( Known as "
Marshaling" ), but such is life. If you plan so you pass as much code as possible outside of the mainloop then hopefully it shouldn't be too harsh.

Byte-Arrays are F9/F10's bitmap methods in terms of a new feature offering a huge leap forward in how we work with Flash. They offer up so much scope for some really cool stuff, from mod-players to things like
Alchemy.

It's looking like it's possible to finally in-line byte-code thanks to the avm2 back-end for LLVM, which has a lot of possibilities for speed enhancements. Also take things like box2D, natively written in c++ ( That is currently being converted, although there have been some teething problems ), or a* pathfinders taking advantage of the much quicker memory access, or engines like Coco3D which could be ported over and solve issues in existing 3D engines, or self-modifying code, or things I can't even hope to think of yet.

Squize.

Tuesday, November 25, 2008 7:02:04 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, November 24, 2008
What a great title. It sounds nice and gamey. Like a sweet bullet time effect, or maybe a real time rewind function. Picture that, being able to pause and then rewind the action in any game, just by dropping the cessation time distortion component into your game. Nice.

It's actually got nothing to do with gaming or Flash, it's yet another smoking reference. Promise it'll be the last mention of my own personal trial on here ( In 15 mins I'll have been a non-smoker for exactly 1 week, hence my final farewell to banging on about how hard it is etc. etc. ).

"A cigarette is the perfect type of a perfect pleasure.
It is exquisite, and it leaves one unsatisfied.
What more can one want ?
"
Oscar Wilde.
I've been doing a bit of reading about smoking and the effects it has on you, it does help when trying to stop, as it makes you realise it's not just a case of you being weak. It's a bit more than just caving in and eating that last bit of cake.
Ok we all know smokings bad. No one is so stupid as to think otherwise. Non-smokers just don't get how smokers can smoke, I mean it stinks, it's bad for you and it costs the earth. Smokers just hide behind a million different reasons just to keep smoking.
( Personally I used the combination of "I do actually enjoy it", "It helps me think" < Strong reason for me there, "I stopped before, and I remember how hard it was, and now I'm self employed I just don't have the time to effectively write off two weeks suffering withdrawal pangs". If you're a smoker I'm sure you can add your own to this list ).

So we all know all the bad things about smoking, the smell, the social costs ( It's no longer cool kids, try standing outside in the rain smoking, far from cool. Speaking of which, I'm sure I can't be the only smoker ever to stand in the rain, thinking "What the fuck am I doing this for ? I'm not even enjoying it that much anymore" only to do it again the next day. Same as going to a shop at 3am to buy some smokes 'cause there's nothing worse than waking up without a cigarette is there. ).

But here's something I only found out over the past couple of days. I was kinda aware of it, but never really knew the details. It's something that's never really thrown up as a reason to not smoke in the first place, I assume that cancer and heart disease are treated as good ( Bad ? ) enough reasons, in addition to the usual staples ( Smell, cost, ages your skin etc. etc. ).
To me it's caused more of a knee jerk than either of the big boy reasons not to smoke.

( Again, there's this pre-conception that smokers are dumb 'cause smoking greatly increases your chance of getting a million different cancers, with lung cancer being the big one, the mother of cancers. God's way of really smiting the smoker. You want to smoke ? Here's a cancer just for you. That'll fucking teach you.
As a smoker you know that, but it's an addiction non-smokers, so you can twist anything to suit your argument [ To keep smoking ].
Here's some stock replies, that I'm sure I've used before "I could get run over by a bus tomorrow", "You only live once, life's too short to worry about things like that. Anyway they say you can get cancer from <insert whatever has just been in the news recently that can give you cancer> so what can you believe anymore?" or the classic "I know it's bad for me, I'll stop smoking as soon as I notice my health getting worse, so I'll be fine".
I'm sure my Dad used that last one, he also used the other classic "Uncle Tom smoked 80 a day from the age of 14 and died in his 80s and was fit and healthy right to the end". Every smoker has that uncle Tom. My Dad died of lung cancer when I was 20, so 16 years ago. I started smoking when I was 17, and by the time Dad was dying infront of us I was quite happily smoking 20 a day. At his funeral ( Which btw was the first one I'd ever been too. Not the best way to lose your burial virginity ) I was desperate for a smoke, and when I got the chance, I did.
Here's a good definition of an addiction, "The uncontrollable, compulsive drug craving, seeking, and use, even in the face of negative health and social consequences." [source]. That's what smoking is, that's what makes you want to smoke at your Dad's funeral. It really is more than just not being able to turn down that last bit of cake ).

Nicotine is a poison, we all know that. It's the tobacco plants natural protection from insects. Drop for drop it's 3 times more deadly than arsenic. I guess there aren't too many insects eating tobacco leaves. It's also a member of the same family as cocaine, morphine, quinine and strychnine. Nice family.
But here's the detail that I only discovered the other day, the "If only I'd known that before I started smoking" bit of info ( That really wouldn't have made much difference in all honesty, but more than the big guns of reasons not to smoke ).

Eight seconds after your first ever drag your brain releases a ton of dopamine ( You can read the very dry definition here, or if you want to skip that, it increases heart rate and blood pressure. Basically it's an instant rush. It's also connected with your bodies reward system, which is handy in terms of forming an addiction ).
K, you've taken your first ever smoke. Nasty as hell. You're going to have to work quite hard to get addicted to this, but don't worry, smoking messes up your sense of smell and taste, so in effect it masks the fact that it tastes like what it is, poison. Also you know that stat about cigarette smoke containing 4000+ chemicals, included in those are things like Cocoa and Corn Syrup, added to make it smell less like death, and more like a white stick of nice.

Your brain knows poison when it gets a lung full of it. In return it reduces the number of [ Acetylcholine ] receptors available to receive nicotine to try and protect itself. It also reduces the number of transporters capable of moving the nicotine around in your brain, and as a final wave of protection, in other areas not affected by that first ever rush of nicotine it creates millions of extra receptors, so if you do have any more nicotine intake it's spread out more.
That's why you'll never ever get the same hit from a smoke as you did on that first ever time, every cig since that very first draw has been an attempt to re-create that first buzz. Your brain has re-wired itself to protect itself from having too much posion concentrated in one spot.

That's the thing that's freaked me out. That the crap I breathed in is dangerous enough that my brain is physically different, that it adapted itself straight away to avoid the harmful effects of nicotine ( The same thing happens with other drugs, it's the bodies way of coping with having something in it that really shouldn't be there ).

And connected to your brain being different to cope with nicotine ? Cessation Time Distortion.
In that first 72 hours when you stop smoking you have some nicotine left in your system ( It has a half life of 2 hours that's why when you're a smoker going over a couple of hours without smoking is hard as hell, for me it was an hour before I'd start getting really needy for one ), but it's not enough and that's why your brain throws a hissy fit.
This includes mood swings, lack of concentration ( It's exactly a week today that I stopped, and it's only just starting to sort itself out, although this post has taken ages to write ) and all the other things that make you a pain in the arse when you stop. At it's most simple level, you have a panic attack due to not being able to get what you crave, mixed in with your body regaining control of it's fight or flight mechanism, which has been run by nicotine since you started smoking ( Hence the attacks of instant pure rage for no real reason. Your body isn't used to handling anger itself properly any more, it's like when people have their sight restored after years of being blind, it's just over whelming and your brain doesn't really know how to cope ).

After those first 72 hours your brain kinda gets it, and starts resetting the changes it had put in place. Basically you're learning how to be the real you again, as opposed to the smoking-in-the-rain-even-though-you-don't-enjoy-it you. This isn't too smooth either, but should only take a couple of weeks.
Part of this re-wiring process is this really weird side effect, time distortion. Your whole concept of time is screwed. As a rule we all have pretty good internal clocks ( We've all had that "Got to get up in the morning it's really important" and then woken up a couple of minutes before the alarm was due to go off ) but during this process of re-wiring it's a million miles out.

At first that's a nasty thing. You know how when you're waiting at the doctors or the dentist time just drags. It's 'cause you're a bit bored, perhaps a bit worried about what's coming up, and it just seems to go in slowmo.
When you stop smoking, the whole day is like that. It's like the week before Christmas when you're a kid, it just goes on and on forever. Apparently actual physical nicotine cravings only last for 3 minutes at a time, but during the first couple of days you get hit by a lot of these cravings, and mixed in with this newly found no concept of time at all, they really really don't feel like 3 minutes.

Now I'm at the worst is behind me stage, this whole time distortion is nearly as cool as a component you could just drop into your Flash game to control time. I'm getting more done because I have more time on my hands. Not just 'cause I'm not having to shoot outside every 45mins / hour for a smoke, but because my brain really doesn't have a clue how long things take.
Which is such a result, as I have a deadline this Friday, and I've done relatively little the past week because I've had no concentration at all. I'm hoping I'm going to stay ever so slightly mental long enough to get the new game done.

And on that note, we're back onto games and leaving smoking behind. Normal service should resume tomorrow, thanks for indulging me.

Squize.

Monday, November 24, 2008 11:22:27 AM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Wednesday, November 19, 2008
I have an inherent dislike of self indulgent blog posts, the whole "I'm not feeling well today" thing.

I've found twitter takes this part of a blogging to it's natural extreme. "I've just been out to buy some tea bags" kind of pointless, mindless, please have an interest in me and my life crap.

Well check my hypocrisy out, here's what my twitter post would be today:

"Gave up smoking Monday. Hate everything right now. Haven't got a civil tongue in my head, so not posting until I'm less of a cock".

Sorry to everyone who I owe emails to, but I really can't write more than 4 words without them turning into some sort of nasty rant for no real reason so it's best I go to ground until I stop wanting to burn down the whole world.
Normal service will resume as soon as my brain fully understands that I don't want to smoke any more and so stops thinking about it every waking second.

Squize.

Wednesday, November 19, 2008 11:33:25 AM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Sunday, November 16, 2008
Gears of War2, the most stunning game I've ever seen, and despite some of the on-rails sections being a bit tricky to the point of swearing at the TV, it's a fantastic game.

One of the new features in it is your "War Journal", where your progress is kept.

gearsJournal.jpg

Which is a really sweet feature. Although it reminds me ever so slightly of...

disJournal.jpg

Nice to know that my thoughts aren't a million miles away from Epic's at times ( I didn't come up with the idea of the journal in Death in Sakkara, but I'm pretty sure that having extra hidden collectables was down to me. That was obviously before I started the 3 month crunch to actually code the game ).

Squize.
Sunday, November 16, 2008 6:52:32 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |  Trackback