Advertisement
Nerexis

Untitled

Nov 27th, 2023
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 1.73 KB | None | 0 0
  1. // Map Benchmark by Nerexis (nmilsim.wordpress.com )
  2. // Discord: https://discordapp.com/invite/s7BMSjp
  3. // Steam: https://steamcommunity.com/profiles/76561198010051679/
  4. // version 27.11.2023
  5.  
  6. [] spawn {
  7.     private _totalFPS = 0;
  8.     private _count = 0;
  9.     private _mapSize = worldSize;
  10.     private _startTime = diag_tickTime;
  11.  
  12.     player allowDamage false;
  13.     private _ehId = player addEventHandler["HandleDamage", {0;}];
  14.  
  15.     setViewDistance 4000;
  16.     setObjectViewDistance 4000;
  17.     setDate [2022,2,24,12,00];
  18.  
  19.     0 setOvercast 0.3;
  20.     0 setRain 0;
  21.     0 setFog 0;
  22.     forceWeatherChange;
  23.     uisleep 1;
  24.  
  25.     systemChat "Starting FPS test, please close debug console...";
  26.     uisleep 1;
  27.  
  28.     diag_log "Starting FPS test...";
  29.     systemChat "3";
  30.     uisleep 1;
  31.     systemChat "2";
  32.     uisleep 1;
  33.     systemChat "1";
  34.     uisleep 1;
  35.     systemChat "START";
  36.    
  37.     for "_x" from 0 to _mapSize step 1000 do {
  38.         for "_y" from 0 to _mapSize step 1000 do {            
  39.             private _center = [_x + 500, _y + 500, 0];            
  40.             if (surfaceIsWater _center) then {
  41.                 continue;
  42.             };
  43.            
  44.             private _pos = [_center select 0, _center select 1, 0];
  45.             cameraOn setPos _pos;
  46.             cameraOn setDir ([_pos, [worldSize/2,worldSize/2,0]] call BIS_fnc_dirTo);
  47.             cameraOn camCommit 0;
  48.            
  49.             uiSleep 1;
  50.            
  51.             private _fps = diag_fps;                
  52.             _totalFPS = _totalFPS + _fps;
  53.             _count = _count + 1;
  54.         };
  55.     };
  56.    
  57.     private _endTime = diag_tickTime;
  58.     private _elapsedTime = _endTime - _startTime;
  59.     private _averageFPS = _totalFPS / _count;
  60.    
  61.     private _msg = format ["Map %1: Average FPS: %2, Samples: %3, Took: %4 seconds", worldName, _averageFPS, _count, _elapsedTime];
  62.     systemChat _msg;
  63.     diag_log _msg;
  64.     player allowDamage true;
  65.     player removeEventHandler["HandleDamage",_ehId];
  66. };
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement