SARGE AI Framework - Public Release

Status
Not open for further replies.
This is fantastic. Just what I am looking for, thank you. For rmod servers, and maps that allow them, is it possible to substitute planes and even fighter jets in SAR_heli_types? I have not had time to try this out myself, but looks like it should work right now? (I notice that the turret code is commented out)
It would be cool to have fighter jets fly over.

EDIT: Ok, just tested on my test dayz server with rmod enabled, didnt seem to work with the merlin or lynx helicopters from arma 2 (no helis appeared). I might not have rmod installed properly (its way past my bedtime), but everything looks ok. I presume that this script will work with helis 'unbanned' from arma 2 too?
 
Firstly thank you Sarge. Secondly my aim is to modify the coding in the mission.pbo to allow more and greater patrols in certain areas and less so in others. I looked through the sqf files and thought I had it worked out atleast to test it on the server but instead I broke all of the npc spawns as they didn't ever spawn in. My most sincere apologies if this matter has already been tackled elsewhere and if it has a link would be greatly appreciated. But I'm not sure how to continue with it working. Help please.
 
I would choose a different approach:

a) Disable dynamic AI spawning (in SAR_config.sqf)
b) define the area at NWAF as a marker area (use my example, maybe extend it a bit to cover your walls
c) setup static AI patrols to patrol within that area.
d) if you want specific spots at the NWAF protected, define them as seperate areas (so e.g. you could have a areas for the gates, areas for the control tower, etc. spawn static AI with the action "fortify" in those.
e) having a wall, define long thin areas inside of these walls for the AI to patrol.
f) spawn static AI in there with the "patrol" action.

profit ;-)

cheers, Sarge

Hi, thanks for your quick response. Since my script knowledge is rather limited, I will try it and post my result :)
 
This is fantastic. Just what I am looking for, thank you. For rmod servers, and maps that allow them, is it possible to substitute planes and even fighter jets in SAR_heli_types? I have not had time to try this out myself, but looks like it should work right now? (I notice that the turret code is commented out)
It would be cool to have fighter jets fly over.

EDIT: Ok, just tested on my test dayz server with rmod enabled, didnt seem to work with the merlin or lynx helicopters from arma 2 (no helis appeared). I might not have rmod installed properly (its way past my bedtime), but everything looks ok. I presume that this script will work with helis 'unbanned' from arma 2 too?

Give it a try, i do position 2 AI at the guns though, so any heli that hasn't got 2 turrets might be problematic. I didnt check that, in case it fails sth should showup in the rpt.
 
Hi Sarge,

I'm attempting to do a slight change to your ai code. What I'm attempting to do is have a player with a excessivly high humanity to be ignored by all AI (including bandits). This way I can allow admins to ignore AI by simply updating their humanity score. I'm unsure of the correct syntax but here is the idea

Code:
// the humanity value below which a player will be considered hostile
// IN SAR_config.sqf
SAR_HUMANITY_HOSTILE_LIMIT = -500;
 
// humanity level to which ai will not attack
SAR_HUMANITY_FRIENDLY_LIMIT = 20000;
 
 
            if(isPlayer _x) then {
               
                _humanity= _x getVariable ["humanity",0];
 
                If (_humanity < _humanitylimit && rating _x > -10000 && side _x != resistance) OR(_humanity < _humanityupper )then {
 
                    if(SAR_EXTREME_DEBUG) then {
                        diag_log format["SAR EXTREME DEBUG: reducing rating (trace_entities) for player: %1", _x];
                    };
                    _x addrating -10000;
                };
            };
 
Hi Sarge,

I'm attempting to do a slight change to your ai code. What I'm attempting to do is have a player with a excessivly high humanity to be ignored by all AI (including bandits). This way I can allow admins to ignore AI by simply updating their humanity score. I'm unsure of the correct syntax but here is the idea

Code:
// the humanity value below which a player will be considered hostile
// IN SAR_config.sqf
SAR_HUMANITY_HOSTILE_LIMIT = -500;
 
// humanity level to which ai will not attack
SAR_HUMANITY_FRIENDLY_LIMIT = 20000;
 
 
            if(isPlayer _x) then {
             
                _humanity= _x getVariable ["humanity",0];
 
                If (_humanity < _humanitylimit && rating _x > -10000 && side _x != resistance) OR(_humanity < _humanityupper )then {
 
                    if(SAR_EXTREME_DEBUG) then {
                        diag_log format["SAR EXTREME DEBUG: reducing rating (trace_entities) for player: %1", _x];
                    };
                    _x addrating -10000;
                };
            };


While you can workaround the "make em enemies " function with the above (although that contradicts, cause you will not be a bandit with 20000 humanity), the problem will be bandit AI. they are on side east, and by that enemy to any player (who is west).

Surv and soldier AI will never shoot a player with high humanity, only case would be player shoots first.

Only way i could think of is use setcaptive on that player - you would need to look that one up though, and i am not sure about the impacts.
 
Hi All,

I've been using this for about a week, I love it. However I have some questions and I am sorry if they have already been asked, I have a hard time finding my answers through all the pages of posts etc. I appreciate any help.

Heres my questions;

Custom load outs for the AI, I set them to have a wider range of weaponry and added some loot to them (bandages etc) and afterwards there were no AI spawning, are there limits on how many weapons they can have or the loot ? is there some consideration I need to have if I am altering that?

Heli Patrols - I have seen none at all, aside from when they steal our choppers.

Military - How would I make military into KOS everything? I want to have them be like the quarantine squads.

Cleanup_fsm - I run dayzCC and I cant seem to find this, I assume its a huge part of making this all run right, where is this located so I can add the suggested lines that I have read?

If you give AI grenades will they use them?

Thanks for any help!
 
Phenomenal work, Sarge. Starting to figure out how to edit what is here to mess with rates, patrols, etc-- fantastic addition to my server.
 
Give it a try, i do position 2 AI at the guns though, so any heli that hasn't got 2 turrets might be problematic. I didnt check that, in case it fails sth should showup in the rpt.

FYI, Got it working pretty well. Removed the turret code for testing, and had drones, su34s, sv22s, apaches and a10s that seemed to be flying fine. C130s I did not see when I tested them, not sure why, also f35bs seemed to not show, but whatever. I also tested a couple of arma 2 two-turret helicopters w. turrets on, which also worked.

But this is great, your code makes it easy to modify and add a conditional to add 0->n turret positions based on what spawned.

I take it that the turret gunners will attack foes then? If so, then will an unfriendly a-10 pilot say, attack? If not, no big woop ;)... this is still awesome!


@Stubbs:
Yesterday, the first time I used the mod on my local test server, surprisingly, I did see a discharged green smoke grenade, which must of been thrown by the AI, fwiw.

Have military KOS with everyone else would be a cool option, if possible. Looking at the code, it looks like more work than simply making WEST and RESISTANCE enemies in SAR_AI_Init.sqf , and setting 'SAR_AI_friendly_side' from resistance to west. SAR_config.sqf has another variable that defines which sides are enemies of resistance (east) and it also has DO NOT CHANGE THIS next to it :) Perhaps also adding 'west' to the array would be worth a try?

edit: also in SAR_setup_AI_patrol.sqf & and SAR_setup_AI_patrol_heli.sqf, you would need to change military side to be 'SAR_AI_unfriendly_side' instead of 'SAR_AI_friendly_side'

Setting 'SAR_AI_friendly_side' to west may cause problems to begin with, so best to let Sarge give proper answers next time he is back on the forums, before I get carried away. Anyways, Great stuff, having a lot of fun poking around with this :)
 
@ddraig - Thanks man, I'll have a look and see how it works out. I will wait to hear back from Sarge about the cleanup_fsm and the heli patrols.

Cheers all!
 
I'm a bit confused on how to edit the amount of humanity you lose for killing a solider/survivor and how much humanity you gain when killing a bandit. I believe it's possible, i'm just not understanding it correctly. If anyone knows how to edit these i would greatly appreciate any help.
Thanks!
 
FYI, Got it working pretty well. Removed the turret code for testing, and had drones, su34s, sv22s, apaches and a10s that seemed to be flying fine. C130s I did not see when I tested them, not sure why, also f35bs seemed to not show, but whatever. I also tested a couple of arma 2 two-turret helicopters w. turrets on, which also worked.

But this is great, your code makes it easy to modify and add a conditional to add 0->n turret positions based on what spawned.

I take it that the turret gunners will attack foes then? If so, then will an unfriendly a-10 pilot say, attack? If not, no big woop ;)... this is still awesome!


@Stubbs:
Yesterday, the first time I used the mod on my local test server, surprisingly, I did see a discharged green smoke grenade, which must of been thrown by the AI, fwiw.

Have military KOS with everyone else would be a cool option, if possible. Looking at the code, it looks like more work than simply making WEST and RESISTANCE enemies in SAR_AI_Init.sqf , and setting 'SAR_AI_friendly_side' from resistance to west. SAR_config.sqf has another variable that defines which sides are enemies of resistance (east) and it also has DO NOT CHANGE THIS next to it :) Perhaps also adding 'west' to the array would be worth a try?

edit: also in SAR_setup_AI_patrol.sqf & and SAR_setup_AI_patrol_heli.sqf, you would need to change military side to be 'SAR_AI_unfriendly_side' instead of 'SAR_AI_friendly_side'

Setting 'SAR_AI_friendly_side' to west may cause problems to begin with, so best to let Sarge give proper answers next time he is back on the forums, before I get carried away. Anyways, Great stuff, having a lot of fun poking around with this :)

The turret gunners will engage enemies. Auto reload should work on these as well (though untested). Keep in mind though that you won't see jets attacking infantry (at least i assume so), but they will attack vehicles.

About making all AI unfriendly:

Do NOT set AI to west :) never ever. I had that at the beginning of this mod. It works, BUT given that players are west as well, people run into the 140 groups max/side pretty often. 40 players = 40 (in effect 41, Dayz is using 1 for spawning) groups, that leaves 100 groups for AI. 36 grids on Chernarus, 3 groups per grid and new players will join as seagulls :)

Why don't you use military skins for bandits as well ? By that you have the looks of soldiers, but the logic still handles them as bandit AI.

Sarge
 
Hi All,

I've been using this for about a week, I love it. However I have some questions and I am sorry if they have already been asked, I have a hard time finding my answers through all the pages of posts etc. I appreciate any help.

Heres my questions;

Custom load outs for the AI, I set them to have a wider range of weaponry and added some loot to them (bandages etc) and afterwards there were no AI spawning, are there limits on how many weapons they can have or the loot ? is there some consideration I need to have if I am altering that?

Heli Patrols - I have seen none at all, aside from when they steal our choppers.

Military - How would I make military into KOS everything? I want to have them be like the quarantine squads.

Cleanup_fsm - I run dayzCC and I cant seem to find this, I assume its a huge part of making this all run right, where is this located so I can add the suggested lines that I have read?

If you give AI grenades will they use them?

Thanks for any help!

any issues in the rpt after the new loadouts ? Can you post the config file with your loadouts?

Heli patrols - if you didnt adjust your server_cleanup.fsm (in your server.pbo, in the sytem folder in there), helis will be killed on spawn.

Ai will use grenades. They will even loot them from cars / dead bodies.

cheers, Sarge
 
I'm a bit confused on how to edit the amount of humanity you lose for killing a solider/survivor and how much humanity you gain when killing a bandit. I believe it's possible, i'm just not understanding it correctly. If anyone knows how to edit these i would greatly appreciate any help.
Thanks!

In your SAR_config.sqf find:

Code:
// -----------------------------------------------
// Humanity values
// -----------------------------------------------
 
// Humanity Value that gets substracted for a survivor or soldier AI kill
SAR_surv_kill_value = 250;
 
// Humanity Value that gets ADDED for a bandit AI kill
SAR_band_kill_value = 50;
 
// the humanity value below which a player will be considered hostile
SAR_HUMANITY_HOSTILE_LIMIT = -2500;

and change as you want to.

Sarge
 
While you can workaround the "make em enemies " function with the above (although that contradicts, cause you will not be a bandit with 20000 humanity), the problem will be bandit AI. they are on side east, and by that enemy to any player (who is west).

Surv and soldier AI will never shoot a player with high humanity, only case would be player shoots first.

Only way i could think of is use setcaptive on that player - you would need to look that one up though, and i am not sure about the impacts.

Thanks Sarge.

I'll read up on the setcaptive function.

As an alternative (not sure if this would work) - couldn't you set all AI to be friendly by default then adjust the rating based on the incoming humanity score like this?
Code:
// SAR_AI_INIT.SQF
//unfriendly AI bandits
EAST setFriend [WEST, 1];  //---> set bandits to friendly initially
EAST setFriend [RESISTANCE, 0];
 
   
       
            //SAR_trace_entities.sqf
            _humanitylimitupper =20000; //this is a high limit for allowing AI to ignore player
       
                if(isPlayer _x) then {           
                _humanity= _x getVariable ["humanity",0];
           
                // Make Bandits hostile if humanity less than extreme upper limit
                If (_humanity < _humanitylimitupper && rating _x > -10000 && side _x != east && side _x != resistance) then {
                    if(SAR_EXTREME_DEBUG) then {
                        diag_log format["SAR EXTREME DEBUG: Bandit reducing rating (trace_entities) for player: %1", _x];
                    };
                    _x addrating -10000;
                };
              // Make Survivors hostile if humanity less than lower limit (player is bandit)
                If (_humanity < _humanitylimit && rating _x > -10000 && side _x != east && side _x != resistance ) then {
                    if(SAR_EXTREME_DEBUG) then {
                        diag_log format["SAR EXTREME DEBUG: Friendly reducing rating (trace_entities) for player: %1", _x];
                    };
                    _x addrating -10000;
                };
           
           
            };

I'm not sure of the downstream impacts of this in the other scripts...any feedback would be greatly appreciated.

Thanks in advance.
 
Thanks Sarge.

I'll read up on the setcaptive function.

As an alternative (not sure if this would work) - couldn't you set all AI to be friendly by default then adjust the rating based on the incoming humanity score like this?
Code:
// SAR_AI_INIT.SQF
//unfriendly AI bandits
EAST setFriend [WEST, 1];  //---> set bandits to friendly initially
EAST setFriend [RESISTANCE, 0];
 
 
   
            //SAR_trace_entities.sqf
            _humanitylimitupper =20000; //this is a high limit for allowing AI to ignore player
   
                if(isPlayer _x) then {       
                _humanity= _x getVariable ["humanity",0];
       
                // Make Bandits hostile if humanity less than extreme upper limit
                If (_humanity < _humanitylimitupper && rating _x > -10000 && side _x != east && side _x != resistance) then {
                    if(SAR_EXTREME_DEBUG) then {
                        diag_log format["SAR EXTREME DEBUG: Bandit reducing rating (trace_entities) for player: %1", _x];
                    };
                    _x addrating -10000;
                };
              // Make Survivors hostile if humanity less than lower limit (player is bandit)
                If (_humanity < _humanitylimit && rating _x > -10000 && side _x != east && side _x != resistance ) then {
                    if(SAR_EXTREME_DEBUG) then {
                        diag_log format["SAR EXTREME DEBUG: Friendly reducing rating (trace_entities) for player: %1", _x];
                    };
                    _x addrating -10000;
                };
       
       
            };

I'm not sure of the downstream impacts of this in the other scripts...any feedback would be greatly appreciated.

Thanks in advance.

A couple of things ...

a) && side _x != east && side _x != resistance are useless, the whole condition is only applied to players, and these are always west.

b) The problem here is that the logic doesnt make AI unfriendly, it makes players enemies ... and that's enemies to everyone. _x is the player object. -> so in this solution, every AI will shoot every player who's humanity is not above 20'000.


c) what you might try is simply change

Code:
_side = SAR_AI_friendly_side;

to

Code:
_side = SAR_AI_unfriendly_side;

in SAR_setup_AI_patrol.sqf in the case 1: // military block.

That will result in military AI not shooting bandit AI anymore though.

Sarge
 
In your SAR_config.sqf find:

Code:
// -----------------------------------------------
// Humanity values
// -----------------------------------------------
 
// Humanity Value that gets substracted for a survivor or soldier AI kill
SAR_surv_kill_value = 250;
 
// Humanity Value that gets ADDED for a bandit AI kill
SAR_band_kill_value = 50;
 
// the humanity value below which a player will be considered hostile
SAR_HUMANITY_HOSTILE_LIMIT = -2500;

and change as you want to.

Sarge
Thanks you. I was looking in SAR_AI_init.sqf for the values. My bad!
 
Sarge I just got this system set up and running on our server. Overall it works quite well, and for sure adds the spice of life to a new server. My question is this.... What is causing the Survivor AI to attack me, and/or my parked vehicle.
This only happens at greater view range, other wise I can stand right beside them and they ignore me like they should. Once there is 30-40 meters between us they start blasting away at me. I'm going to look into the AI adjustments after posting lol.. go figger.. Side note; this only seems to happen after I have recently interacted with, or exited my vehicle.

Thanks mate and great job getting this tweaked out.
 
Sarge I just got this system set up and running on our server. Overall it works quite well, and for sure adds the spice of life to a new server. My question is this.... What is causing the Survivor AI to attack me, and/or my parked vehicle.
This only happens at greater view range, other wise I can stand right beside them and they ignore me like they should. Once there is 30-40 meters between us they start blasting away at me. I'm going to look into the AI adjustments after posting lol.. go figger.. Side note; this only seems to happen after I have recently interacted with, or exited my vehicle.

Thanks mate and great job getting this tweaked out.

Thx for this feedback, might be that the "vehicle" fix causes this, try to disable it, i will run some tests here.

cheers, Sarge
 
Status
Not open for further replies.
Back
Top