Sunday, August 12, 2007
Inspired by this thread at FK games I decided a nice little break from mansion would be in order and started playing with a geometry wars style grid.

It's still not a 100% right, and I think to get much more speed out of it I'm going to have to really rethink it, but it does look pretty cool.

A lot of the actual clever stuff which is beyond me was taken for a example at the always astounding liquid journey site. I also used bytearray.org's raster based line plotter, which I tweaked slightly to try and get a few more ms out of it ( Code for the tweak is here )
public static function quickLine(bmp:BitmapData,x0:int,y0:int,x1:int,y1:int,c:Number):void{
    var i:int;
    var xinc:int;
    var yinc:int;
    var cumul:int;
    var x:int = x0;
    var y:int = y0;
    var dx:int= x1 - x0;
    var dy:int= y1 - y0;
    xinc = ( dx > 0 ) ? 1 : -1;
    yinc = ( dy > 0 ) ? 1 : -1;
    dx = (dx ^ (dx >> 31)) - (dx >> 31);            //Math.abs
    dy = (dy ^ (dy >> 31)) - (dy >> 31);
    bmp.setPixel32(x,y,c);

//Test for a straight vertical line
    if(dx==0){
          for ( i = 1 ; i <= dy ; i++ ){
            y += yinc;
            bmp.setPixel32(x,y,c);
        }
        return;
    }
    if(dy==0){
          for ( i = 1 ; i <= dx ; i++ ){
              x += xinc ;
            bmp.setPixel32(x,y,c);
        }
        return;
    }
   
    if ( dx > dy ){
        cumul = dx >> 1;
          for ( i = 1 ; i <= dx ; i++ ){
            x += xinc;
            cumul += dy;
            if (cumul >= dx){
                  cumul -= dx;
                  y += yinc;
            }
            bmp.setPixel32(x,y,c);
        }
    }else{
        cumul = dy >> 1;
          for ( i = 1 ; i <= dy ; i++ ){
            y += yinc;
            cumul += dx;
            if ( cumul >= dy ){
                  cumul -= dy;
                  x += xinc ;
            }
            bmp.setPixel32(x,y,c);
        }
    }
}
And that's about it really. I'm hoping to play with this some more next time I get chance and hopefully make a homage to a certain popular shoot'em up.

GWars.swf (7 KB)

Squize.
Sunday, August 12, 2007 2:16:01 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Thursday, August 09, 2007
The current project, "Phantom Mansion" is a port of a mobile phone game.

When the site actually goes live you'll see ( If your interested ) case studies for all the projects. The case studies are written in a more professional style, outlining the thought processes as well as the development cycle.

They're glossy and nice.

When it comes to describing Mansions' development, I imagine I'll write something like "A difficult development process due to adhering to the existing design restrictions".

In real life, Mansions' development has been a total cunt.

This is why I've been awol from the blog, and I owe a dozen people a dozen emails ( Sorry ). Indulge me why I vent my spleen a little. The game is  I guess what would be called an "Arcade Puzzler" and as a game it's pretty sweet. It's just that it was designed for java, and so doesn't play to any of Flash's strengths.

At present I'm in the hell that is depth sorting. It's not something I ever seem to do too well, just another black hole in my mind when it comes to coding, but this isn't the usual swapDepths based on the sprites y position. Nope, that would be far too simple. The game has bridges that you can walk over and under. And the baddies can walk over and under. And you can push crates ( You know the score by now ).

Not too harsh. But, and this it the beauty of it, all the sprites are offset on their y position by around 10 pixels ( ie, the image is placed at -10 on the y axis ). This was because in the original it allowed for simple depth sorting with some of the tiles in the game ( So the sprites wouldn't have to be behind certain tiles, so you don't need to worry about sorting for that ). Easy old school trick that surely could never come back to haunt you ( And no, that wasn't a pun ).

So you've got a bridge, and you put it in a higher layer than the sprites, so you can walk beneath it. When you have to walk over the bridge, simple and sly, just have a copy of the same sprite in a layer higher than that, and _visible=true and it's job done.
But, hang on, the sprites are offset. So although they're 32x32 pixels, the same as the tiles, they actually cover the tile above. Surely that means that walking infront of a bridge would lead to the sprites top 10 pixels ( Roughly a head's worth ) being obscured.

Ok, not a problem, we just check that and turn on our higher up copy of the sprite and it's all fixed. Internally every sprite has a zdepth var, so we know what "level" it's on, so you can walk over a bridge and a baddie walking beneath you can't kill you ( It wouldn't be the fairest of games otherwise ).
Where were we ? Oh yeah, at the foot of a bridge bump the sprites level to 1 and display the sprite in the top layer. Now if the sprite is to the left / right of the bridge we shouldn't do this, so we don't. I'm building up to the kicker here. Let's just push that crate along. Oh arse, it's over the bottom of a bridge, let's knock it's level to 1 and blah, blah, blah. The player's sprite whose just pushed it there though, he's still on layer 0, he doesn't know anything about the bridge. So what happens when he goes to push the crate, which is higher than he is ?

pm_bugGrab.png

There's the bridge, tinted orange so I can see it's in a higher layer. The crate which overlaps it tinted green, again so we can tell it's not in layer 0, but look at the Hector ( Our hero ), he's not green 'cause he knows no better.

This is part of why this is a "A difficult development process". There are way more joys that I could share, but I'll hold fire. No one wants to read about someone bitching about their job.

Squize.

Thursday, August 09, 2007 6:27:44 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, August 03, 2007
Yesterday my CS3 design premium box finally arrived. Man was I disappointed.

You certainly know the excitement when a *very* expensive piece of software finally arrives? Not that I was already a bit bitter about the fact that I had to pay a *lot* more than an american customer (for the English version mind you).

So I opened the parcel, and what came ot was a ... 5cm x 15cm x 20cm, about DVD-Box sized, thin cardboard box with the CD's ...

I mean, not even a Quickstart guide ... I wasn't really expecting a printed handbook (which really would be a dream), but at least some sort of keyboard shortcuts ...

</rant off>

Though I must admit that the whole thing is impressive ... so I ordered a new comp, too.

So waiting for a bit of free (ROFL) time to start playing ...

nGFX

Friday, August 03, 2007 9:52:42 AM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Wednesday, August 01, 2007
Just had a few minutes off coding and surfed for a few minutes when I discovered this:

Monkey Island the movie. (Available in English and German) Made in flash it somehow manages to bring the flavour of the first game to a browser next to you ...

I guess I'll fire up ScummVM now for a few minutes of gaming history ...

nGFX

Wednesday, August 01, 2007 1:20:07 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, July 30, 2007
Before the actual jig competion winners are announced, Jay posted some details about the 4th Casual Gameplay Design Competition.

More here.

nGFX

Monday, July 30, 2007 1:02:34 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, July 26, 2007
How pure is pure oop, how usefull are design patterns and how to abuse asBroadcast?

Well, for the current game I'm bound to f8/AS2 because the client's audience is still mostly on f8 and the attempts to make them update the player greatly failed and resulted in a lot of "what is an update of the flash player", "what is a flash player" and "I don't know how" emails ...

The game currently uses my usual structure, that is a single class for the game and some classes for UI, sprites, tiles ... I usually made the game class "LMGame" (LM for the game's name) a singleton, but I wondered if that would be a good practice after all.
(You might guess it, this is a more or less philosophic question.)

I wanted to reduce refrences and singletons to a minimum. (Squize wrote about the problems earlier)

So far I came up with few different methods for accessing the LMGame class from various other classes during the game ...
If needed I pas a reference to the LMGame / needed class but you must admit that this feels rather clumsy.
For the Sprites however I didn't want pass a reference to the LMGame class just to say "Hello" or "I'm dead" ... so I tried a rather unusual way for sprite -> game communication:

While the game has a list of sprites and could call functions directly, I decided to rely heavily on asBroadcast.
I installed a stack (FIFO), to pass values if needed and tried if things were working like I expected ... and they did ... :)

A sprite is moved with this._asBroadcast.broadcastMessage("onTickEvent"); (from the LMGame class' onEnterFrame) and if a sprite dies it places it's id into the stack and calls this._asBroadcast.broadcastMessage("onSpriteDie"); (which is triggered by the LMGame class).

This might seem overly complicated but it really "looks" wonderfull in code and it saves a great deal of thinking, too.

As this is just a "try", I'm not sure if it's going to become very usefull, but I just like trying new "ideas" ...

nGFX
Thursday, July 26, 2007 2:09:01 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, July 21, 2007
Kongregate seems to have a good buzz about it right now, so I figured it'd be interesting to see if it could be used to help pimp GYW.

I've just uploaded a slightly tweaked version of my old game ( Which was originally done to pimp stimunation ), Crazy Balls.

grabFinal.png

After finding out ( Once it was up there, as always ) that the swf is actually bigger than what they allow, and a quick bit of editing, it's all looking good. Don't think my hi-score stuff is working correctly with their back-end, but I can live with that for the time being, this is just a test the water release.

One thing that's freaked me out is that at the time of writing, about 20 mins after it going live on there, it's had 5 ratings. Call me a cynic, but should you be rating a game you've only played for at most 3 mins ? ( I know this 'cause of the hi-scores so far, no one has even cycled through the levels ). You can if you hate a game on sight ( Or even love it, which is rarer ), but to think a game's average / ok in just a couple of minutes seems a bit, hmmm, rushed ( Wanted to say shit, but that's possibly too harsh ).

Perhaps it's 'cause I'm looking at this as a developer, knowing what goes into making a game ( Whether it's good, bad or indifferent ) rather than as a games player ( Playing on a site with an insane number of free games to play ). It's just that I remember doing a couple of reviews for gotoAndPlay.it and spending ages on the games. I wanted to know them inside and out as much as I could before passing comment on them.

Maybe it is a developer thing, maybe it's cause you get points for everything you do at kongregate ( "Farted ? Here's a point" ), or maybe it's not even worth worring about.

Squize.
Saturday, July 21, 2007 5:01:56 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Thursday, July 12, 2007
Just discovered that CDX has picked up an award, a cheeky bronze at the Cannes Lions live 2007.

All credit is due to the boys and girls at preloaded for it. I did a bit of work on it ( It was my last project at preloaded ), but really not enough to be able to bask in any of the glory. Although the moped game in episode 2 did rock ;)

Squize.

Thursday, July 12, 2007 3:19:30 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [0]  |  Trackback