enableSimulation: Difference between revisions

From Bohemia Interactive Community
m (setPos link)
m (Some wiki formatting)
 
(69 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
|version2= 1.50


|arg= global |= Arguments in MP
|game3= tkoh
|version3= 1.00


|eff= local |= Effects in MP
|game4= arma3
____________________________________________________________________________________________
|version4= 0.50


| Enable / disable simulation for given entity. |= Description
|arg= global
____________________________________________________________________________________________


| entity '''enableSimulation''' state|= Syntax
|eff= local


|p1= entity: [[Object]] |= Parameter 1
|gr1= Object Manipulation


|p2= state: [[Boolean]] |= Parameter 2
|descr= Enables / disables simulation for the given entity, e.g its animation and physics; it will still be able to take damage and report enemies.
This command will affect entity simulation only [[local|locally]].
For a global and JIP enabled alternative, see [[enableSimulationGlobal]].


| [[Nothing]] |= RETURNVALUE
|s1= entity [[enableSimulation]] state


|p1= entity: [[Object]]


|x1= <code>player [[enableSimulation]] false;</code>|= EXAMPLE1
|p2= state: [[Boolean]]


____________________________________________________________________________________________
|r1= [[Nothing]]


| [[enableSimulationGlobal]], [[simulationEnabled]] |= SEEALSO
|x1= <sqf>player enableSimulation false;</sqf>


|mp=This command only works locally and must be run on all machines to have global affect.|= MPBEHAVIOUR
|seealso= [[enableSimulationGlobal]] [[simulationEnabled]] [[enableDynamicSimulationSystem]] [[dynamicSimulationSystemEnabled]] [[enableDynamicSimulation]] [[dynamicSimulationEnabled]] [[setDynamicSimulationDistance]] [[dynamicSimulationDistance]] [[setDynamicSimulationDistanceCoef]] [[dynamicSimulationDistanceCoef]] [[triggerDynamicSimulation]] [[canTriggerDynamicSimulation]]
____________________________________________________________________________________________
}}
}}


<h3 style='display:none'>Notes</h3>
{{Note
<dl class='command_description'>
|user= Tyrspawn
<!-- Note Section BEGIN -->
|timestamp= 20110720043900
<dd class="notedate">Posted on 15 July, 2009 - 00:16 (CEST)
|text= {{Feature|informative|The following only applies to {{arma2}} before a certain patch, in which such changes have been integrated in the game code.}}
<dt class="note">[[User:Lou Montana|Lou Montana]]
Nou/Jaynus have discovered something quite important about the {{arma2}} engine:
<dd class="note">
*enableSimulation will "freeze" the unit, including animations, eye blinking, etc ; you cannot switchMove or playMove.
*the unit can still take damages and report status and enemies by radio.


 
Orient yourself to the enableSimulation command in {{arma2}}:
<dd class="notedate">Posted on 19 July, 2011
<dt class="note">[[User:Krause|Krause]]
<dd class="note">
Nou/Jaynus have discovered something quite important about the Arma2 engine:
 
Orient yourself to the enableSimulation command in ARMA 2:


If simulation is disabled on objects (this enablesimulation false), they do not send updates across the network, drastically reducing traffic across the network by an order of magnitude. What this means in practicality is that it is possible to have huge mission maker created cities with no or negligible impact on mission performance. Mission placed objects is the most common cause of performance woes - so this is huge news, and was previously undocumented, both on the BIS wiki and elsewhere.
If simulation is disabled on objects (this enablesimulation false), they do not send updates across the network, drastically reducing traffic across the network by an order of magnitude. What this means in practicality is that it is possible to have huge mission maker created cities with no or negligible impact on mission performance. Mission placed objects is the most common cause of performance woes - so this is huge news, and was previously undocumented, both on the BIS wiki and elsewhere.
Line 59: Line 53:


This also has importance in a technical sense: bandwith is the most significant factor in mission performance. The lower the server bandwith, the better the performance.  
This also has importance in a technical sense: bandwith is the most significant factor in mission performance. The lower the server bandwith, the better the performance.  
}}


{{Note
|user= Rocket
|timestamp= 20110908142000
|text= Objects with disabled simulation are not calculated for lightsources beyond the global light (moon/sun), so any light sources you create will not light them.
}}


<dd class="notedate">Posted on 9 Sept, 2011
{{Note
<dt class="note">[[User:Rocket|Rocket]]
|user= Killzone_Kid
<dd class="note">
|timestamp= 20141021153300
Objects with disabled simulation are not calculated for lightsources beyond the global light (moon/sun), so any light sources you create will not light them.
|text = Units that have been previously subjected to [[enableSimulation]] false; or [[enableSimulationGlobal]] false; may stay unrecognised for a long time even after simulation was re-enabled, returning [[objNull]] as [[cursorTarget]]. Force revealing units with [[reveal]] command usually solves the problem. For example:
<sqf>{ player reveal _x } forEach allUnits;</sqf>
}}


{{Note
|user= Waffle SS.
|timestamp= 20150523162800
|text= After using '''enableSimulation''' [[false]] or [[enableSimulationGlobal]] [[false]] on an object, [[setPos]] will still update its position across the network in MP.
}}


<dd class="notedate">Posted on 12 Nov, 2011
{{Note
<dt class="note">[[User:HomerJohnston|HomerJohnston]]
|user= Pierre MGI
<dd class="note">
|timestamp= 20151202185500
Contrary to Krause's suggestions above, using "this enableSimulation False" on '''static objects''' has '''no effect''' on a dedicated server's bandwidth usage or FPS (as per current 1.59 Release version).
|text= After using enableSimulation false or enableSimulationGlobal false on a vehicle (car, helo), don't forget to re-enable simulation on this vehicle before a player jumps into it. Otherwise, he will be stuck in it, with a black screen and no way to escape!
}}


<dd class="notedate">Posted on 8 May, 2012
{{Note
<dt class="note">[[User:Krause|Krause]]
|user= Demellion
<dd class="note">
|timestamp= 20160901165200
re: Homer.
|text= Since '''{{arma3}} 1.56''' the object can also be returned with [[cursorObject]] even if the simulation is not enabled.
 
}}
Yep. That's because this functionality is now part of the basic arma netcode. Pretty nice :)
 
 
<!-- Note Section END -->
</dl>
 
<h3 style='display:none'>Bottom Section</h3>
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on October 3, 2014 - 21:45 (UTC)</dd>
<dt class="note">[[User:DreadedEntity|DreadedEntity]]</dt>
<dd class="note">
Units with disabled simulation will not be affected by gravity.
</dd>
</dl>
<!-- DISCONTINUE Notes -->
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on October 21, 2014 - 15:33 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
Units that have been previously subjected to [[enableSimulation]] false; or [[enableSimulationGlobal]] false; may stay unrecognised for a long time even after simulation was re-enabled, returning [[objNull]] as [[cursorTarget]]. Force revealing units with [[reveal]] command usually solves the problem. For example: <code>{[[player]] [[reveal]] _x} [[forEach]] [[allUnits]];</code>
</dd>
</dl>
<!-- DISCONTINUE Notes -->
 
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on May 23, 2015 - 16:28 (UTC)</dd>
<dt class="note">[[User:Waffle SS.|Waffle SS.]]</dt>
<dd class="note">
After using '''enableSimulation''' [[false]] or [[enableSimulationGlobal]] [[false]] on an object, [[setPos]] will still update its position across the network in MP.
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 16:58, 28 October 2025

Hover & click on the images for description

Description

Description:
Enables / disables simulation for the given entity, e.g its animation and physics; it will still be able to take damage and report enemies. This command will affect entity simulation only locally. For a global and JIP enabled alternative, see enableSimulationGlobal.
Groups:
Object Manipulation

Syntax

Syntax:
entity enableSimulation state
Parameters:
entity: Object
state: Boolean
Return Value:
Nothing

Examples

Example 1:
player enableSimulation false;

Additional Information

See also:
enableSimulationGlobal simulationEnabled enableDynamicSimulationSystem dynamicSimulationSystemEnabled enableDynamicSimulation dynamicSimulationEnabled setDynamicSimulationDistance dynamicSimulationDistance setDynamicSimulationDistanceCoef dynamicSimulationDistanceCoef triggerDynamicSimulation canTriggerDynamicSimulation

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Tyrspawn - c
Posted on Jul 20, 2011 - 04:39 (UTC)
The following only applies to Arma 2 before a certain patch, in which such changes have been integrated in the game code.

Nou/Jaynus have discovered something quite important about the Arma 2 engine:

Orient yourself to the enableSimulation command in Arma 2:

If simulation is disabled on objects (this enablesimulation false), they do not send updates across the network, drastically reducing traffic across the network by an order of magnitude. What this means in practicality is that it is possible to have huge mission maker created cities with no or negligible impact on mission performance. Mission placed objects is the most common cause of performance woes - so this is huge news, and was previously undocumented, both on the BIS wiki and elsewhere.

There are some quirks.

While an object which has enableSimulation false set on it will take damage, it will not display any animations or damage states until enableSimulation is enabled back onto it. If you want to disable simulation on a unit and then show it as dieing once it is hit or damaged, add an eventhandler onto it which enables simulation on the object when it is hit or killed. Hit handler for best visual, killed handler for best performance.

This discovery will be the basis of a new unit caching script by Jaynus.

This also has importance in a technical sense: bandwith is the most significant factor in mission performance. The lower the server bandwith, the better the performance.

Rocket - c
Posted on Sep 08, 2011 - 14:20 (UTC)
Objects with disabled simulation are not calculated for lightsources beyond the global light (moon/sun), so any light sources you create will not light them.
Killzone_Kid - c
Posted on Oct 21, 2014 - 15:33 (UTC)
Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example:
Waffle SS. - c
Posted on May 23, 2015 - 16:28 (UTC)
After using enableSimulation false or enableSimulationGlobal false on an object, setPos will still update its position across the network in MP.
Pierre MGI - c
Posted on Dec 02, 2015 - 18:55 (UTC)
After using enableSimulation false or enableSimulationGlobal false on a vehicle (car, helo), don't forget to re-enable simulation on this vehicle before a player jumps into it. Otherwise, he will be stuck in it, with a black screen and no way to escape!
Demellion - c
Posted on Sep 01, 2016 - 16:52 (UTC)
Since Arma 3 1.56 the object can also be returned with cursorObject even if the simulation is not enabled.