Jump to content

Sarge AI


Dango

Recommended Posts

Description

Disclaimer: This is the initial release for Epoch. This addon is not meant to be mod specific but some issues may arise. Please also note that I am not the original author of Sarge AI but I have been supporting it since version 1.5 in Arma 2.

This is an AI system that is intended to simulate real players roaming the map, scavenging, looting and engaging in combat. Unlike other AI systems Sarge AI designates two factions as friendly and only one faction as hostile. This approach provides a simulated pvp/pve environment that changes depending on how players react to the AI. If a player fires and hits a friendly unit the entire group will become hostile and return fire. AI groups will perceive a player that has fired and hit one of it's members as hostile until the group is dead or the player is dead. AI are configured to treat any player with a specific amount of respect one of two ways. If the player has respect below the threshold they will be considered hostile and treated as an enemy by all AI. If the player has respect above the threshold they will be considered friendly only by the friendly factions of AI. If a player shoots or kills any AI the player's respect will be changed in one of two ways. If the AI target is from a friendly faction the player will lose respect for each shot and kill. If the AI target is from a hostile faction the player will be rewarded respect for each shot and kill. There are three (3) factions of AI within this feature:

The Survivors

  • Fighting for survival as most of us are; These AI do not wish to start unnecessary conflict as they intend on living as much as any player. These AI will assume every player is friendly unless they are given reason to think otherwise. They often wear toned down military apparel and civilian clothing and should be easy to spot as to not frighten unaware players.

The Military

  • As the dominant force in a wasteland of fugitives and other life threatening obstacles the military takes no chance when it comes to combat. Dressed in high level military apparel and the weapons to back it up these NPCs will roam about the area they spawn in and neutralize any threat they encounter. Don't be a threat ;)

The Bandits

  • With no apparent loyalty to anyone but the small group of others they travel with these NPCs will roam the map surviving any way they are able to. These AI will steal any loot they encounter and attempt to kill any player they encounter. Outfitted with respectable weapons and head wraps to protect their identities from the authorities these AI make for a formidable enemy.

AI can be static or dynamic based on a grid overlay. AI can be bound to the block they spawned in or allowed to freely roam (experimental). AI vehicles are static and are being worked into a dynamic option. Vehicles will patrol within a marker and will not leave the marker unless in combat.

 

Known Issues

  • All AI are hostile. This is not intended and I am still working out how best to configure what determines if a player should be considered hostile or not.

 

Download Sarge AI

Edited by Dango
Added download link
Link to comment
Share on other sites

Latest code has this in the init_base_guards.sqf, so doesn't look like that fix took:

	_baseName = _x getVariable ["ExileTerritoryName",""];
	_sizeOfBase = _x getVariable ["ExileTerritorySize",0];
	_fakeFlag = _x getVariable ["ExileDatabaseID", 0];

 

Link to comment
Share on other sites

  On 10/26/2017 at 1:38 AM, Grahame said:

Latest code has this in the init_base_guards.sqf, so doesn't look like that fix took:

	_baseName = _x getVariable ["ExileTerritoryName",""];
	_sizeOfBase = _x getVariable ["ExileTerritorySize",0];
	_fakeFlag = _x getVariable ["ExileDatabaseID", 0];

 

Expand  

Alright I will add that to the list. As far as I can tell it does not have any affect on our server though. Thanks!

Link to comment
Share on other sites

Uh, those variables do not exist in Epoch so if they are used in the code it would have some effect...

You may want to check the rest of the code too... it's full of Exile variables... i.e. in fn_AI_guards.sqf:

_authorizedUID = _flagPole getVariable ["ExileTerritoryBuildRights", []];

Would be good to have a working A3/Epoch Sarge AI...

Link to comment
Share on other sites

  On 10/26/2017 at 1:50 AM, Grahame said:

Uh, those variables do not exist in Epoch so if they are used in the code it would have some effect...

You may want to check the rest of the code too... it's full of Exile variables... i.e. in fn_AI_guards.sqf:

_authorizedUID = _flagPole getVariable ["ExileTerritoryBuildRights", []];

Would be good to have a working A3/Epoch Sarge AI...

Expand  

The base guards are disabled by default so they don't get run. I will be changing them over to work with epoch though. I have pushed an update and done some cleanup on the exile entries. The only ones left are commented out so I can reference them later on.

Link to comment
Share on other sites

This code would be a big problem since in vanilla Epoch male characters are EAST and females are WEST:

// unfriendly AI bandits
EAST setFriend [EAST, 1];
EAST setFriend [CIVILIAN, 1];
EAST setFriend [WEST, 0];
EAST setFriend [RESISTANCE, 0];

// Players
RESISTANCE setFriend [EAST, 0];
RESISTANCE setFriend [WEST, 1];

// friendly AI
WEST setFriend [EAST, 0];
WEST setFriend [RESISTANCE, 1];

 

Link to comment
Share on other sites

  On 10/26/2017 at 1:54 AM, Grahame said:

This code would be a big problem since in vanilla Epoch male characters are EAST and females are WEST:

// unfriendly AI bandits
EAST setFriend [EAST, 1];
EAST setFriend [CIVILIAN, 1];
EAST setFriend [WEST, 0];
EAST setFriend [RESISTANCE, 0];

// Players
RESISTANCE setFriend [EAST, 0];
RESISTANCE setFriend [WEST, 1];

// friendly AI
WEST setFriend [EAST, 0];
WEST setFriend [RESISTANCE, 1];

 

Expand  

Oh wow! Thanks for pointing that out. :)

Link to comment
Share on other sites

I have altered the relations a bit. I hope this will work and I am loading it right now to test.

// unfriendly AI bandits
RESISTANCE setFriend [EAST, 0];
RESISTANCE setFriend [CIVILIAN, 0];
RESISTANCE setFriend [WEST, 0];
RESISTANCE setFriend [RESISTANCE, 0];

// Players
EAST setFriend [RESISTANCE, 0];
WEST setFriend [RESISTANCE, 0];

// friendly AI
WEST setFriend [WEST, 1];
WEST setFriend [EAST, 1];

I have also changed the friendly side variable to WEST and used the RESISTANCE side for the bandits.

Link to comment
Share on other sites

  On 10/26/2017 at 6:12 PM, Dango said:

Could you post a snippet of the errors. That way I can compare to mine. Thanks!

Expand  

soz for the late reply

first one (sure its something to do with SAR_cfg_grps_chernarusredux.sqf or SAR_cfg_grid_chernarus_summer.sqf )

22:15:05 Error in expression <"SAR_area_%1","x"];
for "_i" from 0 to (_gridsize_y - 1) do
{
for "_ii" from 0 t>
22:15:05   Error position: <_gridsize_y - 1) do
{
for "_ii" from 0 t>
22:15:05   Error Undefined variable in expression: _gridsize_y
22:15:05 File addons\sarge\init\fn_postInit.sqf [SAR_fnc_postInit], line 37

second regarding the below

  Reveal hidden contents

 

third the endless rpt spam thousand and thousand of lines

example below

  Reveal hidden contents

removed sarge.pbo ran server rpt spam gone

will revisit when i have more time as i would like to use this

cheers

natoed

Link to comment
Share on other sites

  On 10/29/2017 at 1:06 PM, natoed said:

soz for the late reply

first one (sure its something to do with SAR_cfg_grps_chernarusredux.sqf or SAR_cfg_grid_chernarus_summer.sqf )

22:15:05 Error in expression <"SAR_area_%1","x"];
for "_i" from 0 to (_gridsize_y - 1) do
{
for "_ii" from 0 t>
22:15:05   Error position: <_gridsize_y - 1) do
{
for "_ii" from 0 t>
22:15:05   Error Undefined variable in expression: _gridsize_y
22:15:05 File addons\sarge\init\fn_postInit.sqf [SAR_fnc_postInit], line 37

second regarding the below

  Reveal hidden contents

 

third the endless rpt spam thousand and thousand of lines

example below

  Reveal hidden contents

removed sarge.pbo ran server rpt spam gone

will revisit when i have more time as i would like to use this

cheers

natoed

Expand  

NPs. Late replies happen. The first two issues stem from the redux map not being supported. Simple fix though. If you look through the supported map setting you will see how it determines if the map is supported or not. I will update it soon to include redux. The last issue is one I have struggled with for a while. It is a result of putting UPSMON in the server pbo. I am currently testing with it in the mission file. Works much better as it was written for this method but it spikes the mission file size by 2K+. Not optimal but hey, it works properly. The endless spam does not impact our server much but we may have less traffic than you do. I may even switch this to a workshop mod to keep things smooth . We'll see :/

Link to comment
Share on other sites

  On 11/3/2017 at 5:44 PM, Berntsen said:

Question, I was looking at the PDF on how to configure map grids... and it's confusing me somewhat.

Just wanted to clarify, is the guide up to date?

Expand  

Essentially, yes it is. The code block for the supported maps is a bit old but for the most part the guide works the same.  Just no longer using the try/catch method for custom error handling. You need to create a mission, save it, add the sarge files and turn on all the debug options. Then save and reload the editor mission. Preview the mission and open the map. You will see the grid and then you adjust it in the files and keep reloading till it is where you want it.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...