Build Your Own Arcade Controls Forum
Main => Main Forum => Topic started by: adder on December 04, 2012, 12:06:24 pm
-
hey all
i never really paid much attention to the whole issue of lag (ie. input, video, or anything else) when using emulators such as mame
however reading around forums lately i notice its obviously a problem, for some more than others it seems
anyway i was wondering, does anyone know a good way to actually test controls/video/other lag in mame without the need of special/extra equipment
the reason i ask is, i tried the advance-frame method (see below) of testing lag in mame but unsure if it's an accurate test
what i did was took the game: galaga'88
i did the following test:
- launched mame, loaded galaga'88
- inserted coins, started a game
- held down the right arrow key on my keyboard to begin to move the ship to the right
- without letting go of the right arrow key, i pressed once the 'P' (pause) button on my keyboard
- now i let go of the right arrow key
- next i held down the left arrow key AND the shift key together
- finally while continuing to hold down the left arrow key and the shift key, i tapped the 'P' (pause) button on my keyboard several times (to now advance the game one frame at a time)
what happens is, the ship in galaga'88 continues to move across the screen to the right, another 4 frames after you have pressed the left arrow key on your keyboard (note: by the way i am not saying this is a mame specific problem, i imagine the actual arcade version itself has similar lag, but perhaps one less frame of lag than mame? i dont know..)
anyway, my question is this.... i heard/read that triple buffer introduces extra lag in mame, so i did the galaga'88 test above with triple buffer turned on and then turned off. i also did the same test with vsync on/off. i didnt get any change in results, the lag of 4 frames does not change.
am i being noob (strongly possible) or have i missed the point altogether? is my test invalid when it comes to determining whether triple buffer creates additional lag? if so, is there a way to test potential lag caused by triple buffer, or failing that, perhaps someone can simply advise me on if triple buffer should be avoided if possible, and if so, what are better suited settings in mame in order to minimise lag (eg. the best method of video sync to use, or, is there a difference in lag between using directdraw/direct3d, is it better to use usb port or older ps2 port controls, etc)
cheers! ;)
-
Post your mame.ini's, one for each of the settings used to compare, and your system specs, including what MAME and OS.
-
to make things easier, rather than post mame.ini's, i can tell you the test was run using totally default settings in official mameui 32bit version 147, (plus the 147 beta versions)
so, to recreate my test simply delete (or rename if you dont want to lose it :)) your current mame.ini and launch mameui 147 into its default settings
now its just a case of enabling/disabling the triple buffer/vsync options and seeing if it makes any difference. in my case it is always the 4 frames lag in galaga'88, no more, no less, regardless of video settings, or if using direct3d vs. directdraw.
tests were done on a laptop with lcd screen, WIN XP 32bit, 2gb ram, 2ghz core2duo intel, directx 9, regular inbuilt laptop keyboard for controls
tests were also done on a second machine, an intel P4 3.4ghz desktop with 2gb ram, WIN XP 32bit, directx 9, usb keyboard, with crt tv connected via vga to scart cable
can i ask you (or anyone else reading this) to run the test and report your results? im assuming you get the same results as me. im assuming everyone will with a 'reasonably good' pc setup, which will either mean this test is pointless and doesnt prove anything :lol, or instead, (hopefully), it can be proved that changing many video settings in mame makes no difference to gameplay, video, (or whatever name it should be called), 'lag'.
-
Its funny cause i noticed that in galaga 88 as well. Ill move the joystick left and right and there is like a half second delay. No delay in windows or in SSF4 arcade.
-
I guess this lag is in the real galaga'88 too. I'm using mame 0.145 on Linux (Ubuntu 12.04 64bit on Intel i5 760 2.8GHz) and tons of GLSL effects to simulate CRT on my LCD.
I did your test on:
Galaga'88 - 4 Frames
Wonderboy - 2 Frames
Scramble (using up-down) - 1 Frame
Terra Cresta - No lag
DoDonPachi - 3 Frames
Provided Terra Cresta has no lag and other games have a variable number of frames I would think the lag is in the real PCBs too. Moreover I don't think a lag introduced by mame or OS buffering input, calculating and plotting the frames, etc would be visible with this method because with the game paused the OS and mame have all the time to catch up... ditto for the TV or monitor display buffer.
-
equilzer could u be persuaded to do the test below, and report back if your lag is more than 4 frames?
____________________________________________________________________
the following test:
- launched mame, loaded galaga'88
- inserted coins, started a game
- held down the right arrow key on my keyboard to begin to move the ship to the right
- without letting go of the right arrow key, i pressed once the 'P' (pause) button on my keyboard
- now i let go of the right arrow key
- next i held down the left arrow key AND the shift key together
- finally, while continuing to hold down the left arrow key and the shift key, i tapped the 'P' (pause) button on my keyboard several times (to now advance the game one frame at a time)
what happens is, the ship in galaga'88 continues to move across the screen to the right another 4 frames, after you have pressed the left arrow key on your keyboard.....
________________________________________________________
-
I've got different PC's and video equipment torn apart, and unfortunately I'm up to my neck in work for the time. So, I'm sorry but I'm not able to properly test things right now.
As I've said, I don't think there's any way for triple buffer to be working and not add lag. So if there's really nothing else going on, you've found a problem with the frame step method.
When I get things straightened in the future I'll test it with the high speed camera method to measure the lag in real time, and see what's really going on.
-
...I did your test on: Terra Cresta - No lag
cool, i just did the terra cresta test also and noticed no lag also
.....with the game paused the OS and mame have all the time to catch up... ditto for the TV or monitor display buffer.
thats what i have been thinking too, maybe the test is invalid. in which case im wondering which video sync effect in mame (triple buffer, vsync, syncrefresh) adds the least amount of 'lag'.. or if its just a dumb question overall and not worth worrying about! ::)
-
I'm sorry but I'm not able to properly test things right now.
no worries at all
When I get things straightened in the future I'll test it with the high speed camera method to measure the lag in real time, and see what's really going on.
awesome, im all ears if you come up with some interesting results ;)
-
im wondering which video sync effect in mame (triple buffer, vsync, syncrefresh) adds the least amount of 'lag'.. or if its just a dumb question overall and not worth worrying about! ::)
Yeah, you shouldn't be picking a refresh rate and trying to force the game to it. You should be adjusting the output refresh rate to that of the original game. Doing this and using -syncrefresh will be the way to ensure the game is running at original speed, without sound issues (soundsync not needed), scrolling smoothly without -waitvsync and -triplebuffer (which cause lag) and without frameskipping.
Not a dumb question. This is especially important with your SCART TV setup ^. You should be getting native resolutions on that thing and running in proper refresh rates.
As for LCD's, you can't usually adjust refresh rates to use this method, so it's a different situation. You can still use syncrefresh and force the game to 60Hz, but then you'll be off from the original speed depending on the native refresh, and you may need autoframeskip to alleviate audio stuttering may not work (actually I'm not sure if autoframeskip would work in this case). Instead you could use waitvsync, which technically causes some lag, but should normally be much less than triple buffer. Just more of the problems with LCD's, they lag in the first place, and then you can't use proper video settings with them.
-
I'm sorry but I'm not able to properly test things right now.
no worries at all
yup, typo again, woops
awesome, im all ears if you come up with some interesting results ;)
I'll get to it when I get things together.