bethesirius / ChosunTruck

Euro Truck Simulator 2 autonomous driving solution
732 stars 104 forks source link

[master] Freezing after input is used in Windows #11

Closed zappybiby closed 7 years ago

zappybiby commented 7 years ago

With the new code suggested in https://github.com/bethesirius/ChosunTruck/pull/10, input works and the program can now move the truck. However, it is sending keys too fast, making it hard to accelerate or use other keys while the program is running. I tried adding Sleep() in different locations inside the code, however that only made the program freeze (crash / slow down significantly).

I also tried removing any commands that would be sent when the truck is going straight. This helped some, but didn't fix the problem.

If you want to help me test this, remember to go to C:\Users\YOURUSERNAME\Documents\Euro Truck Simulator 2\profiles and edit controls.sii from di8.keyboard/fusion.mouse to sys.keyboard/sys.mouse

zappybiby commented 7 years ago

My theories:

We could also just use the mouse with SendInput to avoid this issue altogether. I guess I'll start working on that...

chi3236 commented 7 years ago

I suggest steering with mouse, because mouse steering can control the truck with continuous or analog input. When the truck is in really curved road like a highway entrance or a highway exit, we should steer it fast in short time. However, if we use keyboard key press for steering, the steering speed really depends on the steering sensitivity which is in ETS2 game play setting option. That's why our linux version uses steering with mouse. BTW, I will try your PR in my workstation on this weekend. Sorry for my late