gc8 981 Posted February 22, 2020 Hi I have been using the Logic object as group member so that my empty groups wont get deleted (it's a group spawn thing) but I noticed that even Logic object doesn't sound like performance heavy object it too needs to be processed and causes lag. I found that using _enablesimulation false; on the logics reduces lag so I wanted to ask does anyone know if there's faster way of doing this? Or is using logic object my only option? Test code (Laggy): _g = creategroup west; for "_i" from 0 to 2000 do { private _l = _g createUnit ["Logic", [1000,1000,0], [], 0, "NONE"]; // _l enablesimulation false; }; thx! Share this post Link to post Share on other sites
Rydygier 1317 Posted February 22, 2020 Check alternative syntax for createGroup. It allows you to decide, if empty group should be deleted or not. Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted February 22, 2020 You could also use deleteGroupWhenEmpty. Cheers Share this post Link to post Share on other sites
gc8 981 Posted February 22, 2020 Is it certain the group will not be deleted if I set it not to? The wiki says "Other engine group auto-deletion mechanisms in place are not affected by this." in deleteGroupWhenEmpty page. So I thought it might still get deleted, hope I'm wrong. Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted February 22, 2020 1 hour ago, gc8 said: Is it certain the group will not be deleted if I set it not to? The wiki says "Other engine group auto-deletion mechanisms in place are not affected by this." in deleteGroupWhenEmpty page. So I thought it might still get deleted, hope I'm wrong. I guess that refers to the garbage collector. You can always test stuff. Cheers Share this post Link to post Share on other sites
gc8 981 Posted February 22, 2020 10 minutes ago, Grumpy Old Man said: I guess that refers to the garbage collector. You can always test stuff. Cheers Yeah was thinking the same :) I will test soon as I get the time Share this post Link to post Share on other sites
gc8 981 Posted February 22, 2020 Ok I made a test and it seems to work fine. This is what I tried: for "_i" from 0 to 500 do { _g = creategroup west; _g deleteGroupWhenEmpty false; }; _startGroups = +allgroups; while { true } do { hintSilent format["%1 %2 %3", count _startGroups, count allgroups, {!isnull _x} count _startGroups ]; // prints 288 288 288 // Keep creating groups _g = creategroup west; systemchat format ["new: %1", _g]; _g deleteGroupWhenEmpty false; sleep 1; }; It creates lots of groups (over the max limit) and prints what is expected... Ran the test about 5 minutes.. so it could still be there is garbage collector after x mins Share this post Link to post Share on other sites