Mission Optimisation: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "[[Arma 3 Task Framework" to "[[Arma 3: Task Framework") |
Lou Montana (talk | contribs) m (Text replacement - "{{colorball" to "{{Colorball") |
||
Line 47: | Line 47: | ||
{{Informative| | {{Informative| | ||
: {{ | : {{Colorball|red|1.125}} means a heavy impact on performance<br> | ||
: {{ | : {{Colorball|orange|1.125}} means an average impact<br> | ||
: {{ | : {{Colorball|green|1.125}} means little to no performance impact. | ||
}} | }} | ||
Line 61: | Line 61: | ||
| | | | ||
==== AI unit quantity ==== | ==== AI unit quantity ==== | ||
| {{ | | {{Colorball|red}} | ||
| {{ | | {{Colorball|green}} | ||
| {{ | | {{Colorball|orange}} | ||
| | | | ||
* Use [[createAgent|Agents]] whenever possible | * Use [[createAgent|Agents]] whenever possible | ||
Line 73: | Line 73: | ||
| | | | ||
==== Object quantity ==== | ==== Object quantity ==== | ||
| {{ | | {{Colorball|orange}} | ||
| {{ | | {{Colorball|orange}} | ||
| {{ | | {{Colorball|orange}} | ||
| The less objects, the more FPS you will have. | | The less objects, the more FPS you will have. | ||
* Lower the quantity of objects in the mission, such as: | * Lower the quantity of objects in the mission, such as: | ||
Line 96: | Line 96: | ||
==== General script mistakes ==== | ==== General script mistakes ==== | ||
| {{ | | {{Colorball|orange}} | ||
| {{ | | {{Colorball|green}} | ||
| {{ | | {{Colorball|green}} | ||
| Having too many scripts running is a cause for severe performance issues and execution delays in singleplayer as well as multiplayer. | | Having too many scripts running is a cause for severe performance issues and execution delays in singleplayer as well as multiplayer. | ||
* You can track the number of running scripts using [[diag_activeScripts]]; you can also use: | * You can track the number of running scripts using [[diag_activeScripts]]; you can also use: | ||
Line 115: | Line 115: | ||
| | | | ||
==== High-frequency scripts ==== | ==== High-frequency scripts ==== | ||
| {{ | | {{Colorball|red}} | ||
| {{ | | {{Colorball|green}} | ||
| {{ | | {{Colorball|green}} | ||
| Checking a condition too often is usually a source of poor performance. Does your code execution need to be frame-perfect, or can you afford a delay of a few seconds? | | Checking a condition too often is usually a source of poor performance. Does your code execution need to be frame-perfect, or can you afford a delay of a few seconds? | ||
* A [[while]]-loop checking without a minimum loop-[[sleep]] time is usually a sign of bad conception.<!-- | * A [[while]]-loop checking without a minimum loop-[[sleep]] time is usually a sign of bad conception.<!-- | ||
Line 129: | Line 129: | ||
| | | | ||
==== High-frequency network messages ==== | ==== High-frequency network messages ==== | ||
| {{ | | {{Colorball|orange}} | ||
| {{ | | {{Colorball|green}} | ||
| {{ | | {{Colorball|red}} | ||
| | | | ||
* Use [[publicVariable]] wisely; for specific cases, consider [[publicVariableServer]] / [[publicVariableClient]] | * Use [[publicVariable]] wisely; for specific cases, consider [[publicVariableServer]] / [[publicVariableClient]] | ||
Line 142: | Line 142: | ||
| | | | ||
==== Unscheduled code ==== | ==== Unscheduled code ==== | ||
| {{ | | {{Colorball|red}} | ||
| {{ | | {{Colorball|green}} | ||
| {{ | | {{Colorball|green}} | ||
| [[Scheduler#Unscheduled_Environment|Unscheduled code]] can have a high impact on the framerate, as such code is not subject to the [[Scheduler|scheduler]]'s management (as its name suggests) and will run without limitation. Cyclic unscheduled low-performance code can make the game unplayable, up to freezing it. | | [[Scheduler#Unscheduled_Environment|Unscheduled code]] can have a high impact on the framerate, as such code is not subject to the [[Scheduler|scheduler]]'s management (as its name suggests) and will run without limitation. Cyclic unscheduled low-performance code can make the game unplayable, up to freezing it. | ||
* As only time-critical scripts should run unscheduled, [[spawn]] any other code from unscheduled environment once you have the required results:<!-- | * As only time-critical scripts should run unscheduled, [[spawn]] any other code from unscheduled environment once you have the required results:<!-- |
Revision as of 05:46, 2 January 2021
Introduction
This article will try to be a general guide about improving your mission's performance.
As usual, moderation is the key; do not expect to find on this page a magical solution that makes it possible to run thousands of AI at 144 FPS. Everything comes at a cost, the tweaks here will simply allow you to locate issues and calibrate your mission properly.
Before anything
Before optimising anything, make sure you do not have any performance issue running the game itself:
- Open the editor, place a unit in the area you like and test your computer.
- You can get current FPS in Arma 3 by going into video options or using diag_fps
- Steam allows you to display FPS in a screen corner, in Settings > In game > FPS Counter
- Use (unofficial) Performance Guides to get better performances:
- Play your mission in singleplayer. If your mission runs fine, its network messages might very well be the issue. See Multiplayer Scripting for good practice tips.
- Usual bottlenecks:
- Lower your graphical settings (resolution, textures). If you get way better performances, at least your GPU limits you.
- If the game keeps having low FPS when running @ 1024×768/low textures then your CPU is most likely the issue. Mission scripts may be performance-hogging too.
Creating your mission
- Be sure to create your scripts with the latest available commands and functions.
- In Arma 3 use remoteExec / remoteExecCall and DITCH BIS_fnc_MP FOR GOOD! See Arma 3 Remote Execution for more information.
- In Arma 2 network communication is done using the Arma 2: Multiplayer Framework.
- Use the available frameworks and functions for each topic, unless you replace them by third-party ones:
Performance impact table
Topic | CPU | GPU | Net- work |
Solution |
---|---|---|---|---|
AI unit quantity |
| |||
Object quantity |
The less objects, the more FPS you will have.
| |||
General script mistakes |
Having too many scripts running is a cause for severe performance issues and execution delays in singleplayer as well as multiplayer.
| |||
High-frequency scripts |
Checking a condition too often is usually a source of poor performance. Does your code execution need to be frame-perfect, or can you afford a delay of a few seconds?
| |||
High-frequency network messages |
| |||
Unscheduled code |
Unscheduled code can have a high impact on the framerate, as such code is not subject to the scheduler's management (as its name suggests) and will run without limitation. Cyclic unscheduled low-performance code can make the game unplayable, up to freezing it. |
What else?
If you have applied all these recommendations and your mission still doesn't run well in multiplayer (but does in singleplayer), it might be caused by mods that you are running which could be badly, or not at all, optimised.
If you want to be sure, run the same mission with and without mods. If you have a big difference in performance, look no further.
Performance Diagnostic tools
Server commands
- #monitor 5
- Shows performance information of the server. Interval 0 means to stop monitoring.
- #monitords 5
- Shows performance information in the dedicated server console. Interval 0 means to stop monitoring. (since Arma 3 v1.64)
Diagnostic commands
All builds | Diagnostic build only |
---|---|