Jump to content
Sign in to follow this  
1para{god-father}

Some advise on clearing map / Lag

Recommended Posts

Ok guys have a issue with game lag , and no idea why.

I have about 20ish players on a dedi server, when we start the mission it has no lag what so ever.

I spawn group in and am using UPSMON , and have about 6 tasks - so once task 1 is resolved i spawn in the nest task groups.

The issue is that about 1 hour into the game we start to get lag , i am using "delete:",200 in UPSMON to clear up the dead , and also have the garbage collector function on , to clear up any that if have put in the editor.

Any idea why I would be getting lag later on in a game, I can only put it down to the map not cleaning up? But it should be!

This seems to happen top all my missions

Any suggestions how to resolve this

Share this post


Link to post
Share on other sites

are you sure UPSMON deletes after 200?

try a test with delete 60 or somethng and kill them all and wait for the delete.

Does this happen also in missions not using UPSMON?

Maybe do a test mission without it to confirm or deny UPSMON involvement.

Otherwise, maybe its a server setting, but i cant help there since i know very little about it.

Share this post


Link to post
Share on other sites

Are you by chance spawning Aditional Groups into the Mission Outside of Module use? (IE Bis_Func or CreateVehicle)? I have seen units become De-grouped and wander resulting in a failure to be collected. Espicially if these Units Are synched in JIP it can be a problem (global Vs Local). I'm not a Server expert but In my scriptig projects i have been asked to spawn enemys from a Module local to the SERVER for that reason.

Edit: Since i dont have the full details on the configuration of your server, Modules & arrays, and scripts that are creating units i can only take a guess.

Edited by xALIENAx

Share this post


Link to post
Share on other sites

Thanks guys,

They all delete no problem when using UPSMON so UPSMON is not the issue, yes I do spawn other groups in using the BIS_fnc_spawnGroup , but they should be cleared up by the Garbage collector ?

It just seems the longer we play the more lag we get, sometimes we have to stop reset the game and activate the last task and it runs great again.

We do not really have too many JIP will have a look at the server log to see if I can see anything

Share this post


Link to post
Share on other sites

Do you have any Players on the Other side? (possibility of escaping server side collection if local to a client's machine?)

UPSMON is normally pretty good about cleaning up so i didnt think that would be an issue. Only thing i can think of other then Un-collected units is maybe poor mission design (storing and checking a crud load of variables no longer needed?). I know DOMINATION has an issue due to it's complexity where an eventual server reset is almost inevitable (atleast the version we were using)

Share this post


Link to post
Share on other sites

Yes that could be the case, If say i spawn a group using BIS_fnc_spawnGroup how would i make sure they are deleted after they are all dead ?

Also would it help if i delete old trigger that are not needed anymore ?

Share this post


Link to post
Share on other sites
Yes that could be the case, If say i spawn a group using BIS_fnc_spawnGroup how would i make sure they are deleted after they are all dead ?

Also would it help if i delete old trigger that are not needed anymore ?

Anytime you can Get rid of anything un-needed that helps (even kill (stop) scripts no longer needed). I believe if you execute spawngroup remotely you must define that group for collection. Im mostly a coder not a mission maker so i'll have to look into that before i can say for sure what the limitations of garbage collector are...

The best way to do it in general is to work the mission so that any post init units (spawned units) are spawned from a module local to the server (nothing exectued client side, Plus you can define all your Groups in the module. its alot cleaner way to do things)

Share this post


Link to post
Share on other sites

deleteVehicle is a global command working on all clients.

a simple script would ensure proper deletion of all units.

Share this post


Link to post
Share on other sites

Thanks,

So i could use a trigger around the area and when i leave activate it with something like:-

Trigger name :- clean_task1 500x500

{deletevehicle _x} foreach (list clean_task1);

That should then delete eveything in the area ?

Share this post


Link to post
Share on other sites
deleteVehicle is a global command working on all clients.

a simple script would ensure proper deletion of all units.

Thanks for clearing that up.. Like I said im not the server/Map maker soo i wasnt sure about the network side of things :)

Share this post


Link to post
Share on other sites
Thanks,

So i could use a trigger around the area and when i leave activate it with something like:-

Trigger name :- clean_task1 500x500

{deletevehicle _x} foreach (list clean_task1);

That should then delete eveything in the area ?

problem here is that dead units will not show in triggerlist, so you would need a script instead for them, but yeah that would work.

whenever you spawn any object or unit, it would be best if you just added it to a array and then deleted from that array after a said time of death or for example player is far away or a mision is failed or completed, whatever suits your mission best ofc.

_unit =  createUnit............................................blahblah..
// spawning a small thread waiting for unit to die or a variable to become true.
_null = _unit spawn {
  waitUntil {sleep 1; !alive _unit OR missionCompleted};
  sleep 200;
  deleteVehicle _unit;
};

Thanks for clearing that up.. Like I said im not the server/Map maker soo i wasnt sure about the network side of things :)

the precence of units is localised, meaning AI in a player group lead by player is local to that player, but afaik, allUnits command returns all alive units no matter client, so a script checking allUnits and deleting them after death with deleteVehicle should work on any server or SP mission.

while {true} do {
_all = allUnits;
waitUntil {(count _all) != (count allUnits)};
{if (!alive _x) then {deleteVehicle _x};} foreach _all;
};

one can add timers and vehicles etc, but best practice anyhow is to track all new units you spawn and delete them when needed or desired.

after looking more into this i have been working on a more advanced cleaning script, probably several out there but i like learning this way, even if i reinvent the wheel.

will post it later tonight hopefully, when i get more time to work on it.

Edited by Demonized

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
Sign in to follow this  

×