Jump to content
Meiestrix

Adjust AI reaction time / skill in Zeus missions

Recommended Posts

Hi,

Is it possible to adjust the skill of AI units in a Zeus mission, without using the skill slider for every unit?

It tried different setting, for example the difficulty settings in ****.Arma3Profile on server side.

But there is no difference in Zeus between a value of 0.1 or 1.0 for enemy AI.

Also i have tried to use the Asr ai 3 mod to adjust the skill.

I changed the skill values in the userconfig of this mod on client and server side, but there is no difference in the behaviour the AI react.

In most cases the AI is so fast, that they kill an enemy spawned AI direct in front of them in under 1 second.

In close combat it is nearly impossible to kill the AI with your rifle as a player.

This is really a big problem for me, because 80% of our missions are Zeus missions.

I also tried to use the AGM mod, which tries to make the AI more human, but they are still to fast.

Does anyone have a solution for this problem?

That would be really nice.

Share this post


Link to post
Share on other sites

{_x addEventHandler["CuratorGroupPlaced",{{_x setSkill random 1;} foreach units (_this select 1);}];} foreach allCurators;
{_x addEventHandler["CuratorObjectPlaced",{if((_this select 1) isKindOf "Man") then {(_this select 1) setSkill random 1;};}];} foreach allCurators;

That code will randomize all skill levels of AI you place, if thats what you want. Though ASR AI should be stopping the aimbotting completely, unless your doing something wrong.

Share this post


Link to post
Share on other sites
unless your doing something wrong.

It looks like ASR AI is working on a local hosted game.

But when i use the dedicated server ASR AI doesnt work in the same Zeus mission.

The userconfig files are the same and the PBOs are also loaded on server side.

Share this post


Link to post
Share on other sites

I'm having this same exact issue. It seems that units placed in a server with Zeus don't follow any sort of skill level set by mods, be it ASR, MCC, ZEU, etc. This is extremely frustrating when trying to do a Zeus mission with customized AI. I'm specifically referring to AI Accuracy. In all custom mods it has been felt over the past ~5 years of testing that 20-22% AI accuracy is idea for good gameplay, but Zeus overrides these settings. It would be fantastic if there was a way to set ZEUS AI skill levels across the board.

Share this post


Link to post
Share on other sites
I'm having this same exact issue. It seems that units placed in a server with Zeus don't follow any sort of skill level set by mods, be it ASR, MCC, ZEU, etc. This is extremely frustrating when trying to do a Zeus mission with customized AI. I'm specifically referring to AI Accuracy. In all custom mods it has been felt over the past ~5 years of testing that 20-22% AI accuracy is idea for good gameplay, but Zeus overrides these settings. It would be fantastic if there was a way to set ZEUS AI skill levels across the board.

The problem with that is the fact that AI mods only work with AI the server has assigned to it. Any units you place as zeus are using your PC's CPU to operate, and they disregard anything that has to do with ASR AI since it only works with the server (not clients). A little way you could "glitch" around it is to place all the units in zeus, then log out of the server and come back so the AI get reassigned to the server's CPU and (hopefully) begin using AI mods that are loaded.

NOTE: That only applies to a dedicated envrionment I believe. If its locally hosted then I think all AI use the hosting player's CPU to do things

Share this post


Link to post
Share on other sites
The problem with that is the fact that AI mods only work with AI the server has assigned to it. Any units you place as zeus are using your PC's CPU to operate, and they disregard anything that has to do with ASR AI since it only works with the server (not clients). A little way you could "glitch" around it is to place all the units in zeus, then log out of the server and come back so the AI get reassigned to the server's CPU and (hopefully) begin using AI mods that are loaded.

NOTE: That only applies to a dedicated envrionment I believe. If its locally hosted then I think all AI use the hosting player's CPU to do things

Isnt there a way to do this without logging out? A script or something? I know MCC allows you to spawn units server side and I would also love Zeus units to be controlled by the server without continuously logging in and out of the server.

Share this post


Link to post
Share on other sites
Isnt there a way to do this without logging out? A script or something? I know MCC allows you to spawn units server side and I would also love Zeus units to be controlled by the server without continuously logging in and out of the server.

I don't think there really is a way. If there is I'd say its probably not going to work 100%, or it'll be uber sloppy and will clog up the network with massive amounts of data being sent up to the server from the client that is zeus (most home users have slow upload speeds, so that would probably desync the zeus pretty badly), which then will probably desync everyone else since that same client needs to send that data out to all clients connected that the server owns the AI so they know what PC to ask whats happening with the them from there on.

Though thats assumung your going to be placing a bunch of units in rapid succession, if your not butt rushing then the network congestion might not be as big of an issue if its given a few seconds (or milliseconds if you want to be nerdy) to transmit that data to everybody.

Of course thats all just theory though, almost no one knows how the whole thing truly works.

Share this post


Link to post
Share on other sites

OK i have solved the problem with the skill adjustment with this little script:

while {true} do
{
{
if (!isPlayer _x) then
{
_x setSkill 0.4;
_x setSkill ["aimingAccuracy", 0.15];
_x setSkill ["aimingShake", 0.8];
_x setSkill ["aimingSpeed", 0.6];
_x setSkill ["Endurance",0.5];
_x setSkill ["spotDistance",0.55];
_x setSkill ["spotTime",0.6];
_x setSkill ["courage", 0.8];
_x setSkill ["reloadSpeed", 1];
};
} forEach allUnits;

sleep 10;
};

But It does not solve the problem with the unhuman, way too fast reaction time of the AI in close quarter combat.

Share this post


Link to post
Share on other sites

Meiestrix how would I execute that script on my server/mission? I'm pretty bad with scripts. I just name the script "AI.sqf" and in the mission init I execute it?

Do you know how it would effect a ~60 man server with ~50-100 AI at any given time? Would those skill settings apply to all AI including those spawned with MCC and Zeus throughout the mission?

Edited by MacScottie

Share this post


Link to post
Share on other sites
Meiestrix how would I execute that script on my server/mission? I'm pretty bad with scripts. I just name the script "AI.sqf" and in the mission init I execute it?

Do you know how it would effect a ~60 man server with ~50-100 AI at any given time? Would those skill settings apply to all AI including those spawned with MCC and Zeus throughout the mission?

To answer the question about spawned AI, yes, this will work perfectly fine for those.

There are a couple ways to accomplish using this script (you may need to do some trial and error, will explain why in a minute), you can spawn the while loop, so it's running in the "background", via the init.sqf:

_setSkillLoop = [] spawn
{
while {true} do
{
	{
		if (!isPlayer _x && {!(_x getVariable ["hasSkillBeenSet",false])}) then
		{
			_x setSkill 0.4;
			_x setSkill ["aimingAccuracy", 0.15];
			_x setSkill ["aimingShake", 0.8];
			_x setSkill ["aimingSpeed", 0.6];
			_x setSkill ["Endurance",0.5];
			_x setSkill ["spotDistance",0.55];
			_x setSkill ["spotTime",0.6];
			_x setSkill ["courage", 0.8];
			_x setSkill ["reloadSpeed", 1];
			_x setVariable ["hasSkillBeenSet",true];
		};
	} forEach allUnits;

	sleep 10;
};
};

The only problem with the above code is that every client will be running it as the init.sqf is executed for each connecting client, but this is where the "trial and error" comes in to play, because the setSkill commands are too old, I'm not sure if they are effects global, meaning if one machine executes this code, everyone else sees/has the effects of that command (i.e. the AI are the same difficulty for everyone), that being said, it would make sense the command is effects global, so I would recommend spawning this loop on the server, instead of every client, via an if (isServer) check or the initServer.sqf:

//if (isServer) example >> still in init.sqf

if (isServer) then 
{
_setSkillLoop = [] spawn
{
	while {true} do
	{
		{
			if (!isPlayer _x && {!(_x getVariable ["hasSkillBeenSet",false])}) then
			{
				_x setSkill 0.4;
				_x setSkill ["aimingAccuracy", 0.15];
				_x setSkill ["aimingShake", 0.8];
				_x setSkill ["aimingSpeed", 0.6];
				_x setSkill ["Endurance",0.5];
				_x setSkill ["spotDistance",0.55];
				_x setSkill ["spotTime",0.6];
				_x setSkill ["courage", 0.8];
				_x setSkill ["reloadSpeed", 1];
				_x setVariable ["hasSkillBeenSet",true];
			};
		} forEach allUnits;

		sleep 10;
	};
};
};

If you use the initServer.sqf, simply place the first example (the one without the if (isServer) check), inside that file, same as the init.sqf. I would recommend this option personally.

I also added a get/set variable to the units so they are filtered, so the forEach loop doesn't reapply the skill settings to literally every AI again, every 10 seconds :p. Basically meaning that at mission start if you have 50+ AI editor spawned, those will get the necessary skill settings applied only once, then as you spawn more in, those will get skill applied and so on, so in a sense, this script will get less intensive and faster after initialization of the mission.

Edited by JShock

Share this post


Link to post
Share on other sites

Wow Jsock & Meiestrix. Thank you very much for your help. This will go a long way to solve some of the problems. Cheers

Share this post


Link to post
Share on other sites

@Mac Scottie: In the init file just paste this: execVM "AI.sqf";

-----------------------------------------------------

//if (isServer) example >> still in init.sqf

if (isServer) then 
{
_setSkillLoop = [] spawn
{
	while {true} do
	{
		{
			if (!isPlayer _x && {!(_x getVariable ["hasSkillBeenSet",false])}) then
			{
				_x setSkill 0.4;
				_x setSkill ["aimingAccuracy", 0.15];
				_x setSkill ["aimingShake", 0.8];
				_x setSkill ["aimingSpeed", 0.6];
				_x setSkill ["Endurance",0.5];
				_x setSkill ["spotDistance",0.55];
				_x setSkill ["spotTime",0.6];
				_x setSkill ["courage", 0.8];
				_x setSkill ["reloadSpeed", 1];
				_x setVariable ["hasSkillBeenSet",true];
			};
		} forEach allUnits;

		sleep 10;
	};
};
};

There is one problem with this script version.

If you play a live zeus mission the AIs are not executed on the server they are executed on the zeus players client.

So you need the script on every client.

Share this post


Link to post
Share on other sites

I was unaware of Zeus spawned units executing on the Zeus player's machine. But I still don't think it would matter, as the units still have to be "globalized", or at least I would think. So the server would still need to recognize that there are new units, but eh, testing can figure that out :p. And again as I said, if the setSkill command is effects global, it doesn't really matter where this script is executed.

Edited by JShock

Share this post


Link to post
Share on other sites
There is one problem with this script version.

If you play a live zeus mission the AIs are not executed on the server they are executed on the zeus players client.

So you need the script on every client.

Argh. That brings us back to the crux of the issue, which is being able to set AI skills for Zeus. The missions my unit does are made 100% by an MCC/Zeus controller and most controllers prefer to spawn units via ZEUS on a dedicated server. So you're saying the script won't work if a player is spawning the AI via Zeus because Zeus takes the controller's AI settings when spawning units? This is so damn frustrating.

I was unaware of Zeus spawned units executing on the Zeus player's machine. But I still don't think it would matter, as the units still have to be "globalized", or at least I would think. So the server would still need to recognize that there are new units, but eh, testing can figure that out . And again as I said, if the setSkill command is effects global, it doesn't really matter where this script is executed.

I guess I'll try the script out when I get the chance and report back. Hopefully you're right since the AI are supposed to be assigned to the server once they are placed down and the script affects AI that the server controls, right?

Share this post


Link to post
Share on other sites

I guess I'll try the script out when I get the chance and report back. Hopefully you're right since the AI are supposed to be assigned to the server once they are placed down and the script affects AI that the server controls, right?

The script with if (isServer) will be ran only on the server, yes, so is the initServer.sqf version. The other method isn't on the server, but does ensure everyone will have the skills set for every unit at some point, and it's not that this method is a bad one, or that it's overly taxing on each client, it would just be better if it's handled by the server only, that way it's really one machine with the weight of this loop instead of the 60+ that you mentioned.

Share this post


Link to post
Share on other sites

Was there ever a conclusion to this? I'm looking at similar options for our missions.

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

×