Author Topic: An actual accurate NES port of Donkey Kong! Testers wanted  (Read 11458 times)

0 Members and 1 Guest are viewing this topic.

Offline Sumez

  • New Member
  • *
  • Posts: 11
    • Awards
An actual accurate NES port of Donkey Kong! Testers wanted
« on: November 08, 2017, 01:07:53 pm »
Hi DKF!
Here's a little thing I've been working on the past few weeks, that I hope some people in here will find interesting.
In short, it's an accurate port of Donkey Kong to the NES.

"But Donkey Kong already exists on the NES?" - as I'm sure most people in here would agree, Nintendo's original port, although fairly competent compared to other platforms back then, doesn't really hold a candle to the original arcade game.
My port is based on a discussion I had with my friend (Svavar) some time ago about whether the NES would actually be able to run the game like it plays on the original arcade machine.


Basically the goal of this project is proving that by translating the actual code of the orignal arcade PCB to something usable by an NES, it is possible to run a game that plays exactly like the original version that we all know and love, and I feel that with exception of some unimportant graphical deviances this version is completely comparable to the arcade game to the point where a score set in this version is essentially comparable to one set on a DK arcade cabinet.
As for the orientation of the screen, as you can see it actually plays "sideways", similarly to the arcade game, so if you're playing on a real NES, you'll have to turn your TV on the side - a strange concept that's probably familiar to people who've been playing home ports of arcade shooters from the 90s (more details further down). Special thanks also goes out to Svavar who, aside from supplying general guidance and indepth knowledge of the game, also helped recreating every sound from the game to something similar sounding on the NES sound chip.

Hopefully I can get some of the Donkey Kong experts around here to try out the game and give me some feedback. Because despite feeling that my game is accurate, it is very likely that there are still some untested areas where I might have overlooked something, or bugs that we haven't discovered.
So if you have the time, give the game a spin, check out all the weird moves you know, and let me know if something feels even the tiniest bit off! If a collision happens one pixel to the left of where it's supposed to, that's a bug! If Donkey Kong rolls a barrel one frame too early, that's a bug! If a barrel becomes stearable more often than it's supposed to compared to your internal difficulty, that's a bug! Even though the game can never be completely "arcade perfect" due to some graphical differences, it is my goal to keep it 100% accurate in regards to gameplay!


How to play the game?
Here is the NES ROM that I created.
If you want it, download it now, because I can't promise that it will remain available.

If you have the means to play it on an original NES console, for example using an Everdrive, and hook that up to a CRT TV, that is by far the best solution. When turning a CRT on its side, I recommend unplugging it before rotating it, and waiting 10-15 minutes before plugging it back in. It won't cause any permanent damage, but if you don't give it time to "settle", you'll get really weird colors (arcade owners are probably familiar).

The more approachable solution is just playing the ROM in an emulator. Personally I can recommend both Nestopia and FCEUX, but I have found the former to be the best in regards to input lag (comparable to any low-lag MAME builds out there, if not better). If you have a monitor stand that allows you to rotate your monitor, you're already set. Otherwise Windows users can right-click their desktop to enter "Display settings" and set their monitor orientation to "portrait (flipped)" for the correct orientation.
Emulator users might also consider disabling the sprite limit to prevent sprite flickering. The game has a lot of flickering, and it's generally a lot more noticeable on a digital display compared to a CRT TV. Nestopia allows this by selecting Machine->Options->No Sprite Limit from the menu. Some emulators enable it by default.


Have fun! I'm looking forward to hearing your feedback.
A new post will follow later on with some details about what minor changes can be expected due to hardware differences.
Member for 6 Years

Offline Svavar

  • Senior Member
  • *
  • Posts: 166
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #1 on: November 08, 2017, 01:18:38 pm »
BOOM BABY! Great description!  :D
Member for 11 Years CK Killscreener DK 1M Point Scorer DK Killscreener Twitch Streamer

Offline Sock Master

  • Elite Member
  • *
  • Posts: 375
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #2 on: November 08, 2017, 02:32:03 pm »
Looks amazing!

I haven't tried it yet, but I watched the video and saw the game in action in The Shed's stream and it looks very authentic to the arcade.

I don't know if this would go against your rules of authenticity, but it should be possible to reduce some of the sprite flickering by substituting some stationary sprites with equivalent background tile graphics.

A good example of this would be replacing the 4 barrels next to Kong with BG tile equivalents.  It won't affect the gameplay, but it'll reduce the per line sprite count.

Also the oil barrel, maybe even the oil barrel flame, possibly Pauline.

Hammers, Hat, Purse and Umbrella too maybe...but that might get messy when positions don't align with tiles or the objects overlap other BG graphics like ladders.

Also, if it's not already doing it, you can turn off the 3 black square sprites above the top ladder during gameplay and only enable them when Kong is climbing the ladder at the end of the stage.

Finally, Kong uses up 10 sprites, but often enough one or two of them are blank sprites.  If you added a bit of code to turn off the sprites when they're blank stamps it should ease the flicker a little bit.


Awesome work, I know how much work it is to coax one game from one set of hardware onto a totally different, incompatible and less capable set of hardware.

(update: I tried it now, runs really well :)  I only noticed one teeny bug so far, I think I ended a game when Pauline's "Help!" was on the screen and it didn't erase when it went to the high score screen.)
« Last Edit: November 08, 2017, 07:21:06 pm by Sock Master »
"Badges? We ain't got no badges. We don't need no badges. I don't have to show you any stinkin' badges!"
Member for 8 Years snek Twitch Streamer

Offline D.B. Cooper

  • Full Member
  • *
  • Posts: 67
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #3 on: November 08, 2017, 02:53:04 pm »
Very cool.  I'm not good enough at DK to be a good tester but I played around with it a bit.  This is probably obvious but turning your monitor is way better than changing the orientation as the latter really messes with the graphics.  Thanks for sharing this.
Dick Moreland
Member for 10 Years Blogger Twitch Streamer

Offline Flobeamer1922

  • Elite Member
  • *
  • Posts: 261
    • My YouTube channel
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #4 on: November 08, 2017, 03:16:41 pm »
Awesome work, Sumez! This is very accurate to the arcade version from what I've played of it so far. Maybe the barrel behavior is just a tad off? Though that could simply be me not having played it enough yet.
PBs:
Donkey Kong - 1,032,100 (22-1)
Donkey Kong Junior - 79,400 (4-2)
Donkey Kong 3 - 344,200 (Stage 22)
Crazy Kong Part II - 645,400 (22-4)

I occasionally stream here: https://www.twitch.tv/flobeamer1922
Member for 6 Years DK 1M Point Scorer Blogger CK Killscreener DK Killscreener Twitch Streamer

Offline leejunfan777

  • Full Member
  • *
  • Posts: 59
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #5 on: November 08, 2017, 06:35:51 pm »
very cool port
im impressed
Member for 9 Years DK Killscreener Twitch Streamer

Offline Sumez

  • New Member
  • *
  • Posts: 11
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #6 on: November 09, 2017, 01:01:05 am »
Thanks for your feedback, Sock Master!
Fortunately, most of the stuff you mention are things I've been thinking about. But since you took the time to come up with good suggestions, I'll try to go into details about them all, even if I'm guessing it will be sort of foreign to most other people. :)

I don't know if this would go against your rules of authenticity, but it should be possible to reduce some of the sprite flickering by substituting some stationary sprites with equivalent background tile graphics.

A good example of this would be replacing the 4 barrels next to Kong with BG tile equivalents.  It won't affect the gameplay, but it'll reduce the per line sprite count.

Also the oil barrel, maybe even the oil barrel flame, possibly Pauline.

Hammers, Hat, Purse and Umbrella too maybe...but that might get messy when positions don't align with tiles or the objects overlap other BG graphics like ladders.
This was my original intention. Particularly the barrel stack and Pauline. However, since basically all of the graphics you mentioned are intended as sprites, none of them align properly to the background grid, which is an issue not only in terms of graphic tiles, but also the use of colors, which is limited to a set grid of 16x16(!) tiles on the NES.

So for example, the barrel stack currently uses four 8x8 tiles (it could technically do with two and mirror them, but for some reason the vertical barrel actually isn't completely symetrical - one pixel is off), but due to how tightly they are packed, I'd need around ten or so tiles (I actually made a mockup graphic that I could use for reference, but I don't have it here) to draw it correctly, and the bottom part of the bottom barrels would still have to be sprites due to the color limitations mentioned earlier - in fact, they even overlap slightly into the girder tile, due to the way slanted girders are drawn. And once Kong starts to run out of barrels (if you let the timer run out), you'll need even more graphic tiles to display empty spaces where the barrels used to be - once again, because they overlap across the grid.

Even the oil barrel would be an issue, since I need a way to handle Mario (who normally goes in front of backgrounds) to go behind it. I did however do something very similar with the yellow elevator pulleys, as those line up nicely to the backgrounds. What you see on that stage is actuall background graphics (the arcade uses sprites, as you probably know), but whenever an elevator goes behind a pulley, a hidden "half" sprite appears behind the background to mask it. Before making that change, the left line of elevators was pure flicker hell :P

I actually think the biggest potential gain would be changing most of Donkey Kong into background graphics on the non-pie stages. But it would also be the most amount of work. Not only would it mean huge changes to many parts of the original code, it would also require a lot more graphics data, since Kong is aligned differently on different stages, and you have stuff like his hands going in front of his chest, and all of the currently mirrored sprites would have to be excess graphics data, as you can't flip background tiles.

Anyway, I'm considering doing something like this, but it's a lot of work for minor gain. Another thing is, that to include all the extra graphics data I've mentioned, I'd have to bankswitch the graphics ROM around, to fit it all in there (that could double as animating Kong with less effort, though).
And although bankswitching was very common on later NES games, so I'm guessing it's fair game, I'm kind of happy that I was actually able to fit all the graphics from the original game into a single bank of 8KB CHR-ROM matching the earliest NES games, by reusing parts of sprites and flipping some of them. Check out the CHR-ROM in an emulator's debug tools to see how tightly it's packed. :P


Quote
Also, if it's not already doing it, you can turn off the 3 black square sprites above the top ladder during gameplay and only enable them when Kong is climbing the ladder at the end of the stage.
That's exactly what I'm doing. :) The "3 black square sprites", are actually 6 sprites on an NES. Another thing that caused a crazy amount of flickering before I changed it. I'm actually using solid color sprites (since all sprite palettes are already used up) hidden behind a black (but not "transparent black") background graphic to mask Kong as he climbs. A classic NES trick.
The black sprites next to Kong on the rivet stage are also not drawn. Obviously no real reason for those.

Quote
Finally, Kong uses up 10 sprites, but often enough one or two of them are blank sprites.  If you added a bit of code to turn off the sprites when they're blank stamps it should ease the flicker a little bit.
Already did this, "unfortunately". Took me a while to notice, actually, since the sprites in question are $70 or something like that. But freeing them up, helped a lot.

Quote
(update: I tried it now, runs really well :)  I only noticed one teeny bug so far, I think I ended a game when Pauline's "Help!" was on the screen and it didn't erase when it went to the high score screen.)
Thanks! I'll add it to my list of issues and fix it when I get the time.
« Last Edit: November 09, 2017, 01:04:04 am by Sumez »
Member for 6 Years

Offline Sumez

  • New Member
  • *
  • Posts: 11
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #7 on: November 09, 2017, 01:09:51 am »
Awesome work, Sumez! This is very accurate to the arcade version from what I've played of it so far. Maybe the barrel behavior is just a tad off? Though that could simply be me not having played it enough yet.
If you could pinpoint something, that would be appreciated!
I haven't heard of anyone else seeing anything different with the barrels, but I think there could easily be missed details. The code that determines wether they roll down a ladder should be completely identical to the original (I feel that if I screwed up it would be very obvious), and the bounce effect when they hit a new girder is actually the same as Mario's wall jump, so if that is off, you should be able to find a similar change when jumping into a wall.
But like I said, even a pixel off is a problem, so any info is welcome.

Are you thinking of the wildbarrels maybe? Those are definitely the hardest to test, due to the heavy RNG.
Member for 6 Years

WCopeland

  • Guest
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #8 on: November 09, 2017, 07:55:17 am »
Something feels off with the hammer, but I can't put my finger on it. I played a little last night and I remember being surprised every time it ran out.

Is the hammer still flashing yellow starting on the 17th swing?
Is the music perhaps a different tempo than the arcade game?

Offline Svavar

  • Senior Member
  • *
  • Posts: 166
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #9 on: November 09, 2017, 08:51:00 am »
Something feels off with the hammer, but I can't put my finger on it. I played a little last night and I remember being surprised every time it ran out.

Is the hammer still flashing yellow starting on the 17th swing?
Is the music perhaps a different tempo than the arcade game?

I just realized that the hammer music stops and starts over after each smash, which it obviously shouldn't. I really can imagine that it screwed up the intuitive timing for when the hammer runs out.
Member for 11 Years CK Killscreener DK 1M Point Scorer DK Killscreener Twitch Streamer

Offline Sumez

  • New Member
  • *
  • Posts: 11
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #10 on: November 09, 2017, 09:23:21 am »
Yeah, honestly I think that's a gameplay essential issue there, that we need to fix. :) Anything related to the intuitive perception of the game matters.
Member for 6 Years

Offline Shnypz

  • Senior Member
  • *
  • Posts: 212
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #11 on: November 09, 2017, 11:00:05 am »
Good stuff...I'm going to try this out on the NES Classic tonight.
Member for 9 Years Blogger

Offline aarontruitt

  • Elite Member
  • *
  • Posts: 259
    • AaronTruitt's Twitch
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #12 on: November 09, 2017, 02:29:14 pm »
I played it on EmuHawk with the NESHawk core and it ran pretty well all things considered. I didn't notice the issues with the hammer music until it was pointed out to me. Usually my music is so loud I can't hear the game  ;D ;D ;D Great port! I wonder if it will work with my retroUSB PowerPak... I use custom mappers in order to use save states for speedrunning, but I'm moving and my consoles aren't set up currently... if someone else has tried it with the PowerPak let me know!
Arcade DK PB: 1,007,600 (KS)
Member for 8 Years CK Killscreener DK 1M Point Scorer DK Killscreener Twitch Streamer

Offline Sumez

  • New Member
  • *
  • Posts: 11
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #13 on: November 09, 2017, 02:40:02 pm »
I haven't tested with a PowerPak or Everdrive, but it should work with anything, for all I know. It doesn't require any special mappers at the moment, and it runs perfectly on a real NES.
Member for 6 Years

Offline Sumez

  • New Member
  • *
  • Posts: 11
    • Awards
Re: An actual accurate NES port of Donkey Kong! Testers wanted
« Reply #14 on: November 10, 2017, 01:43:14 am »
Just watched WCopeland's stream on Twitch. Very cool to see you being excited for the game - I really enjoyed seeing such beautiful DK play on this version. A few comments on what I saw:

1. I can see the hammer really catches you offguard. As mentioned that might be an issue with the music, but I'll try to look deep into the code, compare with the arcade, and see if something could possibly be off.

2. The flickering looks really bad when watching the stream in 30hz, since it's timed so that some sprites on busy scanlines will show eg. every even frame, while the others on every odd frame. So when you're only getting every odd frame streamed, it looks like some sprites just blank out. You probably didn't notice that when playing, but people in the chat did. Since it's likely more people will be making videos or streaming this, I think that's an issue I might try to fix by making a 3-frame sprite cycling process.

3. On the elevator stage you're talking about "8 bit chaos". What's the issue here, the flickering, or the sounds cancelling eachother out? I think the latter can be fixed to some extend, I've already been talking to Svavar (being my sound guy :3) about this.

4. The fire disappearing when it goes too far to the right is a really annoying issue I haven't thought about before. Since the screen is rotated, it's technically getting a Y coordinate lower than 0, so there's no easy fix for this... I'll have to think of something.

5. Placement of the "100" is wrong? I had to move it a bit to account for the smaller sprite I used on NES, but I thought I got it right. Apparently not. :) I'll try to fix it. Is it the Y or X position that is off?

6. On the aspect ratio - too bad hat throwing you off, but fortunately this is completely an emulator issue, since most emulators will default to displaying the image with 1x1 square pixels which is the only thing modern LCD monitors does.
But some emulators, like the ones I mentioned, can be set to scale to a proper 4:3 aspect ratio, which will technically stretch the pixels a bit, but that's how CRT screens do it - the NES never had completely square pixels, and neither did the original Donkey Kong arcade. On a real CRT, the game will always run in the correct aspect (variable only by the amount of overscan on each individual TV) - that was a very important point to me, when making this. :)
Member for 6 Years