{"name":"Arma 3: AI Skill","title":"Arma 3: AI Skill","type":"topic","url":"https://community.bistudio.com/wiki/Arma_3:_AI_Skill","revid":364214,"updated":"2024-05-06T08:54:31Z","aliases":["AI Sub-skills","Arma 3 AI Skill","CfgAISkill"],"markdown":"> [!NOTE]\n> Some information on this page were not confirmed by Bohemia Interactive!\n\n### AI Skill\n\nThe AI is characterized by a set of sub-skills.\nThe final AI skill is unfluenced by several factors.\nAdditionally each sub-skill is then interpolated with the values set in CfgAISkill.\n\n### Changing AI Skill\n\n#### Players\n\n- As player one can only influence AI skill by changing the global skill settings **Skill** and **Precision**. One has also the option to choose one of the default **AI Levels**.\n  - Skill: Influences multiple sub-skills related to the AIs \"intelligence\". If the value is set too low, the AI will be dumb.\n  - Precision: Influences sub-skills related to AIs precision. If the value is set too high, the AI will have a super human precision. Lower values result mostly in interesting fire fights.\n\n> [!NOTE]\n> Changing the AI difficulty settings during a scenario will have no effect until the scenario is restarted.\n\n#### Scenario Designers\n\n- A scenario designer has four ways to influence the AI skill:\n  - By changing the skill slider in Eden Editor for each individual unit.\n  - By using functions like BIS_fnc_EXP_camp_setSkill or BIS_fnc_EXP_camp_dynamicAISkill to set the skill of multiple AI entities at once.\n  - By using commands like setSkill.\n  - By using the **Set Skill** module which allows to change the skill of AI entities for example when a trigger was activated.\n\n#### Modders\n\n- A modder can influence the AI skill by overwriting CfgAISkill.\n\n#### Server Admins\n\n- Server admins can change the AI skill by changing the **aiLevelPreset** config parameter found in server config. See Arma 3 Server Profile for more information.\n\n### Sub-Skills\n\nSub-skills are a set of parameters ultimately defining the individual AI unit performance in the game.\n\n| Sub-Skill | Effect | Influence |\n|---|---|---|\n| aimingAccuracy | - Affects how well the AI can lead a target<br>- Affects how accurately the AI estimate range and calculates bullet drop<br>- Affects how well the AI compensates for weapon dispersion<br>- Affects how much the AI will know to compensate for recoil<br>- Affects how certain the AI must be about its aim on target before opening fire | - Higher value means the AI can lead a target better<br>- Higher value means the Ai can estimate range and calculate bullet drop more precicely<br>- Higher value means the AI can compensate weapon dispersion better<br>- Higher value means the AI can control the recoil better<br>- Higher value means the AI needs to now less to open up fire |\n| aimingSpeed | - Affects how quickly the AI can rotate and stabilize its aim | - Higher value means the AI can rotate and stabilize its aim faster |\n| commanding | - Affects how quickly recognized targets are shared with the group | - Higher value means the AI can report targets faster |\n| courage | - Affects unit's subordinates' morale | - Higher value means the AI has got more courage |\n| endurance | - *Disabled in Arma 3* | - *Disabled* |\n| general | - Raw \"Skill\", value is distributed to sub-skills unless defined otherwise. Affects the AI's decision making. | - ? |\n| reloadSpeed | - Affects the delay between switching or reloading a weapon | - Higher value means the AI can switch or reload weapons faster |\n| spotDistance | - Affects the AI ability to spot targets within it is visual or audible range<br>- Affects the accuracy of the information | - Higher value means the AI is better at spotting targets<br>- Higher value means the AI will collect information about targets more precisely |\n| spotTime | - Affects how quick the AI react to death, damage or observing an enemy | - Higher value means the AI will react faster to death, damage or enemies |\n| aimingShake | - Affects how steadily the AI can hold a weapon | - Higher value means the AI will be more precise |\n\n### CfgAISkill\n\nCfgAISkill is a set of arrays, related to Sub-Skills, defining the interpolation curve of each of the sub-skill.\nThey can be changed by a mod for example.\n\n#### Example\n\nIn { w, x, y, z } value from (w,y) gets interpolated into (x,z)\n\n- `spotDistance[] = { 0, 0.2, 1, 0.4 };`\n  - Value in a range **0-1** will change into value in a range 0.2-0.4.\n- `_unit setSkill [\"spotDistance\", 0.5];`\n  - Results in `_unit skill \"spotDistance\"` returning *0.3*\n\n> [!NOTE]\n> More than 2 pairs of defining values can be used (minimum is 2 pairs).\n> The values are used to interpolate on run-time, so even after setting sub-skill by script command it will be interpolated and bound by this array.\n\n#### Arma 3 Defaults\n\n##### Table\n\n| Sub-Skill | minInputSkillLimit (w) | resultingSubSkillLowerBoundary (x) | maxInputSkillLimit (y) | resultingSubSkillLowerBoundary (z) |\n|---|---|---|---|---|\n| aimingAccuracy | 0 | 0 | 1 | 1 |\n| aimingShake | 0 | 0 | 1 | 1 |\n| aimingSpeed | 0 | 0.5 | 1 | 1 |\n| commanding | 0 | 0 | 1 | 1 |\n| courage | 0 | 0 | 1 | 1 |\n| endurance | 0 | 0 | 1 | 1 |\n| general | 0 | 0 | 1 | 1 |\n| reloadSpeed | 0 | 0 | 1 | 1 |\n| spotDistance | 0 | 0 | 1 | 1 |\n| spotTime | 0 | 0 | 1 | 1 |\n\n##### Config\n\n```cpp\naimingAccuracy[] = { 0, 0, 1, 1 };\naimingShake[] = { 0, 0, 1, 1 };\naimingSpeed[] = { 0, 0.5, 1, 1 };\ncommanding[] = { 0, 0, 1, 1 };\ncourage[] = { 0, 0, 1, 1 };\nendurance[] = { 0, 0, 1, 1 }; // disabled in Arma 3\ngeneral[] = { 0, 0, 1, 1 };\nreloadSpeed[] = { 0, 0, 1, 1 };\nspotDistance[] = { 0, 0, 1, 1 };\nspotTime[] = { 0, 0, 1, 1 };\n```\n\n### Related Commands\n\n- skill\n- setSkill\n- skillFinal\n- allowFleeing\n\n### External Links\n\n- [BIS Forums AI Skill](https://forums.bohemia.net/forums/topic/219929-the-mystical-skillfinal-formula-reverse-engineering-it/)\n- [AI Facts & Myths Compilation List](https://forums.bohemia.net/forums/topic/223493-ai-facts-myths-compilation-list/)","sections":[{"heading":null,"level":1,"markdown":"> [!NOTE]\n> Some information on this page were not confirmed by Bohemia Interactive!"},{"heading":"AI Skill","level":3,"markdown":"The AI is characterized by a set of sub-skills.\nThe final AI skill is unfluenced by several factors.\nAdditionally each sub-skill is then interpolated with the values set in CfgAISkill."},{"heading":"Changing AI Skill","level":3,"markdown":""},{"heading":"Players","level":4,"markdown":"- As player one can only influence AI skill by changing the global skill settings **Skill** and **Precision**. One has also the option to choose one of the default **AI Levels**.\n  - Skill: Influences multiple sub-skills related to the AIs \"intelligence\". If the value is set too low, the AI will be dumb.\n  - Precision: Influences sub-skills related to AIs precision. If the value is set too high, the AI will have a super human precision. Lower values result mostly in interesting fire fights.\n\n> [!NOTE]\n> Changing the AI difficulty settings during a scenario will have no effect until the scenario is restarted."},{"heading":"Scenario Designers","level":4,"markdown":"- A scenario designer has four ways to influence the AI skill:\n  - By changing the skill slider in Eden Editor for each individual unit.\n  - By using functions like BIS_fnc_EXP_camp_setSkill or BIS_fnc_EXP_camp_dynamicAISkill to set the skill of multiple AI entities at once.\n  - By using commands like setSkill.\n  - By using the **Set Skill** module which allows to change the skill of AI entities for example when a trigger was activated."},{"heading":"Modders","level":4,"markdown":"- A modder can influence the AI skill by overwriting CfgAISkill."},{"heading":"Server Admins","level":4,"markdown":"- Server admins can change the AI skill by changing the **aiLevelPreset** config parameter found in server config. See Arma 3 Server Profile for more information."},{"heading":"Sub-Skills","level":3,"markdown":"Sub-skills are a set of parameters ultimately defining the individual AI unit performance in the game.\n\n| Sub-Skill | Effect | Influence |\n|---|---|---|\n| aimingAccuracy | - Affects how well the AI can lead a target<br>- Affects how accurately the AI estimate range and calculates bullet drop<br>- Affects how well the AI compensates for weapon dispersion<br>- Affects how much the AI will know to compensate for recoil<br>- Affects how certain the AI must be about its aim on target before opening fire | - Higher value means the AI can lead a target better<br>- Higher value means the Ai can estimate range and calculate bullet drop more precicely<br>- Higher value means the AI can compensate weapon dispersion better<br>- Higher value means the AI can control the recoil better<br>- Higher value means the AI needs to now less to open up fire |\n| aimingSpeed | - Affects how quickly the AI can rotate and stabilize its aim | - Higher value means the AI can rotate and stabilize its aim faster |\n| commanding | - Affects how quickly recognized targets are shared with the group | - Higher value means the AI can report targets faster |\n| courage | - Affects unit's subordinates' morale | - Higher value means the AI has got more courage |\n| endurance | - *Disabled in Arma 3* | - *Disabled* |\n| general | - Raw \"Skill\", value is distributed to sub-skills unless defined otherwise. Affects the AI's decision making. | - ? |\n| reloadSpeed | - Affects the delay between switching or reloading a weapon | - Higher value means the AI can switch or reload weapons faster |\n| spotDistance | - Affects the AI ability to spot targets within it is visual or audible range<br>- Affects the accuracy of the information | - Higher value means the AI is better at spotting targets<br>- Higher value means the AI will collect information about targets more precisely |\n| spotTime | - Affects how quick the AI react to death, damage or observing an enemy | - Higher value means the AI will react faster to death, damage or enemies |\n| aimingShake | - Affects how steadily the AI can hold a weapon | - Higher value means the AI will be more precise |"},{"heading":"CfgAISkill","level":3,"markdown":"CfgAISkill is a set of arrays, related to Sub-Skills, defining the interpolation curve of each of the sub-skill.\nThey can be changed by a mod for example."},{"heading":"Example","level":4,"markdown":"In { w, x, y, z } value from (w,y) gets interpolated into (x,z)\n\n- `spotDistance[] = { 0, 0.2, 1, 0.4 };`\n  - Value in a range **0-1** will change into value in a range 0.2-0.4.\n- `_unit setSkill [\"spotDistance\", 0.5];`\n  - Results in `_unit skill \"spotDistance\"` returning *0.3*\n\n> [!NOTE]\n> More than 2 pairs of defining values can be used (minimum is 2 pairs).\n> The values are used to interpolate on run-time, so even after setting sub-skill by script command it will be interpolated and bound by this array."},{"heading":"Arma 3 Defaults","level":4,"markdown":""},{"heading":"Table","level":5,"markdown":"| Sub-Skill | minInputSkillLimit (w) | resultingSubSkillLowerBoundary (x) | maxInputSkillLimit (y) | resultingSubSkillLowerBoundary (z) |\n|---|---|---|---|---|\n| aimingAccuracy | 0 | 0 | 1 | 1 |\n| aimingShake | 0 | 0 | 1 | 1 |\n| aimingSpeed | 0 | 0.5 | 1 | 1 |\n| commanding | 0 | 0 | 1 | 1 |\n| courage | 0 | 0 | 1 | 1 |\n| endurance | 0 | 0 | 1 | 1 |\n| general | 0 | 0 | 1 | 1 |\n| reloadSpeed | 0 | 0 | 1 | 1 |\n| spotDistance | 0 | 0 | 1 | 1 |\n| spotTime | 0 | 0 | 1 | 1 |"},{"heading":"Config","level":5,"markdown":"```cpp\naimingAccuracy[] = { 0, 0, 1, 1 };\naimingShake[] = { 0, 0, 1, 1 };\naimingSpeed[] = { 0, 0.5, 1, 1 };\ncommanding[] = { 0, 0, 1, 1 };\ncourage[] = { 0, 0, 1, 1 };\nendurance[] = { 0, 0, 1, 1 }; // disabled in Arma 3\ngeneral[] = { 0, 0, 1, 1 };\nreloadSpeed[] = { 0, 0, 1, 1 };\nspotDistance[] = { 0, 0, 1, 1 };\nspotTime[] = { 0, 0, 1, 1 };\n```"},{"heading":"Related Commands","level":3,"markdown":"- skill\n- setSkill\n- skillFinal\n- allowFleeing"},{"heading":"External Links","level":3,"markdown":"- [BIS Forums AI Skill](https://forums.bohemia.net/forums/topic/219929-the-mystical-skillfinal-formula-reverse-engineering-it/)\n- [AI Facts & Myths Compilation List](https://forums.bohemia.net/forums/topic/223493-ai-facts-myths-compilation-list/)"}],"categories":["AI"],"groups":["Configuration"]}