Lou Montana/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Cleaning)
Tag: Replaced
Line 1: Line 1:
{{SideTOC}}
== Introduction ==
This article will try to be a general guide about improving your '''mission's''' code '''and''' its performance.
{{ Informative | This page is about [[Mission Optimisation]]. For ''scripting'' optimisation, see [[Code Optimisation]]. }}
{{ Informative | '''See also [[Multiplayer Scripting]]'''. }}
== Creating your mission ==
* Be sure to create your scripts with the latest available commands.
** In {{arma3}} '''DITCH [[BIS_fnc_MP]] FOR GOOD''' and use [[remoteExec]] / [[remoteExecCall]] instead! See [[Arma 3 Remote Execution]].
** In {{arma2}} '''ONLY''' use the [[Multiplayer framework]].
* Use the available frameworks
** [[Arma 3 Task Framework]]
<!--
== Improving without breaking ==
-->
== ''Moar FPS!!1!'' ==
* AI will eat their host's CPU:
** Use agents whenever possible
** If a client has a low-end machine, they shouldn't lead a group of many AIs as these would then be locally computed.
** [[Arma 3 Dynamic Simulation]] allows you to freeze AI that are distant from players. Many distance settings should be set according to the mission.
** [[Arma 3 Simple Objects|Simple Objects]]
* Less objects = more FPS
** Less mission objects
** Less weapon items / HMD / backpacks = less proxies (item position is calculated)
** Delete dead bodies / wreckages
* [[viewDistance|View distance]]
* Triggers check their condition every 0.5 second (hardcoded value). If you don't need such precision, use a [[while]]-loop script.
{{ Informative | Most if not all of the '''mission''' calculation (objectives, completion distance, etc.) must be done '''server-side'''. Local effects should be calculated '''client-side'''. }}
=== Server-side FPS ===
* The server should be considered as a powerful machine from a scripting point of view; .
* If you own more than one average computers, you could consider [[Arma 3 Headless Client|Headless client]] and coding accordingly.
=== Client-side FPS ===
==== Script optimisation ====
* Don't [[publicVariable]] at a high rate
* Don't spawn many objects
* Client [[viewDistance|view distance]] can be set separately from the server's value through scripting. This can make or break performance for the client.
==== Configuration optimisation ====
* If the client has issues playing in singleplayer, it is most likely that his hardware configuration is not up to the game's current settings, and will encounter even more issues in multiplayer.
*
== Off-the-shelf script ==
<code>_unit [[removePrimaryWeaponItem]] "acc_pointer_IR";
_unit [[removePrimaryWeaponItem]] "acc_flashlight";
[[if]] ([[sunOrMoon]] == 1) { _unit [[unlinkItem]] [[hmd]] _unit; };
</code>
== What's next? ==
* drop unoptimised mods
[[Category: Scripting Topics]]
[[Category:Sandbox]]
[[Category:Sandbox]]

Revision as of 17:09, 25 June 2019

Template:SideTOC

Introduction

This article will try to be a general guide about improving your mission's code and its performance.

This page is about Mission Optimisation. For scripting optimisation, see Code Optimisation.


Creating your mission

Moar FPS!!1!

  • AI will eat their host's CPU:
    • Use agents whenever possible
    • If a client has a low-end machine, they shouldn't lead a group of many AIs as these would then be locally computed.
    • Arma 3 Dynamic Simulation allows you to freeze AI that are distant from players. Many distance settings should be set according to the mission.
    • Simple Objects
  • Less objects = more FPS
    • Less mission objects
    • Less weapon items / HMD / backpacks = less proxies (item position is calculated)
    • Delete dead bodies / wreckages
  • View distance
  • Triggers check their condition every 0.5 second (hardcoded value). If you don't need such precision, use a while-loop script.
Most if not all of the mission calculation (objectives, completion distance, etc.) must be done server-side. Local effects should be calculated client-side.

Server-side FPS

  • The server should be considered as a powerful machine from a scripting point of view; .
  • If you own more than one average computers, you could consider Headless client and coding accordingly.

Client-side FPS

Script optimisation

  • Don't publicVariable at a high rate
  • Don't spawn many objects
  • Client view distance can be set separately from the server's value through scripting. This can make or break performance for the client.

Configuration optimisation

  • If the client has issues playing in singleplayer, it is most likely that his hardware configuration is not up to the game's current settings, and will encounter even more issues in multiplayer.


Off-the-shelf script

_unit removePrimaryWeaponItem "acc_pointer_IR"; _unit removePrimaryWeaponItem "acc_flashlight"; if (sunOrMoon == 1) { _unit unlinkItem hmd _unit; };


What's next?

  • drop unoptimised mods