Jump to content



Photo
* * * * * 1 votes

Potential Flipper Lag Improvement Idea


  • Please log in to reply
357 replies to this topic

#1 Ben Logan

Ben Logan

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 2,275 posts
  • Location:California

  • Flag: ---------

  • Favorite Pinball: System 11

Posted 11 October 2016 - 08:40 PM

My ten year old and I often bounce back and forth between the two real pinball machines in our garage, and our homebrew VP cab in his bedroom. 

 

Last night, after starting on the real machines in the garage and then switching to VP, he said, "These flippers feel slow." He wasn't being negative. Just observing. 

 

I told him we've actually taken a big stride toward improving flipper lag with the introduction of True Fullscreen Mode. It's made a noticeable difference! 

 

VP10 ball physics are there. VPX lighting blows up like the paparazzi during multiball. But VP flippers still feel pretty laggy compared to the real thing. I wonder if we can make our VP flippers feel even snappier (?) I know we're up against a few limitations: 

 

* Controller latency (I'm not sure how much mine introduces. My leaf switches certainly feel faster than my QWERTY keyboard) 

* Refresh rate (60 times per second, if you're using V-Sync like me) 

* Coil RampUp (I always set this to zero, even though flippers often "feel better" with a bit of Coil RampUp, especially on EMs) 

 

This may be a total throwaway post, because I don't really know how VP works. But I imagine the VP flipper engine goes something like this: 

 

* VP waits for player to press flipper

* GPU gets message from VP engine that flipper button has been pressed

* GPU scrambles to draw flipper animation as quickly as possible

 

I imagine that the five or so animation frames between resting flipper and fully extended flipper take time to draw. I'm not sure whether the GPU calculates the full animation in advance and then "deploys" it as a package, or whether the animation starts as immediately as possible upon the flipper button being pressed (and then draws each frame "on the fly"). But either way, the time between one frame and the next must take a certain number of milliseconds. 

 

For argument's sake, let's say it's 5 milliseconds per frame... 

 

screenshot2016-10-11at12.27.10pm.png

 

So, the full flipper animation above would take 20 milliseconds. (4 frames, at 5 milliseconds per frame). 

 

Here's my question: If we were to introduce an option (a tick box in video settings, perhaps?) to eliminate full-flip animation altogether, and simply collapse the "full flip" down to two frames (Flipper at Rest and Flipper Fully Extended), could we eliminate 15 milliseconds (three frames worth) of latency

 

screenshot2016-10-11at120.png

 

Obviously this wouldn't look as cool. But it might be 75% faster (?) 

 

Another consideration is that few of us limit our playing style to simple on/off flipping. nFozzy, Toxie, and Fuzzel have all worked to bring us some flipper code / editor options to make low-voltage flips possible: A huge part of the realism in our flipper physics. I wouldn't trade that feature straight across for snappier full flips, but is there a way to get both? Fast as possible full-flips, with multi-frame animation support for low-voltage flips? 

 

Feel totally free to tell me my understanding of flipper animation's relationship to latency is totally off. I'd appreciate the education! 

 

Lastly, if we never achieve snappier flipping, VP is still a daily source of fun! I absolutely love it, and totally appreciate everyone on the forum: Especially you devs and engine coders. 

 

:D


Edited by Ben Logan, 11 October 2016 - 08:53 PM.


#2 hauntfreaks

hauntfreaks

    Real 4K Tables Since 2013

  • VIP
  • 2,522 posts
  • Location:South Jersey

  • Flag: United States of America

  • Favorite Pinball: -<3<3<3 All Real Pins



Posted 11 October 2016 - 08:59 PM

Ben is the epitome of the VP tweaker... we have coders, we have artists, we have 3D modeling gods....

 

but Ben is an absolute asset in the VP table physics world.... so Sir I thank you for plugging aways at making VP play better and better...


 26794541816_30ca1cca80_o.gif 43109635392_fc11af1a57_o.gif


#3 boiydiego

boiydiego

    Pinball Fan

  • Members
  • PipPipPipPip
  • 978 posts
  • Location:baal

  • Flag: Belgium

  • Favorite Pinball: flinstones,t2 chrome edition,wcs,afm,fish tales,medieval,rollercoaster tycoon,taxi

Posted 11 October 2016 - 10:03 PM

then i would start to see is a leaf switch like you use or is a microswitch button like i use faster or slower if your going to talking miliseconds/microseconds..


boiydiego___gebruik-n2kbkyc.png


#4 Ben Logan

Ben Logan

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 2,275 posts
  • Location:California

  • Flag: ---------

  • Favorite Pinball: System 11

Posted 11 October 2016 - 10:06 PM

Ben is the epitome of the VP tweaker...


Minor league alcoholic -- absolutely! Thankfully I save my tweaking for VP! :P

#5 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 11 October 2016 - 11:19 PM

The problem is not the displayed animation, but rather the 'real physics' itself..

So from the point you press the button until the engine can first actually react on that input and then the image actually can appear on the screen (or the other way round, e.g. when the engine calculated the ball position and it then ended up on the screen until you can react to it)..

Here is a nice sum-up of things from the higan/bsnes dude: https://byuu.org/articles/latency/

 

The only help here would be:

a) low latency USB (or whatever input protocol/hardware one could use else)

b) high frequency display (e.g. 120Hz upwards)

c) extremely high frame rate (e.g. highend GPU and CPU resulting in at least double the FPS of your monitors Hz so that (fast) vsync can work perfect all the time) and no GFX card driver delays (e.g. ideally getting the new low latency VR paths of the drivers to be usable within VP, too)


Edited by toxie, 12 October 2016 - 12:02 AM.


#6 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 11 October 2016 - 11:35 PM

Given that VP could run extremely fast and using something like NVIDIAs Fast (V)Sync (https://www.reddit.c...cial_fast_sync/) that decouples the engine/rendering from the actual display

OR that one turns off VSync completely (either NVIDIA control panel or in VP itself)

AND that one fools around with the "Maximum Pre-Rendered Frames" in either VP or the NVIDIA control panel (lowest can be better, but must not be overall, only testing will tell you, see for example here: https://www.reddit.c...x_prerendered/)

one will still face aboves issues:

 

So to do some math for the lowest/ideal world one can get at the moment:

a) ~8ms (USB = 125Hz)

b) ~17ms (TV = 60Hz, not counting that a lot of current TVs will add one additional frame at least of post-processing/display buffering, e.g. overall ~33ms or even more)

c) ~17ms

 

With new/non-existing hardware/tweaked settings:

a) ~1ms (USB = 1000Hz)

b) ~8ms (TV = 120Hz, with a CRT-style direct output of the image)

c) ~8ms (most likely even less when in a VRish mode)

 

now compare that to the close to 0ms lag of a real pinball machine.  :/


Edited by toxie, 12 October 2016 - 08:04 AM.


#7 Drybonz

Drybonz

    Really bad at pinball, but having fun.

  • Members
  • PipPipPipPip
  • 1,538 posts

  • Flag: ---------

  • Favorite Pinball: Theatre of Magic

Posted 12 October 2016 - 12:04 AM

Higher frequency display makes a huge difference.  I can play on my 144hz monitor, then compare to my old 60hz monitor and everything is laggy and choppy... not extreme, but when you compare the two you can really tell the difference.  I would not be able to go back to any kind of gaming on a 60hz monitor.  The monitor makes more of a difference than we generally admit.


Edited by Drybonz, 12 October 2016 - 12:04 AM.


#8 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 12 October 2016 - 12:06 AM

A super-weird idea would be though to 'rewind' the physics back by the same amount that all these delays caused and then let the ball react to the new input, as if there would have been no delays at all, then fast forward from there to the same time again.

The problem: Each time you press a button (or shake the machine, etc) the ball and everything else will warp back (e.g. extremely strange/juttery movement).


Edited by toxie, 12 October 2016 - 12:12 AM.


#9 Ben Logan

Ben Logan

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 2,275 posts
  • Location:California

  • Flag: ---------

  • Favorite Pinball: System 11

Posted 12 October 2016 - 12:36 AM

Thanks, Toxie. I suspected that the bottleneck is hardware based as you describe. I see now why my little idea would make zero difference!   :P  Sounds like the latency experienced by the user occurs between pressing the flipper button and flipper animation commencement, rather than as function of a "slow" flipper animation drawing process. In that case 10 frames of animation vs. 2 makes no appreciable speed-up. 

 

I am constantly amazed by how well you understand this stuff, Toxie! The info in your three posts above is gold. Time to start saving for some new hardware! :) 

 

Drybonz - What happens when you enable Vsync on your 144hz monitor? Does it lock the VP engine to 144 FPS? 


Edited by Ben Logan, 12 October 2016 - 12:44 AM.


#10 Drybonz

Drybonz

    Really bad at pinball, but having fun.

  • Members
  • PipPipPipPip
  • 1,538 posts

  • Flag: ---------

  • Favorite Pinball: Theatre of Magic

Posted 12 October 2016 - 01:21 AM

Hey Ben... vsync always works the same way for any monitor and will "sync" all FPS to the monitor's refresh rate... so if your monitor is 60hz or 120 or 144, or whatever, it will sync to that refresh rate.

 

If I move my mouse cursor in a fast circle it will leave "trails" on the monitor.  Those trails, on my old 60hz monitor look like choppy, spaced out mouse cursors moving.  The same motion on my 144hz monitor will look more like a smooth, closed circle of mouse cursors.  Maybe not the best explanation, but if you can imagine that, then you can imagine also what affect it would have on moving parts (such as a pinball or flippers) in a game.  It is far more pleasant and playable.


Edited by Drybonz, 12 October 2016 - 01:24 AM.


#11 wrd1972

wrd1972

    Authoring Padawan

  • Platinum Supporter
  • 2,265 posts
  • Location:Central KY. USA

  • Flag: United States of America

  • Favorite Pinball: Funhouse

Posted 12 October 2016 - 01:41 AM

Cant explain why. But I have never felt like the flippers were lagging on my cab. If they were, I am confident I would pick up on it. Maybe its just not as big an issue for some as it is for others. Could have something to do with the various hardware configurations.


My VP Pincab /MAME Arcade  Specs: Dell T3400 workstation with Core2 Quad core 3.0GHZ (Q9650) CPU - 8GB of RAM - Nvidia  GTX 970

40" PF Sony gaming LED TV, Dual 21" Dell monitors in the backbox - Pinscape dual boards - Full DOF - Full MAME arcade support.


#12 hauntfreaks

hauntfreaks

    Real 4K Tables Since 2013

  • VIP
  • 2,522 posts
  • Location:South Jersey

  • Flag: United States of America

  • Favorite Pinball: -<3<3<3 All Real Pins



Posted 12 October 2016 - 02:46 AM

I dont feel the difference between a real machine and my cab...and I can't tell you why....

 

my wife on the other hand says she can tell and almost never plays my cab...

 

I've had real pin dudes play my rig with mixed feelings on the lag.... some feel it, some dont and some say within seconds it fades away....


 26794541816_30ca1cca80_o.gif 43109635392_fc11af1a57_o.gif


#13 Ben Logan

Ben Logan

    Pinball Wizard

  • Members
  • PipPipPipPipPip
  • 2,275 posts
  • Location:California

  • Flag: ---------

  • Favorite Pinball: System 11

Posted 12 October 2016 - 03:13 AM

Thanks for the responses, guys. Jonesing for a 144hz monitor! Alas - zero funds! :P

 

Glad to hear HF and Wrd don't notice any difference. I've been experimenting for the better part of the evening with different settings. You devs / graphics guys do such an amazing job with these recent VPX tables that I'm able to dial down all the bells and whistles graphics settings and the tables still look great. Getting lots less flipper lag as a result. The settings really do make a major difference for the positive in terms of reducing latency.

 

Thanks to Toxie and Fuzzel once again for this amazingly flexible engine!



#14 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 12 October 2016 - 07:38 AM

Some more things:

 

Just yesterday evening when switching from the real thing to the virtual: its very disturbing when playing the first game. So there is definetly more lag. But when one has played a few games, one does not notice it anymore.

 

VSync: There i can just repeat myself more: Fast (V)Sync on NVIDIA cards/in the NV control panel should be the best to go with, but ONLY if your hardware is fast enough (e.g. at least twice the amount of FPS of your monitors Hz): https://www.reddit.c...cial_fast_sync/

 

 

And i somehow like the rewind idea i mentioned above. I just don't have a clue how to implement it, especially with the scripting..  :/


Thanks, Toxie. I suspected that the bottleneck is hardware based as you describe. I see now why my little idea would make zero difference!   :P  Sounds like the latency experienced by the user occurs between pressing the flipper button and flipper animation commencement, rather than as function of a "slow" flipper animation drawing process. In that case 10 frames of animation vs. 2 makes no appreciable speed-up. 

 

Indeed. The animation itself does not play a role, but of course the flipper actually reacting faster within VP itself will still make a difference, so all things one can tune in the flipper physics options to make it go up faster (while not messing up the 'feeling' of a real flipper) will also help, like you mentioned in the first post.

 

 

EDIT: i also pimped my post http://www.vpforums....111#entry359410 a bit more with some additional info


Edited by toxie, 12 October 2016 - 08:03 AM.


#15 Brer Frog

Brer Frog

    Pinball Fan

  • Members
  • PipPipPipPip
  • 1,095 posts
  • Location:Illinois

  • Flag: United States of America

  • Favorite Pinball: Funhouse, Attack From Mars, Medieval Madness

Posted 12 October 2016 - 08:49 AM

Higher frequency display makes a huge difference.  I can play on my 144hz monitor, then compare to my old 60hz monitor and everything is laggy and choppy... not extreme, but when you compare the two you can really tell the difference.  I would not be able to go back to any kind of gaming on a 60hz monitor.  The monitor makes more of a difference than we generally admit.

 

What size and make & model monitor are you using?



#16 Kernel

Kernel

    Enthusiast

  • Members
  • PipPipPip
  • 134 posts

  • Flag: ---------

  • Favorite Pinball: Stones 'n Bones

Posted 12 October 2016 - 09:51 AM

On my cfg I have 180/240FPS with VPX and (like I've said in the performance troubleshooting thread) I feel heavy lag on flippers compared to VP9 that runs super smooth and it's super responsive (moving from VP to real is not so noticeable), so in my case is proved that's not a 60Hz TV or a USB latency problem.

The wired thing is that on some tables with the same FPS amount, there's a great difference in LAG.

 

Roadshow for example is one of the VPX tables that works better for me (not as VP9 BTW). I have more or less the same framerate as the other VPX tables, but flippers are much more responsive, maybe due to different physics settings.

I am seriously thinking that the flipper lag I feel is "only" physics engine/settings related.

 

Flipper responsiveness (lag) is crucial when you play pinballs. Time spent trying to improve that aspect is very well spent.



#17 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 12 October 2016 - 11:51 AM

Absolutely. Thats where the authors come into play. There are different settings one can choose for the flippers so that they act reasonably realistic during gameplay.

But some of these settings will just act "slower" then others in practice, thus one implicitly adds lag by this, too.

 

Plus: If VP9 runs even faster than VPX (which i assume) on your system and you do not use VSync, then all the overhead and delays of VP itself (and its interactions with the drivers and OS) are basically subtracted from the equation.

Or do you also limit VP9 to the same framerates?



#18 Kernel

Kernel

    Enthusiast

  • Members
  • PipPipPip
  • 134 posts

  • Flag: ---------

  • Favorite Pinball: Stones 'n Bones

Posted 12 October 2016 - 12:11 PM

Plus: If VP9 runs even faster than VPX (which i assume) on your system and you do not use VSync, then all the overhead and delays of VP itself (and its interactions with the drivers and OS) are basically subtracted from the equation.

Or do you also limit VP9 to the same framerates?

Exactly. I can exclude hardware related lag (monitor, input) and other delays involving OS/Drivers..

I don't limit VP9 because is super smooth even without v-sync enabled. No need to enable it.

With VPX I've tryied v-sync on 1 (60 FPS - heavy lag. Unplayable), v-sync on 2 or 120 (much better but LAG still there) and v-sync OFF (same as 120, but with stutters).


Edited by Kernel, 12 October 2016 - 12:13 PM.


#19 BorgDog

BorgDog

    We come in peace.. shoot to kill.. shoot to kill.

  • Members
  • PipPipPipPip
  • 1,427 posts
  • Location:Leavenworth, WA

  • Flag: United States of America

  • Favorite Pinball: Alien Star, TNA



Posted 12 October 2016 - 12:40 PM

thanks for the info on fast sync toxie, going to play around with that tonight and see what it can do.  I'm running an i7-6700K@4GHz and a GTX1070 with a 2160p playfield and 1080p backglass (2 screen).  

 

I do notice a little difference between the flippers on Golden Arrow when I go from the real one to the virtual one (they sit side by side), but only for a short bit and my brain compensates.  I imagine someone not used to playing vp all the time would notice it a lot more.



#20 Slydog43

Slydog43

    Pinball Wizard

  • Platinum Supporter
  • 3,008 posts
  • Location:Hackettstown, NJ

  • Flag: United States of America

  • Favorite Pinball: Addams Family, All Williams 90's Games

Posted 12 October 2016 - 12:42 PM

As Toxie stated earlier, I can really feel the flipper lag when I come from playing a few real games on a machine and move to the VP Cab.  1st few balls I can really "feel" the flipper lag, but my brain quickly forgets about it and I just love VP again.  So the best answer seems just to play more pinball (VP pinball at least, hell just play more pinball :)