Page MenuHomeFeedback Tracker

Dynamic Simulation Does Not Wake Up When Units Are Teleported Near Triggering Entities
New, NormalPublic

Description

If a dynamically simulated group is outside of the simulation radius for a triggering entity (a player), and that group is teleported to be within the radius of a triggering entity, dynamic simulation will not trigger a wake up of the group's simulation.

The group will be simulated normally, however, if it is the triggering entity that is teleported to the dynamically simulated group.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
Engine
Steps To Reproduce
  1. Make a mission in VR space with a player object and a debug console.
  2. Execute the following test script in the debug console.
[] spawn {
	/* ----------------------------------------------------------------------------
		Setup
	---------------------------------------------------------------------------- */
	#define INITIAL_SPAWN_DISTANCE 550
	#define DYNAMIC_SIMULATION_DISTANCE 500
	#define ENEMY_UNIT_TYPE "O_Soldier_F"
	#define SLEEP_TIME 0.1

	player setDir 0;
	player allowDamage false;
	player setCaptive true;
	player triggerDynamicSimulation true;

	enableDynamicSimulationSystem true;
	"IsMoving" setDynamicSimulationDistanceCoef 1;
	"Group" setDynamicSimulationDistance DYNAMIC_SIMULATION_DISTANCE;

	private _enemySpawnPosition = player getPos [INITIAL_SPAWN_DISTANCE,0];
	private _enemyGroup = createGroup opfor;
	private _enemyUnit = _enemyGroup createUnit [ENEMY_UNIT_TYPE,_enemySpawnPosition,[],0,"NONE"];


	/* ----------------------------------------------------------------------------
		Test
	---------------------------------------------------------------------------- */
	private _wasSimulatedBeforeDynamicSimulationWasEnabled = simulationEnabled _enemyUnit;
	sleep SLEEP_TIME;

	_enemyGroup enableDynamicSimulation true;
	sleep SLEEP_TIME;

	private _wasSimulatedAfterDynamicSimulationWasEnabled = simulationEnabled _enemyUnit;
	sleep SLEEP_TIME;

	player setPosASL ((getPosASL _enemyUnit) vectorDiff [0,5,0]);
	player setDir 0;
	sleep SLEEP_TIME;

	private _wasSimulatedAfterPlayerWasTeleportedToEnemy = simulationEnabled _enemyUnit;
	sleep SLEEP_TIME;

	player setPosASL (AGLToASL (_enemyUnit getPos [INITIAL_SPAWN_DISTANCE,180]));
	player setDir 0;
	sleep SLEEP_TIME;

	private _wasSimulatedAfterPlayerWasTeleportedAwayFromEnemy = simulationEnabled _enemyUnit;
	sleep SLEEP_TIME;

	_enemyUnit setPosASL ((getPosASL player) vectorAdd [0,5,0]);
	sleep SLEEP_TIME;

	private _wasSimulatedAfterBeingTeleportedToPlayer = simulationEnabled _enemyUnit;
	deleteVehicle _enemyUnit;
	deleteGroup _enemyGroup;
	enableDynamicSimulationSystem false;


	/* ----------------------------------------------------------------------------
		Output
	---------------------------------------------------------------------------- */
	if !(_wasSimulatedBeforeDynamicSimulationWasEnabled) exitWith {
		hint "--FAILED: Expected simulation of enemy unit BEFORE enabling Dynamic Simulation to be TRUE";
	};

	if (_wasSimulatedAfterDynamicSimulationWasEnabled) exitWith {
		hint "--FAILED: Expected simulation of enemy unit AFTER enabling Dynamic Simulation to be FALSE";
	};

	if !(_wasSimulatedAfterPlayerWasTeleportedToEnemy) exitWith {
		hint "--FAILED: Expected simulation of enemy unit after player was teleported CLOSE to the enemy unit, to be TRUE";
	};

	if (_wasSimulatedAfterPlayerWasTeleportedAwayFromEnemy) exitWith {
		hint "--FAILED: Expected simulation of enemy unit after player was teleported AWAY from the enemy unit, to be FALSE";
	};

	if !(_wasSimulatedAfterBeingTeleportedToPlayer) exitWith {
		hint "--FAILED: Expected simulation of enemy unit after being teleported to player, to be TRUE";
	};

	hint "Test Passed!";
};

Expected:

  • See hint "Test Passed!"

Observed:

  • See hint "--FAILED: Expected simulation of enemy unit after being teleported to player, to be TRUE"

Event Timeline

Ansible2 created this task.Dec 18 2023, 1:54 AM
Ansible2 renamed this task from Dynamic Simulation Does Not Wake Up When Units Are Teleported Near Trigger Entities to Dynamic Simulation Does Not Wake Up When Units Are Teleported Near Triggering Entities.