Jump to content
Sign in to follow this  
tmp95

Back to A3 - Adjust AI now? Only via skill slider in editor (no more preciesion)

Recommended Posts

I'm coming back to A3 after giving up on it several / 6 months ago. For a variety of reasons. As is now, is there any tweaking to the AI that can be done (as in A2. with userprofie , precision enemy, precision blufor, ect). Or is it all done today with everyone rated the same skill set (foolish in my opinion). with the only way to differentiate is by giving one unit a 1/2 bar on the skill slider when placing them on the map and another unit a full bar (for example). Thus this really not telling you exactly what is different, nor allowing you to make one much more proficient with accuracy but both being intelligent.

Thanks for any help

Share this post


Link to post
Share on other sites

Hi TMP95, if you just want to change the abilities of units in missions you are creating, it is totally possible to change individual skills like spotting, accuracy, reaction time, etc. via scripting commands. I don't have enough time to elaborate much more on it right now, but if you want me to, I can try to walk you through how to change multiple groups of units' skills quickly and easily at a later time. Just let me know. Or maybe someone else will jump in to show you how.

When it comes to changing the idividual skills of units for "already made missions" it is not really possible besides the current precision slider we have now. Basically the idea is the mission maker balances that, and you only have the option to scale it up or down. Of course sometimes they balance it poorly or people have varying tastes for their missions. Sometimes not everything works out perfectly. Its just the way it is.

It would be possible to fine tune ai abilities for already made missions via modding however. But that is fair sized project in itself.

Share this post


Link to post
Share on other sites

Why can't they just give us the option. I just learnt the commands recently and any serious mission maker can add it on their scripts. Why can't they just give us the options in game and save us the hassle of leaning scripting and commands. If this is between simulation and gameplay then just give us the options in game. I think it's these small very vocal sim groups who don't want it for some weird reason.

Normal gamers (majority) who just want to make their own missions with a specific set of ai skills friendly and opfor have to find and learn commands which is time consuming. If it was in game people don't have to look it up and spend more time playing/making missions.

Accuracy

Spot ability

Aggressiveness

Just give us those 3 skill bars or similar and problem solved.

  • Like 1

Share this post


Link to post
Share on other sites
Why can't they just give us the option. I just learnt the commands recently and any serious mission maker can add it on their scripts. Why can't they just give us the options in game and save us the hassle of leaning scripting and commands. If this is between simulation and gameplay then just give us the options in game. I think it's these small very vocal sim groups who don't want it for some weird reason.

Normal gamers (majority) who just want to make their own missions with a specific set of ai skills friendly and opfor have to find and learn commands which is time consuming. If it was in game people don't have to look it up and spend more time playing/making missions.

Accuracy

Spot ability

Aggressiveness

Just give us those 3 skill bars or similar and problem solved.

+ 100

---------- Post added at 19:09 ---------- Previous post was at 19:08 ----------

and @ -Coulum- Thank you for your advice on making my own missions. I'm going to try and look into how to place a unit (or group) and give that specific unit / group differing skill sets / ranges.

---------- Post added at 19:19 ---------- Previous post was at 19:09 ----------

These are the attributes each unit has a value associated too...

aimingAccuracy

aimingShake

aimingSpeed

endurance

spotDistance

spotTime

courage

reloadSpeed

commanding

general

My question first is. If I place a unit. Adjust the skill slider all the way to full. Does this give that unit a 1.0 rating for all of these attributes??

Share this post


Link to post
Share on other sites

My question first is. If I place a unit. Adjust the skill slider all the way to full. Does this give that unit a 1.0 rating for all of these attributes??

Yes, if you've set the AI skill & precision to max in the difficulty settings. (excluding spotDistance and spotTime which are 0.4 & 0.7. Their value depends on something else)

Read all about it here: https://community.bistudio.com/wiki/Category:AI

Edited by Greenfist

Share this post


Link to post
Share on other sites
Yes, if you've set the AI skill & precision to max in the difficulty settings. (excluding spotDistance and spotTime which are 0.4 & 0.7. Their value depends on something else)

Read all about it here: https://community.bistudio.com/wiki/Category:AI

That chart is slightly outdated ... There is no longer distinction between friendly and enemy AI skill within the provided Game Options structure.

Share this post


Link to post
Share on other sites
These are the attributes each unit has a value associated too...

aimingAccuracy

aimingShake

aimingSpeed

endurance

spotDistance

spotTime

courage

reloadSpeed

commanding

general

My question first is. If I place a unit. Adjust the skill slider all the way to full. Does this give that unit a 1.0 rating for all of these attributes??

Well... no it doesn't... or at least not in all cases. You must understand that the editor slider isn't the only thing at play and certain attributes are by default set lower than others even when editor skill sliders are maxed. I will try to explain more; Here is a run down of my findings (and please keep that in mind - this is not necessarily fact):

Sub-Skills

All units have 10 subskills that define how well they can perform tasks ingame. The skill values can be anywhere from 0 (minimum/worst) to 1.0 (maximum/best). The skills are listed below.

  • aimingAccuracy
  • aimingShake
  • aimingSpeed
  • endurance
  • spotDistance
  • spotTime
  • courage
  • reloadSpeed
  • commanding
  • general

Generally the names explain what task that skill effects. However do note, that the way in which a skill takes effect is not always as expected or even known. For example: I know that AimingAccuracy makes the ai less of a precise/picky shot. In contrast, I have no idea how endurance works, if it even works.

Hierarchy

First things first. Here is the order in which units are given their skills:

  • Unit is assigned skills via editor slider
  • Unit is assigned skills via scripting (these skills override ones set by editor slider)
  • The skills of the unit are then manipulated depending on difficulty sliders/settings

Now, I believe there is a step before this, which has to do with skill configs, but I am not knowledgeable enough to explain its effects and generally that is not important to us at this point. So don't worry about it, but know that there is "more to the story".

Editor Sliders

The editor sliders are a quick and dirty way to adjust the overall ability of a unit. When you decrease/increase this it will decrease/increase all ten of the subskills in equal proportions. When the you raise it to 100%, all the skills will be at 1.0... EXCEPT for two.

SpotTime, and SpotDistance are both shrunk by a factor 70% and 40% respectively, compared to the other skills. This means that they will be 70% and 40% of what you adjust the editor slider to be. All other skills will be 100% of what the editor slider is set to be.

As a closing example: if you set your skill slider to 50%, all skills will be at 0.5 except for SpotTime, which will be 0.35, and SpotDistance, which will be 0.2. This is before the in menu difficulty slider is taken into account which can further manipulate skills. Does that make sense? Moving on.

Scripting Commands

Now from what I explain about editor sliders, you should notice that there are many limitations. For example how would one get a SpotDistance of more than 0.4. Or what if one wanted to get AimingAccuracy lower, but keep AimingSpeed high? With the editor slider, these things are simply not possible to achieve. This is where the SetSkill Array scripting commands come in.

Using the commands is quite easy. Use this simple format:

UNIT setskill ["SUBSKILL", NUMBER];

Where UNIT is the name of the unit whose skills you want to adjust, SUBSKILL is the name of the subskill you want to adjust, and NUMBER is the value (0-1.0) you want to set the given subskill to.

For example: soldier1 setskill ["spottime", 0.8]; will give "soldier1" a "spottime" skill of "0.8".

When you set a skill with this method it will override the editor slider's skill. The other skills that are not changed by scripting will be based on the slider. But the one you define using scripting will be replaced by the scripted value. This allows you to make individual sub skills lower or higher without touching others. This is, in my opinion, the best way for a missionmaker to set skills.

Difficulty Sliders/Settings

The difficulty sliders/settings are found in the Esc menu/ main menu, under CONFIGURE>>GAME>>DIFFICULTY. You will see an AI LEVELING setting. The presets are Novice, Normal, Expert and Custom. When you choose the one of the first three, a preset ratio of precision and skill is applied to your ai. When you select custom, you get to choose those numbers yourself with the precision slider and skill slider. For our purposes, we will assume to be using a custom setting.

The precision and skill slider basically takes a percentage of a unit's originally assigned skills away. This percentage is anywhere from 0% (empty slider) to 20% (full slider) of the original units skills (which were set by editor slider or scripting as explained above). The exact formula that determines just what percentage is shaved off is unknown to me. I just know it limits (0%-20%)

Each slider effects a host of different sub skills. The Precision slider effects only AimingAccuracy, and AimingShake. The Skill slider effects the other eight subskills. Both sliders effect their given subskills in equal proportions.

Here are some rough examples:

  • A unit is set to have 0.5 AimingAccuracy (via scripting commands) and the precision slider is at 50%. He will end up having .45 AimingAccuracy overall.
  • A unit is set to have 0.75 AimingShake (via scripting commands) and the skill slider is set to 0%. He will still end up having 0.75 AimingShake (skill slider does not effect aimingshake, precision slider does.)
  • A unit is set to have 1.0 AimingSpeed (via editor slider) and the skill slider is set to 0%. He will end up having 0.8 AimingSpeed.

Like I mention above, I don't know the precise formula to calculate the final skill. I am just going off of the extents of the sliders. But these example do demonstrate roughly, how the system works.

Questions?

In closing, the system is more intricate than one might think. All the seperate skill sliders, subskills, difficulty options etc. may seem confusing at first. But they do serve a purpose, and once you get the hang of it, its pretty easy stuff. My personal suggestion is just to stick to scripting commands when making missions. Skill sliders are imprecise and hard to apply to many units quickly. Scripting commands are not.

A more elaborate answer to your question at the top of the post, TMP95, based on what I have explained above is...

My question first is. If I place a unit. Adjust the skill slider all the way to full. Does this give that unit a 1.0 rating for all of these attributes??

Not in most cases or for all the subskill. If difficulty sliders are set to maximum, editor sliders are set to maximum and no scripting is done you could get all the unit's subskills to 1.0 except for SpotTime and SpotDistance, which max out at 0.7 and 0.4. You can increase those further however with scripting commands.

Hope that helps more than it confuses. Let me know.

Edited by -Coulum-

Share this post


Link to post
Share on other sites

@ Coulum - Thank you very much! Helps tons! (should be a sticky, your post).

And question regarding he scripting commands - Where exactly do I put this?? (within the init of the unit I place?). Thanks

UNIT setskill ["SUBSKILL", NUMBER];

Share this post


Link to post
Share on other sites

Coulum, almost everything you said is also described in the wiki I linked earlier. But good job on explaining it more throroughly. :)

By the way, that 'endurance' skill is not enabled in A3 according to wiki. And the reason for those strange values for spotting skills is probably that BI thought the maximum of 1.0 value made AI too super-human, so they tried to prevent anyone from accidentally making AI too good with just editor sliders.

TMP95, you can put that code in any script, trigger etc. or in the particular unit's init field: this setskill ["SUBSKILL", NUMBER];

Edited by Greenfist

Share this post


Link to post
Share on other sites

Just curious. I've created a 4 man team. Set this within each of the placed rifemans INIT field.

this setskill ["aimingAccuracy", 1.0, "aimingShake", 1.0, "spotDistance", 1.0, "spotTime", 1.0, "aimingSpeed", 1.0]; this enableFatigue FALSE; this addEventHandler ["RESPAWN", "(_this select 0) enableFatigue FALSE"];

I have custom settings on with skill and precision set all the way to 1.0 (full bar).

Yet, this 4 man team can't hit anything when they are firing. Continually at 200mn and closer engagement on level ground miss continually while firing.?? (but not only miss. But Vs another much lower skill set 4 man unit...with nothing in their INIT fields. Just standard 1/4 skill bar rated. Lost engagements 4-0 or 4-1.

Do I perhaps have my INIT code incorrect? Should it be more like

this setskill ["aimingAccuracy", 1.0]; this setskill ["aimingshake", 1.0]

Edited by TMP95

Share this post


Link to post
Share on other sites

Yeah, I don't think setskill works like that. You have to set skills separately.

You can check the effective skill value with skillFinal command.

For example by adding this to the player's init field:

player addAction ["Show skills",{
hintsilent format["aimingAccuracy %1\n
aimingShake %2\n
aimingSpeed %3\n
spotDistance %4\n
spotTime %5\n
courage %6\n
reloadSpeed %7\n
commanding %8\n
general %9\n", cursortarget skillfinal "aimingAccuracy",cursortarget skillfinal "aimingShake",cursortarget skillfinal "aimingSpeed",cursortarget skillfinal "spotDistance",cursortarget skillfinal "spotTime",cursortarget skillfinal "courage",cursortarget skillfinal "reloadSpeed",cursortarget skillfinal "commanding",cursortarget skillfinal "general"];}];

Then aim at someone and select the "Show skills" action.

  • Like 1

Share this post


Link to post
Share on other sites

@Greenfist. Huh. I used your code. I'm seeing my guys with an aiming accuracy of 2??? I thought 1 was the highest??.

---------- Post added at 19:14 ---------- Previous post was at 18:59 ----------

This is not the correct way - (below)

this setskill ["aimingAccuracy", 1.0]; this setskill ["aimingShake", 1.0]; this setskill[ "spotDistance", 0.2];

As when I use show skill reflection. It does not give a given unit with this in it's INIT the above values. What do I have wrong?

Edited by TMP95

Share this post


Link to post
Share on other sites

I use this in my init.sqf for missions sp or mp

[] spawn 
{
while {true} do
	{
	sleep 10;

		{
		_x setSkill ["aimingspeed", 0.1];
		_x setSkill ["spotdistance", 0.2];
		_x setSkill ["aimingaccuracy", 0.2];
		_x setSkill ["aimingshake", 0.1];
		_x setSkill ["spottime", 0.1];
		_x setSkill ["spotdistance", 0.5];
		_x setSkill ["commanding", 0.2];
		_x setSkill ["general", 0.5];
		} 
	forEach allUnits;
	}
};

This changes the accuracy among other things for AI that are already on the map, as well as newly spawned AI, works like a charm ;)

Adjust it accordingly for your preference.

Share this post


Link to post
Share on other sites

Ok. I see I am getting it to work now with correct INIT code provided by all your guys help. I had ASR-AI3 turned on and this was adjusting things even more (outside of my set coded settings). Meaning if I have

this setskill ["aimingaccuracy", 1.0];

When used in conjunction with ASR-AI3 a unit will have a 2.0 in aimingaccuracy (if that unit within the ASR-AI3 already has a 1.0, 0.0) .

But again, question. Can a unit have a 2.0 rating for aimingaccuracy?? Or does this screw up actual accuracy once in the game by these AI units?

Share this post


Link to post
Share on other sites

But again, question. Can a unit have a 2.0 rating for aimingaccuracy?? Or does this screw up actual accuracy once in the game by these AI units?

ASR probably changes the range up to 2.0 or even higher, but I have no idea how it translates to actual AI accuracy. You should search the ASR thread for more info or ask about it there.

Share this post


Link to post
Share on other sites
ASR probably changes the range up to 2.0 or even higher, but I have no idea how it translates to actual AI accuracy. You should search the ASR thread for more info or ask about it there.

Thanks! Done (on ASR thread). Appreciate all the help! I've learned much and am figuring out how to tweak things and see what-ifs!

In limited play testing I do think perhaps an aimingaccuracy above 1.0 may be detrimental / a negative within the actual game. At least in very limited play testing.

Further playtesting. Yes. Definitely with ASR and having any value over 1.0 makes a unit not engage or be near as accurate. Turning ASR off and I'm seeing pretty much 1 shot 1 kill and immediate engagements (if tweaking all settings to 1.0).

Edited by TMP95

Share this post


Link to post
Share on other sites
I use this in my init.sqf for missions sp or mp

[] spawn 
{
while {true} do
	{
	sleep 10;

		{
		_x setSkill ["aimingspeed", 0.1];
		_x setSkill ["spotdistance", 0.2];
		_x setSkill ["aimingaccuracy", 0.2];
		_x setSkill ["aimingshake", 0.1];
		_x setSkill ["spottime", 0.1];
		_x setSkill ["spotdistance", 0.5];
		_x setSkill ["commanding", 0.2];
		_x setSkill ["general", 0.5];
		} 
	forEach allUnits;
	}
};

This changes the accuracy among other things for AI that are already on the map, as well as newly spawned AI, works like a charm ;)

Adjust it accordingly for your preference.

Adjusted your code slightly for a bit more efficiency ...


[] spawn {
	if (!isServer) exitWith {}; // if running code from init.sqf which loads on players as well as server
	while {true} do {
		{
			if (_x getVariable ["setSkill_applied",nil]) then {
				_x setVariable ["setSkill_applied",true];
				_x setSkill ["aimingspeed", 0.1];
				_x setSkill ["spotdistance", 0.2];
				_x setSkill ["aimingaccuracy", 0.2];
				_x setSkill ["aimingshake", 0.1];
				_x setSkill ["spottime", 0.1];
				_x setSkill ["spotdistance", 0.5];
				_x setSkill ["commanding", 0.2];
				_x setSkill ["general", 0.5];
			};
			sleep 1;
		} count allUnits;
		sleep 10;
	};
};

Share this post


Link to post
Share on other sites

So even with using a script within the INIT of a unit -

There is no way to get SpotDistance greater than .7  and no way to get spottime great than .4  (correct).

Share this post


Link to post
Share on other sites

Updated the picture in https://community.bistudio.com/wiki/Category:AI- I hope it will help grasping it.

The AI Level values together with arrays defined in cfgAISkill create ranges through which the individual AI unit subskills get interpolated. The resulting finalSkill is then used in actual calculations.

(also everything is in 0-1 range)

  • Like 1

Share this post


Link to post
Share on other sites

I use ASR_AI, and because of the new updates seemingly improving the perceptiveness and reaction time of the AI, I had to do some custom modifying in order to get the AI to behave a little less like a force of combat replicants.

Now I can sneak around them, and they don't automatically know where I am simply via their super hearing. They can still hear you, and they can still do their devious AI maneuvering and try to find you, but they won't always have the drop on you even when they should be at a tactical disadvantage.

I recommend to anyone who was a little taken aback by the recent changes to the AI to do the same.

For some reason their ear sensitivity and the "sensitivity" variables are more effective without an actual increases. I'm not sure how that works, but I changed those variables slightly and they're considerably less "psychic".

I had to tone it down along with some other of the stock ASR_AI variables, and I'm generally happy where I'm at, I'll probably increase the AI's shot accuracy a little more, although accuracy of fire was never much of a problem. Easily the most annoying part about the AI changes is how quickly they can turn and aim accurately, It's one thing if your adjustment radius isn't wide, and you don't have to turn much, but I've seen the AI whip around and lay dead eye fire in a fraction of a second and after a while it's not impressive so much as it's annoying. You don't feel like you're fighting a human enemy.

Share this post


Link to post
Share on other sites

Updated the picture in https://community.bistudio.com/wiki/Category:AI- I hope it will help grasping it.

The AI Level values together with arrays defined in cfgAISkill create ranges through which the individual AI unit subskills get interpolated. The resulting finalSkill is then used in actual calculations.

(also everything is in 0-1 range)

 

Thanks for this - It does help.

 

But I would like to also just ask in simple terms. Should one not be able to set 1 Units weapons accuracy level to 0.10  while setting another units weapons accuracy to 1.0  (and see a noticeable difference in firing accuracy? - This with mind you the 1.0 unit having equal to or greater even all around other skill capability ratings).   I just don't see that much of a firing accuracy difference between the bottom 0.10 and 1.0 when I apply such to two different units.

 

Mind with equivalent weapon system and reasonable ranges

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  

×