by LordHavoc » Wed Nov 28, 2007 7:59 am
I recently upgraded the havocbot aiming code, and it IMMENSELY improved their believability, it may be worth a look.
Basically I used to have them kind of interpolate between old and new aiming angles.
But now I made them calculate the delta between the old and new, multiply by 1/frametime to get a rate of change (avelocity), and then blend a bit of that onto a new avelocity-like vector field, so they're basically just adapting their motion tracking to better match what the opponent is doing, and obviously this takes every form of relative motion into account simply by how it works (if they're getting juggled, they'll have a hard time aiming because their motion vectoring is getting hosed).
And I made them fire whenever their motion vectoring is getting close to correct (where "close enough" varies by weapon and bot skill), rather than when the enemy is in a cone of fire, this also immensely improved their believability - the lower skill modes often have them doing strafing attacks with nailguns or lightning, looks very convincingly human.
At higher skills they adapt faster to the motion vectoring, and become uncanny in their aim, and tend to use shorter burst attacks with the nailguns/lightning since their tolerance gets tighter - this is still rather convincingly human, just feels more like you're up against a skilled show-off rather than a newbie or average player.
- search for w_aimdir.