dt-rush / sameriver

game engine written in go
Other
1 stars 1 forks source link

PID controller for aim skill #70

Open dt-rush opened 1 year ago

dt-rush commented 1 year ago

Just a few months ago I used a PID-controller pair to simulate limited AI control over weapon aim. 2D angular impulse is the control input. PID values were hand-tuned to match desired behavior for a few "skill+accuracy" settings, and then used to derive a function of (skill,accuracy) -> (P,I,D,control_limit). Pitting the controller-pair against angular momentum and some degree of "muscle noise", acquiring a target can be efficient and snappy (robotic turret)... or clumsy with overshoot and instability (inexperienced person with a heavy gun).

https://www.reddit.com/r/gamedev/comments/363w67/does_anyone_use_a_pidcontroller_in_games/