Jump to content
driftingnitro

[Script] Client's FPS, Displayed for Zeus (Test your 64 bit framerates with friends)

Recommended Posts

V48jthi.png

NK73sOZ.png

 

Latest V1.3:

MOD THREAD

MOD VERSION

WORKSHOP

ARMAHOLIC

 

This script enables Curators to see the Frames-per-second of each individual client when playing in multiplayer, or yourself when in SP. Allowing the Zeus to identify if there is a widespread framerate problem, or if a few select users are experiencing issues. Comments in the code explain how to modify it if you want to change the 'Warning text' threshold which by default is 20fps. Pasting this code into the

initPlayerLocal.sqf

of any mission should work without a problem.

Given Arma 3 is now in 64 bit it's the perfect opportunity for players to test their performance in multiplayer coop games with large scale combat. Find out who's computer is the beefiest when playing with your unit, or be able to identify which player's computers are having trouble keeping up with all the action on screen. A great tool for mission makers looking to maintain an optimized experience for their players when monitoring their progress in Zeus.

 

DISCLAIMER: The script version is out of date and does not have all the features of the mod. The mod only needs to be downloaded client side and I recommend you use it instead. If you still wish to use the script, or simply see how it runs, it is here at your disposal.

/////////////////////////////////////////////////////////
//Paste the following into the initPlayerLocal.sqf file//
/////////////////////////////////////////////////////////
////////////Script Written by DriftingNitro//////////////
//////////Help from Commy2, Dedmen, and Dscha////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
//Spawns a thread that will loop for each player and   //
//output their FPS to the server to be read by the zeus//
/////////////////////////////////////////////////////////
[] spawn {
   while {true} do {
        player setVariable ["DNI_PlayerFPS", floor diag_fps, true];
        sleep 0.1;
    };
};
/////////////////////////////////////////////////////////
//Waits until curators are initalized in order to check//
//if player is zeus to run the fps scripts             //
/////////////////////////////////////////////////////////
waitUntil {
    private _hasCurators = (count allcurators) > 0;
    private _hasInitializedCurators = (count (call BIS_fnc_listCuratorPlayers)) > 0;
    private _curatorsInitialized = !_hasCurators || _hasInitializedCurators;
    ((time > 2) || _curatorsInitialized)
    };
/////////////////////////////////////////////////////////
//If player is a curator it will run the script and each/
//player will have their FPS appear beneath them       //
/////////////////////////////////////////////////////////
if (player in (call bis_fnc_listcuratorplayers)) then {
	addMissionEventHandler ["Draw3D", {
		{
			_distance = position curatorCamera distance _x;
			//if zeus camera is farther than 1200 meters away from the targets the text will not display
			if (_distance < 1200) then {
				_playerFPS = _x getVariable ["DNI_PlayerFPS",50];
				//if the FPS is below 20 it turns red and becomes more visible for zeus to see so they are aware
				if (_playerFPS  <20) then 
				{
					drawIcon3D
					[
						"",//Path to image displayed near text
						[1,0,0,0.7],//color of the text using RGBA
						position _x,//position of the text _x referring to the player in 'allPlayers'
						1,//Width
						2,//height from position, below
						0,//angle
						format["%1 FPS: %2", name _x, str _playerFPS],//text to be displayed
						0,//shadow on text, 0=none,1=shadow,2=outline
						0.05,//text size
						"PuristaMedium",//text font
						"center"//align text left, right, or center
					];
				}
				//if the FPS is above 20 text is smaller and less visible as to not conern zeus as much
				else
				{
					drawIcon3D
					[
						"",//Path to image displayed near text
						[1,1,1,0.3],//color of the text using RGBA
						position _x,//position of the text _x referring to the player in 'allPlayers'
						1,//Width
						2,//height from position, below
						0,//angle
						format["%1 FPS: %2", name _x, str _playerFPS],//text to be displayed
						0,//shadow on text, 0=none,1=shadow,2=outline
						0.03,//text size
						"PuristaMedium",//text font
						"center"//align text left, right, or center
					];
				};
			};
		} forEach allPlayers;
		//Here is the array of units you wish to display the FPS text for, it can be 
		//changed to be an array of specific units or players if you wish
	}];
};
/////////////////////////////////////////////////////////
/////////////////////End FPS Script//////////////////////
/////////////////////////////////////////////////////////

 

  • Like 6
  • Sad 1

Share this post


Link to post
Share on other sites

Cool, so it does change colors based on the fps count? 

(ex: if the fps is below 20 it is red) 

Share this post


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

Cool, so it does change colors based on the fps count? 

(ex: if the fps is below 20 it is red) 

That's exactly what it does and you can change it to be whatever you like. I was working on some more complicated algorithms using polynomials, where it would get bigger, more opaque, and more red the lower it was. I was concerned about performance however considering It would calculate for each player. I could probably release this alternative (potentially broken with large player counts) script if you'd like.

Share this post


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

That's exactly what it does and you can change it to be whatever you like. I was working on some more complicated algorithms using polynomials, where it would get bigger, more opaque, and more red the lower it was. I was concerned about performance however considering It would calculate for each player. I could probably release this alternative (potentially broken with large player counts) script if you'd like.

Neat, this is pretty damn cool. Keep the effort up yeah? :)

Share this post


Link to post
Share on other sites

Really useful script :D. It is possible to have a mod version that load automatically in mission ? And/or a zeus module version to activate/deactivate it ?

  • Like 1

Share this post


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

Really useful script :D. It is possible to have a mod version that load automatically in mission ? And/or a zeus module version to activate/deactivate it ?

I haven't messed with addons or zeus modules but I'm up for a challenge. I'm in between projects right now though so probably not immediately soon.

 

5 hours ago, foxhound said:

Thanks for sending us your work :)

Release frontpaged on the Armaholic homepage.


news_download_a3_3.png
Client's FPS, Displayed for Zeus v1.0

Thanks for the help too! I was actually visiting this thread to edit the original post with a link to armaholic too!

Share this post


Link to post
Share on other sites
On 3/18/2017 at 2:10 PM, driftingnitro said:

I haven't messed with addons or zeus modules but I'm up for a challenge. I'm in between projects right now though so probably not immediately soon.

 

Sent you a PM about this...

Share this post


Link to post
Share on other sites
On 18/03/2017 at 3:08 PM, norx_aengell said:

It is possible to have a mod version that load automatically in mission ? And/or a zeus module version to activate/deactivate it ?

 

Really nice script, +1 for the above req, with an added req for hosting any future mod on Steam Workshop please :)

 

Great work.

Share this post


Link to post
Share on other sites
7 hours ago, Capt Childs said:

 

Really nice script, +1 for the above req, with an added req for hosting any future mod on Steam Workshop please :)

 

Great work.

 

A couple nice fellas helping me with an addon version. I'll put it on workshop too once it's ready.

  • Like 2

Share this post


Link to post
Share on other sites

Please don't just put it onto the workshop but release it on here too !  I never use Steam Workshop.

  • Like 1

Share this post


Link to post
Share on other sites
On 3/18/2017 at 11:08 AM, norx_aengell said:

is possible to have a mod version that load automatically...

 

On 3/21/2017 at 0:06 AM, That1Drifter said:

 

Sent you a PM...

 

On 3/21/2017 at 5:56 AM, Capt Childs said:

 

Really nice script, +1 for the above req...

 

On 3/25/2017 at 11:20 AM, kremator said:

Please don't just put it onto the workshop but release it on here too !

 

https://drive.google.com/open?id=0B_CeWozXIsKMSXFqTGZsZlpfQzQ

 

Here is the first release for the mod version, should work with any private server and will enable for players that join in-progress as well.

 

Untested scenarios include any scenarios involving more than one Zeus. I only tested this with a single zeus but it should work with more than one.

 

So with that I'm going to look up how to release it on the steam workshop. Also including random logo I made in 10 minutes.

 

9AXeo5f.png

  • Like 2

Share this post


Link to post
Share on other sites

That is awesome!!

 

Does the server and clients need this addon installed?

Edited by kman_(kya)
Ask question

Share this post


Link to post
Share on other sites
14 minutes ago, kman_(kya) said:

That is awesome!!

 

Does the server and clients need this addon installed?

Only Zeus needs the addon installed.

  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, driftingnitro said:

Only Zeus needs the addon installed.

 

Great, thanks for the info, help and mod!

Share this post


Link to post
Share on other sites

Is it possible to make this function toggle? My mates would use zeus after joining mcc. The script seems to require the zeus player to join as zeus from the start 

Share this post


Link to post
Share on other sites
6 hours ago, JT__ said:

Is it possible to make this function toggle? My mates would use zeus after joining mcc. The script seems to require the zeus player to join as zeus from the start 

I don't know quite how to make it a toggle using a module yet, but I am going to have it run some kind of check so it can be enabled if not zeus right at the beginning of the mission.

  • Like 1

Share this post


Link to post
Share on other sites
On 2017. 4. 7. at 1:39 AM, driftingnitro said:

I don't know quite how to make it a toggle using a module yet, but I am going to have it run some kind of check so it can be enabled if not zeus right at the beginning of the mission.

 

It is working perfectly. But in some cases, i have a problem joining in AI with Zeus. I'm not sure it is problem with this mod or prob with MCC. But anyways the functions working really great. Thank you 

Share this post


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

It is working perfectly. But in some cases, i have a problem joining in AI with Zeus. I'm not sure it is problem with this mod or prob with MCC. But anyways the functions working really great. Thank you 

 

Are you talking about remote controlling units? I don't think that's an issue with this mod. Glad to hear the fix is working though, thanks for testing it.

Share this post


Link to post
Share on other sites

Updated

1.2 - Added MCC compatability
- Zeus check now waits for Zeus interface every 5 seconds before activating
- Zeus can be assigned any time after mission start

  • Like 2

Share this post


Link to post
Share on other sites

1.21 - Added .bikey in the mod directory, move to your server's "Keys" folder.

1.22 - Added .bikey to the "keys" folder. (A bit rusty, forgot some protocol)

1.3 - Added ability for admins who log in to see FPS as well by request of(Only logged in admins, not voted admins)
- Added keybinding option to toggle visibility of framerates. Bind a key to: Custom Controls > Action 12 (Known bug, only works as Player or Zeus. Not spectator or splendid cam)
- Updated .bisign
- Backend work for future configuration options
- Changed the mod's logo

  • Like 1

Share this post


Link to post
Share on other sites

@driftingnitro

 

A couple of years on, I thought I would update our older version to 1.3, but I seem to be getting script errors in my RPT:

Error in expression <
];
};
};
} forEach allPlayers;


}];
};

Have I possibly missed something i supposed to edit at the end of the script?

 

Anfo

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

×