Jump to content



Photo
* * * * * 1 votes

Potential Flipper Lag Improvement Idea


  • Please log in to reply
357 replies to this topic

#221 Knorr

Knorr

    Enthusiast

  • Platinum Supporter
  • 221 posts
  • Location:Amstetten

  • Flag: Austria

  • Favorite Pinball: Dirty Harry

Posted 21 October 2016 - 02:31 PM

Last night i had a idea how normal flippers could work with the pinmame flipper calls.

 

I dont want to explain it to much. The basic idea is to ask after every flip if the pinmame flipper actually moved or is in inital pos.

 

The good thing, it works really well. Video modes, totan stuff or also phantom flips (at least with a on/off timer) should work as expected.

 

The bad thing... because it ask after the flip two things do happen: you can flip one more time then the rom call would do. Second when you are in that situation you could hold the flipperfingers up forever....

 

 

The good thing for me, i can do drop/live catches again without thinking about it, now it feels really natural for me...

 

 

 

Anyway, i´m not a scripter. Someone out there can do this much better then me.

 

Judge for yourself, I just put this script in a few minutes together.

 

In DT view you can see the vpinmame flippers on the outside of the table, the left/right flipper on the table are the normal keypress/rotate flippers.

The pinmame flippers are set to a very fast up movement and a slow return movement... just to be sure there is enough time for script calls...

 

The two upper left flippers on the playfield are normal pinmame flippers...

 

RoadShow Flipper Test



#222 vogliadicane

vogliadicane

    Pinball Fan

  • Members
  • PipPipPipPip
  • 517 posts
  • Location:Velbert

  • Flag: Germany

  • Favorite Pinball: The Addams Family

Posted 21 October 2016 - 03:45 PM

Sorry for the late reply, didn't have access to my VPin-PC.

So here are my video settings, nothind demanding I think...

 

Edit: the second one for VP9...

Attached Files


Edited by vogliadicane, 21 October 2016 - 03:49 PM.


#223 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,664 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 21 October 2016 - 03:51 PM

Last night i had a idea how normal flippers could work with the pinmame flipper calls.

 

I dont want to explain it to much. The basic idea is to ask after every flip if the pinmame flipper actually moved or is in inital pos.

 

The good thing, it works really well. Video modes, totan stuff or also phantom flips (at least with a on/off timer) should work as expected.

 

The bad thing... because it ask after the flip two things do happen: you can flip one more time then the rom call would do. Second when you are in that situation you could hold the flipperfingers up forever....

 

 

The good thing for me, i can do drop/live catches again without thinking about it, now it feels really natural for me...

 

 

 

Anyway, i´m not a scripter. Someone out there can do this much better then me.

 

Judge for yourself, I just put this script in a few minutes together.

 

In DT view you can see the vpinmame flippers on the outside of the table, the left/right flipper on the table are the normal keypress/rotate flippers.

The pinmame flippers are set to a very fast up movement and a slow return movement... just to be sure there is enough time for script calls...

 

The two upper left flippers on the playfield are normal pinmame flippers...

 

RoadShow Flipper Test

I have not had time to try this trick, but you can try to do as I do with Surf'n Safari, I have attached the flippers to the solenoid 32 (Tilt?).
The Tilt solenoid for Red and Ted should be 31.



#224 Gromit21

Gromit21

    Hobbyist

  • Silver Supporter
  • 39 posts

  • Flag: United States of America

  • Favorite Pinball: Fun House

Posted 21 October 2016 - 04:24 PM

I tried both gxtjoe and Knorr's changes in regard to flipper lag. When I first loaded the VPX Red and Ted table it looked great - but it was unplayable due to the flipper lag. The flipper's responded spoadically and stuck in the up position often. The gtxjoe change worked great! I tried Knorr's change today and it was just as good... maybe a tad bit more responsive, but that may be subjective. Knorr's change does make the flippers behave normally at game end when they should be off.

 

The bottom line for me, is they both make the table playable and both work. Any further improvement would be for the true aficionados.

 

Edit: I'm running this in a cab, if it makes any difference.


Edited by Gromit21, 21 October 2016 - 04:26 PM.


#225 jimmyfingers

jimmyfingers

    Pinball Fan

  • VIP
  • 832 posts

  • Flag: Canada

  • Favorite Pinball: Comet



Posted 21 October 2016 - 06:12 PM

I tried both gxtjoe and Knorr's changes in regard to flipper lag. When I first loaded the VPX Red and Ted table it looked great - but it was unplayable due to the flipper lag. The flipper's responded spoadically and stuck in the up position often. The gtxjoe change worked great! I tried Knorr's change today and it was just as good... maybe a tad bit more responsive, but that may be subjective. Knorr's change does make the flippers behave normally at game end when they should be off.

 

The bottom line for me, is they both make the table playable and both work. Any further improvement would be for the true aficionados.

 

Edit: I'm running this in a cab, if it makes any difference.

The issue about the flipper's responding sporadically and being stuck in the up position is not the same issue as the overall flipper lag and very important again to distinguish here and from the crux of this conversation / thread.  

 

That issue that you describe is from not having an actual .directb2s file available when the table loads while the controller is set to use B2S (whether old style or with the newer automated scripts).  It's an issue that has been discussed and observed commonly around the forums and to resolve that on it's own, either disable B2S / use regular pinmame in the script directly or in your controller.txt file in the user folder (setting the line ForceDisableB2S=0 to 1) or alternatively find and ensure a functional .directb2s file for the table you are trying to play.  There are ways you can verify whether B2S or pinmame are actually running, but I won't get into the steps here in this reply / scope.  In this main issue / scenario above, you should also be seeing a brief error / message box about the missing .directb2s file when you have this scenario of stuck flippers / sporadic flippers, although the window could get hidden or blocked by other screens and multi-monitor setups may hamper further your ability to find / see this message box.

 

Ensuring B2S is disabled with the latest core and scripts can be a bit tougher than before by simply looking in the script and choosing the desired option.  It's more automated now and in genera a good thing, however, forcing your choice for testing or other purposes on a per table or per execution can be tougher because the goal of the updates to these B2S / core / controller.txt changes was really so that one would not have to specify for each table and their general setup would dictate.  

 

Also, the reason that this all seemed cleared up by the two direct flipper / ROM call bypassing methods that you tried is because bypassing the ROM interaction makes the issues caused from B2S controller being active with a missing .directb2s file totally moot as it is no longer using any controller communication for flipper movement / polling and thus does not encounter the sporadic / stuck issues.

 

This all can definitely mislead correct conclusions and inferences so this is a really important item to have clarified.  Fix the missing .directb2s file or forceably switch to using pinmame only and retest with the scripting options and you will not see nearly the same discrepancy that you were witnessing even though the script will still help make the flippers a bit less latent.



#226 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

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

  • Favorite Pinball: Pinbot

Posted 21 October 2016 - 11:05 PM

 

Last night i had a idea how normal flippers could work with the pinmame flipper calls.

 

I dont want to explain it to much. The basic idea is to ask after every flip if the pinmame flipper actually moved or is in inital pos.

 

The good thing, it works really well. Video modes, totan stuff or also phantom flips (at least with a on/off timer) should work as expected.

 

The bad thing... because it ask after the flip two things do happen: you can flip one more time then the rom call would do. Second when you are in that situation you could hold the flipperfingers up forever....

 

 

The good thing for me, i can do drop/live catches again without thinking about it, now it feels really natural for me...

 

 

 

Anyway, i´m not a scripter. Someone out there can do this much better then me.

 

Judge for yourself, I just put this script in a few minutes together.

 

In DT view you can see the vpinmame flippers on the outside of the table, the left/right flipper on the table are the normal keypress/rotate flippers.

The pinmame flippers are set to a very fast up movement and a slow return movement... just to be sure there is enough time for script calls...

 

The two upper left flippers on the playfield are normal pinmame flippers...

 

RoadShow Flipper Test

I have not had time to try this trick, but you can try to do as I do with Surf'n Safari, I have attached the flippers to the solenoid 32 (Tilt?).
The Tilt solenoid for Red and Ted should be 31.

 

D:

 

I went through and tried to find these solenoids and this is what I came up with:

 

System 80b: No such solenoid in Genesis, but these games are simple enough the GI solenoid might work

 

System 11 / B / C: Sol23 in Road Kings, Swords of Fury and Bad Cats, and Dr. Dude

 

Data East alphanumeric - sol23 in Robocop

Data East Dot-Matrix - sol23 in Tales from the Crypt

 

WPC 90' - sol 31 in Funhouse

WPC 92' - Sol 31 in T2 (I feel dumb now) and Twilight Zone

WPC Security - sol31 in Dirty Harry and Red & Red's Roadshow

WPC 95' - No go, checked from 0 to 100 but no solenoid for this in Scared Stiff, AFM, or Congo

Sega -  No go in South Park

 

Whitestar - No go in Monopoly, and either JP or Pacdude left a note in the Monopoly script that said setting up SolGameOn is impossible for stern tables

 

So in conclusion, older tables should be simple to rig up. Modern tables more complicated.



#227 Drybonz

Drybonz

    Really bad at pinball, but having fun.

  • Members
  • PipPipPipPip
  • 1,538 posts

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

  • Favorite Pinball: Theatre of Magic

Posted 22 October 2016 - 12:22 AM

VP 10.2 rev2815 that posted today has some changes that are relevant here I think?



#228 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

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

  • Favorite Pinball: Pinbot

Posted 22 October 2016 - 12:47 AM

I changed core.vbs to check more than 64 solenoids (though I guess vpm only updates up to solenoid 68?). I didn't find any table that went that high with solenoid callbacks.

 

No idea about the solenoid modulation stuff, I don't think the mame side of it is implemented yet



#229 nFozzy

nFozzy

    Pinball Fan

  • Members
  • PipPipPipPip
  • 553 posts

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

  • Favorite Pinball: Pinbot

Posted 22 October 2016 - 05:03 AM

I made a simple script for skipping the flipper solenoids for games with the easy solenoids (most tables up to WPC 95' / Whitestar / Capcom)

 

add this to your keydown section, if the "keycode = LeftFlipperKey" part isn't there, copy it in

        If keycode = LeftFlipperKey Then
            flipnf 0, 1
        end if
        If keycode = RightFlipperKey Then
            flipnf 1, 1
        end if

and this to key up

        If keycode = LeftFlipperKey Then
            flipnf 0, 0
        end if
        If keycode = RightFlipperKey Then
            flipnf 1, 0
        end if

Find the old solenoid callback subs and comment out the flipper-related stuff.

SolCallback(sLRFlipper) = "SolRFlipper"
SolCallback(sLLFlipper) = "SolLFlipper"

Sub SolLFlipper(Enabled)
    If Enabled Then
 '       PlaySound "flipperup",1,0.1:LeftFlipper.RotateToEnd
    Else
'        PlaySound "flipperdown",1,0.1:LeftFlipper.RotateToStart
    End If
End Sub

Sub SolRFlipper(Enabled)
    If Enabled Then
'        PlaySound "flipperup",1,0.1:RightFlipper.RotateToEnd
    Else
'        PlaySound "flipperdown",1,0.1:RightFlipper.RotateToStart
    End If
End Sub

Then add this in it's own section nearby.

Make sure the solcallback is set to the correct solenoid number: solcallback(23) for System 11 / Data East, solcallback(31) for WPC-alphanumeric through WPC security, solcallback(32) for Gottlieb system 3. Change the flipper sounds in LeftFlipperSound and RightFlipperSound to match the table's sounds, add any upper flippers.

'*********
' Special Flippers
'*********
dim FlippersEnabled

SolCallback(31)        = "TiltSol"

Sub TiltSol(Enabled)
    FlippersEnabled = Enabled
    if Enabled Then
 '       l131.state = 1
        vpmnudge.solgameon true
    Elseif not Enabled Then
'        l131.state = 0
        vpmnudge.solgameon false
        if leftflipper.startangle > leftflipper.endangle Then
            if leftflipper.currentangle < leftflipper.startangle then leftflipper.rotatetostart : leftflippersound 0 : end if
        elseif leftflipper.startangle < leftflipper.endangle Then
            if leftflipper.currentangle > leftflipper.startangle then leftflipper.rotatetostart : leftflippersound 0 : end If
        end If
        if rightflipper.startangle > rightflipper.endangle Then
            if rightflipper.currentangle < rightflipper.startangle then rightflipper.rotatetostart : rightflippersound 0 : end if
        elseif rightflipper.startangle < rightflipper.endangle Then
            if rightflipper.currentangle > rightflipper.startangle then rightflipper.rotatetostart : rightflippersound 0 : end If
        end If
    end if
end sub


sub flipnf(LR, DU)
    if LR = 0 Then        'left flipper
        if DU = 1 then
            If FlippersEnabled = True then
                leftflipper.rotatetoend
                LeftFlipperSound 1
            end if
            controller.Switch(swLLFlip) = True
        Elseif DU = 0 then
            If FlippersEnabled = True then
                leftflipper.rotatetoStart
                LeftFlipperSound 0
            end if
            controller.Switch(swLLFlip) = False                            
        end if
    elseif LR = 1 then        ''right flipper
        if DU = 1 then
            If FlippersEnabled = True then
                RightFlipper.rotatetoend
                RightFlipperSound 1
            end if
            controller.Switch(swLRFlip) = True
        Elseif DU = 0 then
            If FlippersEnabled = True then
                RightFlipper.rotatetoStart
                RightFlipperSound 0
            end if
            controller.Switch(swLRFlip) = False                        
        end if
    end if
end sub

sub LeftFlipperSound(updown)'called along with the flipper, so feel free to add stuff, EOStorque tweaks, animation updates, upper flippers, whatever.
    if updown = 1 Then
        playsound SoundFX("Flipperup",DOFContactors)    'flip
    Else
        playsound SoundFX("Flipperdown",DOFContactors)'return
    end if
end sub
sub RightFlipperSound(updown)
    if updown = 1 Then
        playsound SoundFX("Flipperup",DOFContactors)    'flip
    Else
        playsound SoundFX("Flipperdown",DOFContactors)'return
    end if
end sub

Some troubleshooting:

 

Some tables will be using this solenoid for something already. You'll have to merge the existing sub with the new sub, TiltSol

 

Script error (line 1: Object not a collection) probably means cvpmNudge's tilt objects aren't set up. You can set them up like this in the table init sub:

vpmNudge.TiltObj = Array(Bumper1, Bumper2, Bumper3, LeftSlingshot, RightSlingShot) 'etc

or just comment out vpmnudge.solgameon.



#230 kiwi

kiwi

    Pinball Fan

  • VIP
  • 2,664 posts

  • Flag: Italy

  • Favorite Pinball: Star Trek 25th Anniversary



Posted 22 October 2016 - 05:49 AM

In other cases we can use the Tilt light, if it is present.



#231 toxie

toxie

    VPF Veteran

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

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 22 October 2016 - 01:28 PM

Great stuff, guys. Its good that all this information/secret sauce finally comes together in one thread.



#232 rothbauerw

rothbauerw

    Enthusiast

  • Members
  • PipPipPip
  • 345 posts
  • Location:Wisconsin - USA

  • Flag: United States of America

  • Favorite Pinball: Dr Who, Tee'd Off, Jive Time

Posted 23 October 2016 - 02:16 AM

Ben Logan really knows how to open a can or worms  ;)

 

I'm not going to pretend I've been able to follow this entire thread, but here are a few of my thoughts:

 

  • I don't know that the VP9 to VP10 comparisons have any relevance.  Either VP10 has flipper lag or it doesn't.
  • It looks like a few people are trying to solve for the lag by bypassing the VPinmame emulation?  Do we know for fact that's the problem?
  • I'm not convinced this isn't just a flipper physics settings issue.  I notice significant lag on some tables and none or almost none on others.  In my own personal testing, I've noticed significant lag is often accompanied by high coil ramp up settings (2+).  Reducing the coil ramp up reduces the lag.  Maybe there are others?


#233 Ben Logan

Ben Logan

    Pinball Wizard

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

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

  • Favorite Pinball: System 11

Posted 23 October 2016 - 02:42 AM



Totally fair critique and questions, RothBauerW! With regard to bypassing vpinmame interaction with flippers, give it a shot! One minute cut and paste job in the script of your choice. See below for code. See if it makes a difference on your machine. Just search a script (on a non-EM table) for "keydown."

:)

Code:

You can do this by adding this to the top of the keydown routine

if keycode = LeftFlipperKey Then leftflipper.RotateToEnd
if keycode = RightFlipperKey Then rightflipper.RotateToEnd

and this to the top of the keyup routine

if keycode = LeftFlipperKey Then leftflipper.RotateToStart
if keycode = RightFlipperKey Then rightflipper.RotateToStart

The side effect though is that the flippers will always be active even when the game is not started or is tilted

Edited by Ben Logan, 23 October 2016 - 02:46 AM.


#234 rothbauerw

rothbauerw

    Enthusiast

  • Members
  • PipPipPip
  • 345 posts
  • Location:Wisconsin - USA

  • Flag: United States of America

  • Favorite Pinball: Dr Who, Tee'd Off, Jive Time

Posted 23 October 2016 - 03:20 AM

Thanks Ben.  Here's how I tested:

 

For keydown I only added:

 

if keycode = LeftFlipperKey Then leftflipper.RotateToEnd

 

For keyup I only added:

 

if keycode = LeftFlipperKey Then leftflipper.RotateToStart

 

Then in the editor, I assigned both flippers to the same key (left-shift).  This allowed me to compare the suggested fix side-by-side with a flipper going through emulation using the same input key.  I'm using a very low spec machine (AMD E-450 1.65 GHz with Radeon HD Graphics).  There is a noticeable difference most of the time.  Interestingly, they are occasionally in sync.

 

I'd like to know if the same difference is seen on a machine with decent specs.



#235 Ben Logan

Ben Logan

    Pinball Wizard

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

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

  • Favorite Pinball: System 11

Posted 23 October 2016 - 03:28 AM

Drybonz, for example, has a 144hz monitor and a graphics card that can Vsync to 144 FPS (I think). He says he can't perceive much difference with vpinmame / flipper bypass code enabled vs. disabled.

Lots of us cab guys however have big old 60hz TVs. On my machine it makes a huge difference!

Edited by Ben Logan, 23 October 2016 - 03:29 AM.


#236 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 23 October 2016 - 04:34 AM

This is a gross over simplification, and i'm just making these numbers up but they are somewhat reasonable values for input lag.  So cutting out other factors let's say Drybonz's monitor has 5ms of input lag.  if you add 20ms of vpm lag to that you have 25ms of input lag, which is still not noticeable for most people.  Now say my TV in the cab has 20ms of input lag.  On em tables without the vpm lag, I don't see the lag either, but add 20ms of vpm lag and then I'm at 40ms of input lag which from what I'm reading is noticeable to most people.  So if I can remove that extra 20ms by skipping the vpm flipper callbacks then I'm good to go.  In an ideal world we'd all have nice 40"-46" gaming monitors that don't exhibit any of these issues, but I don't think most of us can afford say the $1400 that virtuapin advertises their monitor for (and I don't have lag numbers for that anyway as they don't list a model number, but hopefully it's better than my $300 display).



#237 vogliadicane

vogliadicane

    Pinball Fan

  • Members
  • PipPipPipPip
  • 517 posts
  • Location:Velbert

  • Flag: Germany

  • Favorite Pinball: The Addams Family

Posted 23 October 2016 - 09:19 AM

Just another observation, the flipper sounds are also delayed. To my opinion this also speaks against the hypothesis, that the lag comes (mostly) from graphics/hardware latency.


Edited by vogliadicane, 23 October 2016 - 09:19 AM.


#238 toxie

toxie

    VPF Veteran

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

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 23 October 2016 - 11:21 AM

Soundcards/drivers also have some latency. But its, as mentioned multiple times in thread already, a combination of many many things, depending on the specific machine setup.



#239 Kernel

Kernel

    Enthusiast

  • Members
  • PipPipPip
  • 134 posts

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

  • Favorite Pinball: Stones 'n Bones

Posted 24 October 2016 - 10:26 AM

the flipper sounds are also delayed.

I've also noticed that.

 

Is there a way to reduce sound latency (like reducing sound buffer or related things)?



#240 toxie

toxie

    VPF Veteran

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

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 24 October 2016 - 12:10 PM


Now for the "sad" part: As i suspected, the new/more complicated rendering pipeline of VPX also comes into play, so as an experiment for all people having issues with VPX having more lag than VP9, please try the following inside the VP video preferences:

a) Disable "Update in-game" in the Ambient Occlusion section

b) Disable "FXAA"

c) Disable "Brute-force 4x Anti-Aliasing"

d) Disable "Maximum pre-rendered Frames" by setting it to 0

e) Disable FPS Limiter/VSync by setting it to 0

 

Then in the table itself, under "Lighting" set the "Bloom Strength" to 0 and make sure that none of the above global settings is actually enabled in the table itself

 

 

Does this improve the situation for you?

 

*ping*

 

Anybody with VPX lag issues was able to test this?

 

and btw: the "maximum prerendered frames" setting is now differently implemented in 10.2 and should also help to reduce lag in VPX: http://www.vpforums....=35311&p=360895