Skip to content

Conversation

@aelzeiny
Copy link

I've been using this to record macros in fighting games; which require very precise input. There are two primary issues with file recording:
(1) Playback is frame-based rather than time-based. Meaning that if there's descrepency between the FPS of the recording & the FPS of the playback, then two fall out of sync.
(2) The code spams the input stack a lot more than necessary. This makes debugging a general pain for recorded macros as file-sizes grow at an unnecessary rate.

Solutions:
(1) Add a timestamp to every button click during recording/creating macros. Wait for the proper time (relative to the start of the script) before sending the write input to the controller. We a class called ControllerStateTime which stores the controller message and timestamp. This class is pickled to a file upon recording, and can be deserialized on playback.
(2) Because of solution #1, we can now only send/write inputs when a change in controller state occurs! On every frame we compare the current message with the last message to decide whether nor not we want to spam the controller, and potentially write to a file.

P.S: This library is great, and you're amazing!!!

@aelzeiny
Copy link
Author

aelzeiny commented Jun 28, 2019

I forgot to mention. This PR will invalidate any previously recorded files :(, but otherwise doesn't negatively impact any other functionalities

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

Successfully merging this pull request may close these issues.

1 participant