Jump to content
gc8

Faster than logic

Recommended Posts

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

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

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
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
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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×