Jump to content
Sign in to follow this  

Promising Experiment Better AI management

Recommended Posts

I've been doing some very rudimentary experiments with AI spawning and found a better way to micro-manage missions and prevent large FPS hits. It turns out if you add conditions that after a "group" of AI are dead then wait a certain amount of seconds spawn them and unhide them. When you hide them they disappear from the scene and their simulation is postponed, now what I did was simple enough that conditionallly when AI Group(A) AND AI Group(B) AND AI GROUP© are all dead then spawn units , and wait this way there is always the AI there but not there they are in a "suspended state" this combined with description.ext for wreck and corpse removal almost eliminates all FPS problems with AI as far as I can tell.

All I did was created 4 infantry groups 2 Blufor Fire-teams and 2 Opfor Fire-teams 1 Opfor tank and 1 Blufor tank as soon as all the AI were dead in that group and that condition fell silent it would spawn in the next group of AI so instead of spawning all AI at once hiding them "disable simulation / hide from object scene" removes stress on the client from the AI side and the server because after and only after the "groups of spawned" AI are dead they are hidden object simulation disabled, then cleaned up after the wreck timeout in description.ext finishes.

So steps to create "simple simulation manager":

1. Create 2 groups of AI

2. Create a Trigger of "When no body is present" execute condition of !(alive ai1) && !(alive ai2) && !(alive ai3) etc.

3. Then execute synchronised module of "hideObjects" under object modifiers

4. Play the mission use cursorTarget setDamage 1; on the objects that are linked to the "alive condition"

5. and as soon as those objects are dead.

6. Hide them and disable simulation frame-rate jump of upto from initial testing 15 - 20 frames

See Attached:

After Fighting AI:

http://i.imgur.com/vBup8A5.jpg (150 kB)

While AI Fighting:

http://i.imgur.com/F7M0Ai9.jpg (163 kB)

Mission Structure:

http://i.imgur.com/yni44wN.png (159 kB)

The one problem appears to be that the sound loops attached to vehicles are not disabled as well.

Edited by Polymath820
Fixed URL order

Share this post

Link to post
Share on other sites

An additional piece of information was to make AI spawning more efficient I saw a need to create "AI Processing Pipelines" so for example:

When the AI in the scene are completed spawning and after they all die. But this was made more efficient by basing it off the fact that Functions in ArmA 3 are non-scheduled environments and AI spawning is similar to one lump effect so I thought, why not separate the system into pieces:

Infantry AI Pipeline (1)

Vehicle AI Pipeline (2)

Empty Vehicle Pipeline (3)

Now after AI have spawned a request is made to the pipelines to line up N number of AI groups or units When N reaches it's limit it maintains the AI Queue at that value which is set to a "safe limit" Then when all the AI are dead in the last spawn cycle the processing queue lets through a few AI groups checks if it's beyond the safety limit and waits. Then once that AI group is dead request the next from the pipelines. A simple Dia diagram has been provided:


So the best way to describe it would be to create a simple non-scheduled function using pre-compiled .sqf which does the spawning and an execVM which makes calls to 3 other execVM .sqf's

Additional Diagrams Provided on the intricate details of the system. Including the pipeline manager and scene manager Other intricate details as stated above would be to use a non-scheduled environment for a re-usable function for spawning units but separate execVM's and scripts for each of the spawning pipelines

I know that non-scheduled environments are bad due to them be executed in the fastest possible time but if they are fast and small which don't depend on too many sub-calls their efficiency can be taken full advantage of.

http://i.imgur.com/HZNUdqC.png (212 kB)

Edited by Polymath820

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