Havoc302

Dynamically Calling in DMS units

9 posts in this topic

So I'm trying to make some areas on the map guarded but I don't want static AI there all the time and in some instances I actually want the AI to spawn exactly where I want them (within a H barrier area) or a static MG to spawn in a tower. Obviously I don't want to use just a trigger to call DMS units otherwise it'll be calling them every time someone enters the area. Want some opinions if this would work and / or is there a better way? We have A3XAI and DMS running on the server but getting A3XAI to do this appears to be even harder. Took most of the code straight from a DMS mission.

If I've set this up right while the player is within range it'll skip straight over the spawning with CP1AI being 1, once they're all dead, the player is dead or the player has left the area it'll wait 15 minutes then reset the trigger, I'm probably wrong and probably missing a bunch of things, hopefully you guys can point them out for me :P

 

Spoiler

_cp1pos = [2134,3367,0];
_cp1staticpos = [2135.537,3366.448,4.174];

if (CP1AI = 0) then {
    if (player distance _cp1pos < 800) then {
        CP1AI = 1;
        
        _group =
        [
            _cp1pos,
            4,
            "moderate",
            "MG",
            "bandit"
        ] call DMS_fnc_SpawnAIGroup;
        
        _staticGuns =
        [
            [_cp1staticpos],
            _group,
            "MG",
            "moderate",
            "bandit",
            "O_HMG_01_high_F"
        ] call DMS_fnc_SpawnAIStaticMG;
    };
};

if ((player distance _cp1pos > 800) or (!alive player) or (!alive _group && !alive _staticguns)) then {
    sleep 900;
    CP1AI = 0;
};

 

 

Share this post


Link to post
Share on other sites

look into exile occupation. It can do what you are looking for.

Share this post


Link to post
Share on other sites
Advertisement

I took a look but the AI are persistent, I don't want that. 

Share this post


Link to post
Share on other sites

If you turned off A3XAI, even with Occupation AI being persistent you would still get better server performance..

Doing it the way you are suggesting will add a server thread for every static group you spawn as well (unless you have one thread which monitors all of the groups).

You would be better off adding it to the Exile server threading system:

if(isServer) then
{
	fnc_spawnStatics = compile preprocessFileLineNumbers "custom\spawnStatics.sqf";
	[900, fnc_spawnStatics, [], true] call ExileServer_system_thread_addTask;
};

If you place your script in your mission file in "custom\spawnStatics.sqf" and put the code above in your init.sqf and lose the timed loop in your script it would just run every 15 minutes.

Share this post


Link to post
Share on other sites

We tested a completely vanilla exile server with DMS and Exile Occupation and for the amount of AI locations we needed it was way above anything DMS and A3XAI have ever used. 

 

I really don't want them in the map unless they're needed. 

Share this post


Link to post
Share on other sites

what you are looking for is called caching... im pretty sure on of the 3 AI systems has this in.

the ai will be persistent, but cached, so no perfomance is lost

else you will need to spawn them everytime someone comes around and I think thats more inefficent than just caching them...

Share this post


Link to post
Share on other sites

The major impact on server performance is not only running the AI, but spawning them as well. Spawning AI/objects creates a spike in network traffic (that the glorious ArmA engine is so amazing at handling).

 

The best choice is what @hieve said, "caching" the AI. Implementing such a system has been on my to-do list for a long time (and admittedly, I still haven't gotten around to it).

Share this post


Link to post
Share on other sites

Yeah I'm really missing some of the AI systems that were around for A2. 

Share this post


Link to post
Share on other sites

Make them invisible and inactive. Then players won't know they are there and you can spawn them like a static mission.

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.