Advertisement
Nerexis

Untitled

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