Lou Montana/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search

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