Isolating Combat NPC's AI From Each Other?
Post Reply
Quote
Re: Isolating Combat NPC's AI From Each Other?
Posted by Aavenr on Mon Jan 2nd at 11:00am 2006


Hey guys,

I have got this big outdoors section on my level taking place inside what is essentially a big basin with a building structure on the center. There are enemies lining up the rock walls of the basin and along bridges that connect it to the main building. The idea is to make this a stealth level of sorts where you can take out each enemy one by one from afar or from point-blank range.

I have tried to sort of isolate each enemy from each and from the player by not giving them a common squad name, and having them turn their backs to the player. However, the problem I am encountering is that whenever the player kills a given enemy or is spotted by one of them and that enemy starts firing back, the rest of them -- which are pretty far away on other bridges, rocks, etc -- hear it, immediately turn towards the player and next thing you know, there is a dozen enemies shooting at the player all at the same time.

So what I want to do is to sort of isolate them into their own world if you will. I can control their visual perception by tweaking their orientation towards the world but I haven't been able to block them from each other.

I also want any them to be available at all times for the player to shoot at, and that they can also respond accordingly. So it's not like I can just put them in a dormant state until a player-activated trigger wakes them up.

I have been researching and testing all day to find a workable solution to this scenario but to no avail. So my question is, do you know if there is any way -- without actually having to go dirty and actually programming a custom NPC -- of shutting off their hearing sense, or blocking them from any action until they have been directly damaged?

Any help would be greatly appreciated.




Quote
Re: Isolating Combat NPC's AI From Each Other?
Posted by SmokersCough on Mon Jan 2nd at 6:04pm 2006


I'm not sure how you are going about this but try giving each enemy a different ai_relationship, now once one enemy is killed trigger the ai relationship to change from like to hate, this will mean they will not respond to their buddies death until the ai relationship changes (i think) also try using the block line of sight texture near each enemy so they can't see the next enemy, you can always kill the brush and it's parneting upon the previous enemy dying, hope this makes sense.





Quote
Re: Isolating Combat NPC's AI From Each Other?
Posted by omegaslayer on Mon Jan 2nd at 10:25pm 2006


Just a little tewwking from what Smoke said:
Make an ai_relationship, make it so all the soldiers are friendly with the !player. This way when they are killed they wont fire at you. But to make them start firing at you, have each soldier have an output of OnFoundPlayer (reverts the ai_relationship to hate).






Quote
Re: Isolating Combat NPC's AI From Each Other?
Posted by Aavenr on Tue Jan 3rd at 3:33am 2006


SmokersCough's idea with the ai_relationship was a bit hard to decipher at first, but omegaslayer's makes perfect sense. Very clever, and you know what? It worked like a charm!

Thank you so much gentlemen. <img src=" SRC="images/smiles/icon_wink.gif">




Quote
Re: Isolating Combat NPC's AI From Each Other?
Posted by omegaslayer on Wed Jan 4th at 7:22pm 2006


Another problem solved <img src=" SRC="images/smiles/icon_smile.gif">







Post Reply