Gaming Your Way

May contain nuts.

LotW Pirated Version

We have recently discovered that one of our sponsored games is out there in a pirated version.

I know that is is part of the deal to spread a game as much as possible, but when someone hacks the (encrypted) game and removes all that what makes it a sponsored game ... I get pissed. I mean it was for "free" anyway.

So fellow flash developers, have a look at your stats and see if your games happen to be run from this domain:


These guys steal games, and use hacked versions.

See this:

Of course the loading screen ad has been bypassed too.

There is money involved so I think it's my damn right to be pissed. I have contacted them, let's see what happens.

/* edited, we found thesource and further steps have been taken ... read the SICO post */


No, I'm not in a good mood today.

Game AI for dummies - or making the enemy see.

Sorry folks yet again no image ... but some code :)

The current game (let's call it CC for the sake of it) is getting close to the point where I would declare the main game engine done, most of the events are processed now and the final enemies are going to be done today (hurray!).

As the title suggests (wow it's something post related) I want to write about the dumb ass AI one, nope rather 4 of the enemies in CC use, if you were so bold to call it AI.

While reading up the docs about the original game I read this:

"goes around objects to the left"

And there are 3 more which go around things to the right.


I first simply ignored the fact of "going around" and just coded a simple "if enemie hits wall turn left".

(ok, I lied, there are some images)

So after noticing my mistake I removed the old code and started to write the one that should allow my enemy to move around things. Sounds easy enough.

Oh, that's easy.

"Go ahead as long as there is something to the left, if not, turn left ..."

After a while I really lost my temper and just coded something that could deal with right turns as well, by checking 3 tiles + one, as you can see in the next image.

Well that is stupid, isn't it?

Jein, it's a dummy approach. (jein is a pseudo German word, combining "ja" and "nein", yes and no).

Some of the common situations, the green arrow shows the next direction
and in "D" shows the use of the 4th check.

In order to simplify (though, yet unoptimised) the checking of the tiles I set up an array of points, holding the offset for each of the checks. To make my life even easier I just numbered the directions (which is used all over the game):
0 = north, 1 = east ...

So the array for 0 (north) looks like this:

this._aTest.push( [new Point(0, -1), new Point( -1, -1), new Point( -1, 0), new Point(1, 0)] );

And because this one should move to the left I added a second array that holds the next direction to go to:

this._aDirNext = [3, 0, 1, 2,  1, 2, 3, 0];

(You might wonder why it has eight entries instead of the needed four, I'll come to that later)
I now could just lookup the next direction I need to face by simply checking with the current direction:

this._iDir = this._aDirNext[this._iDir];

Now, with that in place checking the movement was easy:

private function checkMoveBug ():void {
    var strTest:String = "";
    var i:uint;
    var xx:int;
    var yy:int;
    for (i = 0; i < 4; i++) {
        xx = this._pPos.x + this._aTest[this._iDir][i].x;
        yy = this._pPos.y + this._aTest[this._iDir][i].y;
        if (this._refChipsGame.getTile(this._refChipsGame.aMapGame[xx][yy][0]).objProperties.bMonster && this._refChipsGame.aMapGame[xx][yy][1] == -1) {
            strTest += "0";
        } else {
            strTest += "1";
    switch (strTest.substr(0, 3)) {
        case "000":
// "C"
        case "100":
        case "110":
            this._iDir = this._aDirNext[this._iDir]; // turn to the next dir
        case "111":
// "A"
        case "101":
            if (strTest.charAt(3) == "0") {
                this._iDir = this._aDirNext[this._iDir + 4];
// this one uses the second pair for "A"
            } else {
                this._iDir = this.getOppositeDir(this._iDir); // this one is used vor "D"
        case "011":
        case "001": // "B"
            these are not needed because we can just move ahead
            (there is something to the left)


The final version has the 4th check removed from the loop and just checks it for "111" and "101".

And because we use an array to store the test offsets, we can make the enemy around things to the right by just changing the values (north):

this._aTest.push( [new Point(0, -1), new Point( 1, -1), new Point( 1, 0), new Point(-1, 0)] );

and changing the aDirNext array to face right:

this._aDirNext = [1, 2, 3, 0, 3, 0, 1, 2];

Vioal. Done.

I hope this is quite understandable (the code is, my writing might not)


The curse of the generation C64 ...

This is somewhat of a rant post (again), although, it might just become some sort of history lesson... we'll see where it ends.

My current game somehow managed to be a real endurance test (as you might remember, if not, read it here), a lot of things that I had never done before, or at least not very often. The combination of the specific genre and the "new" language ... well it took it's time.
As a minor update on this, the game now seems to become more playable by the minute (oh, and yes, I rewrote the damn movement routine, dropping about 50% of the code needed making more stable and of course working - yet again I wonder why I haven't wrote it that way in the first place ... well never know.)

So while coding I started to look ahead for my next project. One of the things I didn't want this time, was to re-invent the wheel, so I had a lok at the game-engines I had coded so far and I discovered one, that never had been used in a game before, but was 100% working. It lacked of course all the nice and shiny things, it was just a working, ugly game - but something a lot of people seem to like (looking around the casual game scene).

The decission was quite an easy one, ignoring the fact that this is just a "me too" game.

Let the ideas come ...

Think, think, think.

One by one the ideas came in, this usually a blend of things I like or like to use, but hey, we're just at the beginning.


This time I want something less bloated, slick, clean, minimalistic UI. Once again, I've spend a good time just hunting for inspiration, playing a few of some of the best minimalistic games I've managed to find so far, Tonypa's. They are slick, clean, easy to pick up and don't contain more than the barest minimum of visuals.

Great. Wait. It would be nice if I would add a hint of a background story ...
Oh, and for that I have a great set of visuals in mind ...
Hey, what if I let the player decide what to do next, even though it's just a puzzle game ...

Darn. That's for "less bloated, slick, clean, minimalistic".

Why do I think that this belongs into a game - trying to find the answer.

First of all, I don't like 99% of the mini games that are available in flash. this includes all the "tunnel games", "click as fast as you can", and even praised games like "filler" (which is a nice variation of the qix heme) leave me cold.
I think, it may be, because I've seen their predecessor in various forms on different systems before.
OK, so for me there needs to be some sort of substance attached to a game.

I grew up with a c64 and I collected games (as nearly everyone of this time did), I think my collection had over 2000 games, most of them well, not quite legally optained. But I also owned some original games and paid real money for them. (30 DM, which was a fucking amount of money for a 12 year old school kid).

Anyway these games pretty much defined what I like about games and what not, I like pretty visuals (ok, compared to today those old games look really shit), I like good sound (and I think it's essential for a game) and I like some sort of depth (just clicking and holding for creating a filled circle is it not), a simple form of variation ...

I even tried to add that to "Law of the West", which is a bit shallow, to be honest, but there is some sort of variation in it.

Most of the full price games had at least one or the other, even the low price games from Mastertronic had a lot more game to it than some of the hyped flash games.

Back to pen and paper ... and forget "quick and easy"

Just before I started to write this (and bore you to death) I grabbed a pencil and some sheets of empty paper and began to sketch things out, draw a few charts about the progression of the game and what kind of things I want to add in order to distinguish my "me too" game from all the successfull ones that are already out.

So far I like what I came up with, as I believe I have added some unique things to the core gameplay. Of course it is way bigger than what I wanted in the first place and for sure just as I write this, someone had the same ideas.
To make it even more ... well, use a word you like ... I decided to go with a Pirate theme (still very popular, and although my first idea was to make a third LotW themed game, but I couldn't fit in the ideas I wanted to add)

The basic tasklist so far looks like this:
  • draw a worldmap based on the Caribbean Sea around 1500
  • create a set of outdoor images for the menus and ingame screens
  • maybe create some 3d characters (so it won't look like Myst, ... yet I still want to do my own Myst-like flash based adventure game)
  • draw a map of the decissions a player could make
  • draw the level maps/playfields for the levels (I mentioned it's some sort of puzzle game?)
  • decide on extras that can be used to help the player
  • create a list of nice "medals" (more about that in later post, but right now, play the LotW Pinball to see some).
  • find a way to allow savegames, either over the server, or using a code or shared objects

I'll let you know where this ends, and maybe (if there is interest) I go into detail and post some of the sketches and early renderings.
It seems like this one became a bit more than a simple re-use of an already existing game engine. It also seems that I decided to go a good deal beyond the usual flashgame timewaster - and it clearly shows that I'm nuts. I don't even know if there is money in this one (either as license or (most likely not) as sponsored game (as I had my share of sponsoring madness so far).

stupid me.


Help me with a halfway goofy, funny, catchy headline.


It's been a while (again) since my last post so this is kind of a catch up of what happend to the game that badly needs to be finished soon.

First let me tell you how much I hate tilebased games.

The current game is my first "real" tilebased game, so this might change after I've finished this one, but for now ... I hate them.

  • Here's a little description of the game.
  • Action and timebased puzzlegame
  • collect keys and items to open doors and avoid obstacles
  • avoid monsters running around
As the game has a built in editor my first (and wrong) idea was to built the map based on the requirements of the editor, which needed to add some additional things:
  • 2 layers, one floor and on "on top" so you could place things below other things
  • connections between certain buttons and their "endpoint"
  • ability to alter the monster order (because monsters can trigger buttons, for instance)
Basically to build the editor was easy (taking into account that it must be easy to use and still allow to edit all aspects of a level), after I did a complete layout in Photoshop I used that as roadmap for coding.

(Did I mention that this is my first AS3 project?), first week

As always the first quite easy project turned into something that's tested my endurance, the switch to AS3 was not as hard as I feared and I found my way around the mass of classes faster than I thought (I think it's because I'm used to .NET which works like this for a lot longer now).

The first few days I spent with converting my toolset to AS3 and setting up (and redefining) my working environment. So it was alot of coding without having something to play with. Then there was a good deal of time "wasted" reading ...

So where is my timeline, week two (or so)

I'm using CS3 and FlashDevelop instead of flex/eclipse, mainly because I can't stand eclipse's behavior and FD looks and feels a lot like Visual Studio, so I feel more at home there.

My first idea was to go with a 1 frame sollution, but this also would mean no pretty preloader, so I got my head around that started with a preloading/main class.
Hunting for a replacement for "this.getBytesLoaded()" I finally came up with this:

        public function Preloader() {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.showDefaultContextMenu = false;


            this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
            this.loaderInfo.addEventListener(Event.INIT, this.initDisplay);
            this.loaderInfo.addEventListener(Event.COMPLETE, this.initApplication);
            this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);


        public function showProgress(eProgress:ProgressEvent):void {

            var fPercent:Number = Math.round((eProgress.bytesLoaded / eProgress.bytesTotal )*100 );
            var mcProgressbar:MovieClip = MovieClip(this.getChildByName("mcProgressBar"));
            with (mcProgressbar) {
                mcBar_00.width = fPercent * 2;
            if (this._iState == STATE_NOP) {
                this._iState = STATE_LOADBG;

You may notice my excessive use of "this", I know it's not needed, but I kinda like it, as it helps me to see at a first glance what is coded on class level and what is defined in the current method (and it also triggers autocomplete :) ).

One of the very first problems I encounter was the missing support for Movieclips in AS3, not that it is gone but it's not as straight forwards as it could have been.

"Oh you don't need MCs anymore", week two, Wednesday

Of course I do. Damn.
Sure I could code a complex UI and create and place every button, textbox, bitmap by code, but to be honest: WHY? (when you finally see the UI you understand why, I just say more than 150 elements ...).
Though I learned how to get along with it.

"Yes, that looks good", week three

After the main screen was done, it's time to start with the editor.
The layout was done so I could just dive into coding the UI for it, but yet again the next few days were a pain, because theres was just nothing to see.

The game needed a map structure (internally and for saving and reading xml), so I decided to code a map class that not only was able to hold the level's data, but also a methods for handling serializing xml and the map editing methods.

Also I coded a tile engine, which later was converted into the main game engine class. Why? Well, I decided that I don't want to switch to "real" game mode when testing the currently build map (also game and editor are using different tile sizes). So the tile engine is there (because I need it in the editor) and writting an extra game class would have meant to either create a new instance from withing the game or link it in using a reference.

Now I just switch the state of the tile engine and it runs as game and inside the editor.

To run it as "real" game I now just have to pass over the new tilesheet and the game can be run in a different environment. wow.

Fast forward some weeks now, week ... I stoped counting

A lot of code, more code, even more code without being able to play with the result. To be honest I got utterly pissed and depressed.

While coding this game a lot of different flash projects and some dynamic websites needed to be done too, like this: a database driven web based training site, multi language enabled, but in German only right now, so there was a lot of flash and 3D to do, too.

I now can edit a map, but I still can't play it. Time to wander away from flash and write something to save the map ... and wrote this: FileSave.

It's alive, IT'S ALIVE!, this week

Finally at the game is playble in parts (at least in the editor), "in parts" means: the first level can be played, still there are some features missing that need to be added, but I'll add them when I add the original game's first 150 maps (I mentioned it's an official licensed remake, didn't I?)

To get there I needed to convert the nice thought out editor map format into something that can be used to play the game, yes I could have thought about that earlier but hey, it's my first tile based game (Wintertales and Logimotion seem to be Tilebased, but I used it only for the "background, while all movement is done by math).

Yesterday it finally all fell into place and WORKED, the player is moving, can collect keys, open doors ... and the first level can be solved.

After I moved away from frame based and went over to time based movement (read a great tutorial from Jeff of 8bitrocket here).

Hopefully I'll don't forget to return posting about the progress from now on.

Anyway I planed to post a basic overview of the classes and structure used later. (and to be honest I need get to coding :) )


Howdy stranger ...

Just on a quick sidenote:


Law of the West has finally been released to the public.

And as I'm a sponsor slut now ... go play it on newgrounds (and while you there ... vote, damnit :) )

Oh, well, better than gathering virtual dust on my hdd, I guess.


Filesave - a lazy man's way to get text from swf to file ...

This time I'll post a little tool I wrote earlier this week out of sheer lazyness.

My current game comes along quite well, and the built in editor slowly takes shape and while I'm able to create simple levels now I still can't save them because the backend it all relies on is not yet written ...

As I don't have control over the backend I still want to save out my level-data, though as the editor is built in, each new version of the game might bring changes that need to be saved with the map.

I do use Zinc a lot, but imho it's quite a pain to test with and thinking about compiling the swf, switching to Zinc, compiling the exe just to be able to save my data just doesn't appeals to me.

I could do it as AIR app, but yet again, I don't want to dig into it too deep now for just saving a piece of text ...

So what now?

The solution is as easy as it can get: start Filesave, add the Filesave Class to your swf and just use it to save the file through Filesave.

The current version is rough as a piece of coal, but it does what it shoould right now and that's all I care for atm.

The Filesave UI

"set file" - let's you set the file to save to - no file no save.
"autosave" - saves when data comes in, best used with ...
"overwrite" - replaces the files when saving
"data" - the data to be saved
"save" -  manual save
"clear" - clears data field
"status" - guess ...

And because I think that there are people out there who can use this ... (2,92 MB)

it contains Filesave 0.1, the API and a demo swf. (the first posted version apparently contained a version of Filesave, that didn't work, fixed now)

Have fun, leave comments here, nGFX

Hold yer horses ...

So "Law of the West" is on it's way into the public now. Final preparations have been made and after *that* long dev. time ... well, I think it deserves some pimping :).

LotW was started back in the good ol' flash 6 days, with some 3d I just made for fun and the first idea was to make it a ***space*** shooter. I think the idea underwent some major changes. It soon became more "Wild West"ish (and later I discovered that I unknowingly adobted the idea of a game I played a lot on the c64 (it shouldn't be that hard to guess the title).

The first major delay was due to my idea to use 3d characters as well, but somehow the first test didn't match the style I had in mind (thanks to BlinkOk from Kazoowee Entertainment, who is the damn best Swift artist I know, for doing a few tests). So the final character drawings needed 2 more artists until the last one finally delivered (that was 2006 I think, thanks to Nephilim).
I got the rough, scanned outlines and started to colorize them in Photoshop with my wacom:

The "Lady", from outline to ingame

While waiting for the charcters to take shape, I started coding the game using an event-list system (I'll go into detail once the game is online, because I don't want to spoil all the fun). Basically for each "sequence" I set up an array with a timestamp and an action, as the first entry in the array is the next thing that can happen, I just had to do a iCounter++ and see if the counter has the same time as the first event in the list.
If so, the stored "command" is executed and the entry is removed from the array. If the last entry is removed, a new sequence is created ... easy as 1, 2, 3 ... or so I thought.

Anyway, the "game" was coded pretty quickly, but all the little details and "love" took a *long* time to do (I can admit that all the art took way longer than the coding itself).

To give you something you can look at, here are some screenshots frome the game:

The (scaled) tilte screen



Part of the "Book of instructions"

Level selection

Once it's online I'll post the link here too.

Back to work. nGFX

Meanwhile ...

some might remeber me posting about a sparetime project of mine: Law of the West. It's been quite about it for a good deal of time now, but after a *shit* week I finally got into gear to finish the last damn 5% of it.

The last two night were spent adding the last pice of love to the game, a highscore/gameover screen (the normal gameover screen was in for ages), levels (99, featuring all uglyness I could come up with) and some additions here and there like ingame key-hints when the level starts (this is for all those people who don't read the instructions) and mouse control (it  was designed as keyboard only game).

lThe book of instructions
a shot from the "How to" section (scaled)

Tonight at around 0200h it finally hit gold status, although it took me another three hours to fix (or in terms of flash: work around) some *weird bug*.
Here's a short description, maybe it helps you to avoid it.
LotW consists of two files (game and sound) and I wanted to be able to upload the game and get the sound file from another server, possibly streamed instead of a file reference.

To write the streaming "site" was no problem in .net, so I quickly wrote something that take an ID and returns the swf. I tested it using my local web server - no problem.
Then I uploaded the gamefile to and stored the sound and the streamer here on gamingyourway - guess what: it didn't work.

A quick look at the http headers showed that the file was requested correctly and the size returned was correct, too, but flash returned a solid NaN for getBytesLoaded/Total. WTF?

AH! security! That must be the reason ... ok, changed and added all the "allow *" that was needed and tested again - nope still nothing. Oh well.

To make it short I finally wrote a tiny loader.swf that streamed *both* the game and sound file and viola it worked. F$%&§ knows why.

Anyway here's an image I posted earlier for this game but ...

Meet the gang ...
Meet the gang ...

Right now it's not licensed to I keep a few secrets till then ... but stay tuned (at least I can post about a game here :) ).


Nero did not only burn Rome - he busted Vista as well ...

Another rant post (but once I get back on game coding I'll do some more coding oriented posts. Promised.).

The reason I din't post about the current game of mine is that it's more or less on hold while I slave for another project (which is I'm sorry to say 100% not game related :|).

So why is that another rant post?

I bought a new box, a new shiny f$%&ing fast one (and to slow it down a bit I also installed Vista Ultimate on it :) ) (no need to point out that there are other OSes, because I *like* it).

Sometime last year I bought a copy of Nero Burning Rom, the once best cd/dvd burning app. You may have noticed "once".
The version I got was 7.5.7 and except for the darn amount of useless shit that came with it, I was quite happy with it on XP.

Because I like the ease of Nero Express I just wanted to install this (and the Nero app of course) but who the f$%& needs "recode", "showtime" a wave editor(!) ?
Anyway, I decided to install it on my new box and it turned out to become quite a nightmare ...

Once Nero was installed everytime I opened a folder that contained a video file I was greeted with as "rundll32 crash". Sweet.
First and (why not) choice to blame was MS for their OS, but after a quick google I found out that the problem is Nero. To be precise, one of the things I didn't chose to install, the shit codecs that came with it (there's no option to *not* install them).

But how do you remove a codec under Vista?

Quick google again, here we are: InstalledCodec v1.00
"InstalledCodec is a small utility displays the list of all Codec drivers and DirectShow filters currently installed on your system. For each component the following information is displayed: Display Name, Type, Disabled Status, Installed/Modified Time, Description, Company Name, Filename, and more...
It allows you to easily disable or enable any Codec/DirectShow component or export the list into text/xml/html file."

A few clicks later I disabled all codecs that started with "Nero" and viola. no rundll32 crashes.

So far I noticed no problems.


Day x - back from the dead

I doubt you noticed my absence from posting about the current game but I tell you anyway :).

Basically I had a few days off (unplanned) and then a f#%&%$ยง cold (unplanned, too) so work came pretty much to halt.

The worst what happened during that time was the constant flow of new ideas. Yesterday was the first day I was working again and I learned my funny little lesson about AS3. I haven't used it much (or for more than a few quick tests) but when I started to code the basic functions of the editor I learned to hate it.
Seeing AS3 from an c++ point of view it all makes more or less sense, but when dealing with it having a few years of AS1/AS2 experience some things just don't come a "natural" as they should.

I think that one of the biggest problems existing AS2 users have when starting with AS3 is the way AS3 deals with the display. It's easy to get by the new event model (which I really like) but the new display model just pissed me off big time during the first 3 hours.
For the editor there are a few things that rely on a timeline so I have to use exported MCs, I got the strong feeling that AS3 isn't made for handling timeline based things. (Some of them might have been coded but to be true I don't see the point in coding a color / alpha tween for some 15 elements.)
But handling a "classic" attached MC from AS3 feels as clumsy as a one legged dog.

back to work ... and hopefully some more code oriented posts in the future ...