Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropped inputs during frame advance after tabbing in with PL + OL #373

Open
Cosine256 opened this issue Feb 23, 2024 · 5 comments
Open

Dropped inputs during frame advance after tabbing in with PL + OL #373

Cosine256 opened this issue Feb 23, 2024 · 5 comments

Comments

@Cosine256
Copy link
Contributor

Inputs are being dropped during the first frame advance after tabbing into the game when running PL + OL. This might look familiar because I originally reported it in the PauseAPI PR. It was fixed there, but only for plain OL. I've just now noticed it happening with PL + OL.

  1. Launch PL with speedrun mode disabled.
  2. Attach OL.
  3. Set pause flags to freeze updates, game loop, and inputs.
  4. Go to camp.
  5. Activate a freeze pause.
  6. Tab out of the game window (I'm using the borderless window setting).
  7. Tab back into the game window.
  8. Hold any combination of inputs and use frame advance once (I'm using keyboard).

Those first inputs are ignored by the game during that frame advance, and will keep being ignored until released. Any newly held inputs during subsequent frame advances are processed correctly, but the first set of inputs keeps getting dropped. Releasing the first set of inputs fixes them, even if you don't frame advance while they're released.

@Dregu
Copy link
Collaborator

Dregu commented Feb 23, 2024

IIRC the "Run in last API instance" option was added partly for and fixes this special case, but it's been too long since I made this for my old brain again.

@Cosine256
Copy link
Contributor Author

I see now, enabling that option does fix the issue. It looks like it defaulted to being disabled whenever it was added and I decided not to mess with it at the time. What reasons would there be to have that option disabled?

@Dregu
Copy link
Collaborator

Dregu commented Feb 24, 2024

The reason is pretty theoretical, but OL can't really promise the attached PL version even has a PauseAPI, but since PauseAPI and the ability to detect the existence of PL were added at the same time, it hardly matters. It should probably be default on.

@Dregu
Copy link
Collaborator

Dregu commented Feb 24, 2024

And to be clear, PauseAPI will just run in OL with the option enabled, but no PL or PL in speedrun mode, since it is now "the last api instance" and also the only one.

@Cosine256
Copy link
Contributor Author

Ok, I thought it might just matter only if you had two versions of the script API attached, which doesn't seem like a very good idea now that they can share a bucket. Maybe just defaulting it to true would be a good enough fix for this issue, and maybe warn users that there isn't much reason to disable it unless they really know what they're doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants