Jump to content

Recommended Posts

Posted (edited)

Hello folks,

 

I am currently working on a mission designed for training puposes.

The mission is build upon the OlsenFramework, a mission making framework.

Links are to either githubs.

 

I am running into the following problem:

 

a) If I test the mission in the Eden Editors host environment and singleplayer, all code executes flawslessly when addEventHandler is used (obviously no MP).

b) When tested on a dedicated server, the EventHandlers (addEventHandler and addMPEventhandler) will not fire at all. This was tested via systemChat messages.

 

The code:

(All code can be viewed on the github linked, its the latest changes made and the last version tested on the server)

A few months back I was given a script by my units training officer to work with popup targets but it was split in a multitude of files and also only worked partially on dedicated, which I did not like so I rewrote it into a single script.

The origin of that code is not known to me, so forgive me for the missing credits.

 

In the init.sqf of the mission, I call code which adds a line of code to each targets which apparently is supposed to 'fix' swivel targets not working in multiplayer dedicated environments. This can be found here.
As far as I unterstand this is supposed to disable animation control on all clients (including non dedicated servers and HC), but sofar the targets still behave crappy.

if (!isDedicated) then {
	_localTargets = (entities "Target_Swivel_01_ground_F") + (entities "Land_Target_Swivel_01_F");
	{
		_x setVariable ["BIS_exitScript", false];
	} forEach _localTargets;
};

later I call my script which is mainly in control of the targets: popup.sqf once via the init.sqf to get all targets into a down position at mission start. This works flawless.
Fnc_popup is the same as popup.sqf just processed via: Fnc_popup = compile preprocessFileLineNumbers "customization\popups.sqf";

if (isServer) then {
	[false,"init",500,initCenter] remoteExec ["Fnc_popup", 2];
};

Players being Instructors are makred via a variable "isInstructor" only players with this restriction will have access to the popup addAction ... actions. Which are placed on landBoards in the mission.
en example from the addAction.sqf looks like this:

Fnc_popup = compile preprocessFileLineNumbers "customization\popups.sqf";
if (!isDedicated) then {
	waitUntil { (player == player) };
	if (player getVariable "isInstructor") then {
		arBoard addAction ["<t color='#FF0000'>Raise Bunker Targets",{[true,"setup",15,bnkTgts] remoteExec ["Fnc_popup", 2];}];
		arBoard addAction ["<t color='#FF0000'>Lower Bunker Targets",{[false,"reset",15,bnkTgts] remoteExec ["Fnc_popup", 2];}];
	};
};

This calls a precompiled form of popup.sqf and now the problöem occurs that everything in that popup.sqf works, except for the damn eventHandlers place on the trainingTargets.

case init and case reset work, and throw no script errors.

This is the popup.sqf file content:

///////////////////////////////////////////////////////////////////////////////////////////
//Script to be called by inits or scripts for operating swivel and popup
//targets around a specified object "_center".
//params: [ShouldTargetsAutoPop?,WhichSwitchShouldRun?,WhatDistanceFromObject?,WhatObject?]
//By PaxJaromeMalues
///////////////////////////////////////////////////////////////////////////////////////////
params [["_popenabled",false],["_execution","init"],["_dist",25],["_center",initCenter]];

_targets = nearestObjects [position _center, ["TargetBase"], _dist];
_SwivelTargets = nearestObjects [position _center, ["Target_Swivel_01_base_F"], _dist];

switch (_execution) do {
	case "init": {
		{
			_x setVariable ["nopop", true];
			_x animateSource ["terc",1]
		} forEach _targets;
		{
			_x setVariable ["BIS_poppingEnabled", false];
			_x animateSource ["terc",1];
		} forEach _SwivelTargets;
  	};
	
	case "setup": {
		"setup called" remoteExec ["systemChat"];
		if (_popenabled) then {
			"popup first condition" remoteExec ["systemChat"];
			{
				_x animateSource ["terc",0];
				_x addMPEventHandler [
					"MPHit", {
						"popup first condition EH before CBA" remoteExec ["systemChat"];
						(_this select 0) animateSource ["terc",1];
						[{
							(_this select 0) animateSource ["terc",0];
							"popup first condition EH in CBA" remoteExec ["systemChat"];
						},
						_this, 2 + (random 3)] call CBA_fnc_waitAndExecute;
					}
				] 
			} forEach _targets;
		} else {
			"popup second condition" remoteExec ["systemChat"];
			{
				_x animateSource ["terc",0];
				_x addMPEventHandler [
					"MPHit", {
						(_this select 0) animateSource ["terc",1];
						(_this select 0) removeEventHandler ["MPHit",0];
					}
				]
			} forEach _targets;
		};
		if (_popenabled) then {
			"swivel first condition" remoteExec ["systemChat"];
			{
				_x animateSource ["terc",0];
				_x addMPEventHandler [
					"MPHitPart", {
						((_this select 0) select 0) animateSource ["terc",1];
						[{
							((_this select 0) select 0) animateSource ["terc",0];
						},
						_this, 2 + (random 3)] call CBA_fnc_waitAndExecute;
					}
				] 
			} forEach _SwivelTargets;
		} else {
			"swivel second condition" remoteExec ["systemChat"];
			{
				_x animateSource ["terc",0];
				_x addMPEventHandler [
					"MPHitPart", {
						((_this select 0) select 0) animateSource ["terc",1];
						((_this select 0) select 0) removeEventHandler ["MPHit",0];
					}
				]
			} forEach _SwivelTargets;
		};
	};
	
	case "reset": {
		"reset called" remoteExec ["systemChat"];
		{
			_x removeEventHandler ["MPHit",0];
			_x animateSource ["terc",1];
		} forEach _targets;
		{
			_x animateSource ["terc",1];
			_x RemoveEventHandler ["MPHitPart",0];
		} forEach _SwivelTargets;
	};
};

 

 

I have been sitting at this problem for over a month now, and have no idea what I am doing wrong here.
Pls help.

Edited by Pax_Jarome
words are hard
  • Like 1

Share this post


Link to post
Share on other sites

may or may not be the problem but it looks like you are missing a closing bracket

{	
	_x addMPEventHandler 
	[ "MPHit", 
		{
			"popup first condition EH before CBA" remoteExec ["systemChat"];
			(_this select 0) animateSource ["terc",1];
		[  //whats this ?
			{
				(_this select 0) animateSource ["terc",0];
				"popup first condition EH in CBA" remoteExec ["systemChat"];
			},
				_this, 2 + (random 3)] call CBA_fnc_waitAndExecute;
		}
	] 
} forEach _targets;

 

Share this post


Link to post
Share on other sites

Its CBA_fnc_waitAndExecute parameters array

Here  problem is locality along with objects variables and eh

Share this post


Link to post
Share on other sites
5 hours ago, nomadd said:

may or may not be the problem but it looks like you are missing a closing bracket


{	
	_x addMPEventHandler 
	[ "MPHit", 
		{
			"popup first condition EH before CBA" remoteExec ["systemChat"];
			(_this select 0) animateSource ["terc",1];
		[  //whats this ?
			{
				(_this select 0) animateSource ["terc",0];
				"popup first condition EH in CBA" remoteExec ["systemChat"];
			},
				_this, 2 + (random 3)] call CBA_fnc_waitAndExecute;
		}
	] 
} forEach _targets;

 

thats the opening bracket for CBA_fnc_waitAndExecute

Share this post


Link to post
Share on other sites
5 hours ago, davidoss said:

Its CBA_fnc_waitAndExecute parameters array

Here  problem is locality along with objects variables and eh

I looked at cba docs and if I understand it right, args need to be in brackets if I get that right so I now have: [_this] instead of _this, do I need to also enclose 2 + (random 3) as (2 + (random 3))?

 

But I absolutely not sure what the locality and variable issues could be that you mentioned.

All variables are local to each execution and are not used outside of popup.sqf.

 

It would be much appriciated if you could elaborate on your findings.

Share this post


Link to post
Share on other sites

Well i am not capable  to hold track of this all in abstract  mind  to find possible issue,

but if the problem occurs on dedicated server and you use object variables values not propagated,

than remotexec stuff to server then is most likely an locality problem.

 

Share this post


Link to post
Share on other sites

ah I completely missed the CBA function at the end. Shouldn't look at things when I am tired. 

Share this post


Link to post
Share on other sites

I am baffled.

I checked everything I know. objects are local to the server, scripts are executed for the server only, I tried to get rid of the cba fnc by using "popdelay" which does not work either.

I will continue to shift some stuff around and if that won't work I might just settle for not using swivel targets in that MP mission.

Share this post


Link to post
Share on other sites

Don't give up.

Maybe its all about effect like with animations.

If your object are server sided and script is running server sided too, you need to propagate effect to clients because clients have no idea about.

You need just do the same for clients or only clients

  • Like 1

Share this post


Link to post
Share on other sites

Truly, I wonder the added value of such CBA functions. To delay a unscheduled code, you ask your CPU to loop incrementally a short code, working for nuts, just to avoid a spawn (scheduled) code... Isn't it just "intellectually satisfactory"? Where is the real gain? At least, I hope you don't load CBA just for that!

  • Like 1

Share this post


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

Truly, I wonder the added value of such CBA functions. To delay a unscheduled code, you ask your CPU to loop incrementally a short code, working for nuts, just to avoid a spawn (scheduled) code... Isn't it just "intellectually satisfactory"? Where is the real gain? At least, I hope you don't load CBA just for that!

2

 In this case, he doesn't need CBA. 

https://community.bistudio.com/wiki/BIS_fnc_runLater

Share this post


Link to post
Share on other sites
On 1/5/2019 at 12:41 PM, Pax_Jarome said:

removeEventHandler ["MPHit",0];


Didn't look through the whole code, just noticed this ^^^. What makes you think you can add MP event handler with addMPEventHandler but remove it as if it was a normal event handler? Did you know there is removeMPEventHandler command for that? https://community.bistudio.com/wiki/removeMPEventHandler

Share this post


Link to post
Share on other sites
On 1/5/2019 at 12:41 PM, Pax_Jarome said:

_x addMPEventHandler [ "MPHitPart", {

No such MP event.

There should be no need to use MP events, just use normal EH "Hit" on the server (where the targets are local).

 

 

Spoiler

//initServer.sqf

if !( isDedicated ) then {
	{
		//Not even sure what this is or where it came from as I find no reference to it in a grep of A3
		_x setVariable[ "BIS_exitScript", false, true ];
	} forEach entities [ [ "Target_Swivel_01_ground_F", "Land_Target_Swivel_01_F" ], [] ];
};

_nul = [] spawn {
	waitUntil{ time > 0 };

	//No remoteExec already executing from the server
	[] call Fnc_popup;
};

 


//initPlayerLocal.sqf

params[ "_player" ];

if ( _player getVariable[ "isInstructor", false ] ) then {
	arBoard addAction[ "<t color='#FF0000'>Raise Bunker Targets", {
		[ "setup", 15, bnkTgts, true ] remoteExec[ "Fnc_popup", 2 ];
	}];
	arBoard addAction[ "<t color='#FF0000'>Lower Bunker Targets", {
		[ "reset", 15, bnkTgts ] remoteExec[ "Fnc_popup", 2 ];
	}];
};

 


///////////////////////////////////////////////////////////////////////////////////////////
//Script to be called by inits or scripts for operating swivel and popup
//targets around a specified object "_center".
//params: [WhichSwitchShouldRun?,WhatDistanceFromObject?,WhatObject?,ShouldTargetsAutoPop?]
//By PaxJaromeMalues
///////////////////////////////////////////////////////////////////////////////////////////
params [
	[ "_execution", "init" ],
	[ "_dist", 500 ],
	[ "_center", initCenter ],
  	[ "_popenabled", false ]
];

_targets = nearestObjects[ position _center, [ "TargetBase", "Target_Swivel_01_base_F" ], _dist ];

//Be safe, make sure command was sent in lower case
switch ( toLower _execution ) do {
	
	case "init" : {
		
		{
			//Add noPop vars
			//Do in editor to save network bandwidth?
			if ( typeOf _x isKindOf "Target_Swivel_01_base_F" ) then {
				_x setVariable[ "BIS_poppingEnabled", false, true ];
			}else{
				_x setVariable[ "nopop", true, true ];
			};
			
			//Lower target
			_x animateSource[ "terc", 1 ];
		}forEach _targets;
		
  	};
	
	case "setup" : {

		//Make sure targets are reset
		[ "reset", _dist, _center ] call Fnc_popup;
      
		//Inform Instructor who asked for setup that command was received
		"Setting up targets" remoteExec[ "systemChat", remoteExecutedOwner ];

		{
			//Store a reference to the instructor on the target
			_x setVariable[ "instructor", remoteExecutedOwner ];
			//Store whether this target is to rePop
			_x setVariable[ "rePop", _popenabled ];
			
			//Raise target
			_x animateSource[ "terc", 0 ];
			
			//Add Hit event and store EH ID on target
			_x setVariable[ "HitEH", _x addEventHandler [ "Hit", {
				params[ "_target", "", "", "_instigator" ];
				
				//If the Hit was caused by a player
				if ( isPlayer _instigator ) then {
					//Inform the Instructor who hit the target
					format[ "%1 hit target", name _instigator ] remoteExec ["systemChat", _target getVariable "instructor" ];
				};
				
				//If the target is set to rePop
				if ( _target getVariable "rePop" ) then {
					//Spawn thread and store a reference
					_target setVariable[ "rePopThread", _target spawn {
						//Random sleep time
						sleep ( 2 + random 3 );
						//Raise target
						_this animateSource[ "terc", 0 ];
					}];
				}else{
					//No rePop
					//Remove Hit EH
					_target removeEventHandler[ "Hit", _thisEventHandler ];
					//Clean up
					_target setVariable[ "HitEH", nil ];
					_target setVariable[ "instructor", nil ];
					_target setVariable[ "rePop", nil ];
				};
			}]];
		}forEach _targets;
	};
	
	case "reset" : {
		
		//Inform Instructor who requested reset that command was received
		"reseting targets" remoteExec[ "systemChat", remoteExecutedOwner ];
		
		{
			//If the target still has a Hit EH
			if !( isNil { _x getVariable "HitEH" } ) then {
				//If the target is set to rePop
				if ( _x getVariable "rePop" ) then {
					//Is the target awaiting rePop
					if ( !isNil { _x getVariable "rePopThread" } && { !isNull ( _x getVariable "rePopThread" ) } ) then {
						//If it is terminate the thread
						terminate ( _x getVariable "rePopThread" );
					};
					//Clean up
					_x setVariable[ "rePopThread", nil ];
				};
				//Remove Hit EH
				_x removeEventHandler[ "Hit", _x getVariable "HitEH" ];
				//Clean up
				_x setVariable[ "HitEH", nil ];
				_x setVariable[ "rePop", nil ];
			};
			//Clean up
			_x setVariable[ "instructor", nil ];
			
			//Lower target
			_x animateSource[ "terc", 1 ];
		} forEach _targets;
		
	};
};

All thoroughly untested.

 

Share this post


Link to post
Share on other sites
18 hours ago, pierremgi said:

Truly, I wonder the added value of such CBA functions. To delay a unscheduled code, you ask your CPU to loop incrementally a short code, working for nuts, just to avoid a spawn (scheduled) code... Isn't it just "intellectually satisfactory"? Where is the real gain? At least, I hope you don't load CBA just for that!

... thanks, I guess?

 

15 hours ago, Tankbuster said:

 In this case, he doesn't need CBA. 

https://community.bistudio.com/wiki/BIS_fnc_runLater

Thank you, I did not know this fuction until now, I have to check if it works in unscheduled environment like eh tho, will do that over the next 2 days.

 

15 hours ago, killzone_kid said:


Didn't look through the whole code, just noticed this ^^^. What makes you think you can add MP event handler with addMPEventHandler but remove it as if it was a normal event handler? Did you know there is removeMPEventHandler command for that? https://community.bistudio.com/wiki/removeMPEventHandler

Because I am absolutely unknowledgable in sqf (scripting in general) compared to you guys.

 

3 hours ago, Larrow said:

No such MP event.

There should be no need to use MP events, just use normal EH "Hit" on the server (where the targets are local).

 

 

  Hide contents


//initServer.sqf

if !( isDedicated ) then {
	{
		//Not even sure what this is or where it came from as I find no reference to it in a grep of A3
		_x setVariable[ "BIS_exitScript", false, true ];
	} forEach entities [ [ "Target_Swivel_01_ground_F", "Land_Target_Swivel_01_F" ], [] ];
};

_nul = [] spawn {
	waitUntil{ time > 0 };

	//No remoteExec already executing from the server
	[] call Fnc_popup;
};

 



//initPlayerLocal.sqf

params[ "_player" ];

if ( _player getVariable[ "isInstructor", false ] ) then {
	arBoard addAction[ "<t color='#FF0000'>Raise Bunker Targets", {
		[ "setup", 15, bnkTgts, true ] remoteExec[ "Fnc_popup", 2 ];
	}];
	arBoard addAction[ "<t color='#FF0000'>Lower Bunker Targets", {
		[ "reset", 15, bnkTgts ] remoteExec[ "Fnc_popup", 2 ];
	}];
};

 



///////////////////////////////////////////////////////////////////////////////////////////
//Script to be called by inits or scripts for operating swivel and popup
//targets around a specified object "_center".
//params: [WhichSwitchShouldRun?,WhatDistanceFromObject?,WhatObject?,ShouldTargetsAutoPop?]
//By PaxJaromeMalues
///////////////////////////////////////////////////////////////////////////////////////////
params [
	[ "_execution", "init" ],
	[ "_dist", 500 ],
	[ "_center", initCenter ],
  	[ "_popenabled", false ]
];

_targets = nearestObjects[ position _center, [ "TargetBase", "Target_Swivel_01_base_F" ], _dist ];

//Be safe, make sure command was sent in lower case
switch ( toLower _execution ) do {
	
	case "init" : {
		
		{
			//Add noPop vars
			//Do in editor to save network bandwidth?
			if ( typeOf _x isKindOf "Target_Swivel_01_base_F" ) then {
				_x setVariable[ "BIS_poppingEnabled", false, true ];
			}else{
				_x setVariable[ "nopop", true, true ];
			};
			
			//Lower target
			_x animateSource[ "terc", 1 ];
		}forEach _targets;
		
  	};
	
	case "setup" : {

		//Make sure targets are reset
		[ "reset", _dist, _center ] call Fnc_popup;
      
		//Inform Instructor who asked for setup that command was received
		"Setting up targets" remoteExec[ "systemChat", remoteExecutedOwner ];

		{
			//Store a reference to the instructor on the target
			_x setVariable[ "instructor", remoteExecutedOwner ];
			//Store whether this target is to rePop
			_x setVariable[ "rePop", _popenabled ];
			
			//Raise target
			_x animateSource[ "terc", 0 ];
			
			//Add Hit event and store EH ID on target
			_x setVariable[ "HitEH", _x addEventHandler [ "Hit", {
				params[ "_target", "", "", "_instigator" ];
				
				//If the Hit was caused by a player
				if ( isPlayer _instigator ) then {
					//Inform the Instructor who hit the target
					format[ "%1 hit target", name _instigator ] remoteExec ["systemChat", _target getVariable "instructor" ];
				};
				
				//If the target is set to rePop
				if ( _target getVariable "rePop" ) then {
					//Spawn thread and store a reference
					_target setVariable[ "rePopThread", _target spawn {
						//Random sleep time
						sleep ( 2 + random 3 );
						//Raise target
						_this animateSource[ "terc", 0 ];
					}];
				}else{
					//No rePop
					//Remove Hit EH
					_target removeEventHandler[ "Hit", _thisEventHandler ];
					//Clean up
					_target setVariable[ "HitEH", nil ];
					_target setVariable[ "instructor", nil ];
					_target setVariable[ "rePop", nil ];
				};
			}]];
		}forEach _targets;
	};
	
	case "reset" : {
		
		//Inform Instructor who requested reset that command was received
		"reseting targets" remoteExec[ "systemChat", remoteExecutedOwner ];
		
		{
			//If the target still has a Hit EH
			if !( isNil { _x getVariable "HitEH" } ) then {
				//If the target is set to rePop
				if ( _x getVariable "rePop" ) then {
					//Is the target awaiting rePop
					if ( !isNil { _x getVariable "rePopThread" } && { !isNull ( _x getVariable "rePopThread" ) } ) then {
						//If it is terminate the thread
						terminate ( _x getVariable "rePopThread" );
					};
					//Clean up
					_x setVariable[ "rePopThread", nil ];
				};
				//Remove Hit EH
				_x removeEventHandler[ "Hit", _x getVariable "HitEH" ];
				//Clean up
				_x setVariable[ "HitEH", nil ];
				_x setVariable[ "rePop", nil ];
			};
			//Clean up
			_x setVariable[ "instructor", nil ];
			
			//Lower target
			_x animateSource[ "terc", 1 ];
		} forEach _targets;
		
	};
};

All thoroughly untested.

 

Oh wow Larrow, I will definitely will incorporate a lot of this in my new try, especially the stuff with reducing the two arrays of taregts into one and then asking for its kind, that is super neat.
Thanks alot guys!
 

I'll be back if it works and post the solution or doesn't work and ask for furhter assistance ^^'

Share this post


Link to post
Share on other sites
On 6.1.2019 at 8:21 PM, pierremgi said:

To delay a unscheduled code, you ask your CPU to loop incrementally a short code, working for nuts, just to avoid a spawn (scheduled) code...

I don't see what the difference is. CBA waitAndExecute checks one or zero times per frame whether the time is up. Where scheduled code checks every frame if the 3ms aren't reached.

CBA code can be more efficient in some situations. But also unscheduled vs scheduled.

Choosing unscheduled or scheduled probably has a reason.

 

As you are so keen on CPU time scheduled code is generally less efficient as it checks after each expression whether the 3ms timer ran out. So if you want efficiency you use unscheduled code.

Share this post


Link to post
Share on other sites
4 hours ago, Dedmen said:

As you are so keen on CPU time scheduled code is generally less efficient as it checks after each expression whether the 3ms timer ran out. So if you want efficiency you use unscheduled code.

 

It's difficult to compare a low-level 3ms check with your CBA code. Perhaps someone as @code34  could say.

That's CBA and ACE policy. It's probably efficient up to your CPU limit somewhere. Because any priority "blocks" the other codes. So, there is a choice to be made: give priority to some codes, or let a 3ms scheduler do the job, with the risk of some code rejected by slot overpass. That's what I understand so far and I don't like the first concept. Imho, scheduled smart codes, running in parallel, are better than pushing any unscheduled codes in the CPU food mill.

That doesn't mean I never use unscheduled scripts, EHs or FSM.

This topic (animate targets through an EH MPHit)  is a good example for useless CBA_waitAndExecute , furthermore applied to a randomized value (You're not in a priority and you can miss some 3ms slots if that occurs).  Where is the good balance? Last question: Is the 3ms slot still adapted to our "common" actual CPU (i5?), or is it issued from some old optimization for Jurassic CPU?

Share this post


Link to post
Share on other sites

 

@Pax_Jaromeyou can not test MP mission with a local dedicated server and client on the same machine.

 

Server and client when they are on the same machine, share some local variables and finaly the code doesn't work as expected.

 

Ex: MP handler , or some publicvariable handler are not fired when server and client are on same machine.

 

1) If you want to test your mp mission, you have to execute it on a distant dedicated server, or to install a virtual machine on your local machine with a dedicated arma3 server on it.

2) dont use systemChat (or ui commands) for server part, try with diag_log and check your logs

 

 

 

Share this post


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

you can not test MP mission with a local dedicated server and client on the same machine.

 

Server and client when they are on the same machine, share some local variables and finaly the code doesn't work as expected.

 

WHAT???

Share this post


Link to post
Share on other sites
27 minutes ago, killzone_kid said:

 

WHAT???

 

it seems that you discover this, however since the first version of arma handler of publicvariable works like this :(

 

When you publish a variable the local handler is not fired, in this some case when server is local too the server handler is not fired too.

 

i published BME on arma2 wich was a workaround to fix this problem to have a consistent/same working usage on local and distant dedicated server case.

Share this post


Link to post
Share on other sites

I am not going to read through your BME implementation let alone for Arma 2. This is Arma 3 forum and what you're suggesting is plain wrong and misleading. Yes you CAN "test MP mission with a local dedicated server and client on the same machine", and NO "Server and client when they are on the same machine," DO NOT "share some local variables"

Share this post


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

I am not going to read through your BME implementation let alone for Arma 2. This is Arma 3 forum and what you're suggesting is plain wrong and misleading. Yes you CAN "test MP mission with a local dedicated server and client on the same machine", and NO "Server and client when they are on the same machine," DO NOT "share some local variables"

 

Berk ... toxic attitude. Read again my answer and do not mix everything.

Share this post


Link to post
Share on other sites

The game does a pretty good job of having a server and a client on the same machine. Local variables are not shared, nor are global ones. Public variables are shared as you'd expect. Remote execution works on this type of setup in the same way as if the two instances were physically apart. Given both instances are on the same hardware, it does a surprisingly good job for keeping them separate.

  • Like 1

Share this post


Link to post
Share on other sites

ok then my bad, i mixed two topics. Unbedded in game server and dedicated local server.

 

Quote

Fix:
Server and client when they are on the same game instance, share some local variables and finaly the code doesn't work as expected.

Ex: MP handler , or some publicvariable handler are not fired

1) If you want to test fully your mp mission, you have to execute it on dedicated server instance with the server binary execution but not through the multiplayer in game menu and hosting section.

 

Share this post


Link to post
Share on other sites
16 hours ago, pierremgi said:

It's difficult to compare a low-level 3ms check with your CBA code.

Not really.. A check after every expression sums up quite quickly. CBA does one check at most which is a few microseconds.

Also I didn't compare the 3ms check with CBA code. I compared scheduled with unscheduled.

 

16 hours ago, pierremgi said:

and you can miss some 3ms slots if that occurs

Yes. That would be a reason not to use scheduled. Especially with animations.

 

16 hours ago, pierremgi said:

Is the 3ms slot still adapted to our "common" actual CPU (i5?), or is it issued from some old optimization for Jurassic CPU?

What? adapted? What do you mean? 3ms is hardcoded, CPU doesn't matter.

 

14 hours ago, code34 said:

Server and client when they are on the same machine, share some local variables and finaly the code doesn't work as expected.

Bullshit.

 

Same machine != same instance.

Share this post


Link to post
Share on other sites
8 hours ago, Dedmen said:

What? adapted? What do you mean? 3ms is hardcoded, CPU doesn't matter.

 

 

It's a simple general consideration about engine. I mean nothing should be definitive. CPUs evolve. What was good 10 years ago, can be rethink today. I'm not waiting for an answer, and even less a change!

I'm just wondering where comes this figure from (who decided?, why this slot?), and is it still the best choice?

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

×