DeVsh wrote:*
I wrote a lot of these fancy things... so here is what they do:
set bot_ai_strategyinterval 2 // How often a new objective is executed, capture flag, get health, shoot someone ...
set bot_ai_enemydetectioninterval 0.5 // How often bots pick a new target
set bot_ai_aimskill_blendrate 2 // How much correction is made to aim at the target
set bot_ai_aimskill_fixedrate 15 //What is the mim blend rate ?
set bot_ai_aimskill_firetolerance_distdegrees 180 // The influance of distance on going from mindegree to maxdegreee.
set bot_ai_aimskill_firetolerance_mindegrees 2 // The minimum used tolerance. Used onlarge distances.
set bot_ai_aimskill_firetolerance_maxdegrees 45 // THe max error to fire (so he is allowed to aim of 45 degree at close range)
set bot_ai_aimskill_mouse 1 // Howmuch of the "mouse / order filters" is used to aim. 0 would mean the desired fireing angle is set at once, without him aiming.
set bot_ai_keyboard_distance 250 // Bots must reach there waypoints verry sharply. Or else they won't count as "reached my goal" therefor we disable the keyboard interface for the bots when they get close.
set bot_ai_keyboard_treshold 0.94 // The treshold for selecting a direction on the keyboard.
set bot_ai_aimskill_offset 1 // Bots aim wrong by design, an error is included. This deteremns the size of the error.
set bot_ai_aimskill_think 1 // Do we use the perfect desired angle or the 'human aiming' angle (the one that is beeing fet trough the filters, so it aims like a human)
// Better don't touch these, there are hard to tweak!
set bot_ai_aimskill_order_mix_1st 0.01
set bot_ai_aimskill_order_mix_2nd 0.1
set bot_ai_aimskill_order_mix_3th 0.01
set bot_ai_aimskill_order_mix_4th 0.05
set bot_ai_aimskill_order_mix_5th 0.01
set bot_ai_aimskill_order_filter_1st 0.2
set bot_ai_aimskill_order_filter_2nd 0.2
set bot_ai_aimskill_order_filter_3th 0.05
set bot_ai_aimskill_order_filter_4th 0.25
set bot_ai_aimskill_order_filter_5th 0.3
// Ok to understand these you first need to know what N_th order filters are:
OK this is the output of the first order filter:
the filter Says how fast it will climb. The mix says how much of this will be added to the final aim angle. So what it does it takes the difference of WHAT SHOULD BE and WHAT IS NOW and takes a % of that and correct WHAT IS NOW towards WHAT SHOULD BE.
Ok that was all the old code did, by using a very smooth blendrate (the cvar).
Ok Now the fun part starts:
On the output of the first filter, we apply that same filter on that again, creating a second degree filter. And on and on and on to the 5th filter.
Ok now what do the filters do in HUMAN language
So what does each filter do ? (If you are familiar with integration of acceleration to speed to position this will be natural, if not ... don't worry)
The first: tracks your POSITION
The second: tracks your MOVEMENT
Third: tracks your ACCELERATION
Fouth: PREDICTS level one: tracks your change in acceleration (so moving left/right/left/right will nolonger upset the bot, but note: this is a FORTH filter,so this takes a while to kick in)
Fifth: PREDICTS level two: predicts your next-next-movmement.
(From the third filter, things get slowly, and effects are miniam (see the MIX))
The actual correction SHOULD be in the desired angle... NOT in the mouse smoothing code.
The order filter SHOULD simulate the human movement of the mouse and other factors.
I tried matching the filter to the behaviour of a real person.
Hmmm thinking of it, when setting the bot on high level .... the bot might get more stupid
Tip: To tune, these you need to observer real players, and see what aim errors they make. (You must record it.) Then play it in slowmo (about 0.1 would do, or even lower in some case). Then go to the bots, keep slowmo 0.1 and try to match the bot behaviour.
Another way to tweak them is making the bots aim perfect with these filters, with there crosshair perfectly on the deisred target the entire time.
I Hope this is clear and helped a bit (wow my biggest post EVER)
