Jump to content
spirit6

Mission Template Stand Alone GAIA - Make missions FAST by using MCC GAIA engine

Recommended Posts

Hey @spirit6,

Having seen snkman make TCL for Arma3, I decided to fire up GAIA version HETMAN mission that I'd downloaded a while ago.  Every single time GAIA wasted HETMAN.  I'm sure I've asked this in the past, but is there an addon version that will pick up all AI (either at the start or throughout a mission) ?

Share this post


Link to post
Share on other sites

https://www.dropbox.com/s/7f4c0ixvxualcg2/MCC GAIA V1.0 Release.pdf?dl=0

 

 

https://github.com/shaygman/MCC_sandbox_modDev/blob/master/gaia/functions/control/fn_issueOrders.sqf

 

checkout  issue orders command and delete every line of "

and

(count(_x getVariable ["GAIA_zone_intend",[]])>1)

 

"

 

GAIA now starts issueing all units and not just ones that have been "given".

 

Share this post


Link to post
Share on other sites

I loaded up the template mission but at first I am confused... What is the most minimal way to get an ambient warzone going with MCC loaded and just using Eden editor? I think I need:

 

a) 2 Zones with GAIA controlled units

b) Turn Ambient warzone on (I know the global variables here).

 

So my problem is a) - How can this be done with Eden? I guess I have to add 2 markers to the map, but how assign them to MCC?

 

Thx for any input. Thing is, I love to quickly create Editor missions by just dropping Editor compositions on it.

 

EDIT: OK, solved it with help of page 7 of this thread.

 

- Added BLU/OPF groups and put code to the group, like: this setVariable ["GAIA_ZONE_INTEND",["1", "MOVE"], false];

- Added Markers 1 and 2 for usage as 2 Zones.

- Turnes Warzone on: MCC_GAIA_AC = true; publicvariable "MCC_GAIA_AC";

Share this post


Link to post
Share on other sites
On 4/7/2015 at 10:31 AM, spirit6 said:

I was thinking of simple passing an array of zone's to the unit. so ["[1,2,3]", "MOVE] would lead to the unit patrolling zone 1, 2 and 3 in agressive mode.

Would that hold your interest?

 

Spirit, any news on this, maybe you have a secret GAIA build with this already builtin? 

 

GAIA is awesome for me. For my use case (create mission quick and dirty) ALive turned out to be too complex.

 

Question about variable scope. I am in a pure SP ecosystem. Can I just use normal global variable assignments (var = 5)? Ie I do not need setvariable/publicvariable, correct? 

Share this post


Link to post
Share on other sites

Maybe this helps a bit for setting up GAIA missions in Eden - the VERY quick and dirty way.

 

1. Create player. Create circular/rectangular markers, named 1, 2, 3, ...


2. Add "Game Logic"'s with the below init code, as many, as you want. It spawns a defined number of groups in an area marker.

This example creates 5 random/mixed EAST side groups in zone 2 and moves them to zone 1. I.e., "2" is the spawn place, "1" is their target zone. It's not safe from spawning divers etc. I guess.

https://pastebin.com/c3fzHL5v

 

3. Set up another game logic for the GAIA settings. This one configures caching and enables ambient battlefield.

https://pastebin.com/Tk7XP2sM

 

Fire up mission.

Share this post


Link to post
Share on other sites

Is there a way of stopping GAIA controlling a group that it has previously been given control of?

 

I'm looking at making the group enter a helicopter.  S

Share this post


Link to post
Share on other sites

Hey Spirit, for FPS reasons, I created a script that permanently tunes GAIAs global caching distance variable depending on measured FPS. But GAIA is not robust against decreasing the caching distance in mission - some scripts hate to lose their objects, some forearch loops generate errors. Is there something you can do? 😁 Thx

Share this post


Link to post
Share on other sites

From my understanding and testing (albeit with an older version) Gaia caches based upon the player’s distance from a cached unit; when a player gets within a specified distance the units spawn.

 

 Is there a way to change the system so that units will spawn if any enemy, player controlled or not, travels within the cache distance..?

Share this post


Link to post
Share on other sites
On 6/4/2019 at 1:38 PM, Blitzen88 said:

From my understanding and testing (albeit with an older version) Gaia caches based upon the player’s distance from a cached unit; when a player gets within a specified distance the units spawn.

 

 Is there a way to change the system so that units will spawn if any enemy, player controlled or not, travels within the cache distance..?

 

Hi Blitzen88

 

I don't happen by this thread very often, so sorry if this is old news. The function you want to look at is (I believe) fn_isPlayerNear in the functions\cache folder. It uses a foreach playableUnits loop to test only playable units, and then filters those using isPlayer to actually only test those that are real human players. You might be able to achieve what you want without too many changes to that function, depending on...

 

The function tests the distance between players and a geographical position, so it does not know anything of the unit that the player is being tested against, such as its side. So it can't detect if it is friendly or enemy. If you want any unit of side Blue (player or AI) to be able to cache / uncache units then the function could be tweaked to do that (use allUnits instead of playableUnits and filter by side rather than isPlayer - frame rate hit allowing!). If you want any unit of any side to cache / uncache 'enemy' units then the function has to know something about the actual units - to know if they are on the opposite side. It needs more than just the position they are in. That would need a deeper rewrite of the code to pass the fn_isPlayerNear more than just a position and a distance.

Share this post


Link to post
Share on other sites

Does anyone know how to prevent or stop Gaia from calling in vehicle transportation. I would like to turn this off or prevent it from a  a particular vehicles. I have two ACP's that are guarding a bridge with sentry and guard waypoints. 

 

The problem is Gaia will call for them at times to pick up and transport other foot units around the zone. That cool but the two ACP will never return to the bridge location and the original waypoints assigned through the editor are deleted and the ACP's will now just sit around the zone waiting for new transport orders! 

Share this post


Link to post
Share on other sites
On 10/14/2019 at 1:12 PM, avibird 1 said:

Does anyone know how to prevent or stop Gaia from calling in vehicle transportation.

 

Try setting this at the 'group' level for the ACP units - so in the INIT field in the group in Eden
 

this setVariable ["GAIA_ZONE_INTEND",nil]

 

I think that should stop Gaia having any control over them. 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

@killick did not work ACP's will still get a transport waypoint generated by GAIA and then lose its original waypoints that had a sentry and guard waypoints next to Bridges they are protecting. Each APC has a full squad in it's cargo space so there is really no room for it to pick additional troops up but it still moves attempts to pick them up then moves with the group is attempting to pick up to its destination point and then just sits there idle until it receives another transport waypoint. Very frustrating.

Share this post


Link to post
Share on other sites

@avibird 1 can you maybe describe the units a bit more? Is it one group of infantry in the APC, with the driver / commander who are part of that squad? Or does the APC have the driver (the crew) in a separate group from the infantry squad that is in the cargo space?

Share this post


Link to post
Share on other sites

@killick  I use MCC4 mod as well as the stand alone. I mainly use JEBUS for all my respawn needs. Jebus has GAIA integrated into its respawn scripts. Is this a possible conflict I don't think so.

 

I use the stand alone for secondary zones and not the main AO. The issues ibam having is only with opfor MSE3 marid and the BTR K kanysh. It has a full crew with all it's cargo space with units in the same group as the crew.

 

In some ways it's kind of cool because you really have no idea where the group will be in the AO as well as it will move to different location to pick up new groups calling for transport.  

 

It does lose its original waypoints assigned from the editor which was sentry and guard. 

Share this post


Link to post
Share on other sites

@avibird 1 I believe that if you just put a unit down in the editor, with no init code, and leave it alone in MCC, then I don't think GAIA is allowed to take control of it. So I guess there is something in the mission setup that is letting GAIA order the unit about. The init code I suggested won't work as whatever else it is that is giving GAIA control will just over ride it. 

 

I don't know JEBUS - never used it - but from the thread on it here it seems to need a call to the JEBUS function in the unit's or group's INIT code. What are you using in the APC squad's INIT? (I don't know if jebus works on the vehicle, the group for the crew, or the leader of the crew group - sorry). But does that INIT 'give' the unit to GAIA (any of the Follow / no_follow options)?

 

And then MCC sandox on top of that. Again, I've not used it for a long time (I use the GAIA script version rather than MCC), I recall that in MCC you have to "give units to GAIA"? Are you doing that in any way?

 

Share this post


Link to post
Share on other sites

Does anyone know how to setup GAIA that she will not give waypoints to cars/vechicles into forests or high elevations within the mountains. I love GAIA but for vechicles it gives waypoint that the vehicle can't reach thus making the unit in Mobile at times.

Share this post


Link to post
Share on other sites

Hi all GAIA fans.

I believe I have come across an error in the file: gaia\functions\control\orders\fn_doAttack.sqf

Line 38 does a call to GAIA_fnc_MechanizedInfantry but there is no such function.  However there is a GAIA_fnc_doAttackMechanizedInfantry function.  Which fits with with the naming convention of the functions around line 38.

The new line 38 should look like:

{ _dummy= [_group,_TargetPos] call GAIA_fnc_doAttackMechanizedInfantry;};

I notice this due to testing I did with Bluefor and Opfor units set to fight each other and finding errors in the report file.  With the change the errors stopped.

I'd wanted to change it in Github by doing a push of the change but I failed that test.

I have just recently found you can edit a file directly on Github and did that in the https://github.com/shaygman/mcc_sandbox.Altis.git repository.  I hope that helps @spirit6

  • Like 1

Share this post


Link to post
Share on other sites

Good find.  I'm still looking for some good GAIA missions, as I think it is a really good AI commander !

Share this post


Link to post
Share on other sites

Interesting, strider42.  I wonder what version of GAIA I'm using... this is my line 38, and it does have a matching function:

{ _dummy= [_group,_TargetPos] call fnc_DoAttackMechInf;};

The header of the file says, :"spirit 14-1-2014".

 

I love GAIA and have made many little usability tweaks, like automated zone detection and assignment, cache distance based on mission view distance, units checking to see if they are inside of a building before popping smoke, reduced the frequency at which GAIA checks in on all the groups by half (every 1 second instead of every half second), etc.  Probably some other small things that I don't recall at the moment.

 

I looked at the latest GAIA code from MCC and it mostly looks the same as the old stand alone version that I use.  I figured I'd do some updating by picking things from MCC but Winmerge found almost no differences, though I haven't done a comprehensive comparison yet.

 

I'd say that my only frustration with the mod is the transport system.  Either I am using it incorrectly, or it rarely moves troops around.

 

-Doc

 

p.s. I get a kick out the the comments in the scripts. 

Share this post


Link to post
Share on other sites

@doc. caliban I think that is an old version.  Interestingly it is the one I have been using for my lastes mission, without any problems.

I consider the current versoni to be the one on GitHub where the path to the files is:

gaia/functions/control/orders/fn_doAttack.sqf

In the one you are using the path is:

gaia/scripts/orders/fn_doAttack.sqf

Though both files seem to have the same header.

To get the latest version of GAIA go to this link: https://github.com/shaygman/mcc_sandbox.Altis/tree/SpiritBranche

Then click Clone button, and then click on the Download Zip link.

All the best  S

Share this post


Link to post
Share on other sites

@strider42 Thank you!    Is the linked-to version "stand alone" in its functionality?  Regardless, I'll grab it and have a look.

 

Thanks again,

-Doc

 

EDIT: I made some changes to the gaia init file to reflect the way I use it as a standalone and auto-detect and assign zones.  So far it's working perfectly.  Once I know for sure there aren't any bugs in how I'm using it, I'll post a sample mission here that contains my zone automation and explain how it works. 

Share this post


Link to post
Share on other sites

If anyone is interested in preventing the AI from popping smoke inside of buildings, this is how I managed it.  It's not fancy or perfect, but it works.

 I did it because I was tired of AI units giving away their position to me by popping smoke in little buildings that I hadn't searched yet.  POP! Fshhhhhhhh.... smoke billowing through a wall.   "I'm going to guess that there is a bad guy inside of that building over there." 

 

Open up \gaia\functions\control\fn_issueOrders.sqf

Search for "go smoke it".

You will find this section:

//did we have more then 20% loss? go smoke it
if ((_x getVariable ["GAIA_PreviousPoints",1])>(_x getVariable ["GAIA_points",1])) then
	{ 
	if (alive leader _x) then {"SmokeShell" createVehicle (position leader _x);};
	};

There is a garrison related GAIA function called gaia_fnc_indoors.sqf that I originally employed, but it checks for something over the unit's head (like a ceiling) to determine if the unit is indoors.  The problem with that is it gives false positives when standing under trees, certain bushes, etc.  It would be good for using before firing a flare, though!

 

My solution was simply to find the nearest building and make sure the unit is more than 10m from it.  I came up with that number by checking several buildings and determining that the far interior corners were usually around 8m max from the building position.  The unit may end up being inside of a larger building, or several meters away from a smaller one, but it's good enough for my purposes.  I could dynamically set the minimum distance based on the building's hypotenuse, but I could not find a way to get the dimensions of the building to use in calculating that.

 

Here's my change:

//Did we have more than 20% loss? Are we outdoors? Go smoke it!
if ((_x getVariable ["GAIA_PreviousPoints",1])>(_x getVariable ["GAIA_points",1])) then {
	_nearestBuilding = nearestBuilding (position leader _x); 
	if ((alive leader _x) && ((position leader _x) distance _nearestBuilding > 10))then {
		"SmokeShell" createVehicle (position leader _x);
	};
};

It's a small thing, but it happens a lot so it seemed worth figuring out.

Share this post


Link to post
Share on other sites

@strider42, any thoughts on this?    With the newer version, Gaia is sending "nofollow" and "garrison" groups out of their zone like "move" groups.

 

Before they have a target all 3 groups stay within the zone, but once there's action, they all leave the zone.

 

-Doc

 

EDIT: It's working properly now.  I'm not sure what why that was happening but obviously an error on my part.

EDIT: Dang it, it's doing it again.  I have two groups, both "nofollow", in a zone.  They stay in the zone as long as they can see me and shoot at me.  As soon as I move out of sight, they both leave the zone and come after me.

 

Share this post


Link to post
Share on other sites

I thought I'd share some of the changes I've made to this awesome mod.  Most of it is geared toward making mission creation even easier.  There are a few AI tweaks that we wanted for our small coop group.  Feedback is welcome!

 

MISSION CREATION

 

Gaia zones are automatically determined based on the smallest zone marker occupied by the Group Leader.

Reason: Instead of manually entering the zone name in each Group Leader's Init field, I simply set a variable that specifies the command (move, nofollow, fortify), and use a function that automatically detects which zone the Group Leader is in and then passes the final Gaia zone/order variable to the Group. If the Group Leader is in multiple zones (nested) the Group is assigned to the smallest zone occupied.  Once your zones are all laid out, you can simply copy-paste "move", "nofollow", and "fortify" groups into whichever zones you want and the rest is taken care of automatically.

 

Instead of the original Gaia Group Leader Init line, add one of the following 3 lines for the desired functionality.

(group this) setVariable ["gaiaCommand", "NOFOLLOW", false];

(group this) setVariable ["gaiaCommand", "MOVE", false];

(group this) setVariable ["gaiaCommand", "FORTIFY", false];

 

Groups in which the Leader does not have gaiaCommand defined are left alone in case you want to use them for non-Gaia things.  (Assuming you have MCC_GAIA_ATTACKS_FOR_NONGAIA set to false as well.)

 

You can still use the old method if and when you wish:

(group this) setVariable ["GAIA_ZONE_INTEND",["zoneMarkerName", "MOVE" or "NOFOLLOW" or "FORTIFY"], false];

 

Gaia zone area markers are automatically hidden during mission startup.

Reason: This allows you to simply add your zone markers to a layer that you can toggle visibility on/off while editing, but you don't have to remember to set their alpha to 0 before playing the mission.  This happens in initServer.sqf so that the markers are also hidden on the initial MP mission map.

 

 Level 1 cache distance (all units in the group except the leader) is dynamically set to the mission view distance -100m, or 1,500m; whichever is smallest.  The max range is user definable.

Reason: Performance and ease of configuration.  In most cases it makes no sense to have the whole group uncached beyond the view distance.  This way you don't have to manually update the cache distance every time you create a mission with a view distance below the user defined maximum because it's always set to the optimal distance.  I take 100m off of the view distance for the cache value since you aren't typically moving and looking through a scope into the nearly opaque last dozens of meters of the view distance anyway.

 

Level 2 cache distance (cache the group leader as well) is user definable as either a multiplier or a fixed additional distance.

Reason: This gives you more control over the caching.


AI BEHAVIOR

 

A random (60-480 seconds) timeout for mortar and artillery missions is generated between each fire mission.

Reason: We didn't want a known safety window between fire missions.

 

AI units will check to see if they are likely inside of a building before they pop smoke.

Reason: Units kept giving their positions away by (uselessly) popping smoke inside the small buildings they were hiding in.

 

Reduced the waypoint random timeout range by half.

Reason: We felt that the infantry groups and helicopters were sitting ducks for too long at each waypoint.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×