R3vo/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{TOC|side}}
{{TOC|side}}
= Ambient Light Effects =
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.
== Light 100 m Illumination ==
The captured data can then be viewed and analysed.
Creates a light source with a slightly concentrated light source.


[[File: land_spe_fx_light_100.png|500px]]
== 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'''


== Light 300 m Illumination ==
Read [[Arma_3: Steam Branches]] for a guide on how to access these branches.
Creates a light source, illumination is uniform within 300 m, useful when you want to have visibility during night time.


[[File: land_spe_fx_light_300.png|500px]]
{{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''}}


== Artillery Ground Lights ==
== Frame Capturing ==
Simulates light casted by distant explosions. Can be used either to create the atmosphere of a battle or as a way to illuminate the area around the player from time to time.
There are several commands that allow you to capture a frame.
* [[diag_captureFrame]]
* [[diag_captureSlowFrame]]
* [[diag_logSlowFrame]] - not available in Arma 3 :(
* [[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.


[[File: land_spe_fx_artillery_ground_lights.png|500px]]
== 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


== Artillery Sky Lights ==
== Capture Frame UI ==
Simulates the light of explosions reflected by clouds or particles in the air.
[[File: arma3-capture frame ui overview.png]]


[[File: land_spe_fx_artillery_sky_lights.png|500px]]
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}
# {{Wiki|TODO}}


= Ambient Misc Effects =
== External Viewer ==
== Ground Fog linked to player ==
* chrome://tracing
Creates fog out of particles around the player, in principle to be used in conjunction with vanilla fog for a more dramatic effect.
* https://ui.perfetto.dev/


[[File: land_spe_fx_player_fog.png|500px]]
[[File:Performance_Profiling_04.png|thumb|diag_captureFrame sample output with custom subtree]]
== Creating Your Own Subtree ==


== Low Fog ==
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>
Creates rectangular patches of fog, to be placed over puddles, lakes, river beds etc. It can be rotated to fit the area better.
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>


[[File: land_spe_fx_low_fog.png|500px]]
Into something like this:
<sqf>
addMissionEventHandler ["EachFrame", {
isNil { call myPFHFunction } // isNil creates the subtree
}];
</sqf>


== Night Clouds linked to Player ==
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>
Simulates night clouds during night time made out of particles. Useful when you want to benefit from the lighting of a full moon without using vanilla overcast and still have clouds.
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.


[[File: land_spe_fx_night_clouds.png|500px]]


= Ambient Sound Effects =
== Notes ==
== Big Fire Burning Sound ==
Creates a sound source of a burning place.


== Binaural Battle Sounds ==
* 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.
Plays sounds of distant explosions and shots straight into the headset using binaural sounds. Useful when you want to create a battle environment.
* 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.


= Fire Effects =
== Scopes ==
== Big Fire ==
Creates a relatively big fire, with its own light source and sound. Does damage to players and AI.
 
[[File: land_spe_fx_big_fire.png|500px]]
 
== Fire Burst ==
Creates a fire, with its own light source and sound. Does not do damage and its direction can be tweaked by rotating the object.
 
[[File: land_spe_fx_fire_burst.png|500px]]
 
== Line of Fire ==
Generates a 1 meter line of fire effect. Does not have its own light or sound source, does not do damage. Its direction can be tweaked by rotating the object.
 
[[File: land_spe_fx_line_of_fire.png|500px]]
 
== Roof Fire ==
Creates fire effect which sticks to the highest point in the vicinity either is a roof or floor. Does not have its own light source, though it has a sound and it does not do damage.
 
[[File: land_spe_fx_roof_fire.png|500px]]
 
== Small Area Fire ==
Creates a fire effect covering a small area on ground, it has no light source of its own and does not do damage.
 
[[File: land_spe_fx_area_fire.png|500px]]
<!--
== Small Area Fire TEST ==
Creates the same effect as Small area fire from above, however its behavior was altered so the effect is active only if the player is in range of 55 meters in order to save performance when many effects are active at the same time.
This effect is subject of change, the activation distance can be tweaked based on performance and the mission editor should consider the visibility so the effect does not go on and off for no apparent reason.
-->
== Small Flame ==
Creates a fire effect in a column. Does not have its own light source, it has a burning sound and does not do damage.
 
[[File: land_spe_fx_small_flame_01.png|500px]]
 
== Small East-West Flame ==
Creates a 1 meter line of fire on the east-west axis, it has a sound, the orientation of the effect/object is not tweakable as for the line of fire effect from above.
 
[[File: land_spe_fx_east_west_flames.png|500px]]
 
== Small North-South Flame ==
Same effect as above only that is generated on north-south axis.
 
== Smog Big ==
Creates a plume of smoke above an area.
 
[[File: land_spe_fx_smog_big.png|500px]]
 
== Smog Night ==
Creates a smoke effect which is visible during night time and simulates distant fires or smoking area. Does not have a light or sound source.
 
[[File: land_spe_fx_smog_night.png|500px]]
 
== Smoke Medium ==
Creates a smoke effect, when you want to make a fire more “smoky”, it has no sound or a light source of its own.
 
[[File: land_spe_fx_smoke_medium.png|500px]]
 
== Wreck Fire ==
Creates the wreck on fire effect, uses less particles than vanilla one, it has some randomization built in so the same effect may differ in appearance when used more times. It does damage to units and it has a light and sound source.
 
[[File: land_spe_fx_wreck_fire.png|500px]]
 
= Technical Description =
All visual special effects are executed on the client side of our game hosting system. Currently we don’t have SFX executed on the server. They are not synchronized across clients per se but they behave like they are (with some delays which should not impact gameplay). If it is needed we can have scripts executed on the server and synchronized.
 
Visual appearance of the special effects in [[Eden Editor]] will be different most of the time from what you see in the mission. That is why you should inspect them while running the mission to see the final outcome. In [[Eden Editor]], for example, you might notice lights flickering when placing objects that have a light source. Also, some sounds might be muted, with the exception of the SFX objects which are sounds only.
 
SFX objects are dependent on player distance to those objects, so make sure your character is close enough to see the SFX in action. The “activation” distance may differ in the future but for now, most object’s triggering distance is set to style="text-align:right;" | 500 m meters.
 
There are a series of objects that will not be executed in [[Eden Editor]] because they are not dependent on distance to the player or position on the map, and this will save performance. Also these objects can be placed anywhere on the map. You only need to place one to get the desired effect. Any additional object of those types will be auto-deleted.
 
So far in this list of objects we have:
 
*night_clouds
*fog_around_player
*artillery_sky_lights
*artillery_ground_lights
*binaural_battle_sounds
 
{{Feature|informative|
*All objects can be created using [[createVehicle]] command and deleted using [[deleteVehicle]].
*All objects are available for [[Arma 3: Curator|Zeus]].}}
 
Some effects depend visually on the direction of the object set in [[Eden Editor]], e.g. fire burst. Some effects are calibrated for usage during night time, usually the name of the object will provide a hint, e.g. Smog Night. Not all fire SFX have a light source or a burning sound. For saving performance you can use only one light source and/or one sound source in case you have a group of fire effects in a relatively small area.
(Sound source can be found in assets under SPE effects in [[Eden Editor]] as objects)
 
= SFX Entities in [[Eden Editor]] =
{| class="wikitable sortable"
{| class="wikitable sortable"
|-
|-
! Display Name !! Class Name !! Activation Distance !! Multiple allowed !! style="text-align:center" | Direction has Effect
! 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
|
|  
|-
|-
| Small Column Flame || {{hl|Land_SPE_FX_small_flame_01}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| recCB
|  
|  
|-
|-
| Small East-West flame || {{hl|Land_SPE_FX_East_West_Flames}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| mtPmj
|  
|  
|-
|-
| Small North-South flame || {{hl|Land_SPE_FX_North_South_Flames}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| cuDrw
|  
|  
|-
|-
| Small Area Fire || {{hl|Land_SPE_FX_Area_Fire}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| prepT
|  
|  
|-
|-
| Roof Fire || {{hl|Land_SPE_FX_Roof_Fire}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| drwCB
|  
|  
|-
|-
| Smoke Medium || {{hl|Land_SPE_FX_Smoke_Medium}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| oPasD
|  
|  
|-
|-
| Fire Burst || {{hl|Land_SPE_FX_Fire_Burst}} || style="text-align:right;" | 500 m  || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Checked}}
| o1Drw
|  
|  
|-
|-
| Smog Big || {{hl|Land_SPE_FX_Smog_Big}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| lckDnBf
|  
|  
|-
|-
| Smog Night || {{hl|Land_SPE_FX_Smog_Night}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| prpTx
|  
|  
|-
|-
| Big Fire || {{hl|Land_SPE_FX_Big_Fire}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| inst
|  
|  
|-
|-
| Small Flame || {{hl|Land_SPE_FX_small_flame_02}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| stpSctnTL
|  
|  
|-
|-
| Light 100 m Illumination || {{hl|Land_SPE_FX_light_100}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| o1ShV
|  
|  
|-
|-
| Light 300 m Illumination || {{hl|Land_SPE_FX_light_300}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| scSVI
|  
|  
|-
|-
| Big Fire Burning Sound || {{hl|Land_SPE_FX_burning_sound_big}} || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Unchecked}}
| oPas3
|  
|  
|-
|-
| Night Clouds linked to Player || {{hl|Land_SPE_FX_night_clouds}} || style="text-align:right;" | 2000 m || style="text-align:center;" | {{Icon|Unchecked}} || style="text-align:center;" | {{Icon|Unchecked}}
| sssmC
|  
|  
|-
|-
| Artillery Sky Lights || {{hl|Land_SPE_FX_artillery_sky_lights}} || style="text-align:right;" | 2000 m || style="text-align:center;" | {{Icon|Unchecked}} || style="text-align:center;" | {{Icon|Unchecked}}
| sbDrw
|  
|  
|-
|-
| Artillery Ground Lights || {{hl|Land_SPE_FX_artillery_ground_lights}} || style="text-align:right;" | 2000 m || style="text-align:center;" | {{Icon|Unchecked}} || style="text-align:center;" | {{Icon|Unchecked}}
| aniMt
|  
|  
|-
|-
| Binaural Battle Sounds || Land_SPE_FX_binaural_battle_sounds|| style="text-align:right;" | 2000 m || style="text-align:center;" | {{Icon|Unchecked}} || style="text-align:center;" | {{Icon|Unchecked}}
| ppSSSM
|  
|  
|-
|-
| Low Fog || Land_SPE_FX_low_fog || style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Checked}}
| drwROM
|  
|  
|-
|-
| Ground Fog linked to Player || Land_SPE_FX_player_fog|| style="text-align:right;" | 2000 m || style="text-align:center;" | {{Icon|Unchecked}} || style="text-align:center;" | {{Icon|Unchecked}}
| drwIn
|  
|  
|-
|-
| Line of Fire || Land_SPE_FX_line_of_fire|| style="text-align:right;" | 500 m || style="text-align:center;" | {{Icon|Checked}} || style="text-align:center;" | {{Icon|Checked}}
| wDraw
|  
|  
|-
|-
| Wreck Fire || Land_SPE_FX_wreck_fire || style="text-align:right;" | {{Icon|Unknown}} m || style="text-align:center;" | {{Icon|Unknown}} || style="text-align:center;" | {{Icon|Unknown}}
| 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
|  
|  
|}
|}
<sqf>
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);
</sqf>
== See Also ==
* [[Code Optimisation]]
* [[Mission Optimisation]]
[[Category:Arma Scripting Tutorials]]

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