A new and improved Donkey Kong port

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: A new and improved Donkey Kong port

Post by DRW »

Sumez wrote:I'd rather want windowed mode than three extra frames of input lag for "serious play". Three frames is a LOT.
Well, the obvious solution is: Play the game on the console.
Sumez wrote:I think it's very likely that you have some sort of common source of lag in your setup that affects all three emulators though, most likely the monitor.
But I don't think there's anything that he can do. It's the same number of frames on MAME: Mario jumps after three frames with the most basic configuration.
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
User avatar
Sumez
Posts: 919
Joined: Thu Sep 15, 2016 6:29 am
Location: Denmark (PAL)

Re: A new and improved Donkey Kong port

Post by Sumez »

MAME is famous for adding a lot of lag, too. Try out the shmupmame build, it's one of the more popular low-lag builds of the emulator, and it's not only for shmups.
I tried playing Rainbow Islands on MAME once, and being a huge fan of that game, having played it for countless hours on arcade as I own the PCB, the input lag completely ruined my chances of playing the game well. You probably won't notice it if you aren't as familiar with the game - it isn't obvious, but there's a clear effect of "for some reason I just don't play as well as I should". On shmupmame, my play was almost as good as on arcade.
DRW wrote: Well, the obvious solution is: Play the game on the console.
Absolutely, and preferably on a CRT. I'm a bit of a hardware purist myself, and only use emulators for development purposes :)
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: A new and improved Donkey Kong port

Post by DRW »

Sumez wrote:MAME is famous for adding a lot of lag, too.
I don't know in how far that is true, but if "Super Mario Bros." has three frames of lag in any NES emulator and also three frames of lag in MAME, then the problem probably doesn't originate with MAME itself.
Sumez wrote:Try out the shmupmame build, it's one of the more popular low-lag builds of the emulator, and it's not only for shmups.
Fortunately, I don't have to deal with that anymore. The only arcade game that really interests me is "Street Fighter II" and I circumvented this by finally buying a good old Super Nintendo.
Sumez wrote:Absolutely, and preferably on a CRT.
Exactly. But an NTSC TV and console. Not PAL.
Sumez wrote:I'm a bit of a hardware purist myself, and only use emulators for development purposes :)
And for making screenshots or recording videos for YouTube etc. Anything but the actual "Let's sit down and play a round of "Mega Man"."
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: A new and improved Donkey Kong port

Post by Sour »

Sumez wrote:Don't take this personally, but 100ms input lag is beyond awful for playing any kind of action game. :) No one would accept it.
Like I said, it's a 30fps camera + a non-gaming oriented 2k monitor - I don't expect it to have low input lag in general.
To be perfectly honest though, I've been playing games on this kind of setup for years, and it doesn't bother me in the slightest.

A ~100ms measurement in this case is not as bad as you might think. Mario itself has a full frame of delay before jumping - depending on the timing of the button press, it can be up to almost 2 full frames, so 32ms. Then you have to keep in mind the camera is 30fps, which can easily add another 15+ms of delay. So you can already trim off 30-45ms, which leaves you with ~60ms of lag more than what you might have gotten on a CRT TV in 1985.
DRW wrote:So, yeah, try out the fullscreen version with an emulator where you know it's Direct3D and see how it adds three additional frames of lag.
Yup, using exclusive fullscreen + vsync adds another 2 frames of delay on the video (so 3-4 real frames). Mind you, I don't get any screen tearing in windowed/fullscreen window modes, so I only ever use exclusive fullscreen when a game forces me to.
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: A new and improved Donkey Kong port

Post by DRW »

Sour wrote:Yup, using exclusive fullscreen + vsync adds another 2 frames of delay on the video (so 3-4 real frames).
Funny thing is: DirectDraw does not do this.
Sour wrote:Mind you, I don't get any screen tearing in windowed/fullscreen window modes, so I only ever use exclusive fullscreen when a game forces me to.
Did you set the screen to 60 Hz? Because if it's at 75 Hz, you indeed don't see noticable tearing, but the scrolling isn't that smooth either.

Set the screen to 60 Hz and then run through the first level of "Super Mario Bros." without stopping, wautching the blocks on the ground and any objects that are not the blue background. There's really no screen tearing?
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: A new and improved Donkey Kong port

Post by Sour »

DRW wrote:Did you set the screen to 60 Hz? Because if it's at 75 Hz, you indeed don't see noticable tearing, but the scrolling isn't that smooth either.

Set the screen to 60 Hz and then run through the first level of "Super Mario Bros." without stopping, wautching the blocks on the ground and any objects that are not the blue background. There's really no screen tearing?
My monitor actually only supports 59 & 60hz. In windowed fullscreen, I see no tearing, whether vsync is on or off. In exclusive fullscreen, the tearing is very easy to notice with vsync off, and disappears with vsync on. I can only assume Windows is doing some sort of voodoo magic to prevent screen tearing in windowed mode.
Great Hierophant
Posts: 780
Joined: Tue Nov 23, 2004 9:35 pm

Re: A new and improved Donkey Kong port

Post by Great Hierophant »

Real hardware, aspect ratio and proper orientation : https://www.youtube.com/watch?v=4tUhcluHZfE
Pokun
Posts: 2675
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: A new and improved Donkey Kong port

Post by Pokun »

Heh the Trouble Bug is so easy to smack in the arcade version while I think I never hit him in the original NES version on the first stage. I have probably done it on the cement factory stage in the red Wii version though, don't remember exactly.


I remember I had tearing with my old computer in many emulators but on my newest I don't see any in Mesen even in full-screen mode and vsync off. No noticeable input lag either.

BTW I don't really get the point of vsync. It's to avoid tearing which happens because unfinished frames are displayed. Isn't that why you use a constant framerate? With a constant framerate the game is consistent on all systems that are up to spec, while with vsync all computers run it at different rates and it isn't consistent at all.
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: A new and improved Donkey Kong port

Post by DRW »

Pokun wrote:I remember I had tearing with my old computer in many emulators but on my newest I don't see any in Mesen even in full-screen mode and vsync off.
Might depend on the graphics card.
Pokun wrote:No noticeable input lag either.
I'd really like to know how long it takes from pressing the button on a real NES controller to Mario jumping. Maybe the number of frames that it takes is equal to the number of frames in an emulator (without vsync).
Pokun wrote:BTW I don't really get the point of vsync. It's to avoid tearing which happens because unfinished frames are displayed.
Yes.
Pokun wrote:Isn't that why you use a constant framerate?
But even if the framerate is constant, you still might have the problem: If the emulator starts rendering the new frame while the physical screen is in the middle of updating, you get tearing.
Pokun wrote:With a constant framerate the game is consistent on all systems
True, but scrolling either stutters or you get tearing.
Pokun wrote:while with vsync all computers run it at different rates and it isn't consistent at all.
That's why you need to set your monitor to 60 hz.

However, vsync doesn't have to mean that the game runs faster with a higher monitor hz value. Vsync just means that the game display will only update the image during vertical blank.
So, if your monitor runs at 75 hz, the game will still run at 60 fps and without tearing, but the scrolling will stutter since sometimes frames are updated twice and sometimes they're only updated once.

(In MAME you can actually choose whether the speed should adjust to the monitor frame rate or whether you still want to keep the original speed even if you force the game to update only during vertical blank although the monitor has another hertz value.)
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: A new and improved Donkey Kong port

Post by rainwarrior »

Sour wrote:I can only assume Windows is doing some sort of voodoo magic to prevent screen tearing in windowed mode.
Since Aero was introduced (i.e. Windows Vista) the Windows UI manager has had the ability to vsync the display of composited windows for you. In this mode there's no way for the application to control whether or not vsync applies. As always with Windows, if the application is not in true exclusive fullscreen mode any use of a vsync API is a placebo. (This includes the popular "borderless window that covers the whole screen" alternative to true fullscreen.)

If you've ever seen "do you want to change the color scheme to improve performance" pop up, that fallback mode lacks a global vsync, and you can see tearing there, if you like.

As for whether Direct3D adds 3 frames of lag, I mean, it's quite possible that it does on DRW's system right now, but it doesn't have to and it's not designed to (I've measured very good latency with it in the past), but there's a bunch of links in the chain between application and display (keyboard > keyboard drivers > windows > application > windows > GPU drivers > GPU > monitor) and any of these could be configured in a way that adds unnecessary lag. Most of these aren't directly under the control of the application at all.

If the situation on your system is that true fullscreen performs more poorly than Aero's globally vsynced windows compositing, something is sadly out of order. The whole point of fullscreen is to allow the application direct and low latency control of the screen. :( Most likely I'd suspect the GPU driver here, but like I said there's a lot of links in this chain.

We have had a discussion very close to this a few times before, here's one I remember:
https://forums.nesdev.com/viewtopic.php?f=5&t=14743 "Please explain to a layman: input lag"
User avatar
Sumez
Posts: 919
Joined: Thu Sep 15, 2016 6:29 am
Location: Denmark (PAL)

Re: A new and improved Donkey Kong port

Post by Sumez »

Yeah, dialing the conversation back a bit, I was exclusively talking about lag introduced in one emulator compared to another.

I never did anything to measure each emulator's amount of lag, and I have no idea how much lag is implicit in my system, which is a cheap work laptop. But what I can tell is that no matter what video settings I've tried, I haven't been able to play games in FCEUX without enough lag that it influences my performance, and quick experiments with a bunch of other emulators showed similar results until I tried Nestopia which actually surprised me by being the best out of the the ones I tried, and playing Ninja Gaiden felt completely like playing it on a real console/CRT setup (even though in reality there's probably at least one extra frame of lag, if only due to the LCD display).
As such, it's hard for me to recommend playing this DK port in anything else. I don't know what emulator Wes Copeland (the current world record holder in Donkey Kong) is playing here, but he's constantly complaining about the input lag. At least he's well aware that it's caused by the emulator:

https://go.twitch.tv/videos/188731450?t=2h38m

When you're playing Donkey Kong on this level, one extra frame of input lag does make a difference.
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: A new and improved Donkey Kong port

Post by DRW »

rainwarrior wrote:As for whether Direct3D adds 3 frames of lag, I mean, it's quite possible that it does on DRW's system right now, but it doesn't have to and it's not designed to (I've measured very good latency with it in the past)
I tried it out on several systems and I had people in the MAME community do the same.
Believe me: The three additional frames in Direct3D fullscreen with vsync is definitely a constant value compared to all other configurations.
(DirectDraw with fullscreen and vsync doesn't have it. Direct3D in windows mode with vsync doesn't have it either. And non-vsync doesn't have it anyway.)
Or don't believe me. Try it out. I described a simple method of validating it above.
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
Sour
Posts: 890
Joined: Sun Feb 07, 2016 6:16 pm

Re: A new and improved Donkey Kong port

Post by Sour »

Sumez wrote:I don't know what emulator Wes Copeland (the current world record holder in Donkey Kong) is playing here
According to a few minutes before the time you linked, Mednafen.
User avatar
rainwarrior
Posts: 8731
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: A new and improved Donkey Kong port

Post by rainwarrior »

DRW wrote:
rainwarrior wrote:As for whether Direct3D adds 3 frames of lag, I mean, it's quite possible that it does on DRW's system right now, but it doesn't have to and it's not designed to (I've measured very good latency with it in the past)
I tried it out on several systems and I had people in the MAME community do the same.
Believe me: The three additional frames in Direct3D fullscreen with vsync is definitely a constant value compared to all other configurations.
(DirectDraw with fullscreen and vsync doesn't have it. Direct3D in windows mode with vsync doesn't have it either. And non-vsync doesn't have it anyway.)
Or don't believe me. Try it out. I described a simple method of validating it above.
I've never said that I don't believe that you've experienced this lag. I've never said that.

What I said was Direct3D as an interface is capable of low-latency behaviour. On this, you don't seem to believe me. D3D is designed to be able to do this, and it very much can, and yes I've measured it on many occasions past and present.

If you're talking specifically about MAME's particular Direct3D code, that's very different than talking about Direct3D overall. I have measured many programs, but never specifically MAME. Tried a quick measurement of MAME right now, and yes for me it does have a few extra frames of latency when "video = ddraw" vs "video = d3d". This is not the same as Direct3D vs DirectDraw though. Clearly MAME is also doing a lot of stuff in D3D mode that it isn't in DDRAW, and there are like 30 more options that are specific to D3D in the ini file. I'm not about to dive into MAME's source code, or try a billion permutations of ini settings in order to have an argument about what MAME is doing wrong with its Direct3D implementation, though.


Anyhow, sorry, I didn't want to increase the off topic discussion here. Obviously you can't do better than a CRT + hardware that's directly synched with it. I just wanted to respond to the statment that D3D adds "3 frames of lag", which is just not true as a statement by itself. It does seem to be true that MAME's D3D mode adds 3 frames of lag. I'd gladly agree to that.
User avatar
DRW
Posts: 2225
Joined: Sat Sep 07, 2013 2:59 pm

Re: A new and improved Donkey Kong port

Post by DRW »

rainwarrior wrote:I've never said that I don't believe that you've experienced this lag. I've never said that.
And I didn't claim that you said it. I just wanted to encourage you to try it out yourself and don't take my word for it.

All in all, I don't know whether it's Direct3D itself or the emulator or whatever. I just noticed that the same issue happens in MAME and in Nestopia and they're both based on Direct3D while I never saw anything like that in fceux (DirectDraw) or the DirectDraw mode of MAME. So, I assumed it's Direct3D itself.

But ultimately, I don't really care. I have my NES, my Super Nintendo and a CRT TV. Input lags of emulators don't concern me anymore.
My game "City Trouble":
Gameplay video: https://youtu.be/Eee0yurkIW4
Download (ROM, manual, artworks): http://www.denny-r-walter.de/city.html
Post Reply