It seems like deleteVehicle can't handle super-simple objects properly.
Not only does it cause abnormal freezes, it seems there are also some "side-effects".
For example, deleting a super-simple pond object never deletes its "water", so you will end up hitting invisible water.
Description
Details
- Severity
- Minor
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 10 x64
- Category
- Scripting
To test, just use the "code performance" button in debug console to run the code many times:
Simple object: No freeze; returns ~0.3 ms
deleteVehicle(createSimpleObject ["Land_Axe_F", [0,0,10]]);
Super simple object: returns 0.017 ms, but the game freezes for several seconds during the execution.
deleteVehicle(createSimpleObject ["A3\Structures_F\Items\Tools\Axe_F.p3d", [0,0,10]]);
Event Timeline
Do you actually have a valid situation where this is a problem?
outside of running it in diag_codePerformance?
Freeze happens when you delete hundreds/thousands of objects in a single frame and you have thousands of objects in the same position.
When does that legitimately happen in normal gameplay outside of performance testing?
Normal objects have the exact same issue.
Spawn thousands of them in the same spot, and delete tons of them within a single frame -> Game freezes.
Its just more pronounced with simple objects, because your test spawns way more simple objects before codePerformance timelimit runs out. Normal objects are more expensive and gets fewer objects done before the timelimit runs out.
Considering that this basically never happens in normal gameplay, I think its not worth the time investment
The pond is special case it is broken left right and center hence not officially supported in A3
LouMontana closed this task as Resolved.Mon,
LouMontana changed Resolution from Open to Not A Bug.
It is a valid bug. We have a big inefficiency in object deletion.
I just think its not worth fixing this.