Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Development Progress

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
Development Progress
LennyLen
Member #5,313
December 2004
avatar

I've noticed that quite a few people keep development journals or blogs and I thought I'd try doing one to see if it helped keep me committed to my project. Rather than sign up for some site to make a dedicated page for this, I figured I'd just do it here.

So, my project...

I'm trying to recreate Miner 2049er a 1982 game for the Atari 800 that was also ported to several other systems available at the time. This was my favourite game as a child, and was the first computer game I completed.

The idea behind the game is that you are Bounty Bob, a Canadian Mountie who is searching for the notorious criminal Yukon Yohan in the radioactive Uranium mines belonging to a guy called Nuclear Ned.

To finish each level of the game, the player must step on every square in the level, which clears it, while avoiding contact with radioactive mutants who wander the mines. Along the way, you find items abandoned by previous miners, which when picked up give the player points and also make the mutants safe to walk into for a period of time (walking into them at this point destroys them). There is also a time limit for each level.

Progress so far:

I started with a C++ Allegro Template I created which takes care of timing, animation, Allegro initialization, and which also provides a Game class with a few common elements that can be extended for specific games.

I've also created a player class, which contains all the animations for Bounty Bob, plus functions for walking, falling and repositioning Bob, as well as floor and floor manager classes which take care of loading all the graphics for the various floor types (two types of regular tile, a cleared tile, and a un-clearable tile), and which also take care of checking if Bob is currently on (or in, since he moves at fractions of pixels) the floor and whether or not it therefore needs to be cleared.

Here's the latest screen-shot of the project:

{"name":"600929","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/f\/4fa058e1d0ecc4ce53fb00903c78d81d.png","w":646,"h":506,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/f\/4fa058e1d0ecc4ce53fb00903c78d81d"}600929

To Do:

Next, I'm going to implement jumping, since at the moment, I have to postion Bob on clearable floor to test that the floor, falling and movement functions work correctly.

Once jumping has been implemented, I'll add ladders and climbing functions, then the rest of the gameplay factors from the later levels - chutes, moving platforms, transporters, a lift, pulverizers and the cannon.

Then I can add the mutants and I'll also make Bob killable at this point. Adding scoring and the clock will come after that, at which point the game is essentially complete.

Challenges so far:

I'm working from a Windows based emulator that the original author wrote, and which runs in the original resolution of 320x240. I had to take several screenshots while playing in order to get each frame of the animations from the game, though luckily, there aren't many.

I considered keeping the graphics in the original size, and then resizing as I drew the buffer to the screen for the final resolution, but instead decided to resize all the graphics myself to double their size and go with a 640x48 resolution. For this, I copied the sprites from the screenshots using Graphics Gale and saved them to a directory and then wrote a small program to load every bitmap from a directory, double their size and then resave them.

I also wrote a small program which creates the level file and writes the positions of all the floor tiles, as doing this by hand was going to be too time consuming (I hope to eventually write a graphical editor to take care of doing this, but don't ant to get sidetracked).

Not having the original code to work from, I'm having to guess at how fast to move everything. I've made a rough estimate for now, and I'll tweak these values later on, once more of the gameplay elements are in place.

So that's where I am for now. Hopefully I'll be able to report on more progress soon.

Shravan
Member #10,724
February 2009
avatar

You could polish the game further. In fact there should be some difference between the game developed in 1982 and one that is being developed in 2010 ;).BTW where's the link to progress blog ?.

LennyLen
Member #5,313
December 2004
avatar

Shravan said:

You could polish the game further. In fact there should be some difference between the game developed in 1982 and one that is being developed in 2010

I forgot to mention that the purpose of this isn't just to recreate the original, but to also allow new levels to be created. I don't intend to improve the graphics, mostly because I have no drawing ability, but anyone else can replace them if they want to.

Quote:

BTW where's the link to progress blog ?.

This is the development blog.

23yrold3yrold
Member #1,134
March 2001
avatar

Get a dev journal on GameDev, or see if Matthew has any plans to incorporate an equivalent, or just go to Blogspot or start a LiveJournal or something. No need to put it here. :)

I just incorporate mine into my FaceBook page/albums. :P

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

LennyLen
Member #5,313
December 2004
avatar

I'm trying to see if feedback will help me keep motivated. I figure that since nobody outside of the Allegro community will be interested in this at all, that A.cc is the best place to do this. ;)

Shravan
Member #10,724
February 2009
avatar

But this thread will be closed quite a while from now.Will you start a new thread again ?

LennyLen
Member #5,313
December 2004
avatar

I don't intend this to take long enough for the thread to get closed. ;)

Dennis
Member #1,090
July 2003
avatar

LennyLen said:

and then wrote a small program to load every bitmap from a directory, double their size and then resave them

You could have done that using the batch conversion function in XNView (which is a free image viewing/manipulation tool) to save you some time.

Quote:

I also wrote a small program which creates the level file and writes the positions of all the floor tiles, as doing this by hand was going to be too time consuming (I hope to eventually write a graphical editor to take care of doing this, but don't ant to get sidetracked).

For that, why not just draw the levels in any paint tool which supports paletted images? In the simplest example, each palette index would be interpreted as a different tile-number. You'd save all the time needed to create that level editor, because it becomes unnecessary.

Get a dev journal on GameDev, or see if Matthew has any plans to incorporate an equivalent, or just go to Blogspot or start a LiveJournal or something. No need to put it here. :)

How is a thread here any different or less suitable than any other place?
In fact I think it would be much more convenient to skim through progress logs and to inspire more conversation and discussion if they're all contained on a single site instead of every Joe Shmoe running their own small blog that nobody ever reads.

LennyLen said:

So that's where I am for now. Hopefully I'll be able to report on more progress soon.

Work faster so you can start playing DF. :P

LennyLen
Member #5,313
December 2004
avatar

Dennis said:

You could have done that using the batch conversion function in XNView (which is a free image viewing/manipulation tool) to save you some time.

Yea, I know. I do use XNview quite a bit as it handles PNM formats better than Irfanview. I like writing small programs like that though, and I keep them all together in a directory on my PATH so that I can call them any time from the command line.

Quote:

For that, why not just draw the levels in any paint tool which supports paletted images? In the simplest example, each palette index would be interpreted as a different tile-number. You'd save all the time needed to create that level editor, because it becomes unnecessary.

That was my original idea. I've decided to make the game a lot more extensible than it seems, since then though. The game only uses a limited number of floor tiles and animations because that is all that is in the resource directory. I don't have to change any code to add more types, I just add extra images. So the map file is just a list of objects, and their properties, of which are their position, their floor tile number, whether or not they are clearable, and if so, which floor tile number to use when cleared.

When I do release this, I won't supply any graphics that I'm using in these images (though I will supply dummy bitmaps), unless I can get permission to. So people can easily make their own graphics to replace the existing ones, or make there own level files (which I'll give docs for) that use more floor tile types that they have created. Animation is handled the same way. I search a directory for .anm files, which contain the data for the animations - how many frames, time to display them, and the name of the animation. There is an 'animations' subdirectory of the 'gfx' directory which contains subdirectories each with the same name as the animation name. These contain a bitmap for each frame, numbered sequentially. This again makes it easy for people to add their own animations. They just need to make an .anm file (again I'll give docs), and create a directory with images in it.

I want to extend the level file to be more than just a list of items. For example, being able to specify a line of a certain tail type with a code sequence and the start and end position. Ladders and chutes will be stored this way anyway, probably.

Quote:

Work faster so you can start playing DF.

Heh. :)

I went out for a while tonight, so haven't done a lot since. I got started on jumping before I left, but struck a bizarre bug in my animation class. There's one animation that if I don't declare before all the others will crash the game when first used. It didn't matter if I used a completely different set of graphics and .anm file, so it appears to be some weird memory bug. I'm avoiding it for now rather than fixing it by just declaring that animation first, but I'll need to fix it before I release this. I've used these same animation functions several times before though, without ever having an issue like this.

Arthur Kalliokoski
Second in Command
February 2005
avatar

Your game will seem quite unfinished without a girl for the hero to get in the end, or other places.

They all watch too much MSNBC... they get ideas.

Dario ff
Member #10,065
August 2008
avatar

LennyLen said:

I've noticed that quite a few people keep development journals or blogs and I thought I'd try doing one to see if it helped keep me committed to my project.

It's funny to see the only complete game I've ever finished is my Xmas Hack entry. I think that you should put kind of a deadline for the project. You'll organise your time better, focus on what you think it's important, etc.

I can't talk too much about committing myself to a project though, since I haven't opened Code::Blocks for a week, but I think you're doing the right thing of choosing a thread as a personal log.

I did this once in another community for a project that took me 4 months. The thread got enough bumps to be alive that long. :-* I don't think I'd have ever finished it if people hadn't given me so much positive feedback.

Quote:

and go with a 640x48 resolution.

{"name":"600934","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/4\/04432831358b7371ecdf605ba0c034ed.jpg","w":640,"h":48,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/4\/04432831358b7371ecdf605ba0c034ed"}600934
Wow! :o

I'd say, once you get it finished, play with adding a "modern" mode. And give the ability to switch in-game from retro mode to the modern one(like Secret of Monkey Island SE did). You don't need to bother with making the graphics, just give some templates(a background, a foreground), and that could be the killer detail for the game. ;)

TranslatorHack 2010, a human translation chain in a.cc.
My games: [GiftCraft] - [Blocky Rhythm[SH2011]] - [Elven Revolution] - [Dune Smasher!]

LennyLen
Member #5,313
December 2004
avatar

Dario ff said:

Wow!

Oops! Maybe I'll do that for an extra-challenge mode.

Quote:

I'd say, once you get it finished, play with adding a "modern" mode. And give the ability to switch in-game from retro mode to the modern one(like Secret of Monkey Island SE did). You don't need to bother with making the graphics, just give some templates(a background, a foreground), and that could be the killer detail for the game.

Yup, that's just one of a few ideas I have for when I get the remake done.

Now for a progress report... I've added jumping. It doesn't look 100% like in the original, but I'll fix that up later.

Bounty Bob takes a leap:

{"name":"600937","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/e\/0e2a2d5fa4f334ce0f501158f733bb5e.png","w":655,"h":517,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/e\/0e2a2d5fa4f334ce0f501158f733bb5e"}600937

Trent Gamblin
Member #261
April 2000
avatar

I may have missed this but is it using Allegro 4 or 5?

Dario ff
Member #10,065
August 2008
avatar

LennyLen said:

Yup, that's just one of a few ideas I have for when I get the remake done.

Oh true, you said it here. I was a little tl; dr; :-X.

I may have missed this but is it using Allegro 4 or 5?

My bet is on 4.

TranslatorHack 2010, a human translation chain in a.cc.
My games: [GiftCraft] - [Blocky Rhythm[SH2011]] - [Elven Revolution] - [Dune Smasher!]

LennyLen
Member #5,313
December 2004
avatar

Quote:

I may have missed this but is it using Allegro 4 or 5?

My bet is on 4.

Yes, I'm using Allegro 4 for this. Mostly because that's what my template uses and also because it would probably take me longer to learn the new API than to code this project.

cheatscanner
Member #11,712
February 2010

Good luck good sir!

LennyLen
Member #5,313
December 2004
avatar

Right, it's update time.

I was busy with other things for a couple of days, but resumed work last night. I instantly noticed that the code had started to get quite messy already, so I refactored everything, which has made it a lot easier to understand. I also redid a few of the existing functions to make them simpler and more flexible.

The only new feature I've added at this point is logging (a sample log file is attached).

If anyone wants to play around with this, I've attached a Windows binary as well as the source code, along with some dummy graphics that I made to go along with it. These are extremely ugly, but they get the job done.

As I've mentioned, I've designed this project to be extremely flexible with graphics, so you're more than welcome to make up your own. Because the original game only a had limited number of different floor tile types (two), that's all I've supplied, but the engine will work with however many types you want to add. Likewise with the animations. The original game only used either two or four frames per animation (and I treat the jumping sprite as a single frame animation), but you can add more frames than that, and the engine doesn't care.

The media directory that comes with the engine contains several *.anm files. These can't be renamed, but their contents can be edited. All they are is a number, which signifies how many frames in that animation, and then a list of numbers (one for each frame), which is how many ticks to display the frame for before updating the animation. Inside the media/gfx/anim directory is a set of directories with names corresponding to the *.anm file names. These contain the bitmaps for each frame of the animation. So for the bbleft.anm file (which has data for four frames), there is a media/gfx/anim/bbleft directory containing four bitmaps (named bbleft_0.bmp to bbleft_3.bmp).

One constraint on the bitmaps is that they must all be the same size across all the animations.

The media directory also contains a file named player.inf. This contains the following data: The width of the player in pixels, followed by the height (these must be the same as the width and height of the graphics); the direction the player faces (0 for left, 1 for right); the speeds of the different movements (these are also in pixels, but are floats) - walking speed, falling speed, climbing speed, jumping speed; and the height that the player can jump (also a float).

The last file in the media directory of importance is the level1.inf file. This contains all the data for the level. The first two values are the x and y values of the player's start position. This is followed by the number of floor tiles in the level. Then comes the data for each tile on the map - the x position, the y position, which image to use to for it when it's uncleared, which to use for it when it's cleared and finally the tile type (0 for unclearable, 1 for normal).

For the values for the images, these will be an integer value, corresponding to the floor_#.bmp and clear_#.bmp files in the media/gfx/static directory. Trying to set these to use a bitmap that doesn't exist isn't a good idea as I haven't added a graceful way to exit the program when this happens.

If anyone wants to contribute any graphics, they'd be very much appreciated.

Shravan
Member #10,724
February 2009
avatar

I cannot open both of them,the binary and source.I have 7z installed BTW.

LennyLen
Member #5,313
December 2004
avatar

I've attached them in .rar format.

edit: this version will also need ladder.bmp in the media/gfx/static directory. The ladders aren't functional at this point however.

Shravan
Member #10,724
February 2009
avatar

I need alld42.dll.

LennyLen
Member #5,313
December 2004
avatar

Oops, I incorrectly assumed most people here would already have it. ;)

It's attached.

Update:

I've finished the code for the ladders, so they can now be used. The level1.inf file now has the ladder data immediately after the tile data. This consists of an integer, which represents the number of ladders on the level, and then for each ladder - an x position (leftmost), a y position (topmost) and the height. The width doesn't need to be specified as this is determined from the ladder.bmp bitmap.

If you want to edit this bitmap, keep in mind that for each ladder on the map, I created a unique bitmap at runtime, the height of which is the height of the ladder in the .inf file, and the width of which is the same as the ladder.bmp file. The ladder.bmp image is then tiled vertically to fill the new image, which is the one drawn to the screen.

I've attached new binary (this time I remembered to make a release version) and source archives to this post.

And a new screenshot:

{"name":"601008","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/9\/898a6a5c4f4ed4169caf47cf63c5e49c.png","w":646,"h":506,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/9\/898a6a5c4f4ed4169caf47cf63c5e49c"}601008

Shravan
Member #10,724
February 2009
avatar

{"name":"601010","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d3131e97fbe0565b8a01adb4b3b778aa.jpg","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/3\/d3131e97fbe0565b8a01adb4b3b778aa"}601010
The character is not displayed properly.I have never played this game before.How do you clear the level.

LennyLen
Member #5,313
December 2004
avatar

Shravan said:

The character is not displayed properly

The graphics I'm using in my screenshots are copyrighted, so I'm not supplying them with the game (with the exception of the ladder and cleared floor graphics, which IMO are too generic to worry about). The graphics in your screenshot are the dummy graphics that I provided for testing.

Quote:

I have never played this game before.How do you clear the level.

At the moment, you can't (or rather you can, but nothing happens). When the game is finished, a level is considered clear when all the floor pieces have been walked on (i.e. their graphics changes to the solid colour).

There will also be items to pick up and enemies to avoid and/or kill.

Here's a screenshot from the original Atari 800 version:

{"name":"level1.GIF","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/b\/7bcb3ad95753eb22085bd6193d5d3148.gif","w":320,"h":240,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/b\/7bcb3ad95753eb22085bd6193d5d3148"}level1.GIF

Dario ff
Member #10,065
August 2008
avatar

Would it be hard to add support for alpha-blended sprites and .pngs?

I would really like to put this fella. ;)
601012

EDIT: Oh true, I have the source code. Heck, it's a long time since I used Allegro 4, but I'd like to see this guy in action.

TranslatorHack 2010, a human translation chain in a.cc.
My games: [GiftCraft] - [Blocky Rhythm[SH2011]] - [Elven Revolution] - [Dune Smasher!]

LennyLen
Member #5,313
December 2004
avatar

I'll probably add PNG and alpha blending later on in the project. It would be a fairly trivial thing to do, since everything is done with blitting.

 1   2   3   4 


Go to: