Page MenuHomeFeedback Tracker

createVehicle first time cause massiv performance
New, NormalPublic

Description

If you use the command createVehicle it produces at the first time a massive performance usage of the current class you spawn.
The milliseconds to spawn it are 4 - 70 times as long as after the object is spawned once.
The issue cases every object if you spawn it for the first time.
The issue is client side for every player, hc and server.

So an example, if you spawn this class "B_Plane_Fighter_01_F" in VR on the debug consol with createVehicle it takes for the first time more than 6.8 ms, after it was spawnt and delete or is staying there, the next 100 spawns it is between 0.9 - 1.2 ms.

I think maybe it has to do with the class init event handler, but why is it only on the first spawn?

For mission makers who create missions, like CTI, where you spawn and despawn a lot of objects to balance the FPS on the whole map, it is important to not have a massive lag, when a objects spawn who was not on the map.

My workaround for round about 3 years is to spawn the most objects I use in the mission once time client side, so I don't have the massive spawn lag.

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
Windows 10 Home 19045.5011
Category
Scripting
Steps To Reproduce
  • go to eden editor and open VR map
  • place a unit (don't us the unit class later)
  • start the game (single or mp)
  • open the debug consol
  • insert this code
test_fps = diag_codePerformance [{

    test_veh = createVehicle ["B_Plane_Fighter_01_F",[0,0,0]]

},[],1]
  • you can see the milliseconds in debug output under variable test_veh
  • now delete the vehicle or add some meters between the other vehicle or auto at some meters for spawn more vehicles
  • insert again the code
test_fps = diag_codePerformance [{

    test_veh = createVehicle ["B_Plane_Fighter_01_F",[0,0,0]]

},[],1]

you can now see the different.

Additional Information
  • if you place the vehicle before on the map and start the mission, nothing is different
  • it is with every object (weapons, ai units, etc.)
  • this is a problem who is very old, but now I have enough infos and the time to give you the infos
  • with mods (cba, ace, TFAR, etc.) the spawn milliseconds can rise to very high numbers, maybe the class init eventhandler system is not really good for the modders we have. They use it to extended, or we can change it to more frames/work cores when you create the vehicle.
  • arma 3 stable version is used

Event Timeline

MBMC created this task.Thu, Nov 7, 7:17 PM
MBMC changed Severity from Trivial to None.Thu, Nov 7, 7:22 PM