Jump to content
Sign in to follow this  
.kju

Unit disableAI "FSM"

Recommended Posts

[82451] New: AI FSMs can be disabled using unit disableAI "FSM".

1.60 will introduce this new mode for disableAI.

I am posting here instead of in the MISSIONS - Editing & Scripting for two reasons:

1) The current behavior might be unintentional ("buggy").

2) It will improves chances a lot to catch Suma's attention.

What is the observed behavior?

When you apply the command on an AI, it will

a) Ignore incoming threats (units), incoming fire, being hit

b) Not engage enemies (unless very close)

c) Still follow waypoints

d) When applied to units in 'combat behavior', it may lead to AI getting stuck.

Demo mission: AICombatScenarioAirField.utes

Note:

d) might be due to units being in the 'Cause: 8 - CAN FIRE' with "unit forceSpeed 0;"

So one needs to apply also: "unit forceSpeed -1;"

What is the possibly unintentional behavior?

When looking at the danger.FSM one would not expect a) and b) to happen.

This is probably due to the internal/engine behavior caused/started by AI

getting into 'combat behavior'.

The other question is does it also disable the formation.FSM?

Now with the context in mind to disable AI FSM completely, reduce/avoid

performance impact when not desired/meaningful and possibly the ability to

replace it with custom AI FSM behavior that made Suma create this command,

the observed behavior makes more sense.

Ref:

Bug #20426: AI FSM performance and FSM defaulting/nesting (see comments by Suma on disabling AI FSM)

Feature #16330: Requesting ability to halt all FSM/AI on a specific unit

That said, I am not happy so far, as:

1) I am not sure this correct.

2) Custom AI FSM seems not doable with all internal/engine behavior lost.

3) Many look for ways to have control specifically over the 'combat behavior' mode.

See also:

Feature #23159: New command: setFSM (to swap/disable danger/formation/"core" fsm)

Feature #23151: Add new scripting command: combatBehavior and setCombatBehavior

Thanks.

Edited by .kju [PvPscene]

Share this post


Link to post
Share on other sites

The purpose seems to be to be able to freeze units and not have them cost any bandwidth/performance, as a replacement for the good old "delete all far away units, and spawn them again when players get close to the area etc".

http://dev-heaven.net/issues/20426#note-29

For that I think it works excellent (probably in combination with enableSimulation false etc).

As for customizing AI, I dont see where this purpose was mentioned, but in any case, once all game fsm's are not running on the unit, you should have 100% control over the unit, so with custom scripts (fsm / sqf).

Share this post


Link to post
Share on other sites

I guess one would not want units to freeze and it does not happen either.

The goal (of the command) is probably more like to get brain dead AI that indeed use less

bandwidth/performance. See the points 1 and 2 by Jay in the ticket header.

As for AI customization see comment #6, #7 and the said ticket #16330.

And as explained without the internal/engine behavior of danger.FSM (possibly also formation.FSM)

one cannot do everything with custom scripts.

PS: I cannot see how Jay's comment at #29 is more insightful than those from Suma about the command but ok.

Share this post


Link to post
Share on other sites

The only thing I could find that Suma mentioned about the command is:

> 2. An AI units FSM must always be running

This is true. I think introducing a new disableAI "FSM" could be used to solve this. Implementing this should be very easy on our side.

.

Share this post


Link to post
Share on other sites

It's the only way I can finally get my AI planes to fly directly into danger to drop bombs reliably. Works a treat.

Share this post


Link to post
Share on other sites

Do you have to use scripting to make them drop the bombs?

Can you please share your mission or a simple demo?

Edited by .kju [PvPscene]

Share this post


Link to post
Share on other sites

To get a plane to fly at a high altitude and simply drop a bomb, I needed to add heavy scripting methods to overcome whatever the default AI behaviour was doing to make it not work. I had to setpos and setdir the plane at height and use the fire command (dofire didnt work work well at all) and setvector the bomb towards the target on the way down. If the disableAI fsm for planes can prevent it it from dive bombing targets and crashing into the ground and or deviate from its intended flight path then all that scripting can be taken out and now the plane simply does what it is told by the scripter. Its really important that scripters are allowed to controll the AI when they want to and can enable or disable the default AI methods as needed. If I want a plane to just fly around an area and "do stuff" then the default behaviour is okay. If I want a plane to fly through a hail of AA fire and ignore all targets except for my specific ordered target then I need to turn those behaviours off so I can get the controll I need.

Just adding my experience with scripting AI for what its worth.

Share this post


Link to post
Share on other sites
Can you please share your mission or a simple demo?

I will see what I can do to post something... but the scripts are heavily dependent on a whole bunch of other stuff. I will have to try to trim a lot out.

@TJ72 ... pretty much the same for me. I did find after trying many different things that disabling the pilots FSM worked wonders.

I think I still have every command you can think of in there to try to make them follow "my" orders...but the disabling of the FSM seemed to be the one that worked. Not 100%....but at least the plane flies over the target now!

I also vector the bomb to target...so is a single bomb...precision strike.

EDIT: I agree that we should have total control of the AI.... I don't understand why we don't. One would think it would be easier to make them do nothing than to bob and weave and try to escape!

Edited by twirly

Share this post


Link to post
Share on other sites

Sickboy hit the nail on the head for my intended behavior.

This was an extension for mainly large-player missions and unit caching (read: > 60 player COOP missions).

This allowed us an extra extension on disabling AI; this also allowed us to create custom ambient civilians. The tests/initial implementations for these are internally (@ UO) known as jcache and jciv respectively. They results were:

Perform the following to actually allow for > 700 AI on the map, with 30 players, with minimal lag.


{
_unit = _x;

_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";
_unit disableAI "MOVE";
_unit disableAI "ANIM";
_unit disableAI "FSM";

_unit enableSimulation false;
_unit allowDammage false;

} foreach _groupUnits;

This allowed me to completely 100% remove all performance and network oriented processing for a given unit / group of units. The end result was:

1. Leave only the leader of a group on the map

2. Perform the above

3. Move them to -1000,-1000,-1000 on the map

Additionally - for the sake of a "Not broken ambient civilians" module I was working on, this allowed me to disable the massive script overhead of the default AI behavior even for civilian units in concern to the danger FSM. This allowed me to strictly perform the processing myself via SQF (using PFH/triggers and my own queuing mechanism for processing). This meant much more basic "ambient" civilians, at a much lower server performance cost for count.

That about sums up what the initial intent behind that feature request was, and my results with it.

Share this post


Link to post
Share on other sites

Thanks for sharing your insights guys!

(to share your demo missions would be even more neat ;))

Good point about vehicles. They may or may not show a somewhat different

effect from disableAI "FSM".

To get an infantry, ground vehicle or air unit from A to B without AI reacting to

threats is certainly a very useful application ("brain dead AI").

To reduce the performance and network impact as much as possible as jaynus

uses, it also a very helpful.

That said, it is NOT a way to

a) replace the default AI behavior (as it disables the internal/engine behavior // there are no ways to script/recreate that)

b) simply disable the danger.FSM

c) neither in terms of 'combat behavior' (slow movement)

:(

Edited by .kju [PvPscene]

Share this post


Link to post
Share on other sites

More to this....

After dicking around for hours I kind of... sort of... realise once again :) that almost nothing works on these little buggers. So... my claim that disableAI "FSM" worked for me I believe was only wishful thinking. I actually don't know what to believe. Who knows???

My C130 pilot will not do as told using any combination of :-

_pilot disableAI "TARGET";
_pilot disableAI "AUTOTARGET";
_pilot setBehaviour "CARELESS";
_pilot disableAI "FSM";
group _pilot enableAttack false;

What does seem to work on aircraft is this....and this is how it used to be done in OFP days (but in .sqs)....it seems nothings changed.

while {_plane distance player > 350} do {
   sleep 0.1;
   if(_plane distance player < 2000) then {
       _pilot FlyInHeight 250;
       _pilot doMove getpos player;
   };
};

Nothing else seems to be necessary. Unreal!

Here's what I think is a good question. What the hell are all those commands actually for?

Share this post


Link to post
Share on other sites

Infantry? By default vehicles have no danger/formation FSM assigned (Suma said its

supported though) - I was assuming 'disable "FSM"' would disable some internal/engine

behavior like it seems to do for infantry.

Share this post


Link to post
Share on other sites

My C130 pilot will not do as told using any combination of :-

_pilot disableAI "TARGET";
_pilot disableAI "AUTOTARGET";
_pilot setBehaviour "CARELESS";
_pilot disableAI "FSM";
group _pilot enableAttack false;

Adding this may help you:

_pilot allowFleeing 0;
{deletewaypoint _x} foreach waypoints _pilot;

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  

×