December 18, 2000
... Click ... cloink ... cloink cloink ... kaboom!
"The bot saw the threat move around the corner, behind cover. No more direct line of fire to the threat... The AI made a quick assessment:
- is the threat within grenade throwing distance?
- is it possible to toss or bounce a grenade near the threat?
- is the threat position in an enclosed area (room, alley), so he will have trouble moving away from a grenade blast?
- can I lay fire on most most of the threat's exits from his position?
- can I lob the grenade without being fired upon by the threat?
The threat had entered a nearby small dead-end alley. The only way out was with only a ladder leading to roof that was in full view of the bot. A nearby wall would offer cover when throwing the grenade. Thus, a hand grenade would be the right thing to. Especially for a bot...
The bot took his grenade, pulled the pin, and aimed for a wall close to the alley's entrance. The grenade would have to bounce via that wall to enter the alley. However, the bot remembered a few successful attempts in earlier battles, and chose to repeat it.
Cloink ... cloink ... The threat's run for the ladder proved to be in vain..."
If you know a tactical shooter game (or any mod for such a game) really capable of working out when (not) to use a grenade, and capable of intentionally bouncing grenades around the corner, please let me know.
AI Grenade Handling
Anyway, I wrote the AI performing exactly the reasoning mentioned above. It understands about different kinds of areas (roofs, halls, alleys, tunnels, streets, water). It understands about entrances to and exits from areas. It predicts threat behavior. It knows how to bounce grenades around the corner, through windows, into tunnels. And it knows when throwing a grenade is likely to fail.
Figure 1(a,b,c):
[a] The target: a sniper positioned in the upper room, overlooking distant parts of the city;
[b] Overview of the attacker and the room being attacked; the attacker cannot hit the target (the sniper) but can hit the ceiling overhead;
[c] The rifle grenade launcher equipped attacker, seeing the grenade impact on the ceiling above the target
To help out a few other (Counter-Strike) bot developers, and to hopefully see more advanced grenade handling in commercial games, I documented the major design decisions, and relevant performance date. See either the web or pdf [1.3MB] version (about 28 pages, and the PDF version is intended for on-screen reading).
Weapon Selection and Handling
The AI also has been given more detailed understanding of the weapons. To handle 'weird' weapons such as the M16/M203 combo (a combined assault rifle and grenade launcher), a better weapon selection and handling mechanism is needed. An example of weapon selection is: 'which is the best gun for the job', and weapon handling deals with: 'should I release the trigger now to fire a long burst'.
The 'weapon handling code' provided by game SDKs (for example, Quake I/II and Half-Life) does not make explicit many of the weapon's properties, and tackles weapon selection typically using lots of 'if' statements. Such an approach suffices for simple AI and simple weapons. However, that approach does not cut it for AQ2 which featuring silencers, burst mode, clip based reloading, laser sight, speed reloading, location based damage and posture dependent aiming accuracy.
I've designed a more explicit model of the weapon properties, and documented that here.
Miscellaneous
There will be a next release of CGF, but I am not able to give a date - I have a few other (AI related) things going on.
William
Old News