R3vo/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
(101 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{TOC|side}}
{{TOC|side}}
== Introduction ==
If you have ever wondered why you scenario is running so badly, performance profiling is the way to find it out. It allows you to find bottlenecks and slow code by capturing a "slow" frame.
The captured data can then be viewed and analysed.


This article deals with the '''server.armaprofile''', describing all the visual and difficulty settings in ArmA, like friendly and enemy AI quality, HUD, crosshair, 3rd person view, clock indicator and so on.
== Getting the correct Version ==
Profiling is enabled in the following {{arma3}} versions
* arma3profiling_x64.exe - '''Part of the Performance Profiling Build'''
* arma3diag_x64.exe - '''Part of the Development Build'''


Read [[Arma_3: Steam Branches]] for a guide on how to access these branches.


== Extension ==
{{Feature|informative|It is recommended to use the '''Performance Profiling Build''' (arma3profiling_x64.exe) for performance profiling because:
* Has tools that might not make it into development build
* Has all the profiling related commands that ''arma3diag_x64.exe'' has
* Its performance is closer to the default ''arma3_x64.exe''}}


{| class="wikitable"
== Frame Capturing ==
!Game !! Extension
There are several commands that allow you to capture a frame.
|-
* [[diag_captureFrame]]
| {{arma1}} || .ArmAProfile
* [[diag_captureSlowFrame]]
|-
* [[diag_logSlowFrame]] - not available in Arma 3 :(
| {{arma2}} || .ArmA2Profile
* [[diag_captureFrameToFile]]
|-
In most cases you do not want to capture any or all frames, you just want to capture "slow" frames. A slow frame is a frame that takes longer than the average frame and slows down the game.
| {{arma2oa}} || .ArmA2OAProfile
|-
| {{arma3}} || .Arma3Profile
|}


== Location ==
== How to Use ==  
# Run a mission
# Execute a scripted command <sqf inline>diag_captureSlowFrame ["total", 0.3];</sqf> using any means ([[Arma 3: Debug Console|Debug Console]], mission radio trigger...)
# Once a slow frame is detected, a window will open
# In the window you will be able to browse a lot of performance-related data, which can be interesting
# To export the gathered information for sharing with others:
## Select Main Thread (if not selected yet)
## Press the Copy button
## Open an external text editor
## Paste the text into a new file
## Save the file


The file's location is different on each operating system:
== Capture Frame UI ==
[[File: arma3-capture frame ui overview.png]]


=== Windows ===
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}


The default profile named after the system user can be found at:
== External Viewer ==
* chrome://tracing
* https://ui.perfetto.dev/


* XP EN: <tt>C:\Documents and Settings\%UserName%\My Files\ArmA</tt>
[[File:Performance_Profiling_04.png|thumb|diag_captureFrame sample output with custom subtree]]
* XP DE: <tt>C:\Dokumente und Einstellungen\%UserName%\Eigene Dateien\ArmA</tt>
== Creating Your Own Subtree ==
* Vista/Win7/8/10: <tt>C:\Users\%UserName%\Documents\ArmA</tt>


User created profiles with a different naming are found at:
When Profiling Per-Frame Eventhandlers (PFH), [[diag_captureFrame]] only shows one blob called siFEH that contains all PFH's so you can't see what part of that is caused by your PFH.<br>
You can create your own subtree inside siFEH by wrapping your function call inside a [[isNil]] CODE statement like this:<br>
Turn your old call which may look like this:
<sqf>
addMissionEventHandler ["EachFrame", {
call myPFHFunction
}];
</sqf>


* XP EN: <tt>C:\Documents and Settings\%UserName%\My Files\ArmA Other Profiles</tt>
Into something like this:
* XP DE: <tt>C:\Dokumente und Einstellungen\%UserName%\Eigene Dateien\ArmA Other Profiles</tt>
<sqf>
* Vista/Win7/8/10: <tt>C:\Users\%UserName%\Documents\Arma - Other Profiles</tt>
addMissionEventHandler ["EachFrame", {
isNil { call myPFHFunction } // isNil creates the subtree
}];
</sqf>


==== Profile name ====
Now when you run [[diag_captureFrame]] inside of siPFH you will have a subtree called gsEva and behind that you can see the first line of code inside the isNil statement.<br>
It will only show a part of the first line of that code so you should put something descriptive into the [[isNil]] statement.<br>
You can use the same to create a subtree for any function you like. This will also work inside [[Scheduler#Scheduled_Environment|Scheduled]] ([[spawn]]ed) scripts. <br>
But using this method to "subtree" a function with return values requires a little bit of trickery to get the return value out.


In there is a folder and within filename based on your profile name:


\ArmA\'''MyProfileName'''\'''MyProfileName'''.ArmAProfile
== Notes ==


You can define the profile to be loaded with the [[Arma 2: Startup Parameters|-name]] parameter.
* 0.3 is a time in second used to determine what duration of a frame you consider abnormal, and first such frame will be captured.
* 0.3 is definitely something you should not see in a normal game.
* If you do not capture any frames with 0.3, try lowering it to 0.2 or 0.1.
* If it triggers too early, before the main slowdown happens, increase it to a higher value, e.g. 1.0.


==== Define a different location ====
== Scopes ==
 
{| class="wikitable sortable"
You can specify the location by using the [[Arma 3 Startup Parameters#|-profiles]] parameter.
|-
 
! Technical Name !! Descriptive Name !! Description
For example start the server with
|-
arma_server.exe -profiles=D:\ArmA\Users\ -name=server
| Main
 
|
You can find your file in
|
D:\ArmA\Users\server\server.armaProfile
|-
 
| total
=== Linux ===
|
 
|
The name depends upon the [[Arma 3 Startup Parameters#Profile Options|-name]] parameter when starting the Arma server.
|-
Having started the server with "./server -name=server" (-profiles seems to be useless on Linux) you'll find it as a subfolder of your arma-server directory, for example "/usr/home/arma-server/server/server.armaprofile".
| fsPHa
|
|
|-
| winMs
|
|
|-
| dlcSim
|
|
|-
| steamCbk
|
|
|-
| input
|
|
|-
| wSimu
|
|
|-
| docSim
|
|
|-
| wSimDisp
|
|
|-
| MFDManager
|
|
|-
| wDisp
|
|
|-
| EventPrcs
|
|
|-
| gsEva
|
|
|-
| gbFrm
|
|
|-
| memLo
|
|
|-
| siScr
|
|
|-
| scrVM
|
|
|-
| wsSet
|
|
|-
| sLand
|
|
|-
| simSW
|
|
|-
| cLWObj
|
|
|-
| oTemp
|
|
|-
| FPres
|
|
|-
| waitSnd
|
|
|-
| job
|
|
|-
| sound
|
|
|-
| ssAdv
|
|
|-
| snCmt
|
|
|-
| play
|
|
|-
| ARTCpl
|
|
|-
| rendr
|
|
|-
| drwVi
|
|
|-
| txHLi
|
|
|-
| txPMM
|
|
|-
| dsr2t
|
|
|-
| wPrep
|
|
|-
| dPr
|
|
|-
| fmiRun
|
|
|-
| fmiWait
|
|
|-
| fmiMDrw
|
|
|-
| fmiSIns
|
|
|-
| wPrepFtr
|
|
|-
| clPrp
|
|
|-
| oPrep
|
|
|-
| sceAC
|
|
|-
| oSplt
|
|
|-
| sceACTA
|
|
|-
| sceACPrx
|
|
|-
| lodUL
|
|
|-
| PrxObj
|
|
|-
| manAn
|
|
|-
| ppdOT
|
|
|-
| flProx
|
|
|-
| PrxObjTransport
|
|
|-
| oSoSL
|
|
|-
| oSoJE
|
|
|-
| oSoJE1
|
|
|-
| oSoJE2
|
|
|-
| oSo1OFOv
|
|
|-
| oSo1ON
|
|
|-
| sceCLsHSH
|
|
|-
| prpAMCt
|
|
|-
| oSoJEw
|
|
|-
| pDrwFNP
|
|
|-
| oSoSLu
|
|
|-
| lPGCl
|
|
|-
| pdDrw
|
|
|-
| lDGnd
|
|
|-
| lGSMM
|
|
|-
| recCB
|
|
|-
| mtPmj
|
|
|-
| cuDrw
|
|
|-
| prepT
|
|
|-
| drwCB
|
|
|-
| oPasD
|
|
|-
| o1Drw
|
|
|-
| lckDnBf
|
|
|-
| prpTx
|
|
|-
| inst
|
|
|-
| stpSctnTL
|
|
|-
| o1ShV
|
|
|-
| scSVI
|
|
|-
| oPas3
|
|
|-
| sssmC
|
|
|-
| sbDrw
|
|
|-
| aniMt
|
|
|-
| ppSSSM
|
|
|-
| drwROM
|
|
|-
| drwIn
|
|
|-
| wDraw
|
|
|-
| lDPGT
|
|
|-
| oSDrw
|
|
|-
| oPasO
|
|
|-
| lDSky
|
|
|-
| swRdr
|
|
|-
| ppSWDD
|
|
|-
| swRdGeom
|
|
|-
| swRdGeomVB
|
|
|-
| swFillV
|
|
|-
| oPasA
|
|
|-
| ppShrpn
|
|
|-
| lDWat
|
|
|-
| oPas2
|
|
|-
| o2Drw
|
|
|-
| oPas5
|
|
|-
| o5Drw
|
|
|-
| EDraw3D
|
|
|-
| MEventPrcs
|
|
|-
| cLGSY
|
|
|-
| stpAll
|
|
|-
| stpCB
|
|
|-
| stpTxtCS
|
|
|-
| stpUAVsCS
|
|
|-
| ppHDRCL
|
|
|-
| ppGSB
|
|
|-
| ppDOF
|
|
|-
| ppGlwNw
|
|
|-
| ppGLu
|
|
|-
| stpCBUpd
|
|
|-
| ppQWt
|
|
|-
| ppCMAA
|
|
|-
| hudDr
|
|
|-
| 3DEN_UI_OnDraw
|
|
|-
| 3DEN_PrepareDraw
|
|
|-
| clObL
|
|
|-
| 3DEN_Drawing
|
|
|-
| stpTxtGS
|
|
|-
| txt2D
|
|
|-
| mapDr
|
|
|-
| mapSeaAndNormal
|
|
|-
| mapPM
|
|
|-
| lndPM
|
|
|-
| MapObjectsPrepTask
|
|
|-
| mapSeaAndNormalDraw
|
|
|-
| mapCntDraw
|
|
|-
| mapObjectsDraw
|
|
|-
| mapForestShape
|
|
|-
| mapGrid
|
|
|-
| drwFn
|
|
|-
| dtTot
|
|
|-
| wFram
|
|
|-
| 3dSwp
|
|
|-
| preLd
|
|
|-
| preLV
|
|
|-
| actObjPrld
|
|
|-
| hashChk
|
|
|-
| sSim
|
|
|-
| enfWorkShort
|
|
|-
| updAttPos
|
|
|-
| oSo1AN
|
|
|-
| prpAMCf
|
|
|-
| prpAMCSlt
|
|
|-
| prpSDM
|
|
|-
| locL
|
|
|-
| mapSeaAndNormalWork
|
|
|-
| mapObjectsPrepWork
|
|
|-
| drwIdxPrm
|
|
|-
| oSo3
|
|
|-
| lsCVB
|
|
|-
| oSo5
|
|
|-
| oSo2CL
|
|
|-
| oSo1AF
|
|
|-
| Visualize
|
|
|-
| visul
|
|
|-
| txMLo
|
|
|-
| oSo2Srt
|
|
|-
| oSoSdw
|
|
|-
| prpAMCbsi
|
|
|-
| prpAMCp
|
|
|-
| Render
|
|
|-
| bgD3D
|
|
|-
| stpTxtVS
|
|
|-
| ppHBAOPlus
|
|
|}


If you're not using the <tt>-name</tt> parameter, the default name "player" will be used and you'll find the Arma profile in <tt>player/player.armaprofile</tt>.
<sqf>
private _ctrlTV = ctrlparent (_this select 0) displayCtrl 101;


== Example Configuration File ==
private _export = "{| class=""wikitable sortable"""  + endl + "|-" + endl;
_export = _export + "! Technical Name !! Descriptive Name !! Description";


The server has less values compared to a client version.
private _fnc_logChilden =
 
=== Server ===
 
==== {{arma1}} ====
<spoiler>
<syntaxhighlight lang="cpp">
class Difficulties
{
{
class regular // Displayed as "Cadet"
    params ["_path"];
{
class Flags
{
// These are the settings. Set a value to 0 to disable the feature, or set it to 1 to enable it.
Armor=1; // Gives you improved body armor, tank armor etc
FriendlyTag=1; // Displays information on friendly units. ONLY WORKS WITH 'Weaponcursor=0', eg crosshair on.
EnemyTag=1; // Displays information on enemy units
HUD=1; // Shows you leaders location and your position in formation
HUDPerm=1; // Shows HUD permanently
HUDWp=1; // Shows Waypoints right after they're ordered to you
HUDWpPerm=1; // Shows Waypoints permanently
WeaponCursor=1; // Shows the crosshair for your weapon
AutoAim=1; // Enables auto aim when you're not looking through your weapon's scope. Also works with crosshair off
AutoGuideAT=1; // AT missiles will be automatically guided to their target. If 0, player has to lock onto the target.
3rdPersonView=1; // This turns 3rd(third) person view and group leader view on or off. Please never talk of this as "3D view" - ArmA is not an arcade game !
ClockIndicator=1; // Displays the clock indicator on the left of your screen when giving/receiving orders like "At 11 o'clock, enemy man at 200 meters"
Map=1; // Shows symbols for all objects known to your group on the map. This will NOT disable the map itself !
Tracers=1; // Displays tracers even of small arms that in real life would not have tracers
AutoSpot=1; // If you're close enough to an enemy, you'll report it without right-clicking
UltraAI=0; // Enables some kind of super AI that hears and sees more and has better tactics. This is for both friendly and enemy sides.
UnlimitedSaves=1; // Enables saving permanently. For single player missions. But you then can only load the last save state.
DeathMessages=1; // (1.09 and later) Displays "XXX was killed by YYY" messages in multiplayer
NetStats=1; // (1.09 and later) Enables the scoreboard functionality in MP
VonID=1; // (1.09 and later) When using VoN, display the name of the player speaking.
};
// These are the skills. Value may range from 0.000000 to 1.000000
skillFriendly=0.350000; // Friendly tactics skill
skillEnemy=0.350000; // Enemy tactics skill
precisionFriendly=0.350000; // Friendly shooting precision
precisionEnemy=0.350000; // Enemy shooting precision
};
class veteran // Most of the options from above are not available, because they're off by default.
{
// Also soldiers/vehicles die sooner upon damage (have no armor or body armor).
class Flags
{
HUD=1; // Shows you leaders location and your position in formation
HUDWp=1; // Shows Waypoints right after they're ordered to you
HUDWpPerm=0; // Shows Waypoints permanently
WeaponCursor=1; // Shows the crosshair for your weapon
ClockIndicator=1; // Displays the clock indicator on the left of your screen when giving/receiving orders like "At 11 o'clock, enemy man at 200 meters"
3rdPersonView=1; // This turns 3rd(third) person view and group leader view on or off. Please never talk of this as "3D view" - ArmA is not an arcade game !
Tracers=1; // Displays tracers even of small arms that in real life would not have tracers
UltraAI=0; // Enables some kind of super AI that hears and sees more and has better tactics. This is for both friendly and enemy sides.


DeathMessages=1; // (1.09 and later) Displays "XXX was killed by YYY" messages in multiplayer
    for "_i" from 0 to ((_ctrlTV tvCount _path) - 1) do
NetStats=1; // (1.09 and later) Enables the scoreboard functionality in MP
    {
VonID=0; // (1.09 and later) When using VoN, display the name of the player speaking.
        private _text = _ctrlTV tvText (_path + [_i]);
};
        _text = _text splitString " " select 0;
// These are the skills. Value may range from 0.000000 to 1.000000
skillFriendly=0.850000;
skillEnemy=0.850000;
precisionFriendly=0.850000;
precisionEnemy=0.850000;
};
};
</syntaxhighlight>
</spoiler>


==== {{arma2}} ====
        if !(_text in _export) then
        {
            _export = _export + endl + "|-" + endl + "| " + _text + endl + "| " + endl + "| ";
        };


This is how the default difficulty settings part of the server's .arma2profile file would look:<br>
        if (_ctrlTV tvCount (_path + [_i]) > 0 ) then
<spoiler>
        {
<syntaxhighlight lang="cpp">
            [_path + [_i]] call _fnc_logChilden;
class Difficulties
        };
{
    };
class Recruit
{
class Flags
{
3rdPersonView = 1;
armor = 1;
autoAim = 0;
autoGuideAT = 1;
autoSpot = 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.55;
precisionEnemy = 0.3;
};
class Regular
{
class Flags
{
3rdPersonView = 1;
armor = 1;
autoAim = 0;
autoGuideAT = 1;
autoSpot = 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.7;
precisionEnemy = 0.5;
};
class Veteran
{
class Flags
{
3rdPersonView = 1;
armor = 0; // Cannot be changed
autoAim = 0; // Cannot be changed
autoGuideAT = 0; // Cannot be changed
autoSpot = 0; // Cannot be changed
clockIndicator = 0; // Cannot be changed
deathMessages = 1;
enemyTag = 0; // Cannot be changed
friendlyTag = 0; // Cannot be changed
hud = 1;
hudGroupInfo = 0;
hudPerm = 0; // Cannot be changed
hudWp = 0; // Cannot be changed
hudWpPerm = 0; // Cannot be changed
map = 0; // Cannot be changed
netStats = 1;
tracers = 0; // Cannot be changed
ultraAI = 0;
unlimitedSaves = 0; // Cannot be changed
vonId = 0;
weaponCursor = 1;
};
skillFriendly = 1;
precisionFriendly = 1;
skillEnemy = 0.9;
precisionEnemy = 0.75;
};
class Mercenary
{
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
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 = 1;
precisionEnemy = 1;
};
};
};
</syntaxhighlight>
</spoiler>


==== {{arma2oa}} ====
[[]] call _fnc_logChilden;
<spoiler>
<syntaxhighlight lang="cpp">
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.55;
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.7;
precisionEnemy = 0.5;
};
class Veteran
{
class Flags
{
3rdPersonView = 1;
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 = 1;
};
skillFriendly = 1;
precisionFriendly = 1;
skillEnemy = 0.9;
precisionEnemy = 0.75;
};
class Mercenary
{
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 = 1;
precisionEnemy = 1;
};
};
</syntaxhighlight>
</spoiler>


==== {{arma3}} ====
copyToClipboard (_export + endl + "|}" + endl);
</sqf>


'''Since 1.58:'''<br>
== See Also ==
One of the main changes that came with 1.58 is that the difficulty levels were transformed to true presets (Recruit, Regular, Veteran).<br>
Each preset has exactly defined value for each difficulty option. If any of the options doesn't match the preset, the preset is changed to Custom. The particular flags stored in profile are only for the Custom preset, since Recruit, Regular and Veteran are fixed ones and predefined in game's data in <tt>CfgDifficultyPresets</tt> config class.
* Documentation of presets and data config as well as a list of the most significant changes in 1.58: [[Arma 3: Difficulty Settings]]
* Related forum thread: [https://forums.bistudio.com/topic/188661-difficulty-overhaul/ Difficulty Overhaul]<br><br>
 
==== Server Difficulty Example ====
<syntaxhighlight lang="cpp">
class DifficultyPresets
{
class CustomDifficulty
{
class Options
{
/* Simulation */
 
reducedDamage = 0; // Reduced damage
 
/* Situational awareness */
 
groupIndicators = 0; // Group indicators (0 = never, 1 = limited distance, 2 = always)
friendlyTags = 0; // Friendly name tags (0 = never, 1 = limited distance, 2 = always)
enemyTags = 0; // Enemy name tags (0 = never, 1 = limited distance, 2 = always)
detectedMines = 0; // Detected mines (0 = never, 1 = limited distance, 2 = always)
commands = 1; // Commands (0 = never, 1 = fade out, 2 = always)
waypoints = 1; // Waypoints (0 = never, 1 = fade out, 2 = always)
tacticalPing = 0; // Tactical ping (0 = disable, 1 = enable)
 
/* Personal awareness */


weaponInfo = 2; // Weapon info (0 = never, 1 = fade out, 2 = always)
* [[Code Optimisation]]
stanceIndicator = 2; // Stance indicator (0 = never, 1 = fade out, 2 = always)
* [[Mission Optimisation]]
staminaBar = 0; // Stamina bar
weaponCrosshair = 0; // Weapon crosshair
visionAid = 0; // Vision aid
 
/* View */
 
thirdPersonView = 0; // 3rd person view (0 = disabled, 1 = enabled, 2 = enabled for vehicles only (Since  Arma 3 v1.99))
cameraShake = 1; // Camera shake
 
/* Multiplayer */
 
scoreTable = 1; // Score table
deathMessages = 1; // Killed by
vonID = 1; // VoN ID
 
/* Misc */
 
mapContent = 0; // Extended map content
autoReport = 0; // (former autoSpot) Automatic reporting of spotted enemied by players only. This doesn't have any effect on AIs.
multipleSaves = 0; // Multiple saves
};
// aiLevelPreset defines AI skill level and is counted from 0 and can have following values: 0 (Low), 1 (Normal), 2 (High), 3 (Custom).
// when 3 (Custom) is chosen, values of skill and precision are taken from the class CustomAILevel.
aiLevelPreset = 3;
};
 
class CustomAILevel
{
skillAI = 0.5;
precisionAI = 0.5;
};
};
</syntaxhighlight>
 
== See Also ==


* [[ArmA: Server configuration|Server Configuration]]
* [[Arma 3: Difficulty Settings|Difficulty Menu]]
* [[Armed Assault:Dedicated Server]]
* [[Operation Flashpoint:Dedicated Server]]


[[Category:Startup Parameters]]
[[Category:Arma Scripting Tutorials]]
{{GameCategory|arma3|Multiplayer}}
{{GameCategory|arma2|Multiplayer}}
{{GameCategory|arma1| Multiplayer}}

Latest revision as of 18:23, 4 November 2024

If you have ever wondered why you scenario is running so badly, performance profiling is the way to find it out. It allows you to find bottlenecks and slow code by capturing a "slow" frame. The captured data can then be viewed and analysed.

Getting the correct Version

Profiling is enabled in the following Arma 3 versions

  • arma3profiling_x64.exe - Part of the Performance Profiling Build
  • arma3diag_x64.exe - Part of the Development Build

Read Arma_3: Steam Branches for a guide on how to access these branches.

It is recommended to use the Performance Profiling Build (arma3profiling_x64.exe) for performance profiling because:
  • Has tools that might not make it into development build
  • Has all the profiling related commands that arma3diag_x64.exe has
  • Its performance is closer to the default arma3_x64.exe

Frame Capturing

There are several commands that allow you to capture a frame.

In most cases you do not want to capture any or all frames, you just want to capture "slow" frames. A slow frame is a frame that takes longer than the average frame and slows down the game.

How to Use

  1. Run a mission
  2. Execute a scripted command diag_captureSlowFrame ["total", 0.3]; using any means (Debug Console, mission radio trigger...)
  3. Once a slow frame is detected, a window will open
  4. In the window you will be able to browse a lot of performance-related data, which can be interesting
  5. To export the gathered information for sharing with others:
    1. Select Main Thread (if not selected yet)
    2. Press the Copy button
    3. Open an external text editor
    4. Paste the text into a new file
    5. Save the file

Capture Frame UI

arma3-capture frame ui overview.png

  1. 🚧
    TODO: this must be updated.
  2. 🚧
    TODO: this must be updated.
  3. 🚧
    TODO: this must be updated.
  4. 🚧
    TODO: this must be updated.
  5. 🚧
    TODO: this must be updated.
  6. 🚧
    TODO: this must be updated.
  7. 🚧
    TODO: this must be updated.
  8. 🚧
    TODO: this must be updated.
  9. 🚧
    TODO: this must be updated.

External Viewer

diag_captureFrame sample output with custom subtree

Creating Your Own Subtree

When Profiling Per-Frame Eventhandlers (PFH), diag_captureFrame only shows one blob called siFEH that contains all PFH's so you can't see what part of that is caused by your PFH.
You can create your own subtree inside siFEH by wrapping your function call inside a isNil CODE statement like this:
Turn your old call which may look like this:

addMissionEventHandler ["EachFrame", { call myPFHFunction }];

Into something like this:

addMissionEventHandler ["EachFrame", { isNil { call myPFHFunction } // isNil creates the subtree }];

Now when you run diag_captureFrame inside of siPFH you will have a subtree called gsEva and behind that you can see the first line of code inside the isNil statement.
It will only show a part of the first line of that code so you should put something descriptive into the isNil statement.
You can use the same to create a subtree for any function you like. This will also work inside Scheduled (spawned) scripts.
But using this method to "subtree" a function with return values requires a little bit of trickery to get the return value out.


Notes

  • 0.3 is a time in second used to determine what duration of a frame you consider abnormal, and first such frame will be captured.
  • 0.3 is definitely something you should not see in a normal game.
  • If you do not capture any frames with 0.3, try lowering it to 0.2 or 0.1.
  • If it triggers too early, before the main slowdown happens, increase it to a higher value, e.g. 1.0.

Scopes

Technical Name Descriptive Name Description
Main
total
fsPHa
winMs
dlcSim
steamCbk
input
wSimu
docSim
wSimDisp
MFDManager
wDisp
EventPrcs
gsEva
gbFrm
memLo
siScr
scrVM
wsSet
sLand
simSW
cLWObj
oTemp
FPres
waitSnd
job
sound
ssAdv
snCmt
play
ARTCpl
rendr
drwVi
txHLi
txPMM
dsr2t
wPrep
dPr
fmiRun
fmiWait
fmiMDrw
fmiSIns
wPrepFtr
clPrp
oPrep
sceAC
oSplt
sceACTA
sceACPrx
lodUL
PrxObj
manAn
ppdOT
flProx
PrxObjTransport
oSoSL
oSoJE
oSoJE1
oSoJE2
oSo1OFOv
oSo1ON
sceCLsHSH
prpAMCt
oSoJEw
pDrwFNP
oSoSLu
lPGCl
pdDrw
lDGnd
lGSMM
recCB
mtPmj
cuDrw
prepT
drwCB
oPasD
o1Drw
lckDnBf
prpTx
inst
stpSctnTL
o1ShV
scSVI
oPas3
sssmC
sbDrw
aniMt
ppSSSM
drwROM
drwIn
wDraw
lDPGT
oSDrw
oPasO
lDSky
swRdr
ppSWDD
swRdGeom
swRdGeomVB
swFillV
oPasA
ppShrpn
lDWat
oPas2
o2Drw
oPas5
o5Drw
EDraw3D
MEventPrcs
cLGSY
stpAll
stpCB
stpTxtCS
stpUAVsCS
ppHDRCL
ppGSB
ppDOF
ppGlwNw
ppGLu
stpCBUpd
ppQWt
ppCMAA
hudDr
3DEN_UI_OnDraw
3DEN_PrepareDraw
clObL
3DEN_Drawing
stpTxtGS
txt2D
mapDr
mapSeaAndNormal
mapPM
lndPM
MapObjectsPrepTask
mapSeaAndNormalDraw
mapCntDraw
mapObjectsDraw
mapForestShape
mapGrid
drwFn
dtTot
wFram
3dSwp
preLd
preLV
actObjPrld
hashChk
sSim
enfWorkShort
updAttPos
oSo1AN
prpAMCf
prpAMCSlt
prpSDM
locL
mapSeaAndNormalWork
mapObjectsPrepWork
drwIdxPrm
oSo3
lsCVB
oSo5
oSo2CL
oSo1AF
Visualize
visul
txMLo
oSo2Srt
oSoSdw
prpAMCbsi
prpAMCp
Render
bgD3D
stpTxtVS
ppHBAOPlus

private _ctrlTV = ctrlparent (_this select 0) displayCtrl 101; private _export = "{| class=""wikitable sortable""" + endl + "|-" + endl; _export = _export + "! Technical Name !! Descriptive Name !! Description"; private _fnc_logChilden = { params ["_path"]; for "_i" from 0 to ((_ctrlTV tvCount _path) - 1) do { private _text = _ctrlTV tvText (_path + [_i]); _text = _text splitString " " select 0; if !(_text in _export) then { _export = _export + endl + "|-" + endl + "| " + _text + endl + "| " + endl + "| "; }; if (_ctrlTV tvCount (_path + [_i]) > 0 ) then { [_path + [_i]] call _fnc_logChilden; }; }; }; [[]] call _fnc_logChilden; copyToClipboard (_export + endl + "|}" + endl);

See Also