Project: Chip's Challenge for NES

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Project: Chip's Challenge for NES
by on (#55376)
I'm currently working on a NES version of this old classic. As you can see if you try the ROM, it's going to resemble the Windows version. It isn't too complex yet and I certainly have a long way to go before it's even playable.

What currently works:

- Map decoding (RLE) and rendering (expanding metatiles, writing attributes, etc.)
- Various functions for replacing metatiles in VRAM etc.
- Objects (metasprites) including movement and collision testing
- Player movement and scrolling (the screen scrolls whenever Chip is in the center of the screen)
- A rudimentary system for "actions" happening when an object is in contact with different types of map blocks
- Picking up objects

A lot of this stuff still has to be improved. I consider the most basic graphical functions as finished, such as scrolling and object drawing (drawing here really just means going through the object list, checking if the objects are in range and if yes, compute their position depending on scroll speed and position.)

What will probably be a challange is the two layered map format of Chip's challenge (there can be things hidden under bricks etc.). I also have to implement a sort of "hybrid" object system where objects remain background blocks as long as they're not moving. And when they move, they'll be replaced by a sprite at the same initial position, move, and then be replaced by a background block again.

You can try what I've done so far: test 1, test 2 (this is a demo showing that objects react to background blocks in the same way as the player)

What do you think so far? As you can see, it's far from playable. I have to implement buttons, teleports, tanks, monsters ... the list lis long. However, this is farther than I've come on any previous NES project :p

EDIT: By the way, most of the graphics is done by my brother. I think he's done an excellent job. The tiles used in this game are 1/4 of the original size. There's also, of course, limitations on how many colors can be used etc.

by on (#55397)
That is really awesome and it's obvious you've come pretty far already. I will enjoy watching this progress. :)

When you think about it, it's mostly just an advanced Lolo, it should fit on the NES quite nicely.

Now, if you could allow for user-made levels...even if it's using an editor and recompiling...

by on (#55401)
Looks pretty good so far.

by on (#55404)
Looks great, keep it up, improve the colours and graphics a little (better contrast), and you've got yourself a winner! (Or, a copy of a winner.)

Chip's Challenge is a great game to choose for conversion to 8-bit systems.
Re: Project: Chip's Challenge for NES
by on (#55405)
Looks very cool, I would recommend though, to take a look at the atari lynx version.

http://en.wikipedia.org/wiki/Chip%27s_Challenge

It's got an opening scene with story, plus the enemy movements are shown while crossing "half way" on the tile. Rather than going directly from one tile to another (kind of choppy and hard to determine enemy direction in the win version...)

by on (#55406)
Actually, you could almost do it at full resolution, though it might be hard to see where you're going at times:

Image

This image isn't quite there, but it's close. Chip's body and the fire use too many colors.

by on (#55411)
Will it play "Bummer" when you die? 8)

by on (#55413)
Sivak wrote:
Will it play "Bummer" when you die? 8)

That is extremely important and should fit nicely within DMC size restrictions. :)

by on (#55420)
Looks promizing to me.

by on (#55447)
Need a music engine? :P

by on (#55465)
Here's an NSF I threw together...

by on (#55468)
UncleSporky wrote:


haha, nice! Are you going to do the other song, and maybe canyon.mid and passport.mid too? :D

by on (#55472)
Drag wrote:

haha, nice! Are you going to do the other song, and maybe canyon.mid and passport.mid too? :D

Oh my god I remember I was a FAN of those songs very long ago, too bad I lost the files (I think they somehow came with Windows 95). Thanks god some peple recorded it on Youtube, sounds especially nostalgic with the (terrible) FM synthetis like my very old PC had. I'd really LOVE to see a NES version of them.

EDIT : Obviously a fake : http://www.youtube.com/watch?v=fyiDtkivRDw&feature=related

by on (#55480)
Bregalad wrote:
Drag wrote:

haha, nice! Are you going to do the other song, and maybe canyon.mid and passport.mid too? :D

Oh my god I remember I was a FAN of those songs very long ago, too bad I lost the files (I think they somehow came with Windows 95). Thanks god some peple recorded it on Youtube, sounds especially nostalgic with the (terrible) FM synthetis like my very old PC had. I'd really LOVE to see a NES version of them.

EDIT : Obviously a fake : http://www.youtube.com/watch?v=fyiDtkivRDw&feature=related


Virt (Jake Kaufman, who did the music for Contra 4 among other things) made an mp3 arrangement of canyon.mid, and even received comments from its original creator:
http://www.biglionmusic.com/music/arran ... nts/canyon

by on (#55490)
Wow what a nice remix. Maybe it'd sound like that if you had a very expensive and very modern MIDI soundcard (which I haven't obviously).

by on (#55632)
UncleSporky wrote:
Actually, you could almost do it at full resolution, though it might be hard to see where you're going at times:

Image

This image isn't quite there, but it's close. Chip's body and the fire use too many colors.


I considered using 32x32 pixel blocks, but in my opinion it gets to small. And the colors would be a problem too.

The way it is now, all objects that are static and can use one of the four background palettes, use background tiles. An example is the chips. All objects that may occur many times within the same visible area, so that the 8 sprite-per-line-limit is broken, also use tiles (and the graphics is simplified if needed to.) That's why the fire looks like lava here.

Some objects will need to be implemented as a sort of hybrid between the two. The movable blocks for example; they can occur many places, and many in a row in a map, and therefore can't be drawn as sprites. At the same time they'll have to move when they collide with Chip. So the only solution will be to, at the time they collide with Chip, remove the background tile, add a new metasprite at the same position, move this metasprite to the next block position and then replace it with a metatile.

by on (#55656)
UncleSporky wrote:


Haha, great!

When it comes to sounds an music I must say I don't really know ANYTHING about it. I've never programmed anything sound related for the NES. But I find it very interesting, so maybe I'll look into it when I get stuck in the current development.

by on (#56013)
I've worked on the project a bit this weekend. Movable dirt blocks are now working. When they're not moving they are displayed as background tiles. Otherwise a lot of the original levels would have to be excluded because of the NES sprite limit. Also notice that they can be moved into water and force fields etc.

You can download a demo here.

by on (#56029)
That's really cool. I like how you've duplicated the exact mechanics of the block, I know that's always been the goal but it's nice to see it working. :)

by on (#56390)
this would have been really cool if it was finished...
Have you considered re-releasing the extent of what you have if you don't plan on working on it anymore in hopes that others will learn from it or carry it on?
That's what I would do anyway...
That, and chips challenge rules!

by on (#56394)
fireseed wrote:
this would have been really cool if it was finished...
Have you considered re-releasing the extent of what you have if you don't plan on working on it anymore in hopes that others will learn from it or carry it on?
That's what I would do anyway...
That, and chips challenge rules!

why do you think he doesn't work on it anymore? :S

by on (#56399)
Did he say anywhere that he was quitting it? I don't see it. It's only been a week since an update.

by on (#56403)
I'm not thinking about quitting yet, it's too much fun :p

I haven't worked on it that much lately, but I have completed a few new things. Moving objects will bounce back if they hit a solid block while sliding on ice. Also movable blocks cannot be moved if something is blocking them (this wasn't hard to implement, I was just too lazy to do it :p)

You can download a demo here.

Next up will probably be object-to-object-collision detection. It's really just one situation that will require it: blocks colliding with each other on ice. Monsters/blocks/balls colliding with Chip will kill him, and that doesn't look too bad if it happens only at 16-pixel boundaries. So maybe I'll do it a little hardcoded so that only moving block objects check for fine collision.

Also I have to work on various bug fixes. One critical bug I have found is that scrolling while moving blocks can corrupt nametable data. It happens when moving a block just past the point that triggers nametable updates of the two first rows of $2000 and $2400 due to a buffer conflict. Really, the whole buffer system should be rewritten entirely. I've been thinking about something along the lines of an interpreter that reads opcodes from the buffer along with data. For example $00 could mean to set address, $01 could mean to update a metatile, $02 could mean to write a row of upper- or lower halfs of metatiles, $03 could mean to write attributes, etc. So e.g. buffer contents $00 $40 $20 $01 $02 $03 $04 $05 would translate to "set PPU address to $2040 and write a metatile with upper tiles 2 and 3 and lower tiles 4 and 5. I'm afraid running an interpreter for such a "buffer program" would be far to cycle consuming when doing large updates, and really, it's far too general and high level for the few practical situations it would be used.

by on (#56404)
The refresh engine in Super Mario Bros. runs a kinda-sorta interpreter: each VRAM update has a start address, length, and direction (+1 or +32).
Re: Project: Chip's Challenge for NES
by on (#57498)
As a suggestion, you might want to look at the code of the Lynx version of the game...

(EDIT) Sorry Ortega, I replied before noticing that you said exactly the same thing.

I look forward to further updates on this project. Chip's Challenge was probably my favourite Lynx game, so I;d really love to see a NES port of it! Any news???

-Xious

Jaffe wrote:
I'm currently working on a NES version of this old classic. As you can see if you try the ROM, it's going to resemble the Windows version. It isn't too complex yet and I certainly have a long way to go before it's even playable.

What currently works:

- Map decoding (RLE) and rendering (expanding metatiles, writing attributes, etc.)
- Various functions for replacing metatiles in VRAM etc.
- Objects (metasprites) including movement and collision testing
- Player movement and scrolling (the screen scrolls whenever Chip is in the center of the screen)
- A rudimentary system for "actions" happening when an object is in contact with different types of map blocks
- Picking up objects

A lot of this stuff still has to be improved. I consider the most basic graphical functions as finished, such as scrolling and object drawing (drawing here really just means going through the object list, checking if the objects are in range and if yes, compute their position depending on scroll speed and position.)

What will probably be a challange is the two layered map format of Chip's challenge (there can be things hidden under bricks etc.). I also have to implement a sort of "hybrid" object system where objects remain background blocks as long as they're not moving. And when they move, they'll be replaced by a sprite at the same initial position, move, and then be replaced by a background block again.

You can try what I've done so far: test 1, test 2 (this is a demo showing that objects react to background blocks in the same way as the player)

What do you think so far? As you can see, it's far from playable. I have to implement buttons, teleports, tanks, monsters ... the list lis long. However, this is farther than I've come on any previous NES project :p

by on (#58895)
I'm sorry, it's been way too long since last update. And unfortunately there's nothing new now. I've sort of lost a bit of interest in this project lately. Last time I worked on it, I discovered some deep structural faults in the design (one of them was the nametable update problem described in my last post). I know they can be fixed, but I'm just not up for it. I would much rather continue on the game design and implementing new features rather than rewriting a lot of code, constantly checking that it hasn't broke, etc.

As for a Lynx version, I don't plan to make a NES version of that. The Windows version was the one I grew up with and is the one I like the most (graphics wise.) I will however release the source code when I feel that it is in shape to do so, so that people can modify it the way they like.

by on (#63661)
Ok, so three more months have passed, and I haven't touched the project at all. I don't have time for it, and I can't see me having any more time or energy for it in the forseeable future... As fireseed suggested I will release the source code and graphics files so that people can learn from it, continue on it or something. I'll upload it to http://home.no/johan-af/chip

by on (#72113)
Hi all. I've got some time to work on this during the Christmas holidays. I've fixed a few (not many) bugs, and implemented some new features:

- Objects now change sprites depending on what direction they are facing
- Keys and doors are properly implemented
- Collecting chips and completing levels works (it loads the next level.)

I've also started to work on various monsters. The easiest is the 'frog', which I'm nearly finished with. As of now, it chases you in some way, but not as it should. You can see this in the last level of the demo. The bees and bugs shouldn't be to hard either.

Sadly, the code looks like a mess right now, so I've just uploaded the compiled ROM if anyone wants to try it. It's here.

I think next up will be bug fixes. There are some serious ones, best seen on the third level in this demo when moving on ice. Try to walk in any direction while on the ice. It is also impossible to move when on a force field... These should be minor bugs though.

by on (#72367)
Hi again. I've uploaded a new ROM, showing what I've worked on the last couple of days. The demo shows 6 levels from the original game. My development strategy now is working on successive levels from the game, and implementing the necessary features as I go. Here's what and what's not working as well as some notes about each level:

- Level 1 ("Lesson 1"):

Image

This is pretty much complete. I haven't noticed any bugs in this level. The only thing I had to implement in order for this level to work was the doors. A rather simple (and boring) task.

- Level 2 ("Lesson 2"):

Image

Finally got the bug code to work. I noticed that the bees, bugs, tanks, fireballs, gliders and balls pretty much work the same way. They only differ in what move they take when free to do so. E.g. the bees always want to go left when possible, if not straight ahead, then eventually right and as a last resort backwards. The only difference with the other monsters is how moves are prioritized.

- Level 3 ("Lesson 3"):

Image

Everything works as expected here too. Moving on ice is no longer glitchy.

- Level 4 ("Lesson 4"): When trying out this level, you don't have to collect more than the available chips to finish the level!

Image

I'm currently working on the features necessary to implement in order for this level to be playable. As mentioned, I noticed that the tanks really just work the same way as the bees in Level 2. The only difference is that the tank only knows one move -- go straight ahead. The same code that controls the bugs also takes care of the tanks, it just uses a different list of direction priorities. The green buttons and toggle walls is a bigger problem. In order for them to work, my engine needs to be able to update several single tiles in one bite. Far back when I coded the part of the update engine that does this, I didn't think that this would be necessary. It seems I'll have to do a rather large rewrite of the whole nametable update system.

- Level 5 ("Lesson 5"):

Image

This is just an early test to show that clone machines work! Whatever object is placed on this tile will be cloned when another object touches the red button. This feature is still very early in development. I have not yet implemented mapping between individual buttons and their respective clone machines. In order for that to work, I'll also need to extend my map format and figure out how it should most effeiciently be implemented.

Also note that the bomb graphics used in the windows version has been replaced by my brother with a TNT-tile. It would look too ugly trying to mimick the bomb (on a floor tile background) using the available red palette, and it would be impossible to use an object (metasprite) for this purpose, as there are lots of levels with many, many bombs.

- Level 6 ("Lesson 6"): A rather straight forward level to get working on this engine. However this level also shows the same shortcoming as described over here -- my engine can't update several individual metatiles in the same frame (it can only update whole lines of tiles when scrolling.) This is seen when trying to pick up a chip and at the same time touching one of the blue walls beside. Only the wall tile will be updated, since it was touched after stepping on the chip.

- Level 8 ("Lesson 8"): Still haven't worked any more on the monster AI. It's just lazyness really. I have to focus on the larger issues first...

The issue I will concentrate on now is getting the tile updating system fixed. I'll do something like what I wrote about a few posts over here.
Also, I guess those who've tried it have noticed some graphical sprite glitches when scrolling. This is something I'll look into when the tile updating issue is resolved.

by on (#73430)
I am a huge fan of this game! If by any chance it will be ready by May we would love to release it at Too Many Games!

by on (#73502)
Never played the original. Hmmm... So you actually introduced me to it. Your remake's looking good.

by on (#75881)
Thanks for the comments. :)

It's been brought to my attention that the compiled version that I have uploaded is a test version of something I tried to do a while ago. It starts of at the wrong level and the game just freezes once you've completed it. This was not what I intended to upload! I have uploaded the correct, latest build now. Hopefully that one should match the pictures and level descriptions in my last post...

edit: You'll find it here.

by on (#75894)
I spy a Creeper in the tileset, good sir. :P

Looking good! Keep up the good work. :D

by on (#75901)
Thanks :) I'll work more on it when I have time for it. Soon it's easter break, maybe I'll get something done then.

Haha, is the creeper still there? :o

by on (#77164)
A little update (playable demo here: http://home.no/johan-af/chip/chip.nes)

Green buttons and toggle blocks have now been implemented. They can be seen in the fourth and fifth levels. To do this, I decided to make my game use CHR-RAM instead of CHR-ROM. This was really the only way the game could support the large amount of toggle blocks found in some levels. Instead of writing new metatiles to the nametables over several vblank periods (if there are many blocks), the graphics for open and closed toggle blocks are switched in CHR-RAM. This does take some time too (128 bytes to be copied), but in sum it's worth it.

Brown buttons (or grey here) and traps have also been implemented. This can be seen in the fifth level in the demo. Cloners are also working properly, which can also be seen in the fifth level.

There are still lots of things left to implement. The most important is teleports. After that comes the blocks that have walls that block you from only certain directions. My engine currently doesn't allow them to be implemented in a non-hacky fashion, so I'll have to revise how collisions and interactions work. After those are implemented, some serious optimization and bug fixing will commence. Some of the bugs are probably easy to spot in the demo (objects flickering on the wrong side of the screen when scrolling them off screen for instance.) Others are only revealed by larger and more complex levels.

On the graphics side, my brother has done some polishing. It seems I have failed to mention this before, but most of the graphics in this game is done by my brother. Of course, the original design is by Microsoft, but he's done a good job in making NES versions of the various tiles (and coming up with brand new ones where this was impossible.)

I have also written a level editor for the game, so that I don't have to RLE code them manually and write object lists, etc. any more :p The editor is written in Common Lisp and can be found here: http://home.no/johan-af/chip/mapeditor.

by on (#77296)
I just played to the first green block level and noticed the block graphics don't always match to their passable/impassible state.

by on (#77343)
I'm aware of this, and this is what I'll be working on fixing next. It happens because the green button is aligned just on the same block row as the "trigger row" for updating nametables when scrolling (the nametables cover in total 30 rows, so 2 nametable rows have to be used again to display map rows 31 and 32 as well as 1 and 2). My current system for doing nametable updates is really "hacky". I'm working on making a more robust system that can do some kind of prioritizing. Another effect of the same problem can be seen in level 6 (the level with blue walls). If you walk straight towards a wall and at the same time pick up a chip, only either the wall or the chip will be replaced by floor. Not both.

As can be seen in a demo I uploaded a few days ago (link in my last post), teleports are now working. They were surprisingly simple to implement. They function as in the Windows version: When entering a teleport the game searches through the level for the next teleport in reverse reading order -- that is right to left and bottom to top. To fasten this process, a list of teleports sorted in this order is added to each level with teleports. There are still some issues with control input while entering teleports, but this will be sorted out later... (I'm going to revise my input routines.)

Walls which block you from only certain directions have also been implemented since my last post.

by on (#82515)
Hi Jaffe,

I wonder how this project comes along, any news? Possibly any new demo? :)

Regards
Kojote

by on (#83031)
I like the demo (only the first link worked for me) Funny thing is I'm not sure if I played the original or not. I had a game on Windows 95 about fifteen years ago that was similar to this game, not sure if it was a knock off. I just remember moving around on a gray grid, collecting keys, and other things (not sure if they were chips). I wonder what it was? Anyway, looks cool.

by on (#83036)
Google Image Search chip's challenge windows
Is that what you were looking for?

by on (#83037)
It's coming back to me now. Yes, I think that was it. I played that on my Pentium 133 when I was like...13. I hope this NES version gets finished cause that was a really fun game. :)

by on (#84521)
I would also like to see this finished, but I simply don't have the time to work on it now. When I'm working on something programming related I need to work on it non-stop. I can't dedicate an hour here and an hour there and work on it, it has to be more of a continuous process. That's why it has taken this long to get to the stage the game is in now. I've only worked on it a month or so during the last two easter and christmas breaks.

The latest version is the one found under http://home.no/johan-af/chip (there's also source code for the game and the map editor here)

The problems I am facing now (as I remember them) are the following:

- Efficiency: There's a lot to be done here. As of now, there are a lot of levels which can not be played because there are simply too many monsters and objects for the game code to handle in between vblanks. I know some optimization can be done here, but I'm afraid some of the most complex levels in the original game will never be playable in this version :/

- Graphical glitching: The most prominent glitch occurs when a nametable update happens at the same time as the scrolling routine demands an update of an entire row of tiles. As of now the code simply doesn't handle this. The request that happens last is the one carried out by the vblank code. Another glitch occurs when toggling the green walls. I'm unsure about how to fix this.

- Monster behavior: The more complex monsters, such as the 'frog', are not implemented correctly. The 'slime' and 'walker' monsters are also not implemented as of yet.

- Status screen: This has not been implemented, and doing so will not be easy. A status screen would have to be separate from the main view, it could for example be brought up by pressing START. The screen would have to be blacked out, and one of the nametables would have to be emptied. When continuing the game, everything would have to be re-drawn. This is the only way to do it as far as I can see, and it will not be a very neat result.

- Music: I've been in contact with a guy who was interested in making music for the game, but music is something I can't even think about now. The game engine is inefficient enough as it is, and adding a music routine would probably take a lot more leves of the playable levels list.

In conlusion: A lot still remains. And sadly it becomes more and more clear that a game like this isn't well suited for the NES. Some of the levels require quite a lot of comupting each frame. Every single object in a level is alive at all times, not only when showed on the screen. This can not be omitted. A bug at the opposite end from the player could for instance control toggle blocks or tanks that are far away, and in many levels that is crucial to the whole premise of the level. When Christmas time comes and I don't have much else to do, I'll take a look at it again. But I doubt that I will get much further.

by on (#84525)
Can it run at 30 fps or 20 fps instead of 60 fps? Players accepted reduced frame rates back in the day for games developed by Micronics.

by on (#84759)
Thanks, I must admit I never even thought of doing that! The game is still fully playable at 30 fps, but the jerky movement gets quite tiring after a while :/ I do however feel optimistic about eventually adding music to the game if it's acceptable to run it at 30 fps. The same demo as before is available at 30fps here: http://home.no/johan-af/chip/chip_30fps.nes

by on (#84778)
Jaffe wrote:
Thanks, I must admit I never even thought of doing that! The game is still fully playable at 30 fps, but the jerky movement gets quite tiring after a while :/ I do however feel optimistic about eventually adding music to the game if it's acceptable to run it at 30 fps. The same demo as before is available at 30fps here: http://home.no/johan-af/chip/chip_30fps.nes

Did you notice that this demo has the "stuttering sprites" problem? That is, sprites are not always lined with background properly as the screen scrolls. It's easier to see when frame stepping.

by on (#84856)
I forgot to upload the most recent version... Try it again, it shouldn't have this problem now.
Re: Project: Chip's Challenge for NES
by on (#150410)
Need music? I'll do it for free, whether you want original music, or the music converted from the original game.
Re: Project: Chip's Challenge for NES
by on (#150422)
That's a 4 year bump and like every single link to content in the original thread is dead now.
Re: Project: Chip's Challenge for NES
by on (#150486)
Since the links are dead, here's the 30 fps version in case anyone wants to try the demo still:
Re: Project: Chip's Challenge for NES
by on (#150490)
That's cool to see. Thanks, NovaSquirrel.
Re: Project: Chip's Challenge for NES
by on (#151739)
If anyone's interested, I've kept the source code here: https://github.com/Jaffe-/chip-challenge

I haven't worked on it since 2011, when I lost interest and belief in the project. I've thought about it now and then since that time, and I think I can make a better effort now than I could back then. When I get the time, I will write the game from scratch and do things properly.
Re: Project: Chip's Challenge for NES
by on (#155926)
Soooo... I think I might actually have a real prototype of the NES version of Chip's Challenge. It's the same build number as the one on ebay from 2014 (v0.924B) and its on an NEC d27c1000a-12 chip shoved into a Zelda cartridge. I'm posting it to youtube. https://youtu.be/FP2BtOUh3gY

Someone please tell me there is some way to dump the ROM before the chip dies... please?

Attachment:
IMG_0998.JPG
IMG_0998.JPG [ 1.41 MiB | Viewed 3954 times ]
Re: Project: Chip's Challenge for NES
by on (#155928)
'Course there is.

The simplest way to do it is to buy or borrow a programmer, such as a Willem or a MiniPro.

Other options include ccovell's TapeDump, mailing it to someone with programmer, or building your own ROM reader.
Re: Project: Chip's Challenge for NES
by on (#155930)
If the ROM is just sitting in a socket and easily removed, it's pretty easy to dump straight from the ROM chip with any EPROM programmer. Otherwise it's probably better to use some sort of NES dumping tool like the CopyNES or Kazzo.

There are many NESDev users who could dump it for you. I there is one of us you think you can trust, you could just mail it to them to be dumped, then mailed back. I would gladly do it for you, for instance, but I don't know if you'd have any reason to trust me.

If the prototype is valuable, it's probably worth just buying your own dumper to take care of it, rather than taking a risk. e.g. http://www.infiniteneslives.com/kazzo.php
Re: Project: Chip's Challenge for NES
by on (#155973)
I'm a little fail at programming and don't want to break it so I ordered a kazzo. Thanks guys and I will keep you updated. I mostly just want to make a ROM of this because awesome...
Re: Project: Chip's Challenge for NES
by on (#158139)
Here's the ROM
Re: Project: Chip's Challenge for NES
by on (#158141)
Wow, quite a lot of the game was implemented. Really missing the David Whittaker soundtrack though.