MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

9ofzeven
MAME Fan
Reged: 09/02/05
Posts: 124
Loc: Austria
Send PM


MAME latencies?
#320778 - 01/23/14 07:36 AM


What are typical delays introduced by the emulation layer in MAME compared to original hardware? Have their been any measurements or blind tests?



SmitdoggAdministrator
Reged: 09/18/03
Posts: 16877
Send PM


Re: MAME latencies? new [Re: 9ofzeven]
#320806 - 01/23/14 04:57 PM


Aside from input device frame lag you would probably get the opposite effect in a lot of cases like cd images loading faster than the original could read at, ram speed being faster, chds loading faster than original hard drives, and things not being emulated yet like wait states. But that's a guess and I have no idea how low of a level original ram speed is emulated at.



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: MAME latencies? new [Re: 9ofzeven]
#320813 - 01/23/14 06:46 PM


> What are typical delays introduced by the emulation layer in MAME compared to
> original hardware? Have their been any measurements or blind tests?

An emulator (MAME or any other) will have at least 1 video frame of latency, and at least 2 if you enable triple buffering. This is on top of any latency that the game's original hardware/software have, of course. It's well known that modern consoles tend to have quite a bit, and even back in the 1980s games often had at least a couple of frames of joystick-to-eyeball latency. Space Invaders runs slower when all the invaders are alive, for instance, but that works well with the gameplay since you get better latency when you need it, towards the end of each stage



Trebor
MAME Fan
Reged: 01/18/05
Posts: 509
Send PM


Re: MAME latencies? new [Re: R. Belmont]
#320817 - 01/23/14 07:47 PM


> > What are typical delays introduced by the emulation layer in MAME compared to
> > original hardware? Have their been any measurements or blind tests?
>
> An emulator (MAME or any other) will have at least 1 video frame of latency, and at
> least 2 if you enable triple buffering.

How about v-sync (waitvsync 1)? Curious. From what I read/recall it is better to v-sync than triple buffer if you're system/video can handle it.

I used triple buffering for years, but switches over to v-sync a few years back...

Ah, now I remember it helped with any sound skipping/stutter (V-Sync over Triple Buffering), I think.

Nevertheless, curious of (any) v-sync (additional) latency, although honestly, don't really notice any difference while playing (At least not with my Arcade Joystick panel).



9ofzeven
MAME Fan
Reged: 09/02/05
Posts: 124
Loc: Austria
Send PM


Re: MAME latencies? new [Re: R. Belmont]
#320820 - 01/23/14 08:49 PM


So when you say at least 1 frame latency, are these approx. 16ms noticeable? Have there been any rigorous (or at least anecdotal) comparisons between MAME and original PCBs?



9ofzeven
MAME Fan
Reged: 09/02/05
Posts: 124
Loc: Austria
Send PM


Re: MAME latencies? new [Re: Smitdogg]
#320821 - 01/23/14 08:51 PM


> Aside from input device frame lag you would probably get the opposite effect in a lot
> of cases like cd images loading faster than the original could read at, ram speed
> being faster, chds loading faster than original hard drives, and things not being
> emulated yet like wait states. But that's a guess and I have no idea how low of a
> level original ram speed is emulated at.

Hmmm, thanks. It seems that things can get a little complicated in emulation



Trebor
MAME Fan
Reged: 01/18/05
Posts: 509
Send PM


Re: MAME latencies? new [Re: 9ofzeven]
#320830 - 01/23/14 10:13 PM


> So when you say at least 1 frame latency, are these approx. 16ms noticeable? Have
> there been any rigorous (or at least anecdotal) comparisons between MAME and original
> PCBs?

Some comparisons here:
http://forum.arcadecontrols.com/index.ph...bunu75on75jph40

More talk here:
http://www.mameworld.info/ubbthreads/sho...part=1&vc=1



MooglyGuy
Renegade MAME Dev
Reged: 09/01/05
Posts: 2261
Send PM


Re: MAME latencies? new [Re: 9ofzeven]
#320832 - 01/23/14 10:43 PM


> So when you say at least 1 frame latency, are these approx. 16ms noticeable? Have
> there been any rigorous (or at least anecdotal) comparisons between MAME and original
> PCBs?

Out of curiosity, what's your end goal here with this line of questioning? This is all information that gets rehashed every 6-12 months on these and other MAME-related forums, so my "Just Asking Questions" sense is sending up red flags all over the place. If you have no ulterior motive, then I apologize.



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: MAME latencies? new [Re: Trebor]
#320833 - 01/23/14 11:05 PM


> > An emulator (MAME or any other) will have at least 1 video frame of latency, and at
> > least 2 if you enable triple buffering.
>
> How about v-sync (waitvsync 1)? Curious. From what I read/recall it is better to
> v-sync than triple buffer if you're system/video can handle it.

My original statement that you quoted is authoritative on this matter; vsync gives you at least 1 frame of latency, triple gives you at least 2. No sync at all may get you less than a frame of delay, but of course everything tears then.



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: MAME latencies? new [Re: Trebor]
#320837 - 01/23/14 11:18 PM


> Some comparisons here:
> http://forum.arcadecontrols.com/index.ph...bunu75on75jph40

It's nice that Calamity is sticking with science. ShmupMAME, having desynced backgrounds from sprites, is now rewriting the gameplay of the original games to make them "faster".

And in response to people being shocked that real CPS hardware has lag, a free tip from someone who programmed a 16-bit game or two: measuring by when you see the screen react is imperfect because most sprite animations in those games were drawn at like 12 or 15 FPS max, maybe 20 in the case of a "buttery" game like Aladdin. Because of that, it's quite possible the game saw your input 4 or 5 frames beforehand but the animation runs at a speed where something won't happen until later. Similarly, there may be inertia and other physics simulation types of things preventing your guy from moving at least 1 pixel each time the game sees an input.



Anonymous
Unregistered
Send PM


Re: MAME latencies? new [Re: 9ofzeven]
#320845 - 01/24/14 03:00 AM


> What are typical delays introduced by the emulation layer in MAME compared to
> original hardware? Have their been any measurements or blind tests?

You don't need to measure it. On an arcade board the CPU can sit in a loop monitoring your button presses. When you run that in MAME the inputs are only updated every frame.

On seeing you press that button it could change a palette register which will be output instantly. In MAME it's not only had to wait up to a frame to get the input but the frame can only be output once it's fully generated. Which can add up to another frame.

This is before you get into vsync/triple buffer/display driver issues which can add more latencies.



Anonymous
Unregistered
Send PM


Re: MAME latencies? new [Re: 9ofzeven]
#320846 - 01/24/14 03:01 AM


> Hmmm, thanks. It seems that things can get a little complicated in emulation

The more accurate you try to emulate something, the more you realise how inaccurate you really are.



Trebor
MAME Fan
Reged: 01/18/05
Posts: 509
Send PM


Re: MAME latencies? new [Re: R. Belmont]
#320852 - 01/24/14 04:34 AM


> My original statement that you quoted is authoritative on this matter; vsync gives
> you at least 1 frame of latency, triple gives you at least 2. No sync at all may get
> you less than a frame of delay, but of course everything tears then.

Cool...thanks! Again, I don't notice it...more a curiosity. I appreciate the response.



Trebor
MAME Fan
Reged: 01/18/05
Posts: 509
Send PM


Re: MAME latencies? new [Re: R. Belmont]
#320853 - 01/24/14 04:44 AM


> ShmupMAME, having desynced
> backgrounds from sprites, is now rewriting the gameplay of the original games to make
> them "faster".

Never heard of "ShmupMAME", previously. Wouldn't that be more "porting" the game than emulating it? If gameplay is being re-written, at best it sounds like something you would see in HBMAME, rather than it being an 'accurate as possible' simulation of the original game, no?

Pardon my ignorance if the above does not make sense. It's just how it comes across to me.



SmitdoggAdministrator
Reged: 09/18/03
Posts: 16877
Send PM


Re: MAME latencies? new [Re: Trebor]
#320854 - 01/24/14 05:05 AM


I used to feel the same way but...it's not a matter/care of accuracy, it's an attempt to get away from input lag which is not really a care of emulation's side effects as much as it is lag in general, even if the original had it. And if you're into shooting games and you've ever played a pcb like Battle Bakraid, you would understand the desire for it, to actually make a game fun. MAME baseline should stay away from it and stick to accuracy, but input lag can ruin a shooting game period, whether it was ruined originally on the pcb or through emulation. I had the pcb (Bakraid) for about 5 minutes. Complete garbage on account of the lag.



Traso
MAME Fan
Reged: 01/15/13
Posts: 2687
Send PM


Re: MAME latencies? new [Re: MooglyGuy]
#320857 - 01/24/14 06:05 AM


> Out of curiosity, what's your end goal here with this line of questioning? This is
> all information that gets rehashed every 6-12 months on these and other MAME-related
> forums, so my "Just Asking Questions" sense is sending up red flags all over the
> place. If you have no ulterior motive, then I apologize.

Novice though I am, I did feel something remotely similar on entering. Especially as they are an AdvanceMAME user, hmmmm.


As for input lag, I've occasionally experienced it, and thinking back on it, perhaps it was an errant circumstance... As for original HW lag, only retro games have I experienced it, and it didn't bother me. Perhaps I don't suck as bad as I thought as fighters, though.....



Scifi frauds. SF illuminates.
_________________

Culture General Contact Unit (Eccentric)



9ofzeven
MAME Fan
Reged: 09/02/05
Posts: 124
Loc: Austria
Send PM


Re: MAME latencies? new [Re: MooglyGuy]
#320883 - 01/24/14 06:46 PM


> Out of curiosity, what's your end goal here with this line of questioning? This is
> all information that gets rehashed every 6-12 months on these and other MAME-related
> forums, so my "Just Asking Questions" sense is sending up red flags all over the
> place. If you have no ulterior motive, then I apologize.

Well I don't visit other MAME-related forums, only this one occasionally...

Anyway, the question came up because I am planning on putting a PC into my Naomi cab and I just wanted to know what to expect from a modern MAME.

On a side note, perhaps it's worth including some of the answers here in the performance FAQ on mamedev.org because you guys really helped me get a perspective on things.



9ofzeven
MAME Fan
Reged: 09/02/05
Posts: 124
Loc: Austria
Send PM


Re: MAME latencies? new [Re: Trebor]
#320884 - 01/24/14 06:49 PM


> Some comparisons here:
> http://forum.arcadecontrols.com/index.ph...bunu75on75jph40
>
>
> More talk here:
> http://www.mameworld.info/ubbthreads/sho...part=1&vc=1

Thanks a lot, this is good stuff!



9ofzeven
MAME Fan
Reged: 09/02/05
Posts: 124
Loc: Austria
Send PM


Re: MAME latencies? new [Re: ]
#320886 - 01/24/14 07:00 PM


> You don't need to measure it. On an arcade board the CPU can sit in a loop monitoring
> your button presses. When you run that in MAME the inputs are only updated every
> frame.

Well I thought more in the line of measuring if the lag was perceived/perceivable by gamers.

>
> On seeing you press that button it could change a palette register which will be
> output instantly. In MAME it's not only had to wait up to a frame to get the input
> but the frame can only be output once it's fully generated. Which can add up to
> another frame.
>
> This is before you get into vsync/triple buffer/display driver issues which can add
> more latencies.

Call me naive, but I would have thought that MAM emulation granularity would be (at least partly) in sub-frame slices.

Given your example, what happens to multiple input events in MAME within a single frame, say joystick right, then left? Is only the latest one processed?



9ofzeven
MAME Fan
Reged: 09/02/05
Posts: 124
Loc: Austria
Send PM


Re: MAME latencies? new [Re: Traso]
#320892 - 01/24/14 07:23 PM


> Especially as
> they are an AdvanceMAME user, hmmmm.
>

Thanks for the hint, they have just changed their profile title!



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: MAME latencies? new [Re: 9ofzeven]
#320897 - 01/24/14 09:58 PM


> Given your example, what happens to multiple input events in MAME within a single
> frame, say joystick right, then left? Is only the latest one processed?

Correct, only one event will be seen, if you can actually pull that off (at 60 FPS it's harder than you think).

That said, there are, to my knowledge, no known games that sample the inputs more than once per generated video frame. On consoles it was somewhat common that pre-PS1 hardware could only read inputs during VBL, and we know that while some humans can do some limited buttonmashing at a 60 FPS rate they can't do it reliably (this is why TASes exist). So even today on PC/WiiU/PS4/Xbone games sample the inputs once per frame at VBL.



9ofzeven
MAME Fan
Reged: 09/02/05
Posts: 124
Loc: Austria
Send PM


Re: MAME latencies? new [Re: R. Belmont]
#320952 - 01/26/14 10:12 AM


> Correct, only one event will be seen, if you can actually pull that off (at 60 FPS
> it's harder than you think).
>
> That said, there are, to my knowledge, no known games that sample the inputs more
> than once per generated video frame. On consoles it was somewhat common that pre-PS1
> hardware could only read inputs during VBL, and we know that while some humans can do
> some limited buttonmashing at a 60 FPS rate they can't do it reliably (this is why
> TASes exist). So even today on PC/WiiU/PS4/Xbone games sample the inputs once per
> frame at VBL.

Ok, thanks a lot for the thorough explanations, RB and smf!



Outrun2006
MAME Fan
Reged: 03/15/07
Posts: 557
Send PM


Re: MAME latencies? new [Re: R. Belmont]
#320968 - 01/26/14 10:29 PM


>
An emulator (MAME or any other) will have at least 1 video frame of latency, and at
> least 2 if you enable triple buffering. This is on top of any latency that the game's
> original hardware/software have, of course. It's well known that modern consoles tend
> to have quite a bit, and even back in the 1980s games often had at least a couple of
> frames of joystick-to-eyeball latency. Space Invaders runs slower when all the
> invaders are alive, for instance, but that works well with the gameplay since you get
> better latency when you need it, towards the end of each stage


+++++

> You don't need to measure it. On an arcade board the CPU can sit in a loop monitoring
> your button presses. When you run that in MAME the inputs are only updated every
> frame.
>
> On seeing you press that button it could change a palette register which will be
> output instantly. In MAME it's not only had to wait up to a frame to get the input
> but the frame can only be output once it's fully generated. Which can add up to
> another frame.
>
> This is before you get into vsync/triple buffer/display driver issues which can add
> more latencies.


+++++++++++++++++++++

Interesting posts. Do you guys think that is the reason why the Ms Pac-Man games seem so difficult to control? I'm often making tons of mistakes because I can't the bitch go where I want her to.



Anonymous
Unregistered
Send PM


Re: MAME latencies? new [Re: Outrun2006]
#320983 - 01/27/14 01:50 AM


> Do you guys think that is the reason why the Ms Pac-Man games seem
> so difficult to control? I'm often making tons of mistakes because I can't the bitch
> go where I want her to.

You can preload the direction for the next turn, so moving shouldn't be a problem. Only reacting to ghosts would be affected.



Traso
MAME Fan
Reged: 01/15/13
Posts: 2687
Send PM


A lot of things figure in here..... new [Re: Outrun2006]
#321051 - 01/28/14 08:56 PM


> Interesting posts. Do you guys think that is the reason why the Ms Pac-Man games seem
> so difficult to control? I'm often making tons of mistakes because I can't the bitch
> go where I want her to.

Not just PC and OS, but also controller and controls. Any decent 4-way works well - *although* I played mspac on an original pac machine the other day (it had a multi-pac board in it) with possibly the original stick, it feels like leafs and all, and I did worse than I normally ever do at home on my U360 with custom map and octagonal restrictor, and that's with triple buffer off. (I'm also running at 800x600 with scanlines.png .)

I do even better with much older MAME. Current MAME seems to read analog differently than it used to a ways back. Perhaps more detailedly, but I find it's easier to screw up than older days MAME.



Scifi frauds. SF illuminates.
_________________

Culture General Contact Unit (Eccentric)



Outrun2006
MAME Fan
Reged: 03/15/07
Posts: 557
Send PM


Re: A lot of things figure in here..... new [Re: Traso]
#321062 - 01/28/14 09:59 PM


> > Interesting posts. Do you guys think that is the reason why the Ms Pac-Man games
> seem
> > so difficult to control? I'm often making tons of mistakes because I can't the
> bitch
> > go where I want her to.
>
> Not just PC and OS, but also controller and controls. Any decent 4-way works well -
> *although* I played mspac on an original pac machine the other day (it had a
> multi-pac board in it) with possibly the original stick, it feels like leafs and all,
> and I did worse than I normally ever do at home on my U360 with custom map and
> octagonal restrictor, and that's with triple buffer off. (I'm also running at 800x600
> with scanlines.png .)
>
> I do even better with much older MAME. Current MAME seems to read analog differently
> than it used to a ways back. Perhaps more detailedly, but I find it's easier to screw
> up than older days MAME.

>>>>>>>>>>>>>>>>>>>>>>>

Ahhh, very interesting. It seems those other factors do indeed play a role into the perceived latency of the game.


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 236 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1970