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

Hacknet does not read inputs properly #592

Open
ToonLucas22 opened this issue Feb 3, 2024 · 2 comments
Open

Hacknet does not read inputs properly #592

ToonLucas22 opened this issue Feb 3, 2024 · 2 comments

Comments

@ToonLucas22
Copy link

When running the game Hacknet (whether it be the Steam version or the DRM-free GOG version) through libTAS, the following weirdness happens:

  • On default settings, mouse inputs aren't read at all. Not even the cursor's position is read. (Have not been able to test keyboard inputs on default settings)
  • Also on default settings, libTAS fails to report the game information, and the OSD also fails to display on top of the game window.
  • When "Native events" is enabled on the Debug tab of libTAS's settings, the mouse does work and so does the keyboard. However, getting the game to start reading mouse inputs requires clicking on the libTAS window after the game has launched, then clicking back on the Hacknet window.
  • Also, when using "Native events", the game reads keystrokes from the user even when it's paused through libTAS. In other words, keystrokes continue to be read in real time even when the game is supposed to be paused. Mouse inputs still work the way you'd expect though.
  • As a result of the above keyboard input bug, playing back a movie file while "Native events" is enabled results in the game reading the mouse inputs correctly, but the keyboard inputs from the movie file are not read whatsoever. Instead, it still polls keyboard inputs from the user, rather than the movie file.

I should mention that the game runs on FNA, and (when "Native events" is checked) libTAS reports Hacknet as using SDL2 for keyboard, mouse and joystick inputs, so theoretically it should work as intended, but it's not. However, the FNA version this game is using is version 17.02, so I suspect that libTAS may be having problems with an FNA version that old. Or it could be something unrelated. I am not sure.

@ToonLucas22
Copy link
Author

UPDATE: The culprit seems to be the game's web renderer plugin. Launching the game with the -disableweb command line argument fixes all of the problems I outlined above. Not sure if this issue is worth keeping open but I'll keep it open in case someone wants to look into the whole web renderer mess.

@clementgallet
Copy link
Owner

Games running inside a web browser are very hard to handle, I tried CrossCode, which is a html5 game with native linux version, but couldn't do much.

* Also, when using "Native events", the game reads keystrokes from the user even when it's paused through libTAS. In other words, keystrokes continue to be read in real time even when the game is supposed to be paused. Mouse inputs still work the way you'd expect though.

That is the expected behaviour of "Native events", the game has access to the actual events that are generated by the OS, such as keyboard inputs.

* As a result of the above keyboard input bug, playing back a movie file while "Native events" is enabled results in the game reading the mouse inputs correctly, but the keyboard inputs from the movie file are not read whatsoever. Instead, it _still_ polls keyboard inputs from the user, rather than the movie file.

Possible keyboard inputs are handled by events, whereas mouse inputs are handled by direct calls (e.g. XQueryPointer()).

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