yannbouteiller / vgamepad

Virtual XBox360 and DualShock4 gamepads in python
MIT License
169 stars 21 forks source link

Stuttery #22

Closed jonafinmicclen closed 10 months ago

jonafinmicclen commented 10 months ago

Hello, im pretty noob so probably is a mistake on the useage at my end.

I am trying to record then playback controller input. first i record a real controller then i play it back through vgamepad it plays back but is extremely stuttery even when trying to do just the analog inputs so far, as its trying to replicate the original input it sends updates quite frequently.

Is there anyway to smooth move an analog stick so i could estimate the motion with linear segments instead of jumping for each state.

jonafinmicclen commented 10 months ago

Nvm. There was a mistake in my code sorry.

yannbouteiller commented 10 months ago

Not sure what happened here, but make sure to sleep a little bit between calls in order not to flood the driver ;)

jonafinmicclen commented 10 months ago

I'm using it to record controller input then replay it through a virtual controller. The polling rate of the recording is 100hz and I attempt to update the virtual controller at the same rate. I think my program was lagging because of the way I was keeping track of the timing for when to update the controller, I was using a while loop checking the time rather than 'time.sleep' not 100% sure why that caused problems but it seems to be fully functional now. Thanks for taking the time to reply.