Jump to content
Sign in to follow this  
rimblock

Agents: Any good overviews / tutorials out there ?.

Recommended Posts

Hi,

I am trying to find a primer on agents.

My limited understanding is that they are AI units without set behaviours (ie. they will do noting unless scripted to do so).

Having a quick play with them, it seems like a number of commands (via sqf) do not appear to work with them (or I was just not applying them correctly).

Is there any guide with a brief overview of what an agent is, how it differs from a normal AI unit and how to control them (any commands that don't work or do work, sqf or FSM only etc).

The plan is to use them for creatures / monsters rather than AI units to save available groups and allow the 4 sides to be used for other things. This wont work if I cannot do some heavy scripting for them though (pack behaviour etc).

Thanks

Share this post


Link to post
Share on other sites

More specifically, an agent does not have any FSM (Finite State Machine) attached to it which is what puts the "I" in "AI". Once spawning an agent, a scripter may wish to use a custom FSM using execFSM.

For example, the soldiers in the game are simple "objects". They will just be frozen unless something makes them move, this is what the FSM does, it "controls" the object like a human player would. Human players do not have an FSM associated with their objects (technically I suppose your brain could be considered an FSM, but for some people I've met it's either non-existant or contains very few states).

I can only give an extremely basic overview of what an FSM is, no specifics relating to Arma. I can say, though, that spawning an agent isn't very difficult. It would definitely be worth it to play in the editor's debug console to spawn an agent and add it to your group to see if you can control it.

Share this post


Link to post
Share on other sites

Thanks for the reply.

Ok so the game engine attaches a FSM to an AI unit on creation ?. We can then amend the FSM flows by setting 'states' (like setting behaviour to "SAFE" etc) which affects how the FSM runs but can also allocate commands to the AI unit like domove via sqf script as well ?.

I wrote a fairly simple AI chase player script. The AI polls the surrounding area, gets the nearest player controlled unit and does a doMove to that position. It polls every few seconds and reissues the doMove each time if the player remains in range (as I said, pretty simple). When I changed the unit to an agent it did nothing at all. The doMove did not seem to affect it.

Are Agents only controllable via FSM codes and called scripts from the FSM whilst not being affected by external SQF scripts ?. Is there any other reason the doMove command did notwork on the Agent when it did on the AI ?.

I am trying to assess if using Agents will be good enough for what I have in mind or if I need to stick to AI units.

Share this post


Link to post
Share on other sites

Judging from the information you gave about your doMove test, I assume that objects can only be controlled by their FSM's and all of the scripting commands related to controlling objects, like doMove, will actually call the FSM using certain parameters.

I can't really say what would be best for you though because I have no idea what you're trying to do, you never said

Share this post


Link to post
Share on other sites

Sorry, maybe I was unclear.

On my test, I did not assign any FSM to either the AI unit or the Agent. Control of the chasing unit was purely via SQF scripts called from the missions init.sqf.

When the chaser was the AI Unit it was moving around and then would 'spot' the player and then the doMove command would kick in and it would run to the player.

Using the same SQF scripts with the only difference being the chaser was created with createAgent command, the agent would just stand there even when the player was in range and the doMove command would have been kicked off. It seems the doMove command has no effect on Agents.

So the same commands, via an external SQF script were fired to control the chaser and worked when the chaser was an AI unit and didn't when the chaser was an agent. This leads me to believe the agent unit type work differently and maybe some commands / techniques for control do not work with them.

The aim of this post is to find out what does and what doesn't work with Agents as opposed to with AI units so I can better understand what I need to do to be able to accurately control and make use of them.

Thanks

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  

×