peon2 / fbneo-training-mode

a simple training mode for multiple games on the fbneo platform
58 stars 35 forks source link

Keyboard inputs not read correctly after load state #94

Closed zass30 closed 2 years ago

zass30 commented 2 years ago
  1. Make sure that your character inputs are read from keyboard (for example, arrow keys for each joystick direction)
  2. Hold down/back. You can see the input viewer showing down back
  3. Load a saved state while keeping down/back held down. You will see that the input viewer is no longer shows directional input

https://www.youtube.com/watch?v=7l20FKk5F30

video is in french but basically it's saying that you can see chun li is holding down back on keyboard. when save state is loaded, she stands up and the keyboard directions are ignored.

peon2 commented 2 years ago

I can't seem to replicate this, could this be keyboard ghosting? Try binding the directions to other keys.

zass30 commented 2 years ago

Bound to other keys, made a video to show step by step repro

https://www.youtube.com/watch?v=GhN7HS9oicU

peon2 commented 2 years ago

Some investigation: Initially I couldn't replicate the issue as I was using fbneo-training-mode's internal save/load system where no problems occur. This is because it uses lua's edition of savestate loading which seems to skip safeguards and such with a direct call to BurnStateLoad https://github.com/finalburnneo/FBNeo/blob/74f23c841a6460759828d221d98abc12e7c4de5c/src/burner/luaengine.cpp#L1628 (this is the same procedure Asunaro uses) In comparison, the standard load state (and save state) hotkey goes through more code https://github.com/finalburnneo/FBNeo/blob/9899e4c2f941ce076a3bf184e41c046615621236/src/burner/win32/scrn.cpp#L1285 [StatedLoad(0) calls BurnStateLoad] what is disabling input after loading (or saving) a state is "InputSetCooperativeLevel(false, bAlwaysProcessKeyboardInput);" This is why only kb input is disabled and not controller input which confused me.

In conclusion, the fbneo-training-mode can't fix this, maybe ask the fbneo team why non-hotkey kb inputs are disabled until releasing them?

peon2 commented 2 years ago

Closed for not being a fbneo-training-mode issue :)