Squad issue

Any aspects of level design for the Source engine.

Squad issue

Postby Aus_Karlos on Wed Apr 16, 2014 12:49 pm

Hey guys ive got a squad issue. Basically i have a patrolling group consisting of 2 Hunters and 4 combines. They all follow a path_corner route that was trigger by an ai_scripted_sequence. That all works fine. But when the player attacks the group and shoots a hunter, Only the hunters respond to the attack and will give chase to the player. If the player shoots a combine, all 4 combines will shoot but only the one that has taken damage will chase the player the rest will fire while continuing the path route (untill the player shoots all 4).

Each NPC is in the same Squad and they seem to respond as a squad if they here combat noises. They also take turns in advancing on the player once all 6 members are engaged in the attack.
Wake Squad is enabled with an auto radius.

Could i have missed something in the setup? Basically i have an Auto_logic fire to a point_template which spawns the patrol. The template applies initial script and the relationships. Then each NPC has an Output, OnDamagedByPlayer enables a new ai_relationship via a logic_relay which disables itself (stops each NPC firing the same relationship again) Then if the player runs away out of the NPCs LOS they output again OnPlayerLost > math_counter > Add > 1 (Total of 6)
which fires a similar logic_relay. The math_counter setup is more complex. Its there so if all 6 npc's have lost sight then it resets the relationship. If the same NPC that lost sight of the player gains sight again the math_counter is deducted.
Under Construction
mg_sawI
Aus_Karlos
Regular
Regular
 
Joined: Mon Sep 10, 2007 11:47 am

Re: Squad issue

Postby marnamai on Thu Apr 17, 2014 1:12 am

I think you're overcomplicating the ai setup a little.

Take a look at this tutorial? http://www.halfwit-2.com/?page=tutorials&id=130
User avatar
marnamai
Veteran
Veteran
 
Joined: Thu Nov 10, 2005 12:17 pm
Location: Belgium

Re: Squad issue

Postby Riomaki on Thu Apr 17, 2014 6:14 pm

I don't know what a ai_scripted_sequence is. Do you mean an aiscripted_schedule or a scripted_sequence? It would help to clarify what you want the end result to be.

You shouldn't need all of the OnDamaged/OnLost scripting.
Riomaki
Regular
Regular
 
Joined: Sun Jul 14, 2013 12:28 am

Re: Squad issue

Postby Aus_Karlos on Fri Apr 18, 2014 3:34 am

yeah sorry aiscripted_schedule, theres a few ive been trying. If i dont use OnDamage/OnLost outputs the following will happen.
1) The patrol will ignore any incoming damage (Player, antlion, prop_physics, ect ect)
2) Player can just stand there shooting them
This is because the relationship to the player is set to "Like" only upon attacking the patrol will another relationship be fired that is set to "Hate"

I think the problem lies with the aiscripted_schedule it seems to limit the AI and "holds" onto the NPC until the player directly attacks that NPC.
Im going to try a different approach involving assault_assaultpoint. The group rallys to the assault point stays there for a bit. May even throw in a actbusy entity. Then after X Minutes the group is triggered to move to the next assault point.
Under Construction
mg_sawI
Aus_Karlos
Regular
Regular
 
Joined: Mon Sep 10, 2007 11:47 am

[deleted]

Postby Zaughi on Fri Apr 18, 2014 6:42 pm

[deleted]
Last edited by Zaughi on Mon Sep 16, 2019 5:14 am, edited 1 time in total.
Zaughi
Regular
Regular
 
Joined: Wed Jun 06, 2012 8:37 pm

Re: Squad issue

Postby Riomaki on Sat Apr 19, 2014 4:11 pm

Yes, aiscripted_schedule basically forces the AI to do whatever you tell it to, regardless of what the player is doing. So if you put them on a path, they'll run the path and ignore the fact that the player is firing on them. It's not that smart about this, however - the AI will tend to beeline from point-to-point and if it reaches an obstruction, it won't try to avoid it and will instead stand around looking clueless, so keep that in mind.

If your goal is to have them follow this path, but break out of it when the player attacks them, you can try doing as Zaughi proposes or set the aiscripted_schedule's Interruptibility setting to "Damage or Death." Your ai_relationship is just complicating things.

An assault will basically have the AI going from point-to-point, "securing" each one, and breaking out of it naturally if they see the player. It has quite a bit more entity overhead, but if you want a more natural looking patrol, this would be the best option.
Riomaki
Regular
Regular
 
Joined: Sun Jul 14, 2013 12:28 am

Return to Hammer Editor Help

Who is online

Users browsing this forum: Bing [Bot]