Jump to content
Sign in to follow this  
1n7r3p1d

Unexplained Performance in Mission on Dedicated. (Example Provided)

Recommended Posts

Hey guys,

So I've been slaving away on my first mission and have successfully uploaded the first version to a dedicated server. What follows is an explanation of the unique performance issue affecting this mission:

Periodically, with no overtly observable cause the mission will lag. This is not network lag, desynch of a decrease of server FPS which runs at 25-20ish fluidly throughout the mission. This is a clientside FPS drop to frames of 2-5 which lasts for a minute or more. From what I can tell something may be looping endlessly or else one of the modules I have placed on the map may be performing poorly.

Because this performance drop sometimes occurs near the beginning of the mission, some superstitious individuals have claimed that it is because of the number of objects I have present on spawn (which is under 100 placed in the 3d editor).

Some people have claimed it is because of too many AI (about 40 on map with more spawned via triggers)

Some people have claimed it is the ambient civilians module which is active.

I'm totally confused as to the cause of this poor performance. I am a novice at scripting and mission making but this mission (aside from the detail scripts/modules) is actually remarkably simple.

Since I know you have a problem here with people asking for help as a code-word for asking for somebody to design their dream mission I've decided to provide a .rar with the mission files inside them so you can check it out for yourselves.

What I'm ideally looking for is someone who knows more than I do to have a look at my files for me and/or test the mission out to diagnose the problem.

The mission does require ACE2/ACRE so just a heads up to anybody who is willing to help me.

Here's a link to the mission: http://www.easy-share.com/1916004722/CO23_Spur_Ride_v1.Takistan.rar

I personally suspect something is being looped in the Init that is hurting performance on JIP or possibly that there is a conflict between the ACE CSW 81mm mortar and the BIS version. Those are my two lines of inquiry.

Just incase thate's a more simple solution here's the init.sqf:

//////////////////////////////////////////////////////////////////
// Init.sqf
// Created by: Intrepid
//////////////////////////////////////////////////////////////////
[] execVM "scripts\tickets.sqf"; //Beta Ticket Script
[] execVM "scripts\playerDeath.sqf"; //Beta Ticket Script
[] execVM "vdg\VDG_init.sqf"; //Viewdistance Script

if (!(isNull player)) then  //non-JIP player
{
	[] execVM "briefing.sqf";
};

if (!isServer && isNull player) then  //JIP player
{waitUntil {!isNull player};
	[] execVM "briefing.sqf";
};	

if (isServer) then {
	[] execVM "scripts\statics\cob.sqs"; //spawns cob
	[] execVM "scripts\statics\sakhe.sqs"; //Spawns insurgent positions/cars
};

//Civilian kill counter
SHK_DeadCivilianCount = 0;
SHK_DeadCivilianLimit = 5;
SHK_EndMission = false;
[] spawn {
 waituntil {SHK_EndMission};
 cuttext ["Parties to an armed conflict must distinguish between the civilian population and combatants and between civilian objects and military objectives. Any intended target must be a military target.  Attacks are prohibited if they cause incidental loss of civilian life, injury to civilians, or damage to civilian objects that is excessive in relation to the anticipated concrete and direct military advantage of the attack.  The use of military force is justified only to the extent it is necessary to achieve a military goal. This force used must not exceed the level required to stop the threatening activity.","PLAIN",2];
 sleep 35;
 endmission "END3";
};

SHK_fnc_deadCivilians = {
 hintsilent format ["Civilians dead: %1",_this];
 if (_this >= SHK_DeadCivilianLimit) then {
   SHK_EndMission = true;
   publicvariable "SHK_EndMission";
 };
};
SHK_eh_killed = {
 private "_side";
 _side = side (_this select 1);
 if (_side == WEST) then {
   SHK_DeadCivilianCount = SHK_DeadCivilianCount + 1;
   publicvariable "SHK_DeadCivilianCount";
   if isdedicated then {
     if (_this >= SHK_DeadCivilianLimit) then {
       SHK_EndMission = true;
       publicvariable "SHK_EndMission";
     };
   } else {
     SHK_DeadCivilianCount call SHK_fnc_deadCivilians;
   };
 };
};
if isserver then {
 {
   if (side _x == Civilian && _x iskindof "Man") then {
     _x addEventHandler ["killed", SHK_eh_killed];
   };
 } foreach allunits;
} else {
 "SHK_DeadCivilianCount" addpublicvariableeventhandler { (_this select 1) call SHK_fnc_deadCivilians };
};
[] spawn {
 waituntil {!isnil "BIS_alice_mainscope"};
 waituntil {!isnil "bis_fnc_variablespaceadd"};
 [bIS_alice_mainscope,"ALICE_civilianinit",[{_this addEventHandler ["killed", SHK_eh_killed]}]] call bis_fnc_variablespaceadd;
};

//ace specific settings
ace_wounds_prevtime = 120;

//intro text/effect
if (time < 10) then
{
titleCut ["", "BLACK FADED", 999];
[] Spawn {
waitUntil{!(isNil "BIS_fnc_init")};

// Info text
[str(" 'Spur Ride' ") , str(date select 2) + "." + str(date select 1) + "." + str(date select 0), str(" Loy Manara Province ")] spawn BIS_fnc_infoText;

sleep 3;
"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust [6];
"dynamicBlur" ppEffectCommit 0;
"dynamicBlur" ppEffectAdjust [0.0];
"dynamicBlur" ppEffectCommit 7;
titleCut ["", "BLACK IN", 5]
};

Share this post


Link to post
Share on other sites

I used the Civilian kill counter, and the Civilian Module and to be honest i had a lot of lag !

I took the Civilian kill counter out of my INI and put it in its own .sqf that did help a little.

But i always get issue when using the Civi module on our dedi with 20+ player - so have stopped using it.

You could try that and see if that helps?

Share this post


Link to post
Share on other sites

See there's no evidence to that claim, just more superstition about what 'might' work.

This isn't video lag and low server FPS caused by civilians module if improperly used. This is a sudden and serious clientside FPS problem caused as clients try to synchronize something that from what I can tell is either local to one of them or local to the server. The closest I could find was a description of serious lag in Domi with ammo crates that are local to the player.

I'm wondering whether creating vehicles/crates in the 3d editor and calling those scripts on the server is creating ammo crates that are local to the server which then create massive lag when synchronizing with players rather than creating them once globally for all players.

I'm not sure how to call a script once globally.

Share this post


Link to post
Share on other sites

Do you create any vehicle, weapons or some other items through the editor or scripting that not ALL players have?

When my squad starting using ACRE, not everybody had it activated when they joined the server. Shortly after someone without joined the server there would become massive fps lag (down to 2-3 fps) for some of us.

Share this post


Link to post
Share on other sites

Remove one mission feature / mod at a time and test if the lags are still there. Takes a bit of time but works.

In a perfect world you would have saved a different version your mission everytime you added something new to it, but hey... ;)

Edited by ])rStrangelove

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  

×