3 ms·
That time warping has already been implemented in the project of Lagless MAME. It compensates for input and display lag by always rendering a few frames into t
by T-hawk 14y ago
That time warping has already been implemented in the project of Lagless MAME. It compensates for input and display lag by always rendering a few frames into the future. It's commonly used for games where frame-accurate timing is critical, notably 2D scrolling shmups and fighting games.
Lagless MAME renders into the future assuming that the state of the input controls remains constant over that future time, and saves the emulation state every frame. When a button is pressed or released or whatever, Lagless MAME rewinds to the saved state for that frame and quickly re-emulates from that point forward. So the result is to send your input back in time past the lag, to the moment in the emulation exactly synchronized to when you saw it on the screen. The experience isn't perfect -- your spaceship would jump a few pixels then move smoothly -- but by and large it's far superior to playing with the actual lag.
This technique could be used for lag compensation in almost any environment. The limiting factor is the cost of re-computing several frames of game state on every input action. Of course, as Carmack says, actually eliminating lag is far preferable to masking it with such techniques.
The lag compensation in Guitar Hero and Rock Band games works essentially this way too.