Jump to content
Dango

Sarge AI

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

Share this post


Link to post
Share on other sites

interesting I'll have a crack real soon and provide some feedback

thou the Sarge-AI/sarge/config.cpp still has this in it....

requiredAddons[] = {"exile_client","exile_server_config"};

 

Share this post


Link to post
Share on other sites
4 minutes ago, natoed said:

interesting I'll have a crack real soon and provide some feedback

thou the Sarge-AI/sarge/config.cpp still has this in it....

requiredAddons[] = {"exile_client","exile_server_config"};

 

Good call. It appears I forgot how to use my git client lol. The files should be good now.

Share this post


Link to post
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];

 

Share this post


Link to post
Share on other sites
1 minute ago, 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];

 

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!

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites
1 minute ago, 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...

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.

Share this post


Link to post
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];

 

Share this post


Link to post
Share on other sites
2 minutes ago, 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];

 

Oh wow! Thanks for pointing that out. :)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

You should probably remove that code altogether since Epoch handles setting side relations on server initialization. Friendly sides have to be EAST and WEST though since they are both player sides.

Share this post


Link to post
Share on other sites
6 minutes ago, Grahame said:

You should probably remove that code altogether since Epoch handles setting side relations on server initialization. Friendly sides have to be EAST and WEST though since they are both player sides.

TBH I like that idea better lol. Let me push that out.

Share this post


Link to post
Share on other sites
5 hours ago, Helion4 said:

Nice!

Welcome Dango & thanks for bringing this over, I have many fond memories of this AI system from Dayz Epoch. :biggrin:

I freaking love sarge's ai. They are always so unpredictable lol.

Share this post


Link to post
Share on other sites
4 hours ago, natoed said:

after an hour of fuck'n around got this bad-boy to run, pretty damn good, thou you need to look at the way epoch spawns vehicles (rpt spam)

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

Share this post


Link to post
Share on other sites
On 10/27/2017 at 4:12 AM, Dango said:

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

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

Spoiler
22:15:10 "Sarge AI: Static Spawning for Helicopter patrols finished"
22:15:10 "Sarge AI: Static Spawning for infantry patrols started"
22:15:14 Cannot create non-ai vehicle ,
22:15:15 Cannot create non-ai vehicle ,
22:15:17 "Sarge AI: Static Spawning for infantry patrols finished"
22:15:17 "Sarge AI: Static Spawning for vehicle patrols started"
22:15:17 Cannot create non-ai vehicle ,
22:15:17 Cannot create non-ai vehicle ,
22:15:17 "Sarge AI: Static Spawning for vehicle patrols finished"
22:15:17 "Sarge's AI System: Dynamic spawn definitions have been configured for ChernarusRedux."
22:15:17 "SAR_AI: Dynamic spawning definition / adjustments started"
22:15:17 "SAR_AI: Dynamic spawning definition / adjustments finished"
22:15:17 "SAR_AI: Static spawning area definition started"
22:15:17 "SAR_AI: Static spawning area definition finished"
22:15:17 "Sarge AI: Static Spawning for Helicopter patrols started"
22:15:20 Cannot create non-ai vehicle ,
22:15:24 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:24 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:24 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:25 "Sarge AI: Static Spawning for Helicopter patrols finished"
22:15:25 "Sarge AI: Static Spawning for infantry patrols started"
22:15:27 Cannot create non-ai vehicle ,
22:15:31 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:31 Cannot create non-ai vehicle ,
22:15:32 "Sarge AI: Static Spawning for infantry patrols finished"
22:15:32 "Sarge AI: Static Spawning for vehicle patrols started"
22:15:33 Cannot create non-ai vehicle ,
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 Ragdoll - loading of ragdoll source "Soldier" started.
22:15:33 Ragdoll - loading of ragdoll source "Soldier" finished successfully.
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 Error in expression <UPSMON_CIV_Total = UPSMON_CIV_Total + count (units _npc)>
22:15:33   Error position: <UPSMON_CIV_Total + count (units _npc)>
22:15:33   Error Undefined variable in expression: upsmon_civ_total
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 Cannot create non-ai vehicle ,
22:15:33 "Sarge AI: Static Spawning for vehicle patrols finished"
22:15:33 "Sarge's AI System: Static spawn definitions have been configured for chernarusredux."

 

 

third the endless rpt spam thousand and thousand of lines

example below

Spoiler
22:28:32 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:28:34 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:28:44 Server: Object 2:1313 not found (message Type_93)
22:28:44 Server: Object 2:1312 not found (message Type_93)
22:28:44 Server: Object 2:1318 not found (message Type_93)
22:28:44 Server: Object 2:1317 not found (message Type_93)
22:28:44 Server: Object 2:1322 not found (message Type_93)
22:28:44 Server: Object 2:1321 not found (message Type_93)
22:28:48 Server: Object 2:1322 not found (message Type_121)
22:28:48 Server: Object 2:1317 not found (message Type_121)
22:28:48 Server: Object 2:1321 not found (message Type_121)
22:28:49 Server: Object 2:1318 not found (message Type_121)
22:28:49 Server: Object 2:1312 not found (message Type_121)
22:28:49 Server: Object 2:1313 not found (message Type_121)
22:28:54 Server: Object 2:1386 not found (message Type_93)
22:28:54 Server: Object 2:1385 not found (message Type_93)

 

removed sarge.pbo ran server rpt spam gone

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

cheers

natoed

Share this post


Link to post
Share on other sites
On 10/29/2017 at 9:06 AM, 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

22:15:10 "Sarge AI: Static Spawning for Helicopter patrols finished"
22:15:10 "Sarge AI: Static Spawning for infantry patrols started"
22:15:14 Cannot create non-ai vehicle ,
22:15:15 Cannot create non-ai vehicle ,
22:15:17 "Sarge AI: Static Spawning for infantry patrols finished"
22:15:17 "Sarge AI: Static Spawning for vehicle patrols started"
22:15:17 Cannot create non-ai vehicle ,
22:15:17 Cannot create non-ai vehicle ,
22:15:17 "Sarge AI: Static Spawning for vehicle patrols finished"
22:15:17 "Sarge's AI System: Dynamic spawn definitions have been configured for ChernarusRedux."
22:15:17 "SAR_AI: Dynamic spawning definition / adjustments started"
22:15:17 "SAR_AI: Dynamic spawning definition / adjustments finished"
22:15:17 "SAR_AI: Static spawning area definition started"
22:15:17 "SAR_AI: Static spawning area definition finished"
22:15:17 "Sarge AI: Static Spawning for Helicopter patrols started"
22:15:20 Cannot create non-ai vehicle ,
22:15:24 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:24 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:24 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:25 "Sarge AI: Static Spawning for Helicopter patrols finished"
22:15:25 "Sarge AI: Static Spawning for infantry patrols started"
22:15:27 Cannot create non-ai vehicle ,
22:15:31 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:31 Cannot create non-ai vehicle ,
22:15:32 "Sarge AI: Static Spawning for infantry patrols finished"
22:15:32 "Sarge AI: Static Spawning for vehicle patrols started"
22:15:33 Cannot create non-ai vehicle ,
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 Ragdoll - loading of ragdoll source "Soldier" started.
22:15:33 Ragdoll - loading of ragdoll source "Soldier" finished successfully.
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 Error in expression <UPSMON_CIV_Total = UPSMON_CIV_Total + count (units _npc)>
22:15:33   Error position: <UPSMON_CIV_Total + count (units _npc)>
22:15:33   Error Undefined variable in expression: upsmon_civ_total
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:15:33 Cannot create non-ai vehicle ,
22:15:33 "Sarge AI: Static Spawning for vehicle patrols finished"
22:15:33 "Sarge's AI System: Static spawn definitions have been configured for chernarusredux."

 

 

third the endless rpt spam thousand and thousand of lines

example below

  Reveal hidden contents

22:28:32 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:28:34 "Sarge AI System: _ai_xp = 0; _ai_xp_type = Rookie"
22:28:44 Server: Object 2:1313 not found (message Type_93)
22:28:44 Server: Object 2:1312 not found (message Type_93)
22:28:44 Server: Object 2:1318 not found (message Type_93)
22:28:44 Server: Object 2:1317 not found (message Type_93)
22:28:44 Server: Object 2:1322 not found (message Type_93)
22:28:44 Server: Object 2:1321 not found (message Type_93)
22:28:48 Server: Object 2:1322 not found (message Type_121)
22:28:48 Server: Object 2:1317 not found (message Type_121)
22:28:48 Server: Object 2:1321 not found (message Type_121)
22:28:49 Server: Object 2:1318 not found (message Type_121)
22:28:49 Server: Object 2:1312 not found (message Type_121)
22:28:49 Server: Object 2:1313 not found (message Type_121)
22:28:54 Server: Object 2:1386 not found (message Type_93)
22:28:54 Server: Object 2:1385 not found (message Type_93)

 

removed sarge.pbo ran server rpt spam gone

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

cheers

natoed

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 :/

Share this post


Link to post
Share on other sites
23 hours ago, 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?

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.

Share this post


Link to post
Share on other sites

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


  • Similar Content

    • By Cubitron
      Aloha all
      We start our new Epoch Cherno Redux Server (Funserver)
      ip:185.194.140.234:2302
      Features:
      -increased Atagonist Spawn
      -Vehicle Patrol
      -Npc Patrol
      -Missions
      -F4 Player Menu ( WIP) with craft bike and quad)
      -Igiload

      Mods:
      -RDS Civilian Pack (the good old A2 Vehicles)
      -No Strider and Ifrit
       
    • By Thug
      Hello all
      I have been asked to post this so here goes. The island is surrounded by 20m high walls. Only 4 ways in, well you could try and land a heli,  There are 3 weapon creates and a lottery box in the palace.
      M2s waiting to greet you.
      If you would like the files, please PM me and I will send them to you.  Don't forget to leave email in PM. I am looking to find a new way to post links since DropBox changed the way they share.
      You have to update the items in the crates to the new class names in 1.0.6.1
    • By ViktorReznov
      So here I am going to post what I have been working on for quite a while now, well started some 4 months ago, and have nearly completely working. I am hoping that posting this here will inspire the community to assist in bringing back this absolute badass ai script to life.
      This is the stock 1.5.2 SargeAI Framework that you can still download. Right out of the box it does "function" in Epoch 1.0.6.1 but with an extreme amount of errors. I have already modified this version to eliminate most errors, however, most of the Urban Patrol Script is broken. Here is where we begin to demolish the myth that Sarge is dead!
      https://github.com/Arstan13/SargeAI-Genesys
      for install...
      this is nearly fully working. Ive had very limited number of errors to include
       
    • By Hooty
      deleted
       
    • By Asian Kid
       Units are not spawning not sure what I did wrong.

      https://pastebin.com/FrScw6nd
      https://pastebin.com/SeETUnRy
  • Advertisement
  • Donation Box

    Please donate to support the community.
    We appreciate all donations!
  • Advertisement
  • Supporters
  • Latest Donations

  • Advertisement
  • Discord

×