Jump to content
hogscraper

Hogs AI - Choose your own mission system UPDATED- 01/03/15

Recommended Posts

Hello Epoch forums!
UPDATED:January 3rd (SEE NOTES BELOW)
 
 
I wanted to post up my AI mission system I've been working on. I updated one that I had made for vanilla Arma 3 when it was in Alpha and a couple
people I let use it thought I should give it out to the community. This is not meant to be a one stop AI system but rather a randomly generated
compliment to a beefier AI system already in use on your server. Most AI systems seem to have large groups of bandits in one location and I thought
a compliment to that would be other missions, running at the same time, that offered a hunt for players. For my standard missions, each AO will have
AI spawned around a central location. This random generation of locations plus custom missions can spawn 30 AI roaming the hills in small groups,
four large groups interspersed among a cities buildings, or anything else you would like. 
The idea I had was that no where should be safe, (except the central Epoch spawn island), so I have 50+ locations that will be randomly chosen from.
These AI are bandits and terrorists. When they move into an area, they wire up C4 to any buildings they erect and any vehicles they bring in. When
time runs out on a mission, if any enemies are left, they will detonate their belongings before they leave the area. If a player sneaks in and grabs a
mission vehicle, they may have an explosive surprise in store on their way to the trader if the mission timer runs out. Any buildings the bandits erect will
be destroyed as the next mission is called up. Prize boxes do not spawn until the AI are killed but if AI wander outside the AO, they will not be counted. 
 
This AI system uses a headless client, so if you haven't figured out how to set one up, you can check out my tutorial here:
 
and the github:
 
This system is filled with more options than most server admins will ever want to look at. I originally wrote this for an admin who was more 
of a cut and paste kind of admin so I wanted all of my options to be in one file and compartmentalized. If you want a specific mission to have
its own loot table on completion, you just add that switch to your mission and fill out a new prize pool. Same for AI loadouts. At its heart, this
system is about having generic missions that are so randomized that they don't feel stale to the players trying to clear them out. If you don't 
like random, you can drill down into the options and fine tune pretty much everything. 
 
I also added mini tutorials pretty much at every section so you would know what you were looking at and what it did. Please look through all of the
files but AI_Init is where you will find the init variables that control everything in this system. 
 
The main points of interest to anyone choosing to use this system:
 
AI_Init.sqf lines 28-37: These are the main variables you want to look at and make sure are good for your server. Length of time before the mission
despawns, time before the prize box despawns(if any),delay between missions, size of each AO and special missions. 
 
I wanted to touch on the Special_Mission_01 and _02 variables. They decide how many SPECIAL missions run. They will be chosen randomly, 
like the other missions, but you can set whether or not to run them at all and how many times they will pop up each restart. 
 
Currently, _01 is a building materials mission with tons of ai and _02 is under development and currently turned off. If interest 
warrants it, I will develop more building materials locations. This special mission is an example, (in the Mission_Sets array), of how
to make a mission with most positions pre-defined. This means if you want a max of three of these to run each restart, each one of the
three will spawn in the same location. You can easily cut and paste one of the standard missions from the set and change it to make a 
smaller building material mission as well.  
 
You must change these three things or suffer the consequences:
1. In the prize section, I listed one of pretty much every item I could think of. If you choose the default prize option
of 0, every mission will get one of everything in that first prize pool. You can look through those options and decide to randomize 
the loot each time and decide the number of items and quantities. 
 
2. In the AI gear section, look through what I've placed into the first AI gear pool. By default, gear will be randomly chosen, piece
by piece from that section. Since I figured that section also works as a handy list of nearly everything you could give a player I felt
it made sense to leave it all in there and let you, the server admin, decide what you wanted your AI to wear. Be warned, if you 
choose to go full random with the default items I have in there, you may eventually find yourself with an AI patrol where one guy is
wearing a ghillie, the next guy is wearing a racing outfit with a fishing hat and the next guy is wearing a glow in the dark, blue VR
outfit carrying an RPG. Its up to you to decide what kind of fashion sense your AI have.
 
3. In the mission section, the last mission is for you to change. I tweaked a few things in how the missions work and am working on adding
more mission types, but the last one is generic in its statements. I did this because I like admins that pay attention to things. Just 
type in whatever you want the mission to tell players. 
 
Since I am a coder, and not a server admin, I can't help you with your BE filters at the moment. The ones in use where I test this are heavily
modified for other custom code and not really something I would feel ok about sharing. I will try to get some time this week and work on a
set that works for vanilla installs, but at this point I don't have them to offer. Editing them is fairly straight-forward and easy, it just 
takes a little more time than I have right now to do so from scratch.
 
As far as the system goes, if you think I messed something up or have a great addition, please feel free to make a pull request
on github or post it here. I gladly take suggestions when things can be made better but let me know either way what you think.
 
If you feel lucky, here ya go:
 
 
 
NOTES:
UPDATE:01/03/2015
Thanks to drsubo and willy for reporting a major bug! I added in a bit of code into the serverPVEH so that all of
my AI are set to see East, West and Civilian all as enemies and should now properly fire on players in all situations.

 

Share this post


Link to post
Share on other sites

Any chance you could do a Chernarus version?

I don't currently have Chernarus on my test system but if this is something enough people want I could definitely work up the locations for you guys. Where do you guys put the main Epoch spawn in for Chernarus? Or is there a common place for all Cherno servers? If you would like to send me a download link to the mission.sqm you are using for A3 Epoch Chernarus I can make another mission folder in my github and put the info there. 

Share this post


Link to post
Share on other sites

Hogs,

 

Are you experiencing any issues with the AI created on your HC being immune to vehicle damage?

 

I am not able to run over AI atm.  I placed code in the 'killed' EH to destroy gear for an AI that is ran over.  Problem I am having is that driving over an AI does not seem to trigger the 'killed' EH.

 

I'm going to try a modified 'handledamage' EH, but I wanted to find out if your HC is experiencing the same issue 1st.

 

Thanks!

Share this post


Link to post
Share on other sites

Hogs,

 

Are you experiencing any issues with the AI created on your HC being immune to vehicle damage?

 

I am not able to run over AI atm.  I placed code in the 'killed' EH to destroy gear for an AI that is ran over.  Problem I am having is that driving over an AI does not seem to trigger the 'killed' EH.

 

I'm going to try a modified 'handledamage' EH, but I wanted to find out if your HC is experiencing the same issue 1st.

 

Thanks!

 

I have always been against cowardice in games so I actually thought of this as a bonus instead of a bug. If you are ok with players being able to use vehicles to clear missions for practically free loot you may want to look into reveal. I think the issue might be that for whatever reason the HC is not 'aware' of vehicles spawned on another client or the server so I'm not sure what could do it. I did randomly have one mission where I ran over an AI while I was trying to steal the mission vehicle during testing and three seconds later he fell down dead. After that I wrote an EH to delete the bandit's corpse and any gear he dropped if killed by a vehicle, but after I wrote that I never saw another one die from a vehicle and decided to leave it as is. 

Share this post


Link to post
Share on other sites

I don't currently have Chernarus on my test system but if this is something enough people want I could definitely work up the locations for you guys. Where do you guys put the main Epoch spawn in for Chernarus? Or is there a common place for all Cherno servers? If you would like to send me a download link to the mission.sqm you are using for A3 Epoch Chernarus I can make another mission folder in my github and put the info there. 

 

Nice one, thanks a lot :)

 

Here is the mission file I have for Chernarus which is using the default spawn points:

https://www.dropbox.com/sh/fvqwe918w7ltr3y/AAAPbThlsYXgfj0TXozhleTNa?dl=0

Share this post


Link to post
Share on other sites

ai wont attack me any idea why? I can walk up to them and stand there and nothing, they just stare at me. I can shoot 4 of their friends and still nothing. Sometimes after killing a bunch of them they will start to shoot back but not always iv been able to walk up and kill all 10 ai in mission without one shot fired by them. What would cause this thanks

Share this post


Link to post
Share on other sites

Ive actually ran into dsrubos issue as well. It seems the randomized clothing corresponds to different faction alignment. Ive also ran into issues with the AI shooting at where I was instead of my current position.

 

Ive ran the older Hogscraper missions and even Horbins "CloneHunters" on my headless client and never ran into this phenomenon. Maybe I'll filter out some of the randomness in AI gear and see if this narrows it down when I get home from work.

 

Other than that thansk to all Hogscraper, Horbin and Dsrubo for your brilliant tutorials for missions and HC configuration.

 

xoxo Willy

Share this post


Link to post
Share on other sites

With this system, everything is modular. For testing I turn static missions =true and make changes to just the first mission in the mission sets. This way you can leave everything you aren't testing alone. You can cut and paste to make new sets of anything so I would go into the AI gear section, copy and paste the first one into a new gear set 3, put a limited amount of things in there, then assign gear group 3 to ai mission_set select 0. With static missions=true it will only load that first mission so you can quickly get to the bottom of what's going on. I definitely remember many issues like this in A2 epoch where certain skins would make the players friends to the ai and they could walk into an AO and clean out the mission crate. As it stands, all AI in my system are spawned as side Resistance, so it might be the clothes. Especially if you guys are seeing ai spawned with other hc systems and they seem to work fine. I will look into assigning one of the epoch fsm's to the ai and see what that changes. 

Share this post


Link to post
Share on other sites

well idk if this is the problem or if it was random but where _skill=_this select 3 I just set their skill to 0.7 and it seems to work fine. I haven't tested more than a few missions but they seem to be working. Also thanks for the mission system. I always like looking at all the new ones and making a Frankenstein mission system with my original and bits and pieces from everyone else. Good work.

Share this post


Link to post
Share on other sites

same here drsubo! I started this one a while back and its funny when you see some code and remember where you learned it. That's interesting about the skill. I was noticing that even though I had given them ammo first, then the weapon, the ai aren't shooting me because they aren't carrying loaded weapons. I shot several just now and none were loaded. Maybe the skill, while not giving me an error is breaking the fsm to the point they won't even reload. more testing it is, then.

Share this post


Link to post
Share on other sites

That's really strange that skill seemed to make them work for you. I added in a bit of code in the serverPVEH to setfriend on the AI. I made them enemies with the other three sides and they seem to be spot on now. I forgot about the fact that baddies generally won't shoot at side civilian even if they fire at them. I think epoch has all of their ai running under FSMs that override this behavior. I just made them hate everyone. Updated https://github.com/hogscraper/HOGS_AI as well.

Share this post


Link to post
Share on other sites

ya had 30+ players on today and the ai worked fine when I set their skill up like that. don't know why but know I have another question. How would I make it so that only certain vehicles will spawn. mainly I don't want tanks spawning at missions. 2 missions in a row tanks spawned and there a lil op considering the weapons that are allowed. is there a way to make it so no tanks or stuff like that will spawn?

Share this post


Link to post
Share on other sites

in the AI_Init.sqf you can change the Mission_Sets to have whatever you want. Just go to the line where it calls the tank

I_MBT_03_cannon_F

and change it to the offroad. Just look through every mission. These are made as generics and I wanted to include as many things as possible so they would be there as reference.

Share this post


Link to post
Share on other sites

thanks alot

No worries. You may want to also edit the line that gives secondary weapons. Pretty much all of the AI, by default, are spawning in with weapons that will take out tanks and attack helis if players put in the effort to pick them up. There are also anti-tank mines that spawn in the deployables as well. If you are removing tanks you might also want to remove all the weapons that are very OP against softer targets like players and cars.

Share this post


Link to post
Share on other sites

I updated my headless client just before I reported that they were attacking me just fine and forgot to mention that. Not sure if it was what fixed it or not but I added

localClient[]={"127.0.0.1"}; 
just after the line:
headlessClients[]={"127.0.0.1"};
 
in my config.cfg.
I had the thought that somehow locality was playing into it as they were definitely set to see me as enemy but weren't firing. After making those changes it seemed to work but I haven't tested it with other, non local players. There definitely seems to be some issues with non-local clients' spawned AI not 'knowing' about other clients.

Share this post


Link to post
Share on other sites

 

I updated my headless client just before I reported that they were attacking me just fine and forgot to mention that. Not sure if it was what fixed it or not but I added

localClient[]={"127.0.0.1"}; 
just after the line:
headlessClients[]={"127.0.0.1"};
 
in my config.cfg.
I had the thought that somehow locality was playing into it as they were definitely set to see me as enemy but weren't firing. After making those changes it seemed to work but I haven't tested it with other, non local players. There definitely seems to be some issues with non-local clients' spawned AI not 'knowing' about other clients.

 

How can I make it so that it doesn't spawn every single gun/backpack/grenade/magazine in the missions prize box? I have messed around with it for a day now and nothing is really changing on it.

Share this post


Link to post
Share on other sites

i have this :

 

13.02.2015 15:14:46: Laurent (***********) 5******************************************e - #33 "bjNull;

_centerpos = getmarkerpos "Marker1";
_unitGroup = createGroup RESISTANCE;
_unitGroup setBehaviour "AWARE";
_unitGroup se"

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...