Monday, July 31, 2006

Tile-Engine Rebirth




It's highly enjoyable remaking old classics of your childhood. but it sure is time-consuming. I'm embaressed to say how long it took to make some of the backgrounds alone. Today I got quite a lot done though.

Check out the Nexus link for some new updates.

You can press Q to punch, and if you're in the elevator room, you can see the doors open too when you press it. I haven't as yet implemented a proper elevator system as of yet(that's probably next) but if you tap Space bar it flips arrays and you can see the next level when you leave the screen.

CODING
First, I got around to rewriting the art/tile based hybrid engine. If you check the Nexus l*ink you can see the little beauty in action.
It wasn't much of a hurdle to code- in fact, I'll post the code here for the newbs.

tile_width=60;
tile_y=50;

myMap = [5, 4, 6, 4, 3, 2, 1, 2, 0];

//myMap is the array for the background. The numbers refer to the corresponding movies. Ah, you'll get what I mean in a minute..It'll probably end up as a 2d array (to deal with levels) but I'm just keeping things simple for now.

myMiddleMap = [[0,10,0,0,0,0,0,1,1,0],
[0,1,0,0,0,0,0,0,0,0],
[0,0,0,0,2,0,0,0,0,0],
[0,1,0,3,0,0,1,1,1,0],
[0,0,0,1,1,1,0,0,0,0],
[0,0,0,0,0,0,1,0,0,0],
[0,0,0,0,0,0,0,0,10,0]];

//myMiddleMap is a double-array that contains references to objects held in movies that combine to create the middle tile layer.

this.createEmptyMovieClip("background", this.getNextHighestDepth());

background.attachMovie("cavetile_" + myMap[current], "cave", background.getNextHighestDepth());

//In the library, my backgrounds are all named like "cavetile_1" "cavetile_10" etc, so all the above line does is check the myMap array to see which one is up, then attaches it to an empty movieclip called background.


for(var i=0;i < style="font-style: italic;">current is a referer to which screen you are actually in.
First we check to make sure the array reference isn't 0. If it is, that means there's nothing to plot, so we do nothing except go to the next tile, 60 pixels further to the right. If we do have a tile that needs to be placed, we give it a name "Midtile" with a number from 1-9. and we position it appropriately by setting its x co-ords to i*the set tile width.

Later on I make sure to replace 'cave' with the new backgrounds at screen change, and remove the previous one when it's out of view, along with all the tiles that are attached to it.

I quite like my little tile engine because it's fairly flexible. Though the mid-tiles have to retain a set width, their height is dependant upon you. Further more, since they're all movies, they can be animated and code put on them.

For example, an invisible wall tile is pretty easy to implement.
When the character runs, before incrementing or decrementing his x position, we check to see if a collision flag has been raised. If so, we disallow any changes. The collision flag check is performed within the tile movie itself. You run a hitTest to see if the _root.hero has collided with it, and if so it returns true and our character stops moving towards it. With most tile-engines, you have to check every frame for a collision, but because the code is inside the tile and not on the main program, it's that little bit faster as it only runs tests after it has been created.

I'm either really smart, or my code is pants and I'm just too dumb to recognise it.
-----------------------------------------------------------------------------------------------
I was thinking about whos faces to use for the undercover agents. In the original, the faces were digitized and probably mates of the programmers, but I figure "Why not just go the whole hog?" and put my favourite actors in there instead. So look forward to seeing Christian Bale, Al Pacino, Di Caprio (haha, just kidding), Christopher Walken, and plenty of others make an appearance. I figure I'm never going to get sued since the game is being made basically just for my entertainment, and if any Ebaum or wherever steals it without my permission for their site then they'll likely be the ones getting the finger pointed at instead. Hell, I'd find it hilarious if I was a famous moviestar and some cheeky Brit used my face for a crappy game.

Well, it'll be a laugh getting to that, but first and foremost I need to get the levels working properly and a tracking system up and running. Did I mention I welcome volunteers? Sigh.This is going to take forever...

Labours of love.

Saturday, July 29, 2006

Bollucks. The worst thing that can happen to any programmer happened to me. I know, you're thinking "Your doctor told you you've got 6 months to live". Nope. Worse.

My laptop died. I know, shocking news. What makes it even worse is that it was smack-bang after I had just finished coding a sweet little tiling engine that worked exactly in the way I described in the below post. Oh man, it was so perfect. There I was, rubbing my hands in glee and self-congratulation, and was 5 seconds from saving when I knocked a bottle of wine over the soddin' keyboard. Instant fizz-out death. I'm now writing from our new nifty 80 gigabyte 1.6 mhz Dynabook, so, some good things can come from bad.

Oh but Nexus. Shite. I lost all my Poser animation files.  Actionscript. Everything I worked for. And none of it was backed-up because, hey, who ever imagines your PC is gonna fry? I mean, maybe your flash memory stick or CD drive but the whole thing. Let's just say I will learn from my mistakes. It takes the piss that I will now have to use a decompiler, and try to salvage whatever crap I can from it. I'm pretty hopeful I'll get the code back, but all the graphics...unlikely.

All for now, folks. Will update you tomorrow on the how's-it-goes.

Tuesday, July 11, 2006

Nexus [2]

Didn't have time to fiddle around much with Nexus today. In the morning I noticed that I had forgotten to remove movies that were no longer visible to the player once another background movie swiped over it, so I fixed that. Then later on in the early morning I made a few more screens for the cave level. Trying to make sodium lamps in the walls was a bit of a bugger in Photoshop, but after dabbling with a million filters I finally got a result I was satisfied with.

You can check out the additions now - I've updated the link below.

Monday, July 10, 2006

Nexus [1]

Working on Nexus kept me off the porn all day.
TILE-ENGINE



Originally, I had decided I was going to use small 50x60 tiles for everything, but today I was going over it in my head and I thought "Well, hang on EvilKris, that could be a waste of time - since the screen isn't that big in dimensions anyway. Why not just use 1 big tile per screen - for the lions share of the background- and one simple row of tiles that runs along the middle of each screen for objects and doors."

That way, even if the main background on each level is fairly homogenous, I can just chuck in whatever 8 tiles I like sort of randomly and each screen will still look unique. I probably won't need to piss around with many 2d arrays or map editors as much.

Anyway, I designed a couple of screens of the cavern where you meet the first Nexus member in the original, and suprisingly, designing the main background tile-engine only took about an hour of my time (guess my coding's improved), complete with an RPG style screen swipe'n' all.






Simple is best eh?

Will update the flash file on this page in a week or so..

Saturday, July 08, 2006

Nexus

Here now's a new prototype I've been working on. Based on the old C64 game 'NEXUS' (C64 - Oh those were the days...). So far you can roll, jump and run, and punch with Q.

The character was made in Poser. Some of you out real, real old time gamers might recognise that the animation seems a little familiar. That's because it was modelled frame-for-frame on Impossible Mission, yet another C64 classic. You've got to love those golden oldies. I've been trying to figure out a way to make the main character less fuzzy when he's animated (looks perfect if he runs on the spot). Reducing the amount of frames in the animation hasn't worked, nor decrementing the detail. What a bugger..

One good discovery I made today (that had quite stumped till now) was how to make a flash file 'reset' when the player gets game over or hits the Escape key. With regular flash animations, all you have to do is stick _root.gotoAndStop(1) and that would work fine, but with a game you get some odd results with that method and your movies will still be there even back at the beginning frame. Finally, I came across this bit of code-

loadMovieNum(_url, 0);

- which does the job marvellously. No need to set all your variables back to their original values or unload/remove movies.

CHECK IT OUT HERE


By the way, if anyone out there wants to fiddle around with the stuff I've made already, adding your own code or techniques, that's cool with me.

Welcome..Stay a while...Staaaay forever!

Greetings,



EvilKris here. English teacher by day, game coder by night. This is my game-programming journal and portfolio of existing projects. So far I have yet to fully complete any of my games but a number of prototypes can be found here for those of you who would like to take a peek.

Mostly I go for action/arcade games so anyone who fancies a 3d isometric rpg engine won't find one on here. However, should you be into scrolling fighters, 1st person shooters, or generally any class of game that requires nimble fingered dexterity, you might not have to look any further.

I find Flash to be the medium of choice. It's close to useless for making 3d games in, but for 2d games, it's fundamentally one of the best game-creation tools out there and does half the job for you most days.

I make games out of nostalgia and desire to replicate those happy memories of my teens. Now that I'm a little older, spend less time chasing chicks, my geeky new hobby is taking old games and redesigning them myself. Currently I'm working on the classic Nexus for the C64. They'll be a demo on here somewhere.



GAMES UNDER CONSTRUCTION

I'd like to apologise first as, due to this blog being hosted on a freebie geocities, there's only so much bandwidth on offer, and as a result, some of you may have to keep retrying every hour if it reaches it's limits. (Hey, I'm getting hosted reeeealll soon).






HOUSE OF SPLATTER - 1st Person Gunnery








I shamelessly decompiled and ripped quite of lot of stuff from other Flash games out there whilst making House of Splatter (though one could argue their stuff was already from other games anyhow!). If it ever makes it past the prototype stage I'll change all that, but for now enjoy what is available.

In the game you are supposedly Rick from the game Splatterhouse, and the stage is set prior to his reincarnation as the mad hockey-mask sporting nut job who goes around battering zombies to death.

Umm..there's not a lot you can do here except shoot zombies till the cows come home. Oh! And you can die if you let one get too close.

KEYS:

Mouse moves the crosshair.

R - Reload







THE DEMON WITHIN











- Scrolling Streetfighter/Mortal Kombat rip







Since nobody has made one yet, I thought it would be awesome to have a Streetfighter game in the mould of Mortal Kombat Mythologies.

You take on the role as Ryu out to seek his revenge on Akuma for the murder of Ryu's mentor and father-figure Gouken. Instead of it being a boring one-screen SFII clone, it's a scrolling fighter. At it's present stage, it has a functional fight engine (though the moves are more akin to Mortal Kombat in structure), and you can fight a never-ending horde of Sub-Zero's each complete with the most basic AI ever conceived. I've actually two versions planned. The first is a simple game such as you see here, where you have to beat progressively harder enemies until you can take on the boss, and another far more ambitious project with Ryu able to leap around platforms like Strider.