Door Kickers 2

Door Kickers 2

Door Kickers 2 Workshop
Unlimited gameplay via our in-game mission editor and extensive game moddability.
t_haugli 2 29 Dec, 2022 @ 2:14pm
Setting AI behavior question
Hi

I am starting to dabble with the editor, and I have watched a few of the editor tutorials.

What I have not figured out is how to set up AI behavior properly.

1. How do I stop the bad guys from rushing at the good guys, but instead stay and fight from their position of cover?

2. How do I set it up so a bad guy that is patrolling will take up a static fighting position once combat starts?

Thanks!
< >
Showing 1-2 of 2 comments
Tomahawk0201 2 Jan, 2023 @ 9:48pm 
Might be able to help here.

1. When you spawn an enemy AI, you'll want to change their investigation parameters. Investigation is when an AI does NOT see your troopers but has heard gunfire or other suspicious activity and will travel towards the noise. Two parameters control this:

"Investigate max distance" -- how far from the AI's position he'll walk towards suspicious activity. AI will not investigate suspicious activity outside his max range even if they hear it.

"Chance to investigate" -- the % chance an AI will leave his position and walk towards suspicious activity.

If a bad guys sees a trooper he'll engage/take cover/ambush regardless of investigation settings.


2. I understand what you want, but haven't personally tried to get this behavior. Here's what I'd try:

Setup a trigger and check "Enabled" AND "When combat starts". This means the trigger is ready to activate and it's activation condition is when combat starts.

The trigger should target the AI and target a way point with no additional nodes (setting multiple nodes just makes a patrol route). The way point should be placed at the static position.

I'd also recommend setting the AI's investigation chance to 0% just to make sure he's not gonna run off and do his own thing.

Hope this helps.
Ninja_Prime 432 11 Feb, 2023 @ 11:51pm 
Hi its great to know you want to make maps for this game, its really rewarding and at the same time frustrating.

To answer your questions, as Tomahawk said to your 1st question, also set the AI to blind fire and also play around with the Investigate range. The game does not really have any actual script you can use to make the AI act differently. Personally I tweak the Investigation range and set them to blind fire more than the default setting..There is also something that was implemented, the range that the AI can randomly wonder.

With regards to your second question, you can set up a trigger as suggested, but triggers can get really confusing, I find that if you set up a way-point for the AI to follow such as a patrol path, they will automatically engage and then return back to their patrol route once the enemy has been killed. However if you set a trigger to start the AI to follow a patrol path, it will follow the patrol path, but once it engages and survives it will just randomly walk about the map.and no longer follow the patrol path.
Last edited by Ninja_Prime; 11 Feb, 2023 @ 11:52pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50