Jump to content
dlegion

help on bubble script 2.0

Recommended Posts

thanksssssssss!

following your example i translated the other action into this:
 

[_this, ["<t color='#67DF0C'>SAVE Loadout</t>",{[player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory;hintSilent "Loadout saved";}]] remoteExec ["addAction",0,true]; 

and it works!
i still have a problem with a different code, probably its something i still cant insert into my brain....how translate this?
 

[OBJECT, -1,nil, "LIGHT"] execVM "R3F_LOG\USER_FUNCT\init_creation_factory.sqf";

i keep reading the Biki, but really cant get it to work!
really thanks man !

============= E D I T ======================================
i found it!
 

[[_this, -1,nil, "LIGHT"],"R3F_LOG\USER_FUNCT\init_creation_factory.sqf"] remoteExec ["execVM",0,true];

this works !!
finally!
really thanks for helping me !!
 

  • Like 1

Share this post


Link to post
Share on other sites

...damn...this remoteExec dont enter into my mind....
 

null = [_H1] spawn {while {alive _H1} do {"hostages1" setmarkerpos getpos _H1; sleep 11;};};

///tried to convert to remoteExec :

[[_H1],{while {alive _H1} do {"hostages1" setmarkerpos getpos _H1; uisleep 9;};}] remoteExec ["spawn",0,true];

and it returns an error about a missing ";" in the ["spawn",0,true # ];
it breaks my mind

Share this post


Link to post
Share on other sites
53 minutes ago, dlegion said:

...damn...this remoteExec dont enter into my mind....
 


null = [_H1] spawn {while {alive _H1} do {"hostages1" setmarkerpos getpos _H1; sleep 11;};};

///tried to convert to remoteExec :

[[_H1],{while {alive _H1} do {"hostages1" setmarkerpos getpos _H1; uisleep 9;};}] remoteExec ["spawn",0,true];

and it returns an error about a missing ";" in the ["spawn",0,true # ];
it breaks my mind

Well that's not how you use remoteExec.

You're trying to pass code as parameters, which isn't supported.

You can define your code as a function, and pass the function instead:

//init.sqf or wherever
TAG_fnc_updateMarker = {
	params ["_unit","_markerName"];
	while {alive _unit} do {
		_markerName setmarkerpos getpos _unit;
		sleep 11;
	};
};

//proper remoteExec usage:
[YourHostageName,"YourMarkerName"] remoteExec ["TAG_fnc_updateMarker",0,true];

Cheers

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

ahh, now it starts to get clearer...
so...my hostage gets spawned by server script, it has a server-script-local name "_H1", i can use it or i have to make it global, considering the function to update marker will have to run on clients?
as always...a huge thanks !

======= EDIT===========
oh....for god sake, thanks, thanks and THANKS!
it works!

Share this post


Link to post
Share on other sites

hem....just tested on dedicated....marker dont move :down:
what i did wrong? in editor MP preview the code works...

Share this post


Link to post
Share on other sites
1 hour ago, dlegion said:

ahh, now it starts to get clearer...
so...my hostage gets spawned by server script, it has a server-script-local name "_H1", i can use it or i have to make it global, considering the function to update marker will have to run on clients?
as always...a huge thanks !

======= EDIT===========
oh....for god sake, thanks, thanks and THANKS!
it works!

 

Just use _H1 then, should work anyway.

 

 

40 minutes ago, dlegion said:

hem....just tested on dedicated....marker dont move :down:
what i did wrong? in editor MP preview the code works...

It's best to call and spawn marker related stuff from initPlayerLocal.sqf to make sure it runs on every connected player, should work in SP, MP and dedicated.

 

Alternatively you can draw stuff on the map like this:

 

//initPlayerLocal.sqf
GOM_fnc_drawUnit = {

	_eh = ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", '
	{
		_scale = 0.2;
		_lastname = "";
		_color = [1,1,1,1];
		_text = format [''Unit %1'',(missionNamespace getVariable [''GOM_fnc_unitsToDraw'',[]] find _x) +1];

		_align = "right";
		_fontsize = 0.04;
		_drawicon = "";
		_drawicon = configFile/"CfgVehicles"/typeOf  _x/"Icon";
		 (_this select 0) drawIcon [getText (_drawicon),
		_color,
		getPosVisual  _x,
		 0.5/ctrlMapScale (_this select 0),
		 0.5/ctrlMapScale (_this select 0),
		getDirVisual  _x,
		_text,
		1,
		_fontsize,
		"TahomaB",
		_align];
	} foreach (missionNamespace getVariable ["GOM_fnc_unitsToDraw",[]])'];

};
[] call GOM_fnc_drawUnit;

//init.sqf or whenever you've spawned hostages in:
missionNamespace setVariable ["GOM_fnc_unitsToDraw",[Hostage1,Hostage2],true];

//add another hostage to the drawing function:
_toDraw = missionNamespace getVariable ["GOM_fnc_unitsToDraw",[]];
_toDraw pushBack _myNewHostage;
missionNamespace setVariable ["GOM_fnc_unitsToDraw",_toDraw,true];

If you don't want anything drawn simply use this:

missionNamespace setVariable ["GOM_fnc_unitsToDraw",[],true];

If you spawn in units that should be drawn simply add them to that array like shown above.

Advantage of this is that the display of units is extremely fluid.

Pretty basic, really.

 

Cheers

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

nice idea! thanks man, as sson as i get back home i will try!
thanks man !

  • Like 1

Share this post


Link to post
Share on other sites

finally i had time to check everything from start....and i found where was located the problem, in the end this simple code works good also on dedicated server:

DmarkerMOVE = {

    params ["_unit","_markerName"];
    while {alive _unit} do {_markerName setmarkerpos getpos _unit;sleep 11;};
};

and from the hostages script :
[_H1,"hostages1"] remoteExec ["DmarkerMOVE",0,true];

thanks for your help guys !

  • Like 1

Share this post


Link to post
Share on other sites

ok, guys, thanks to your help (seriously, THANKS guys!) i finally reached a "BETA" version of the whole thing, i wish to share with you (and all the community):

this is the civilian spawner:

Spoiler

if (isServer) then {

//nul = [] execVM "SPAWNERciv.sqf";    >> in  initSERVER.sqf   to run script.  it need the "DELETEfar.sqf" script to delte units too far!
// needs allahBOOM.sqf

//////// MANUAL SETTINGS ////////
uiSleep 1;                  // to not overlap SPAWNERind.sqf
_MaxUnits = 16;             // number of units to spawn
_loop = 2;                  // time between 1 spawn and next one, for more performance use higher number 
_allahBOOM = FALSE;          // spawn also random civilian kamikaze, 1 out 12 infantry civilians, it need the script "allahBOOM.sqf" in the main mission folder

_MinDistMEN = 300;           // minimum distance to players for MEN, number in meters
_MaxDistMEN = 400;          // maximum distance to players for MEN, number in meters
//_MinDistDIVER = 20;           // minimum distance to players for MEN, number in meters
//_MaxDistDIVER = 40;          // maximum distance to players for MEN, number in meters
_MinDistLAND = 500;          // minimum distance to players for LAND VEHICLES, number in meters
_MaxDistLAND = 2000;         // maximum distance to players for LAND VEHICLES, number in meters
_MinDistAIR = 3000;           // minimum distance to players for AIR, number in meters
_MaxDistAIR = 6000;          // maximum distance to players for AIR, number in meters
_MinDistSHIP = 2000;          // minimum distance to players for BOATs, number in meters
_MaxDistSHIP = 4000;         // maximum distance to players for BOATs, number in meters

_Dside = civilian;       // the side faction of spawned unit, can be   WEST, EAST, INDEPENDENT, CIVILIAN

//////////////////END OF MANUAL SETTINGS, DO NOT EDIT UNDER THIS LINE////////////////////////////////////////
_MinDist = 300;
_MaxDist = 800;
_OnWater = 0;            // spawn on land OR water, 0 on land, 2 on water , 1 water or land
_DtypeA =[];
//_Dtype = "I_MRAP_03_hmg_F";   // the type of unit to spawn, can be more than 1, for example:       "I_MRAP_03_hmg_F","I_MRAP_03_hmg_F" , AIR, SHIP, LAND (subType CAManBase), 

_allcivs = "(getNumber (_x >> 'scope') == 2) and {(getNumber (_x >> 'side') == 3)} and {configName _x isKindOf 'allVehicles'}" configClasses (configFile >> "CfgVehicles");

while {true} do {

   uiSleep _loop;              // for more performance use higher number 
   _ALLspawned = [];
   _allahCALL = FALSE;
   {if (!isNil {_x getVariable "FARdelete"} && side _x == _Dside && alive _x) then {_ALLspawned pushBack _x};} forEach allUnits;
   _activeUnits = count _ALLspawned;
   if (_activeUnits < _MaxUnits && (count playableUnits) > 0) then {
   _DtypeN = selectRandom _allcivs;_Dtype = configName _DtypeN;_DtypeA = [_Dtype];
//      if (_Dtype isKindOf "I_diver_F" || _Dtype isKindOf "I_diver_TL_F" || _Dtype isKindOf "I_diver_exp_F") then {_MinDist = _MinDistDIVER;_MaxDist = _MaxDistDIVER;_DtypeA = [_Dtype];_Gs2 = selectRandom ["I_diver_F","I_diver_exp_F"];_DtypeA append [_Gs2];_Dtype = "I_boat_armed_01_minigun_F";}; 
      if (_Dtype isKindOf "LAND") then {_OnWater = 0;_MinDist = _MinDistLAND;_MaxDist = _MaxDistLAND;if (_Dtype isKindOf "CAManBase") then {if ((selectRandom [1,2,3,4,5,6,7,8,9,10,11,12]) == 1) then {_allahCALL = TRUE};_MinDist = _MinDistMEN;_MaxDist = _MaxDistMEN;_DtypeA = [_Dtype];};};
      if (_Dtype isKindOf "AIR") then {_OnWater = 1;_MinDist = _MinDistAIR;_MaxDist = _MaxDistAIR;};
      if (_Dtype isKindOf "SHIP") then {_OnWater = 2;_MinDist = _MinDistSHIP;_MaxDist = _MaxDistSHIP;};
      randomplayer = selectRandom playableUnits;
      randomplayerpos = getPos randomplayer; 
      _posBlacklist = playableUnits apply {[_x,_MinDist]};
      _grpDveh = [[randomplayerpos, _MinDist, _MaxDist, 10, _OnWater, 0.3, 0,_posBlacklist] call BIS_fnc_findSafePos,_Dside,_DtypeA] call BIS_fnc_spawnGroup;    // SPAWNER
      {_x setVariable ["NOT_remove",true,false];(vehicle _x) setVariable ["NOT_remove",true,false];} forEach (units _grpDveh);
      _grpDveh deleteGroupWhenEmpty true;
      {_x setVariable ["FARdelete",_MaxDist,false];} forEach (units _grpDveh);
      {(vehicle _X) setVariable ["FARdelete",_MaxDist,false];} forEach (units _grpDveh);
      _UnitLeader = leader _grpDveh;

      _Rn = selectRandom [1,2,3,4,5];  // to decide if move or stay and if garrison building or not
      if (_Dtype isKindOf "CAManBase" && _Rn > 3) then {[(getpos _unitLeader),(units _grpDveh)] call DFN_occupy;{_x disableAI "PATH"} forEach (units _grpDveh);};
      if (_Rn > 1) then {[_grpDveh,(getpos _unitLeader), 9000,_OnWater,(selectRandom ["FULL","LIMITED"])] call DFN_Patrol;};
      if (_allahCALL && _allahBOOM) then {_suicider = leader _grpDveh;null = [_suicider] spawn allahBOOM;};
   };
 };
};

 


this is the faction spawner (independent in this case, but can be used for every faction and launched multiple times to have more than 1 faction):
 

Spoiler


if (isServer) then {

//////// MANUAL SETTINGS ////////
//nul = [] execVM "SPAWNERciv.sqf";    >> in  initSERVER.sqf   to run script.  needs DELETEfar.sqf to delte far units
//needs SNIPE.sqf

_MaxUnits = 30;             // number of units to spawn
_loop = 2.1;                  // time between 1 spawn and next one, for more performance use higher number 
_SUPERsnipers = TRUE;       // set to TRUE if you want scripted snipers able to hit targets at 2000m in a rainstorm!

_MinDistMEN = 900;           // minimum distance to players for MEN, number in meters
_MaxDistMEN = 1500;          // maximum distance to players for MEN, number in meters
_MinDistDIVER = 200;           // minimum distance to players for MEN, number in meters
_MaxDistDIVER = 400;          // maximum distance to players for MEN, number in meters
_MinDistLAND = 1500;          // minimum distance to players for LAND VEHICLES, number in meters
_MaxDistLAND = 3000;         // maximum distance to players for LAND VEHICLES, number in meters
_MinDistAIR = 3000;           // minimum distance to players for AIR, number in meters
_MaxDistAIR = 6000;          // maximum distance to players for AIR, number in meters
_MinDistSHIP = 2000;          // minimum distance to players for BOATs, number in meters
_MaxDistSHIP = 4000;         // maximum distance to players for BOATs, number in meters

_Dside = independent;       // the side faction of spawned unit, can be   WEST, EAST, INDEPENDENT, CIVILIAN

//////////////////END OF MANUAL SETTINGS, DO NOT EDIT UNDER THIS LINE////////////////////////////////////////
_MinDist = 0;
_MaxDist = 100;
_OnWater = 0;            // spawn on land OR water, 0 on land, 2 on water , 1 water or land
_DtypeA =[];
//_Dtype = "I_MRAP_03_hmg_F";   // the type of unit to spawn, can be more than 1, for example:       "I_MRAP_03_hmg_F","I_MRAP_03_hmg_F" , AIR, SHIP, LAND (subType CAManBase), 

_allINDEP = "(getNumber (_x >> 'scope') == 2) and {(getNumber (_x >> 'side') == 2)}" configClasses (configFile >> "CfgVehicles");

while {true} do {

   _REALsniper = FALSE;
   uiSleep _loop;              // for more performance use higher number 
   _ALLspawned = [];
   {if (!isNil {_x getVariable "FARdelete"} && side _x == _Dside && alive _x) then {_ALLspawned pushBack _x};} forEach allUnits;
   _activeUnits = count _ALLspawned;
   if (_activeUnits < _MaxUnits && (count playableUnits) > 0) then {
      _DtypeN = selectRandom _allINDEP;_Dtype = configName _DtypeN;_DtypeA = [_Dtype];
      if (_Dtype isKindOf "SHIP") then {_OnWater = 2;_MinDist = _MinDistSHIP;_MaxDist = _MaxDistSHIP;};
      if (_Dtype isKindOf "I_diver_F" || _Dtype isKindOf "I_diver_TL_F" || _Dtype isKindOf "I_diver_exp_F") then {_OnWater = 2;_MinDist = _MinDistDIVER;_MaxDist = _MaxDistDIVER;_DtypeA = [_Dtype];_Gs2 = selectRandom ["I_diver_F","I_diver_exp_F"];_DtypeA append [_Gs2];_Dtype = "I_boat_armed_01_minigun_F";}; 
      if (_Dtype isKindOf "LAND") then {_OnWater = 0;_MinDist = _MinDistLAND;_MaxDist = _MaxDistLAND;if ((_Dtype isKindOf "I_G_offroad_01_armed_F") || (_Dtype isKindOf "I_G_Offroad_01_AT_F")) then {_Dtype setObjectTextureGlobal [0,'\A3\Soft_F_Bootcamp\Offroad_01\Data\offroad_01_ext_IG_04_CO.paa'];};if (_Dtype isKindOf "CAManBase") then {if (_Dtype isKindOf "I_ghillie_ard_F" || _Dtype isKindOf "I_ghillie_lsh_F" || _Dtype isKindOf "I_ghillie_sard_F") then {_REALsniper = TRUE};_MinDist = _MinDistMEN;_MaxDist = _MaxDistMEN;_DtypeA = [_Dtype];_Gs2 = selectRandom ["O_G_Soldier_LAT_F","I_ghillie_sard_F","I_soldier_AA_F" ];_DtypeA append [_Gs2];};};
      if (_Dtype isKindOf "AIR") then {_OnWater = 1;_MinDist = _MinDistAIR;_MaxDist = _MaxDistAIR;};
      randomplayer = selectRandom playableUnits;
      randomplayerpos = getPos randomplayer; 
      _posBlacklist = playableUnits apply {[_x,_MinDist]};
      _grpDveh = [[randomplayerpos, _MinDist, _MaxDist, 10, _OnWater, 0.3, 0,_posBlacklist] call BIS_fnc_findSafePos,_Dside,_DtypeA] call BIS_fnc_spawnGroup;    // SPAWNER
      {_x setVariable ["NOT_remove",true,false];(vehicle _x) setVariable ["NOT_remove",true,false];} forEach (units _grpDveh);
      _grpDveh deleteGroupWhenEmpty true;
      {_x setVariable ["FARdelete",_MaxDist,false];} forEach (units _grpDveh);
      {(vehicle _X) setVariable ["FARdelete",_MaxDist,false];} forEach (units _grpDveh);
      _UnitLeader = leader _grpDveh;

      _Rn = selectRandom [1,2,3,4,5];  // to decide if move or stay and if garrison building or not
      if (_Dtype isKindOf "CAManBase" && _Rn > 3) then {[(getpos _unitLeader),(units _grpDveh)] call DFN_occupy;{_x disableAI "PATH"} forEach (units _grpDveh);};
      if (_Rn > 1) then {[_grpDveh,(getpos _unitLeader), 9000,_OnWater,(selectRandom ["FULL","LIMITED"])] call DFN_Patrol;};
      if (_REALsniper && _SUPERsnipers) then {_sniper = leader _grpDveh;null = [_sniper] spawn snipe;format ["A veteran SNIPER is operating in the area!"] remoteExecCall ["hint"];["TaskAssigned",["",format ["A veteran SNIPER is operating in the area!"]]] remoteExec ["bis_fnc_showNotification"];};
   };
 };
};

 

then this is the script to delete the units too far from players, allowing the spawn of new ones:
 

Spoiler

///// nul = [] execVM "DELETEfar.sqf";   >> in initServer.sqf

if (isServer) then {
   while {true} do {

   uiSleep 9;
   {uiSleep 0.1;if !(isNil {_x getVariable "FARdelete"}) then {if ([(getPos _x), _x getVariable "FARdelete"] call ALLfar) then {deleteVehicle _x;}}} foreach allUnits;
   {uiSleep 0.1;if !(isNil {_x getVariable "FARdelete"}) then {if ([(getPos _x), _x getVariable "FARdelete"] call ALLfar) then {deleteVehicle _x;}}} foreach vehicles;
   _Rand = selectRandom [1,2,3,4,5];
   if (_rand < 2) then {
      _TOdelLIST = [];
      {if !(isNil {_x getVariable "FARdelete"}) then {_TOdelLIST append [_x]};} forEach allUnits;
      _TOdel = selectRandom _TOdelLIST;
      deleteVehicle _TOdel;  
   };
  };
};

 


here it is an "extra" script used by the main ones to spawn realistic snipers (that aim and shoot up to 2000m) :
 

Spoiler

if (isServer) then {

// null = [this] execVM "SNIPE.sqf";        // in unit init to run script. for best result, use a sniper with M320 LRR .408 rifle and LRPS optic 
//(yes, even at night and in a rainstorm...it should hit 1 man in 1 minute of shooting at 2000m)

/*
    Parameter(s):
    0: [OBJECT] - Object who is 'looking'
    1: [OBJECT] - Object to look for
    2: [NUMBER] - Looker's FOV (OPTIONAL) DEFAULT (70)

    Returns:  [BOOLEAN]
*/

Dlos = {

params [["_looker",objNull,[objNull]],["_target",objNull,[objNull]],["_FOV",70,[0]]];
if ([position _looker, getdir _looker, _FOV, position _target] call BIS_fnc_inAngleSector) then {
    if (count (lineIntersectsSurfaces [(AGLtoASL (_looker modelToWorldVisual (_looker selectionPosition "pilot"))), getPosASL _target, _target, _looker, true, 1,"GEOM","NONE"]) > 0) exitWith {false};
    true
} else {
    false
   };
};

_Tside = west;                // manually define ENEMY side to shoot at
_Tside2 = east;               // manually define ENEMY side to shoot at (if just 1 enemy side needed, place the same side on both _Tside and _Tside2
_S1 = (_this select 0);

_S1 disableAI "PATH";

_S1 setUnitPos "DOWN";

_S1 disableAI "AIMINGERROR";
//_S1 disableAI "FSM";
_S1 setSkill 1;

while {true} do {

   _Dtargets = [];
   {if ((_x distance2D _S1) < 2000 && ((side _x == _Tside) || (side _x == _Tside2)) && (alive _x)) then {_S1 reveal [_x,4];_Dtargets pushBack _x}} forEach allunits;

   _Tcount = count _Dtargets;
   if (_Tcount > 0) then {_Target = (selectRandom _Dtargets);_S1 doTarget _Target;_S1 doSuppressiveFire _Target;uiSleep 0;if ([_S1, _Target] call Dlos) then {_S1 forceWeaponFire [(currentWeapon _S1), "Single"];};};
   _S1 setVehicleAmmo 1;

   uiSleep 5;
};
};

 


...will soon (i'm testing this week) come a full mission "Liberation style" with many features, based on this bubble 2.0 system !
thanks guys!

  • Like 1

Share this post


Link to post
Share on other sites

It's useless to create a function for remote executing setMarkerPos which is an EG command. if _unit is defined on server only, running this command on server will have the expected result on clients also.

 

You persist to write:

{uiSleep 0.1;if !(isNil {_x getVariable "FARdelete"}) then {if ([(getPos _x), _x getVariable "FARdelete"] call ALLfar) then {deleteVehicle _x;}}} foreach allUnits;

 

Say, you have 200 units (very easy to obtain, as far as allUnits is for all sides).

Your line takes at least 20 sec to be completed, no matter what the result of your condition inside.

Not seen your allFar function.

 

 

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

sorry Pierre, i forgot that function :)
 

if (isServer) then {

    uiSleep 1;
    params ["_pos", "_limit"]; // Read the parameters sent to the function into these variables.

    // First assume that the position is far from all players.
     _farFromAll = true;

    // Loop through all players in a forEach loop.
    {
        // If the distance from the position to the player is less than the distance limit, then the position is not far from all
        if (_pos distance2D _x < _limit) then {
            _farFromAll = false;
        };
    } forEach playableUnits;          //  was: forEach call BIS_fnc_listPlayers; 

    // Return the value in _farFromAll (do not write a semicolon after a return value)

   _pos = nil;
   _limit = nil;
   _farFromAll
};

about the UiSleep ...well main reason i still use it is that there's no hurry at all...this units are spawned far away, and randomly, so no matter if it spawn now, in 20 secs or in minutes....the important part is only spawn them :)
thanks for pointing it out anyway, and for your review, i appreciate it !
this week will test it as much as i can....you are all welcome, server name DWAR, after some vanilla tests, i will probably run it with some mods like ACE3, CUP and RHS to test how it do with them!
thanks again!

Share this post


Link to post
Share on other sites

ok i start with technical questions....
for better performance, what is the best way to run this scripts?
right now i         compileFinal preprocessFileLineNumbers           the scripts, then       spawn      the functions....but was thinking that being the script an endless      while {true} do     ....probably its quite useless do this,
execVM the script would probably be the same ?
maybe there's a better way to achieve better performance ?
thanks !

Share this post


Link to post
Share on other sites
10 hours ago, dlegion said:

ok i start with technical questions....
for better performance, what is the best way to run this scripts?
right now i         compileFinal preprocessFileLineNumbers           the scripts, then       spawn      the functions....but was thinking that being the script an endless      while {true} do     ....probably its quite useless do this,
execVM the script would probably be the same ?
maybe there's a better way to achieve better performance ?
thanks !

Don't obsess over performance if you don't experience performance issues.

 

Cheers

  • Thanks 1

Share this post


Link to post
Share on other sites
3 hours ago, Grumpy Old Man said:

Don't obsess over performance if you don't experience performance issues.

yep...you probably are right....i cant ask more to my old i5 with no hyper Threading :)

AI numbers seems to impact way more than all my scripts togheter....so there's probably not much to do ,hehe.
thanks for remembering that to me GOM !

  • Like 1

Share this post


Link to post
Share on other sites

i've taken an empty Altis map, placed exactly the same number of AI present in my mission, (same side, same type too), made all them immortal (so they keep doing theyr things), and spectate it...the FPS are comparable....lets say +8 fps average difference.
So, the mission runs around 30 fps for clients in average condition, quite stable 45+ fps for server, seems mainly due to AI numbers.
is there any way to make the AI "lighter" on performance ?
any dedicated server setting suggested for a 100Mb down and 20Mb up connection ?
thanks!!
 

Share this post


Link to post
Share on other sites
2 hours ago, dlegion said:

i've taken an empty Altis map, placed exactly the same number of AI present in my mission, (same side, same type too), made all them immortal (so they keep doing theyr things), and spectate it...the FPS are comparable....lets say +8 fps average difference.
So, the mission runs around 30 fps for clients in average condition, quite stable 45+ fps for server, seems mainly due to AI numbers.
is there any way to make the AI "lighter" on performance ?
any dedicated server setting suggested for a 100Mb down and 20Mb up connection ?
thanks!!
 

 

- Use the dynamic simulation... Personally, I don't like it because it's non revertible . When AIs are spawned, they stay spawned. Half work, imho.

- Use the module objects modifier / "simulation manager".  Works fine to spawn / despawn units (do not name them. If named, they are blacklisted). Very simple to use and efficient.

- Use headless client (HC) if you can. Not very easy to manage.

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

thanks Pierre!
well about this:

2 hours ago, pierremgi said:

- Use the dynamic simulation... Personally, I don't like it because it's non revertible . When AIs are spawned, they stay spawned. Half work, imho.

- Use the module objects modifier / "simulation manager".  Works fine to spawn / despawn units (do not name them. If named, they are blacklisted). Very simple to use and efficient.

i tried to code the bubble system for this specific reason, as you say they did half work (at best). Same for the many limitations of simulation manager. 
about HC, in fact i did some experiments some time ago...but never menaged to get good results...
my actual situation is this: i have a server (full machine), so will it be useful run also HC on it, or HC is useful only if run on other computer?
thanks!

Share this post


Link to post
Share on other sites

Well... HC is supposed to make AIs calculations on a remote computer, then decreasing CPU load of the server. What about 2 Arma sessions on the same computer with server for one and HC for the other? Playing with CPU cores? I don't know. If someone could answer, thanks.

  • Thanks 1

Share this post


Link to post
Share on other sites

at today date, the only problem happened in the test is a respawn bug,
in 2 different occasions, to a player appeared a respawn on other players (instead of MHQ vehicle or main HQ),
i did some research on forums, but found nothing useful...any idea what can be ?
thanks!

Share this post


Link to post
Share on other sites

Well....except that strange respawn bug, everything else seems to be working correctly...probably later this week or next week will publish the mission !

Thanks again for your help guys !

Share this post


Link to post
Share on other sites

hello, i keep testing, and found a quite relevant problem...
the mission is supposed to run 24h , then server machine will reboot and start it again...so the target is run 24h with no problems.
I noticed today, around 17:00 (it reboots at 07:00, so after 10 hours of server running), joining the server, that there was a huge performance drop for the client,
lets say in the same situation and place where it was running for the client at 52 FPS, now was running at 17-19 FPS !
the cleaning system worked, there was no dead or wrecks, no groundWeaponHolders, nothing strange at all.
server itself was still running at 47-48 fps, that is like after a fresh start.
just the client was having this problems! i tried disconnect, reboot my client PC, and rejoin, same situation. so its something on server slowing down the client!
but what can be?
any idea?
i'm really disappointed by this problem! thanks for any help !

Share this post


Link to post
Share on other sites

pheraps i found where the problem lies, after 10+ hours i run this code serverside on dedicated:
 

_Dn = count allgroups; 
str (_Dn) + " GROUPS!" remoteExecCall ["hint"];

...and found that there were 140 groups....while on map there were clearly no more than 40 groups.
i suspect client/server are not sync on groups, or they are not deleted for real (but cant find any trace except that count),
any idea on this ?

Share this post


Link to post
Share on other sites

did you use the group deletion when empty in editor (for edited groups) and deleteGroup in a loop for spawned ones?

0 = [] spawn {while {true} do {

  {deleteGroup _x } forEach (allGroups select {(count units _x) isEqualTo 0});

  sleep 10;

}};

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hem no...maybe thats the problem !

I was just using "deleteGroupWhenEmpty" on the spawners...but clearly was not enough on the long run...

Included your code both client and server...will test now with this...huge thanks !

Share this post


Link to post
Share on other sites

hello guys!
i'm finally releasing (after sooooo many test, and fixes)  the DWAR mission , based on the bubble you helped to create!
really thanks again guys for all your help !!
 

 

  • Like 1

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

×