Author Topic: CPS3 1f input lag (compared to old FBA revisions)  (Read 7726 times)

Offline shine

  • Newbies
  • *
  • Posts: 18
  • Karma: +0/-0
CPS3 1f input lag (compared to old FBA revisions)
« on: June 13, 2020, 07:19:05 AM »
Some players have noticed latest FBNeo has 1f extra input lag when playing 3rd Strike. Old FBA versions do not have that 1f extra, as they did a compare basically putting an old version (v0.2.96.74) vs a new one (v0.2.97.44) in the same PC at the same time, capturing video and inputting with a joystick, and clearly new FBNeo display at 1f later (same settings). It seems in .43 was already happening, we haven't tried .42 or earlier versions. And 1f in 3s is pretty important for hit confirms and so.
If that helps, one thing they noticed is that the SOCD input clener does get into some inputs, so I did a fast build and removed that (a fix we did to fix a crash in Jojo a while ago, if you remember), and it actually helped with inputs.

But from there, I don't know where to start investigating. Other games (CPS2) do not have that extra 1f input delay, could it be something related to the CPS3 driver or the SOCD cleaner? (I just removed ClearOpposites function). I read a bit the driver, but I am not much familiar and I've seen much changes viewing different revisions. Perhaps one of you guys know what's happening?

Thanks for your help!

PS: We at Fightcade are always releasing our sources for FC2, now in GitHub (sadly we don't have sources for FC1). For the new version we rewrote a few things, and we would like to share them as perhaps it's something that could be merged into trunk. But that's for another thread.
« Last Edit: June 13, 2020, 07:56:12 AM by shine »

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #1 on: June 13, 2020, 08:38:22 AM »
Hi Shine,
I have some ideas what might have caused it, I will investigate this sometime in the next day or 2. (unless barbudreadmon beats me too it!)   :)
p.s. that's great about FightCade2, maybe we can merge some sources at some point, to make it better for everyone.

best regards,
- dink

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #2 on: June 13, 2020, 10:23:06 AM »
Can you please test .42 and and earlier versions to see when this problem started, it would help me a lot to know for sure where the bug originated.

thanks,
- dink

Online barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #3 on: June 13, 2020, 11:11:29 AM »
I get different input lag between current (3 frames) and v0.2.97.43 (2 frames), i don't have a v0.2.96.74 libretro version to test input lag.

The additional frame of input lag was introduced by sprite list caching (https://github.com/libretro/FBNeo/commit/bd5a180a90ab016e3b6abb09771d6a3103e0c5b7), something which exists on real hardware, the fact it adds 1 frame of input lag seems legit to me (that commit was my first thought until reading the issue already existed in .43), it probably has the same effect on real hardware.

Except if dink has some genius idea to reduce cps3's input lag without re-introducing gfx glitchs, i'm not sure there is something in need to be fixed here. If you want to reduce the input lag introduced by accurate emulation, my recommendation would be to add a feature like RA's runahead to FC2 instead.

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #4 on: June 13, 2020, 02:59:19 PM »
I think runahead is a bad solution, but we can try to find what caused the problem and selectively disable it.

Online barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #5 on: June 13, 2020, 02:59:41 PM »
@shine I added a dipswitch to revert to the old direct sprite reading behavior, be aware that enabling this dips with re-introduce some glitchs though (a bunch of sprites appearing when they shouldn't)

Offline shine

  • Newbies
  • *
  • Posts: 18
  • Karma: +0/-0
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #6 on: June 13, 2020, 03:55:21 PM »
Thank you both!
That was superfast. We are discussing it, but considering people have been playing with that glitch (and probably many other glitches) since the old GGPO application (2008), they agree on disable it at a cost of a few gfx glitches (which they haven't really noticed)

I am aware of runahead, but I don't know if they do that online, my mind just can't handle how would that be implemented. Perhaps after I learn more about the emu and their implementation...


Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #7 on: June 13, 2020, 07:25:22 PM »
If that dip helps & to make things easier, we could make it an ifdef to enable it by default. 

best regards,
- dink

Offline shine

  • Newbies
  • *
  • Posts: 18
  • Karma: +0/-0
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #8 on: June 13, 2020, 08:25:57 PM »
Thanks dink, I can merge this change directly. Perhaps the guys at RA would also like to know about it if they have a 3s player base, and would benefit of that define
« Last Edit: June 13, 2020, 09:12:24 PM by shine »

Online barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #9 on: June 14, 2020, 03:59:45 AM »
Perhaps the guys at RA would also like to know about it if they have a 3s player base, and would benefit of that define

I'll keep the glitchless behavior as default on the libretro port, even if the glitchs are barely noticeable. Ultimately having this dips turned on or off is not even a problem savestate-wise since the setting is only evaluated at rendering time, and libretro has other means of reducing input lag.
« Last Edit: June 14, 2020, 04:03:23 AM by barbudreadmon »

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!

Offline shine

  • Newbies
  • *
  • Posts: 18
  • Karma: +0/-0
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #11 on: June 15, 2020, 05:37:39 AM »
Thanks dink, people are very happy with the latest release after this fix
So the 3rd value of the array is the initial default value right? Good to know thanks

{0x1C,  0xFF, 0xFF, 0x01, NULL},

Offline shine

  • Newbies
  • *
  • Posts: 18
  • Karma: +0/-0
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #12 on: June 15, 2020, 05:40:08 AM »
I'll keep the glitchless behavior as default on the libretro port, even if the glitchs are barely noticeable. Ultimately having this dips turned on or off is not even a problem savestate-wise since the setting is only evaluated at rendering time, and libretro has other means of reducing input lag.

Yes it's awesome how good and big is becoming RA, especially the run ahead tech. Does it also work during netplay?

Offline dink

  • Administrator
  • *****
  • Posts: 5014
  • Karma: +449/-1
  • pie? I nearly bought one!
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #13 on: June 15, 2020, 07:52:16 AM »
shine, that's right :)

Online barbudreadmon

  • Administrator
  • *****
  • Posts: 1091
  • Karma: +59/-1
  • Helper
Re: CPS3 1f input lag (compared to old FBA revisions)
« Reply #14 on: June 15, 2020, 08:19:06 AM »
Yes it's awesome how good and big is becoming RA, especially the run ahead tech. Does it also work during netplay?

Not 100% sure since i never use those features myself, but it seems ra's netplay supports "negative input latency", same as runahead : https://github.com/libretro/RetroArch/pull/6846