Putting the 'Tactical' into Tactical AI
by Bryce · 07/28/2009 (7:01 pm) · 20 comments
This is Toni

Toni, though you probably wouldn't assume so, has a problem. He is wracked by the embarrassment of being featured in two GarageGames blogs in two days. Anyway, Toni's problem is that he is dissatisfied by the TAIK's lack of good squad support. Have no fear, Toni! Look, now his problem is gone!

MOVING ON......
Behold, my second blog post this week. Just like the last time this happened, the question of high productivity vs. having no life has come to mind. Whatever. I've got new stuff to show off, and it's cool.
Anybody who played my first Tactical AI Kit demo back in October (nine months ago...wow, time flies) got a taste of the very early squad functionality. Commanding a squad worked sort of well, but when you set the game at the Start Mission screen to have an AI squad leader, things went horribly. He would get the whole squad killed. If the squad leader died, usually the position would not be handed down to the next living squad mate, and your squad would sit there.
In the second demo I released a few months ago (back in May, wasn't it?), I just removed the option to pick your own position in the squad. Finally, here we are in July, and I've finally gotten to fixing the horrible squad support.
The new AI squads allow for leader-ordered regrouping and move-up/bound overwatch maneuvers, and deciding whether to take cover or shoot him on the spot. AI squad members can also tell when shooting a target won't alert nearby enemies, so they now perform stealth kills.
Wanting to hear more? Yes? Why of course you do.
--Regrouping and Moving Up--
This was never fully functional, but now is. When a squad is moving towards an objective, sometimes a member may fall behind for some reason (especially if they're a human player with a low attention span). The new AI squad leaders are smart enough to realize this, and will order a regroup to keep the squad together before moving to the objective again.
Moving up is an interesting concept. I noticed myself doing this a lot when I play as the squad leader: I would send my squad mates into an area to check it out, or I'll have them draw fire while I run to cover somewhere else. Now wouldn't it be nifty if AI squad leaders could do this?
I devised a system for finding corners based on the positions of navigation nodes on their paths. When an NPC is moving to a path node, it will factor in the one it moved from, the one it is moving to, and the one after it, in it's quest to find out where the path turns into non-visible territory.
Here is a quick visual representation of a corner and a path being taken by an NPC (the green dot):

The NPC is moving away from node 1 and towards node 2. To see if the current node we are moving to (in this case, node 2) is a corner point, the NPC checks for line of sight between nodes 1 and 3. If there is no line of sight, then we have a corner, and node 2 leads into unknown areas (fear the unknowwwnn.....).
Depending on the circumstances, a squad leader who encounters (what I'll now be calling) a bend point in the path, he will stop and send his squad into the area (to node 2). The squad mates (yellow dots) will move in and take available cover in this area.
Once the squad mates are in position, they crouch, hold, and wait for the AI squad leader to meet up and get ahead of them. I accidentally got a bound overwatch working when I just wanted simple movement around corners. I love when that happens!
--Stealth Kills--
Thanks to a new function I put together in a little under 5 minutes (which is a record for me, especially because it worked the very first time!) called ::CanKillStealthily(), a squad with rules of engagement set to return fire only/stealth can tell whether or not they can kill a threat without alerting any other enemies. By checking for enemies close enough to hear the gunshot or notice the body, and making sure there are none, a squad member will aim for the head and fire. Goodbye.
I've found them to alert far less enemies this way. Before, they would keep moving while watching the enemy closely, and if they get too close and get noticed, then they have no choice but to open fire. The problem with this is that they are then often in a position where others hear the shot or get alerted in one way or another, and more likely than not, they get shot to death.
I've sent a squad through the palace level, and they've shown me a way to successfully make it through the vehicle entrance (the big area with guards on the walkways, roof, and the watch tower) without alerting ANYONE. It took artificial intelligence to show me how to move and snipe without being detected...that blew me away. I removed two of the rooftop enemies, but still...geez.
Questions and comments! Bring 'em!

Toni, though you probably wouldn't assume so, has a problem. He is wracked by the embarrassment of being featured in two GarageGames blogs in two days. Anyway, Toni's problem is that he is dissatisfied by the TAIK's lack of good squad support. Have no fear, Toni! Look, now his problem is gone!

MOVING ON......
Behold, my second blog post this week. Just like the last time this happened, the question of high productivity vs. having no life has come to mind. Whatever. I've got new stuff to show off, and it's cool.
Anybody who played my first Tactical AI Kit demo back in October (nine months ago...wow, time flies) got a taste of the very early squad functionality. Commanding a squad worked sort of well, but when you set the game at the Start Mission screen to have an AI squad leader, things went horribly. He would get the whole squad killed. If the squad leader died, usually the position would not be handed down to the next living squad mate, and your squad would sit there.
In the second demo I released a few months ago (back in May, wasn't it?), I just removed the option to pick your own position in the squad. Finally, here we are in July, and I've finally gotten to fixing the horrible squad support.
The new AI squads allow for leader-ordered regrouping and move-up/bound overwatch maneuvers, and deciding whether to take cover or shoot him on the spot. AI squad members can also tell when shooting a target won't alert nearby enemies, so they now perform stealth kills.
Wanting to hear more? Yes? Why of course you do.
--Regrouping and Moving Up--
This was never fully functional, but now is. When a squad is moving towards an objective, sometimes a member may fall behind for some reason (especially if they're a human player with a low attention span). The new AI squad leaders are smart enough to realize this, and will order a regroup to keep the squad together before moving to the objective again.
Moving up is an interesting concept. I noticed myself doing this a lot when I play as the squad leader: I would send my squad mates into an area to check it out, or I'll have them draw fire while I run to cover somewhere else. Now wouldn't it be nifty if AI squad leaders could do this?
I devised a system for finding corners based on the positions of navigation nodes on their paths. When an NPC is moving to a path node, it will factor in the one it moved from, the one it is moving to, and the one after it, in it's quest to find out where the path turns into non-visible territory.
Here is a quick visual representation of a corner and a path being taken by an NPC (the green dot):

The NPC is moving away from node 1 and towards node 2. To see if the current node we are moving to (in this case, node 2) is a corner point, the NPC checks for line of sight between nodes 1 and 3. If there is no line of sight, then we have a corner, and node 2 leads into unknown areas (fear the unknowwwnn.....).
Depending on the circumstances, a squad leader who encounters (what I'll now be calling) a bend point in the path, he will stop and send his squad into the area (to node 2). The squad mates (yellow dots) will move in and take available cover in this area.
Once the squad mates are in position, they crouch, hold, and wait for the AI squad leader to meet up and get ahead of them. I accidentally got a bound overwatch working when I just wanted simple movement around corners. I love when that happens!--Stealth Kills--
Thanks to a new function I put together in a little under 5 minutes (which is a record for me, especially because it worked the very first time!) called ::CanKillStealthily(), a squad with rules of engagement set to return fire only/stealth can tell whether or not they can kill a threat without alerting any other enemies. By checking for enemies close enough to hear the gunshot or notice the body, and making sure there are none, a squad member will aim for the head and fire. Goodbye.
I've found them to alert far less enemies this way. Before, they would keep moving while watching the enemy closely, and if they get too close and get noticed, then they have no choice but to open fire. The problem with this is that they are then often in a position where others hear the shot or get alerted in one way or another, and more likely than not, they get shot to death.
I've sent a squad through the palace level, and they've shown me a way to successfully make it through the vehicle entrance (the big area with guards on the walkways, roof, and the watch tower) without alerting ANYONE. It took artificial intelligence to show me how to move and snipe without being detected...that blew me away. I removed two of the rooftop enemies, but still...geez.
Questions and comments! Bring 'em!
#2
07/28/2009 (7:14 pm)
Well this is what i get for posting a comment before watching the video. Does the AI check building roof tops and windows for enemy AI? Can they go inside those buildings and take cover if there are pathnodes within them?
#3
Looking good, nice to see progress and Toni XD.
Just wondering who does your voiceover?
07/28/2009 (7:33 pm)
Quote:And the problem is ... ?
high productivity vs. having no life
Looking good, nice to see progress and Toni XD.
Quote:tell me about, half the battle of design seems to be tackling the player messing around - having said that I've found a fair few 3A games that have failed in doing this completely. Should've taken more care with their millions...
human player with a low attention span
Just wondering who does your voiceover?
#4
They can go in the buildings for cover if you place path nodes and cover points inside. In the video, I just had the street pathed up, and there are only cover points on the outside corners of the building.
@Steve: That's my voice you're hearing
07/28/2009 (7:59 pm)
@Johnathon: The looking around you see is just a pattern invoked by a switch statement so they look around, but I'm working on finding a way to get them to strafe around corners, check for probable locations for enemies, etc.They can go in the buildings for cover if you place path nodes and cover points inside. In the video, I just had the street pathed up, and there are only cover points on the outside corners of the building.
@Steve: That's my voice you're hearing
#5
Mind you Jaimi McEntire posted a pick of himself on his ID today, and I always reckoned he was blonde (based on NOTHING whatsoever) which he isn't.
What did you say about production to life balance? I need to get out more...
07/28/2009 (8:11 pm)
Did you stick it through a filter? I always had a strange feeling that you should sound squeakier.Mind you Jaimi McEntire posted a pick of himself on his ID today, and I always reckoned he was blonde (based on NOTHING whatsoever) which he isn't.
What did you say about production to life balance? I need to get out more...
#6
07/28/2009 (8:26 pm)
A Blonde? Mostly people assume I'm a woman - this is the first time that I've been assumed blonde. :)
#7
07/28/2009 (8:32 pm)
@Steve: Haha no, I've got a fairly deep voice. In the second TAIK demo, when you press U or Y for the squad commands, that's my voice you hear (quite unfiltered)
#8
07/28/2009 (8:44 pm)
i want one kit...
#9
07/28/2009 (10:07 pm)
Looks awesome as usual Bryce, can't wait until release!
#10
07/28/2009 (10:50 pm)
Looks fantastic Bryce!
#11
I am not going in there.. you go! :)
Not sure how you have the AI, hard to tell in the video. But in the scenario you describe above. One squad member should cover from the corner of the building to clear the left side and squad member #2 moves around point #2 and clears the right so squad member #1 can then move up and clear the right while squad member #2 is covering him.
That would make clearing a corner more realistic than sending someone out in the open and getting sniped. Probably just me, but having the squad members play leap frog would be kool:)
07/29/2009 (12:15 am)
Quote:Depending on the circumstances, a squad leader who encounters (what I'll now be calling) a bend point in the path, he will stop and send his squad into the area (to node 2).
I am not going in there.. you go! :)
Not sure how you have the AI, hard to tell in the video. But in the scenario you describe above. One squad member should cover from the corner of the building to clear the left side and squad member #2 moves around point #2 and clears the right so squad member #1 can then move up and clear the right while squad member #2 is covering him.
That would make clearing a corner more realistic than sending someone out in the open and getting sniped. Probably just me, but having the squad members play leap frog would be kool:)
#12
07/29/2009 (7:04 am)
Bryce, cool as usual. I don't think I ever downloaded your second version, but still play with the first one from time to time. Gonna love to see this when it's finished.
#13
But AI leader, I don't want to check the unknown, its too scary to go there alone!
07/29/2009 (8:47 am)
Now this is looking awesome!But AI leader, I don't want to check the unknown, its too scary to go there alone!
#14
07/29/2009 (12:21 pm)
so big question. How much and where do I order?
#15
07/29/2009 (1:17 pm)
@Edward: Still sorting some stuff out regarding sales...I've contacted Derek Bronson regarding getting the finished product in the product store, but no response yet.
#16
@Jaimi McEntire, I thought you were blonde too, don't know why. Strange.
I guess we always put an image of what we think people should look like based on their names? Don't hold this against me please!
07/29/2009 (1:27 pm)
@Bryce, very cool!@Jaimi McEntire, I thought you were blonde too, don't know why. Strange.
I guess we always put an image of what we think people should look like based on their names? Don't hold this against me please!
#17
07/29/2009 (5:24 pm)
It's always inspiring to read about your progress! I've always thought that the ultimate goal of game AI should be to have the AI fight battles against itself competently - what you're doing sounds like exactly that. I think I've said this before, but seeing your blogs makes me want to get to work on my own AI... sadly, that's a little way in the future :P.
#19
http://www.garagegames.com/community/forums/viewthread/62670
09/27/2009 (2:27 pm)
Bryce, I came across your findcover resource, where would I put that in script???http://www.garagegames.com/community/forums/viewthread/62670
#20
10/06/2009 (11:43 am)
Even with TGE being dropped I hope you still sell this for guys like me who are still using TGE.......can't wait to buy T3D.....Donnie 
Torque Owner Johnathon