Jump to content
Sign in to follow this  
afp

[Tutorial] Gameplay difficulty

Recommended Posts

Setting up a server that provide a nice gameplay with proper configured AI strength it's not really an easy task. Keep in mind that mission designers set different skill for AI in mission editor, there are several places both in ArmA UI or in config files where difficulty can be changed, some game conditions can also affect accuracy, etc, all these may lead to a bad gameplay experience if they are not properly matched. The present tutorial not only refers to the dedicated servers but they can be applied to the single missions too.

So what is a nice gameplay? Well, in real soldiers miss their shoot depending on various condition, distance, morale, weapon condition etc. So in game, being hit every time at the first shot is not realistic nor pleasant. In a similar manner, shooting to an enemy that always misses is not challenging nor fun. There should be a balance where AI can shoot you close to the rate you can shoot them, without weird behavior like seeing you instant at a mile away and giving you a headshot. Beside that, the sound of bullets flying close to you or ripping objects apart is nice and creates a lot of adrenaline.

What are the factors that affects difficulty?

There are several factors involved, defining the AI skills and accuracy. First you need to understand that each AI soldier has a number of parameters defining his strength. Internally, these parameters look like this:

class CfgAISkill
{
spotDistance[] = {};
spotTime[] = {};
courage[] = {};
reloadSpeed[] = {};
endurance[] = {};
commanding[] = {};
aimingShake[] = {};
aimingSpeed[] = {}
aimingAccuracy[] = {}
general[] = {}
};

So these parameters basically are related to how far the AI can see / identify a target, how fast the AI will abandon the combat, how fast the AI reload the magazine or the stamina is drained, etc. You cannot set each of these params individually, but only with the AI "skill". Either in mission editor, or in menu->options->game->difficulty slider. Once you rise the AI skill, all these params go up together. I have to mention that these params have nothing to do with the pathfinding, covering behavior or other skills related to how "smart" the AI seems to be. Maybe only the "general" value but waypoints parameters are really more important in defining their "intelligence".

A special parameter is the aiming accuracy, which can be adjusted separately too. So you can have a very fast moving AI soldier, courageous, seeing far, no shaking, but always missing its shots, if the aiming accuracy is reduced. This can be done with the "precisionEnemy" entry in .arma3profile file.

Now, to sum up all the factors that affect the AI strength, here they are:

1. AI skill in mission editor. You can chose each AI skill when designing the mission, from 0 to 1. This affect all above internal parameters. On the same server configuration, a mission can have some very weak AI while some other mission can have very strong AI. My suggestion for mission editors is to set AI close to middle of the strength (skill 0.5) so the general difficulty is chosen by the player or the server administrator.

2. Chosen game difficulty (main menu->options->game->difficulty-> drop down recruit/regular/veteran/expert)

This will multiply all the internal AI parameters with a factor depending on the chosen difficulty. For example if you chose "veteran", spot distance will be higher, reload speed shorter etc. Also aiming accuracy. Actually this automatically update the "AI skill" slider in the difficulty settings.

3. "Super AI" option in difficulty setting. This will maximize all above internal parameters, without affecting pathfinding or behavior. I do not recommend it as it makes the AI turns or spot you instantly, making them unrealistic.

4. The "AI skill" slider in difficulty settings (main menu->options->game->difficulty->AI skill) This will combine with the default AI skill from mission design, setting up a general AI skill.

5. "precisionEnemy" entry in your current .arma3profile file. This only affect AI shooting accuracy, without affecting any other parameter. So you can have an AI skill 0.9 (almost maximum) but missing all shots if you set "precisionEnemy=0.001" in .arma3profile file.

6. Used mods(addons)

Keep in mind that some mods can internally modify the above skills array, so the AI can became more accurate or faster when playing the same mission with the same settings, with the mod enabled, then without it. If you use a mod for a server, read carefully the settings you need to make and what changes it performs. Some mods may force a lower accuracy for the AI, so you don't need to go in .arma3profile file anymore. Once you set a configuration for your server, you need to test it with a default simple mission and check if everything works as expected.

7. Used scripts

Some missions are using scripts that may change the AI strength on the fly, which is not quite fair as the AI strength should be let to the server administrator decision. Some scripts creators or mission editors assume that some people don't know how to tune the difficulty and try to force the difficulty at a decent value. If the server administrator already tuned down the AI accuracy for a specific mission and the scripts tune down AI skill in some other mission, the result will be a very weak AI.

8. Weapons accuracy

Each weapon has an internal value for accuracy, so each one can be more or less accurate. Also, optics, caliber etc affects the accuracy so you may find out that a decent accuracy for an enemy shooting an "ak" like weapon becomes too precise if the enemy has an optic on that weapon. There are also weapons addons packs where their designer changed the default accuracy with a better one. This will not make their weapons more likely to play with but unbalance the whole mission. This also happens with some units packs, I have seen soldiers having 4 times more armor then default game soldiers.

The game difficulty

Let's have a look at the game difficulty that you can adjust with the game UI (main menu -> options -> difficulty) or directly in .arma3profile file. If you edited the .arma3profile file, next time you start the game the changes will appear in game options UI too. Actually you need to have the game off when you edit the .arma3profile file, or the changes you performed can be overwritten.

As we can see, there is a difficulty for single player missions and another one for multiplayer (this is from OpF times but lately only one may be considered). As you chose a higher difficulty, like "veteran" on "expert", you cannot change some setting anymore. So what if you want to enable third person view for a specific mission? Then you need to change the whole difficulty level on the server and check all other precision settings are fine.

That's why I suggest playing on "regular" difficulty and adjust the values as you wish. If you need to adjust one of the option for a specific mission, just go to that option and change it, no need to change the whole level. You can have "expert" settings even playing "regular", with proper adjustments. (Just make all entries "0" and make AI precision "1" -though not recommended at all)

.arma3profile file:

difficulty="regular";
difficultyMP="regular";
class Difficulties
{
...
class regular
{
	class Flags
	{
		Armor=1;
		FriendlyTag=1;
		EnemyTag=0;
		MineTag=0;
		HUD=1;
		HUDPerm=1;
		HUDWp=1;
		HUDWpPerm=1;
		HUDGroupInfo=1;
		AutoSpot=0;
		Map=0;
		WeaponCursor=1;
		AutoGuideAT=1;
		ClockIndicator=1;
		3rdPersonView=1;
		UltraAI=0;
		CameraShake=1;
		UnlimitedSaves=1;
		DeathMessages=1;
		NetStats=1;
		VonID=1;
		ExtendetInfoType=1;
	};
	skillFriendly=0.7;
	skillEnemy=0.6;
	precisionFriendly=0.4;
	precisionEnemy=0.25;
};
...
};

As long as we wish to adjust "regular" value, we need to assure that both "difficulty" and "difficultyMP" are set on "regular" in this file. This will make either single player missions or dedicated server mission to start with this difficulty and take values from "regular" entry. Let's discuss some of these values, particulary important in dedicated server missions:

Armor - give improved armor, pretty much realistic since soldiers using plate carrier vests etc. Recommended value "1"

FriendlyTag - see the name of the guys in your team, in real you would recognize them. I'd recommend "1"

EnemyTag - this should be set to 0, as it give too much information about an enemy, like type and distance, things you don't get in real life.

MineTag - I'd say to go with 0, or the mines will have a graphical red diamond, not really needed.

Hud - hud related entries plus waypoints can be set as desired, some may want them removed, some not. No recommendation here.

AutoSpot - auto reporting of enemy, not really needed especially in cooperative multiplayer games. I suggest "0".

Map - show enemies on map as red dots, even if you didn't see them in 3d view. Strongly recommended against, since it can be used as a cheat. ". so "0".

WeaponCursor - set as desired, have in mind that without cursor you can't see the friendly names either.

AutoGuideAT - the player has to press lock key or auto lock when using launchers, not so important, I would recommend "1".

UltraAI - will maximize all internal skills like turning speed and spot distance making AI unrealistic. Strongly recommend against, so "0".

UnlimitedSaves - I would let it to "1" for single mission unless you're a hardcore player who don't like saves at all.

DeathMessages - display death messages in multiplayer, set as desired.

NetStats - gives access to score, I'd say "1" as some people really like to see their performance.

VonID - recommended "1" as if VoIP is used, you can see the name of the speaker.

You can adjust some other options not mentioned here like "clock" or "camera shaking" as desired.

Very important, the precision and skill for AI are bellow, having some decent values at this time, but BIS may adjust things in time. Particularly important is "precisionEnemy", which at current time should be set to 0.2 for decent AI shooting accuracy. However, it may not work yet as expected.

Some advices for modders and mission creators

- If you are working on weapons or units addons, try to stick around game default values. Making them stronger won't make your weapon more likely to play but will unbalance some servers, especially if they are used by AI or as AI;

- Don't change the AI skill on the fly as it can combine with server values giving unrealistic values. Let the difficulty at the administrator hand;

- Avoid maximizing AI skill to 1, as this won't make them "smarter";

- Try to stick around at 0.5 for AI skill, as this will avoid some extreme values in case of wrong settings;

- Don't set your own AI precision programatically as BIS may change some default values or internal skills array;

Conclusion - setting a server difficulty step by step:

1. Download or make a test mission like this one, so you can test how accurate / fast the AI is. You can also test with some other simple missions, don't use scripted ones for now;

2. If you're using mods, make sure you read how they interfere with the difficulty and set them accordingly;

3. Edit your .arma3profile file, set difficulty on "regular", adjust the "regular" entry as above, tune up other options as desired;

4. Play the test missions, make sure the AI performs well in terms of turning speed, spot distance, shooting accuracy. Ignore covering behaviour, pathfinding or things like this, you cannot adjust them. If they are too slow (like on turning to you etc), rise "skillEnemy" value a bit in arma3.profile file (restart needed). If they are too accurate, adjust the "precisionEnemy" value down, to 0.20, 0.17 etc. Play enough missions as in some the AI may be accurate, in others not, depending on the AI skill given by mission designer in editor. That's why a test mission with AI skill 0.5 will be close to the most values.

5. If your server only play a particular mission, create a server on your own with that mission and make sure the AI works as expected, by playing several times, before making it public.

Edited by afp

Share this post


Link to post
Share on other sites

Nice tutorial, but the precision parameter in .arma3profile works now?

I tested some months ago in Arma 3 alpha and Arma 2 and did nothing about AI's accuracy. Many other people can tell you, even Dwarden said that parameter wasn't working.

Share this post


Link to post
Share on other sites

Maybe not as expected but at big values seem to hit you every time, on the test mission. However, on small values they still hit you pretty often.

EDIT: tested even more, I'm not sure about the precision any more, it's too random. You can go with "skillEnemy=0.5;" or even 0.4 untill they fix it or make it really count.

Edited by afp

Share this post


Link to post
Share on other sites

I dont think the precision and skill values in the difficulty settings still have an effect yet

You are incorrect about not being able to set the following skills individually (It can be done via scripting)

class CfgAISkill

{

spotDistance[] = {};

spotTime[] = {};

courage[] = {};

reloadSpeed[] = {};

endurance[] = {};

commanding[] = {};

aimingShake[] = {};

aimingSpeed[] = {}

aimingAccuracy[] = {}

general[] = {}

};

The A3 config to date has the following values

aimingAccuracy[] = {0,0,1,1};
aimingShake[] = {0,0,1,1};
aimingSpeed[] = {0,0.5,1,1};
commanding[] = {0,0,1,1};
courage[] = {0,0,1,1};
endurance[] = {0,0,1,1};
general[] = {0,0,1,1};
reloadSpeed[] = {0,0,1,1};
spotDistance[] = {0,0.2,1,0.4};
spotTime[] = {0,0,1,0.7};

This addon addresses this issue

http://forums.bistudio.com/showthread.php?152393-zeu_ServerSkill-(Serverside-AI-skill-setting-addon-with-userconfig-configuration)

Share this post


Link to post
Share on other sites

I know the AI skills can be set by addons or scripting, I even said so. Indeed, working AI skills in settings is still work in progress, limiting accuracy with an addon is the best temporary fix for now. But one day I hope those values will be working and adjusted as they should be.

Share this post


Link to post
Share on other sites

Need some help please!

I cant seem to get the weapon cursor disabled on my server. This is my server.cfg:

// GLOBAL SETTINGS
hostname = "Arma 3 - COOP - hosted by Dale on Tour! | SurvivalServers.com"; // The name of the server that shall be displayed in the public server list
password = ""; // Password for joining, eg connecting to the server
passwordAdmin = "*********"; // Password to become server admin. When you're in Arma MP and connected to the server, type '#login xyz'

//Server #2
Port = 2802
steamPort = 8770;
steamQueryPort = 2320;

// WELCOME MESSAGE ("message of the day")
// It can be several lines, separated by comma
// Empty messages "" will not be displayed at all but are only for increasing the interval
motd[] = {
"Welcome to the Dale on Tour! server. Please play nice...",
"If there are any issues with the server report them to me via the BIS forums in a pm (dale0404).",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
};
motdInterval = 30;					// Time interval (in seconds) between each message

// JOINING RULES
maxPlayers              = 40;                                   // Maximum amount of players. Civilians and watchers, beholder, bystanders and so on also count as player.
kickDuplicate = 1;                                              // Each ArmA version has its own ID. If kickDuplicate is set to 1, a player will be kicked when he joins a server where another player with the same ID is playing.

// VOTING
voteMissionPlayers      = 1;                                    // Tells the server how many people must connect so that it displays the mission selection screen.
voteThreshold           = 0.33;                         // 33% or more players need to vote for something, for example an admin or a new map, to become effective

// INGAME SETTINGS
disableVoN              = 0;                                    // If set to 1, Voice over Net will not be available
vonCodecQuality         = 7;                                    // Quality from 1 to 10
persistent              = 1;                                    // If 1, missions still run on even after the last player disconnected.

// REQUIRED BUILD
//requiredBuild		= 104711;

//Verify Signatures
verifysignatures	= 2;
onUnsignedData = "kick (_this select 0)";		// unsigned data detected
onHackedData = "ban (_this select 0)";			// tampering of the signature detected
//onDifferentData = "";					// data with a valid signature, but different version than the one present on server detected

class Difficulties
{
class Recruit
{
	class Flags
	{
		3rdPersonView = 1;
		armor = 1;
		autoAim = 0;
		autoGuideAT = 1;
		autoSpot = 1;
		cameraShake = 0;
		clockIndicator = 1;
		deathMessages = 1;
		enemyTag = 0;
		friendlyTag = 1;
		hud = 1;
		hudGroupInfo = 1;
		hudPerm = 1;
		hudWp = 1;
		hudWpPerm = 1;
		map = 1;
		netStats = 1;
		tracers = 1;
		ultraAI = 0;
		unlimitedSaves = 1;
		vonID = 1;
		weaponCursor = 1;
	};
	skillFriendly = 1;
	precisionFriendly = 1;
	skillEnemy = 0.3;
	precisionEnemy = 0.3;
};
class Regular
{
	class Flags
	{
		3rdPersonView = 1;
		armor = 1;
		autoAim = 0;
		autoGuideAT = 1;
		autoSpot = 1;
		cameraShake = 1;
		clockIndicator = 1;
		deathMessages = 1;
		enemyTag = 0;
		friendlyTag = 1;
		hud = 1;
		hudGroupInfo = 1;
		hudPerm = 1;
		hudWp = 1;
		hudWpPerm = 1;
		map = 1;
		netStats = 1;
		tracers = 1;
		ultraAI = 0;
		unlimitedSaves = 1;
		vonId = 1;
		weaponCursor = 1;
	};
	skillFriendly = 1;
	precisionFriendly = 1;
	skillEnemy = 0.3;
	precisionEnemy = 0.5;
};
class Veteran
{
	class Flags
	{
		3rdPersonView = 0;
		armor = 0;// Cannot be changed
		autoAim = 0;// Cannot be changed
		autoGuideAT = 0;// Cannot be changed
		autoSpot = 0;// Cannot be changed
		cameraShake = 1;
		clockIndicator = 0;
		deathMessages = 1;
		enemyTag = 0;// Cannot be changed
		friendlyTag = 0;// Cannot be changed
		hud = 1;
		hudGroupInfo = 0;
		hudPerm = 0;// Cannot be changed
		hudWp = 1;
		hudWpPerm = 0;// Cannot be changed
		map = 0;
		netStats = 1;
		tracers = 0;// Cannot be changed
		ultraAI = 0;
		unlimitedSaves = 0;
		vonId = 0;
		weaponCursor = 0;
	};
	skillFriendly = 1;
	precisionFriendly = 1;
	skillEnemy = 0.3;
	precisionEnemy = 0.75;
};
class Elite
{
	class Flags
	{
		3rdPersonView = 0;// Cannot be changed
		armor = 0;// Cannot be changed
		autoAim = 0;// Cannot be changed
		autoGuideAT = 0;// Cannot be changed
		autoSpot = 0;// Cannot be changed
		cameraShake = 1;// Cannot be changed
		clockIndicator = 0;// Cannot be changed
		deathMessages = 0;
		enemyTag = 0;// Cannot be changed
		friendlyTag = 0;// Cannot be changed
		hud = 0;// Cannot be changed
		hudGroupInfo = 0;// Cannot be changed
		hudPerm = 0;// Cannot be changed
		hudWp = 0;// Cannot be changed
		hudWpPerm = 0;// Cannot be changed
		map = 0;// Cannot be changed
		netStats = 0;
		tracers = 0;// Cannot be changed
		ultraAI = 0;
		unlimitedSaves = 0;// Cannot be changed
		vonID = 0;
		weaponCursor = 0;// Cannot be changed
	};
	skillFriendly = 1;
	precisionFriendly = 1;
	skillEnemy = 0.3;
	precisionEnemy = 0.80;
};
};

Anyone help please? Before anyone says so I make sure the mission I am playing is set to Veteran or Elite.

Share this post


Link to post
Share on other sites

Dale - I could be way off here???

But the 'class difficulties' should not be in the server.cfg ????

But the .arma3profile ?

Share this post


Link to post
Share on other sites

Hi all,

Just to add from the above, I now have all the correct stuff in the correct places lol. But I still cant seem to get that damn crosshair disabled. Any help please?

Command line:

-server -ip=144.76.4.149 -port=2802 -config=cfg\server.cfg -cfg=cfg\basic.cfg -netlog -profiles=C:\Users\user\Documents\Arma 3 - Other Profiles\Dale\server.arma3profile

server.arma3profile:

class Difficulties
{
class recruit
{
	class Flags
	{
		Armor=0;
		FriendlyTag=1;
		EnemyTag=0;
		MineTag=0;
		HUD=0;
		HUDPerm=0;
		HUDWp=0;
		HUDWpPerm=0;
		HUDGroupInfo=1;
		AutoSpot=1;
		Map=1;
		WeaponCursor=0;
		AutoGuideAT=0;
		ClockIndicator=1;
		3rdPersonView=1;
		UltraAI=0;
		CameraShake=0;
		UnlimitedSaves=1;
		DeathMessages=1;
		NetStats=1;
		VonID=1;
		ExtendetInfoType=1;
	};
	skillFriendly=0.64999998;
	skillEnemy=0.3;
	precisionFriendly=0.36999995;
	precisionEnemy=0.3;
};
class regular
{
	class Flags
	{
		Armor=1;
		FriendlyTag=1;
		EnemyTag=0;
		MineTag=1;
		HUD=1;
		HUDPerm=1;
		HUDWp=1;
		HUDWpPerm=1;
		HUDGroupInfo=1;
		AutoSpot=1;
		Map=1;
		WeaponCursor=0;
		AutoGuideAT=0;
		ClockIndicator=1;
		3rdPersonView=1;
		UltraAI=0;
		CameraShake=1;
		UnlimitedSaves=0;
		DeathMessages=1;
		NetStats=1;
		VonID=1;
		ExtendetInfoType=1;
	};
	skillFriendly=0.75;
	skillEnemy=0.3;
	precisionFriendly=0.54999989;
	precisionEnemy=0.5;
};
class veteran
{
	class Flags
	{
		HUD=1;
		HUDWp=1;
		HUDWpPerm=0;
		HUDGroupInfo=1;
		AutoSpot=1;
		WeaponCursor=0;
		ClockIndicator=1;
		3rdPersonView=0;
		UltraAI=0;
		CameraShake=1;
		DeathMessages=1;
		NetStats=1;
		VonID=0;
		ExtendetInfoType=0;
	};
	skillFriendly=0.85000002;
	skillEnemy=0.32;
	precisionFriendly=0.72999996;
	precisionEnemy=0.76;
};
 class mercenary
{
	class Flags
	{
		HUD=1;
		AutoSpot=0;
		WeaponCursor=0;
		DeathMessages=1;
		NetStats=1;
		VonID=0;
	};
	skillFriendly=1;
	skillEnemy=0.4;
	precisionFriendly=1.0;
	precisionEnemy=0.75;
};
};

Share this post


Link to post
Share on other sites

check your .armaprofile for these or whatever difficulty you want, to ensure that entry is used for WeaponCursor=0;

difficulty="regular";

difficultyMP="regular";

Share this post


Link to post
Share on other sites

Many thanks for a useful guide.

I assume that if a parameter is not specified within .arma3config file, the server will use the defaults?

Is there a complete sample .arma3profile config somewhere?

Edited by Gimpymoo

Share this post


Link to post
Share on other sites

I understand the ideal would be to have the server set the difficulty of a mission but unfortunately small changes to these values can render a mission unplayable on veteran that's fairly easy on regular. This is why I would like to dictate the skills inside my mission, also to make sure it's playable with (single) players that don't hassle with their difficulty levels. I trial and errored with the description.ext and init.sqf since I'm inexperienced there and didn't get it to work.

So how to override server settings please?

Edited by Surfer

Share this post


Link to post
Share on other sites

Wonder if anyone can clear this up for me

If I use this line in my mission init.sqf {_x setskill ["spotTime",0.5]; _x setskill ["spotDistance",1.0]; _x setSkill ["aimingspeed", 0.5]; _x setSkill ["aimingaccuracy", 0.4]; } forEach allUnits; to set the skill of the ai

Does this set the skill level of the ai in the mission regardless of what the dedi server settings are or do the server settings get applied to ai regardless?

Thanks in advance

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
Sign in to follow this  

×