Jump to content
Sign in to follow this  
schaefsky

Letting AI defend what you want them to defend?

Recommended Posts

Hello,

I have really big problems (since OFP actually) to let the AI do what I want them to do, in regards to "tasks".

Short cut: How do you make AI defend something (making them attack something seems rather easy to me)

For example:

I want a group of AI to engage the enemy, e.g. go towards them or flank them.

I want another group to hold a hill or highpoint in the area while another group holds the actual objective, let's say a town.

The problem I have is mainly that I can't get AI to hold an area. They always seem to engage on their own. In a mission I'm working on, it plays out like this:

AI groups moving towards position of player groups to give him something to shoot at (this works fine apart from friendly AI spotting them from distances I would never notice anything, maybe I just suck at spotting?)

A different group to hold a highground on way to player's actual objective (this does not seem to work at all. In my mission enemy AI constantly wanders to the lower nearby road, where even I can spot them from far away, which usually results in a turkey shoot. No enemy AI seems to actually hold the high ground, which I think would be a good idea). I have tried "guarded by" triggers with groups with "guard" waypoint (which gives quite the opposite effect I want for me, AI just wanders all around), "Hold" waypoints (works a little better, but not much), giving simple "Move" waypoints. The only thing that does what I want is placing them manually and disableAI move, but that leads to lot of micro-management (when to allow them to move again, for example).

The group I want to guard the actual objective is quite close to the group on high ground and will happily go and look what is happening over there...

So... has anyone got the same problems? What is your take on it? I saw bis_fnc_taskDefend, but from the description it doesn't sound exactly like what I'm after (haven't actually tried it yet, though)

Or do you think something like a script (suite) to handle this would be needed?

Or did I just miss something obvious (crosses fingers) :o

Share this post


Link to post
Share on other sites

Thats a good question. I tried pretty uncessfully via the various combat modes + Hold waypoint to get the AI to actually hold the hill -no luck so far. They do tend to run around a lot all the while under a hold waypoint.

I think Hold should do exactly that -make them stay put. If mission designers want a stipulation to leave the Hold, that would be easy enough, so why not simplify these waypoints and orders somewhat to better control the AI.

Share this post


Link to post
Share on other sites

I used a guard waypoint and then have my FSM manage the locations.

Example from a mission to protect a GRU officer located in a building.

_SafeRoom_num  = floor(random (RU_HQ_count - 1));
_SafeRoom_pos = RU_HQ buildingPos _SafeRoom_num;
Ivan doMove _SafeRoom_pos;

.... (other state transitions)...

_SafeRoom = createGuardedPoint [east, _SafeRoom_pos, -1, objNull];

Share this post


Link to post
Share on other sites
Thats a good question. I tried pretty uncessfully via the various combat modes + Hold waypoint to get the AI to actually hold the hill -no luck so far. They do tend to run around a lot all the while under a hold waypoint.

Well the thing about the Hold waypoint, as far as I understand it, is that it is more or less a move waypoint that doesn't "complete itself" unless you make it "completed" by trigger.

It doesn't actually tell AI to hold a (very) specific area, it may appear so because the waypoint doesn't complete and they will go back to it (when they are too far away from it? *guessing*)

I used a guard waypoint and then have my FSM manage the locations.

My problem with the Guard waypoint is that AI interprets it rather... loosely. They do guard a trigger area, just their understanding of guarding tends do differ from mine, i.e. engaging in an area around the Guarded By area. That might be good for some cases, but I never got the results I wanted (see first post) from it.

Share this post


Link to post
Share on other sites

Hi schaefsky,

I'm no expert, but did you consider using disableAI "MOVE" ?

This would keep the units from moving. Then, if you place a trigger that the enemy crosses you could reactivate the AI units.

At the very least they're holding the area. :D

Best, Splicer.

Share this post


Link to post
Share on other sites

Yes, I actually use it sometimes. However I would like something in between "not moving at all" and "wandering around wherever AI likes to" :)

Share this post


Link to post
Share on other sites

Hmmm... Have you considered using the USPMON urban patrol script?

You can set the patrol area to be as small as you would like and the units will stay within that perimeters until they spot an enemy or attacked upon.

What do you think? :)

Best, Splicer.

Share this post


Link to post
Share on other sites
Hmmm... Have you considered using the USPMON urban patrol script?

You can set the patrol area to be as small as you would like and the units will stay within that perimeters until they spot an enemy or attacked upon.

What do you think? :)

Best, Splicer.

Try setting the way-point size and completion area to some thing that would encompass the building or zone, 65x60 and maybe seek and destroy or better still sentry until you want to move on.

Might help, might not.

Share this post


Link to post
Share on other sites
_cnt = createCenter EAST;
_grp = createGroup EAST;
_unit = ["CAF_AG_ME_T_AK74","CAF_AG_ME_T_SVD","CAF_AG_ME_T_ RPK74","CAF_AG_ME_T_PKM","CAF_AG_ME_T_GL","CAF_AG_ ME_T_AK47"] call BIS_fnc_selectRandom; 
_soldier = _grp createUnit [_unit,(position spawnpoint),[],0.5,"NONE"];
_soldier setPosASL [8632.27,10878.1,349.124]; _soldier setDir 266.972;  
_soldier setUnitPos "down"; _soldier disableAI "move"; 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×