Gaming Your Way

May contain nuts.

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.

filesave_screen_00.jpg
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 ...

 

Filesave_0.1.zip (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:

lotw_creation.jpg
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:

lotw_title.jpg
The (scaled) tilte screen

lotw_highscores.jpg
Highscores

lotw_options.jpg
Options

lotw_bookofinst_0.jpg
Part of the "Book of instructions"

lotw_level.jpg
Level selection


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

Back to work. nGFX

Milestone #1

I've been meaning to post this for about a week, and seeing how today ( And yesterday ) have been spent being really frustratingly trying to get the pinball game to work with the new version of Box2D, I thought I needed a break and should post this up.

Orbs is now a game. Hurray! You can start it, you can clear levels, you can die and it'll take you to the Game Over screen, and then you can run it again. That makes it a game, rather than just a demo, and is a really nice and important milestone to get out of the way.

Aside from getting the basic framework in place, I've added a ton of stats to it, put the medal award code in ( So it slides in nicely down the bottom right to let you know when you've won one ) and added a new baddie.

orbs_grab6.jpg

Those purple bad boys are "leechers". They leave your ship the hell alone, and instead home in on the Orb. When close enough they suck up some energy from it ( The energy bar in the top right there shows that some energy is being stolen ).
When the Orb has no energy remaining, that's it, Game Over. This is the core mechanic behind the game, that it's fun flying around shooting the crap out of things, not so great dying and only having 3 lives. So in Orbs your ship will regenerate so long as the Orb has enough energy to allow it ( Same thing is going to happen with the smart bombs ). The Orb powers everything, and you've got to protect it.

The plan is to have a nice mix of baddies which come after your ship, and ones which just go all out to destroy the Orb. The tricky part for me will be getting the balance right, so you're encouraged ( Or forced ) to move away from the Orb at times leaving it defenceless, rather than just sitting on top of it overly protecting it.

I'm really itching to get back to working on it, but I've got to nail this pinball game as it should be complete in a couple of weeks and we want to get it out there.

Squize.

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 ngfx.de 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 :) ).

nGFX

c-c-c-changes

An update to the progress of Orbs is well overdue.

orbs_grab3.jpg

Some big changes. I've re-done the collision routines. They were a simple brute force method ( Checking bullet 1 against each baddie, checking bullet 2 against each... ), now they're based on a grid system. I've done simple sectors before in my old asteroids clone, X, but that was just splitting the screen into quarters, this uses smaller sectors ( So it's more of a grid than just sectors. Moot point I know ).

I've also altered how the particles were plotted. I always wanted to use the Add blendMode as it looks so good ( The Orb itself is a sprite and uses that blendMode ) but the particles are blitted into a bitMap using copyPixels for speed.
I bit the bullet and changed it to use Draw(). Slower ( As it uses Flash's vector renderer ), but I think the visual pay off is worth it. I'm panting to code the smart bomb as it should look great a whole screen full of baddies blowing up in go, with the blendMode it should nearly white up the screen.

With the collisions, I've had to code a bounce routine for the orb, so when a baddie hits it, it moves. Added to that the player bullets now hit the orb and bounce off realistically too ( As opposed to a pong still rebound where the direction just changes ).
In doing this I was badly anal and coded up a faster version of atan2, just to save a handfull of ms
I'm really pleased with how it feels, you can shoot the orb and push it into a baddie to kill the baddie. It feels great being able to move it around the screen by shooting it.

The title screen is in place, and I used papervision for the background. Having never used it before, I was blown away! Really straight forward, and stupidly fast. I now totally believe the hype.
As part of the title screen stuff I've started on the stats page, and got some medals in there ( Achievements with a different name ).

orbs_grab4.jpg

Going back to the collisions, I knew the player > orb collisions were going to be a bit of a mare. I was toying with using Box2D for them, but realised that was overkill for this game.
The solution ? Give the player a shield ( As seen above ) and then it's just a simple circle-circle collision check. Much quicker and much easier. With the Orb already being able to rebound it was just a case of making the player ship do the same. So now you can push the orb around the screen as well as shoot it around.

The shield also sorts the problem of a baddie teleporting on top of you. If that happens, the shield will just kick in, and the baddie dies. Two birds with one stone, great.

There have been quite a few more updates, but time talking about them is time not adding new stuff. I'm hoping to post an alpha here in the next 2 weeks, just to get some nice early feedback.

Squize.

Day six and seven - only the strong ...

So the menu screen is nearly done - I could resist the urge to do it "right" and add some node-based pathfinding just to display some screen changes.

Today is designh day again, because I have to find a way to do the editor in 640x480 without making it a big pain in the a**. To make this task even easier, I have to fit in the 40 different tiles (which includes buttons and traps) and the 9 different enemy types.

Luckily the maps are only 32x32, but it still means they can't be shown completely at 100% (during play you can see only 9x9 tiles at a time), so I'm going to have to add some sort of scrolling and scaling. Although I think I'm not adding scrollbars and just use space&drag for moving the map, as I use some more key/mouse combinations for the editor (like shift&click to paint a secondary tile (to simulate the right mouse button), ctrl&click to paint into the second layer).

Speaking of the second layer, another neat, yet painfull thing (still thinking of a way to get rid of it). It is in there to allow the hiding things blow moveable tiles, so you can place a fire or a button under a moveable wall tile ... joy.
It may just be a good idea to allow access to the tiles of the secondary layer only if a tile sits on top already ... mhm ... we'll see how that is going to turn out.

nGFX


Day five - have you seen this man?

No post yesterday, not because I forgot it, but because I had a few other things to do.

So today is day five, I'm finally going to code the menu screens (or as far as I get today), it's going to be a bit tricky, because I don't want to just move in/swap the screens.

My Idea is to have some sort of main-board like grid of connected elements which all can send "redraw" commands to it's neighbour, so when you "start" one node it'll look like flowing energy (I doubt I can explain it well).

Now, instead of just going to the next screen, I want to give a "clean up" command and all unneeded elements hide one by one (following the connections) and then redrawing the new grid from the existing nodes.

Wow - that sounds really - unintelligible.

And here's a picture of our hero (more or less :) ):
cc_posed_01.jpg
(not the finall pose and light, though)

Now lets do some coding ...

nGFX


Day four - or how I let the Friday slip though ...

So I got a bit carried away on Friday. I finished the construction of our new little hero C... (damn I can't tell you his name right now), boned hime up and did a few test renderings ...

And then I got myself an ice cold beer and drank myself away ... nah, I had just one.

I tried to code for a couple of minutes but then thought that it's Friday and I should get my ass out of the door and have some facetime with a few friends.

So on Monday I'm going to pose our new little friend so he can make his apperearance on the titlescreen I'm going to start coding then.

Yeahaaaa!

nGFX

ps: Right now I can't provide an image (same reason I can't give a name - darn - I really would like to)

Day two - still beating polygons ...

OK, I admit I didn't get half as far as I wanted yesterday, there have been far to many distractions on the way, not to mention a big mistake on the design of the character.

Half way through the left leg and the half upper body a test rendering showed: 100% bullshit. So back to pen and paper to get a new idea. If I had a working scanner from where I write this I'd post the scetch, but ... oh well.

Anyway, I had some other projects that needed my attention (in fact they screemed at me), so the first part of the days was wasted fixing some long dead flash thingies (and AS1, too) and after that was out of my system I went back to 3d.

Five hours later (just a few minutes ago) I decided to call it a day and have a finall look at what I have accomplished so far:

cc_chr_00.jpg
A rough OpenGL shot of our hero, head and arms still missing.

One day behind my own schedule, though I hope I get it done tomorrow (arms and head and a few modifications on the breast plate, which looks a bit too stiff imho).

I'm starting a highres rendering now to spot any dents I may need to remove and I'm done for today.

nGFX

Day one - beating up polygons

Inspired by Squize's last posts, I decided to go the same route for this game, too.

Of course I can't tell the name, but I hope to be able to post a screenie now and then. Though, I may say that it will be an "official" port of a (at least it seems so) widely popular game and it will feature an built in level editor to design and share you custom built levels. I still don't have all details about the backend, so when I promise that you can rate other peoples levels and bulit your own favourite levels game, chances are that it might not make it into the final built, but then you still have a game with an editor ...

So this is my "official" day one, I've been working on this game for a few days now (mainly getting a design for the menus and screens) to get "into it".

Today it's 3d day, and I'm building the game's hero. So far I'm done with a leg, the body comes next. I hope I'll be done with him by the end of the day, so I can start building the attractor screens and finally start coding.

some screenies later today, promised.

nGFX