Jump to content

Download now: Customizable DCS Benchmark Tool (v0.1: Open XR and Frameview)


Flextremes

Recommended Posts

This first version of the DCS Benchmark Tool is a very basic but functional tool to Benchmark OpenXR VR tracks in a consistent and precise way. This tool starts and stops statistics logging automatically when you replay a track. Constistent logging is crucial to evaluate small changes and makes comparisons between different systems possible

It is possible to capture detailed frame times and fps with Nvidia Frameview. Enable Frameview in the DCS_Benchmark_settings.ini that comes with the tool.

A few notes:

  • There are a million ways to improve this benchmark tool. This is truly the first version. 
  • I am anything but a professional coder, please improve and share updates with the community.
  • For the next versions I would like to add automatic calculation of the 'Average' and '5% Low' of the FPS and all 3 Frame Times (app CPU, rdr CPU & app GPU) available in OpenXR.
  • This version now supports OpenXR and Nvidia Frameview (Enable in the DCS_Benchmark_settings.ini)
  • Other tools are supported if you can set a the start and stop command in the DCS_Benchmark_settings.ini
  • You can use any track, just set the record duration in DCS_Benchmark_settings.ini.

Enjoy...

Suggestions for replay tracks for VR benchmarking are more than welcome!

Screenshot 2023-03-21 014142.png

 

 

Download "DCS Benchmark Tool.exe" from this ZIP (includes the AutoHotKey V1 script) https://drive.google.com/file/d/1zOOTsgHpzubCVU-aLPYJ20pmU56T_lVX/view?usp=sharing

OR copy the AutoHotkey V1 Script below into notepad and name the file "DCS Benchmark Tool.ahk"  and download runtime from www.AutoHotKey.com

EnvGet, Appdata, Appdata
EnvGet, LocalAppdata, LocalAppdata
EnvGet, Windir, Windir
EnvGet, CommonProgramFiles, CommonProgramFiles
EnvGet, CommonProgramW6432, CommonProgramW6432
EnvGet, HOMEDRIVE, HOMEDRIVE
EnvGet, HOMEPATH, HOMEPATH
EnvGet, Path, Path
EnvGet, SystemRoot, SystemRoot
EnvGet, USERPROFILE, USERPROFILE
EnvGet, TEMP, TEMP
EnvGet, TMP, TMP

; Set Default Settings
Inifile := A_ScriptDir "\DCS_Benchmark_settings.ini"
defaultFrameView := "No"
defaultSleepSeconds := 30
defaultStartCommands := """%programfiles%\OpenXR-Toolkit\companion.exe"" -record-stats toggle"
defaultStopCommands := """%programfiles%\OpenXR-Toolkit\companion.exe"" -record-stats toggle"
defaultLogFolder :=  """%localappdata%\OpenXR-Toolkit\stats"""

; Create settings.ini with default settings file if not exist
if !FileExist(IniFile) {

    IniWrite, %defaultSleepSeconds%, %IniFile%, Settings, SleepSeconds
    IniWrite, %defaultFrameView%, %IniFile%, Settings, FrameView
    IniWrite, %defaultStartCommands%, %IniFile%, Commands, StartCommands
    IniWrite, %defaultStopCommands%, %IniFile%, Commands, StopCommands
    IniWrite, %defaultLogFolder%, %IniFile%, Folders, LogFolder
}

; Read Settings from INI file
IniRead, SleepSeconds, %IniFile%, Settings, SleepSeconds
IniRead, FrameView, %IniFile%, Settings, FrameView
IniRead, StartCommands, %IniFile%, Commands, StartCommands
IniRead, StopCommands, %IniFile%, Commands, StopCommands
IniRead, LogFolder, %IniFile%, Folders, LogFolder

Transform, LogFolder, Deref, %LogFolder%
Transform, StartCommands, Deref, %StartCommands%
Transform, StopCommands, Deref, %StopCommands%


; Check if any setting is empty and prompt user to update INI file
if (SleepSeconds = "" || StartCommands = "" || StopCommands = "" || LogFolder = "") {
    MsgBox, 36, Update INI file, Some settings in the settings.ini file are empty. Do you want to update the INI file with default settings?
    IfMsgBox, Yes
    {
        IniWrite, %defaultSleepSeconds%, %IniFile%, Settings, SleepSeconds
        IniWrite, %defaultFrameView%, %IniFile%, Settings, FrameView
        IniWrite, %defaultStartCommands%, %IniFile%, Commands, StartCommands
        IniWrite, %defaultStopCommands%, %IniFile%, Commands, StopCommands
        IniWrite, %defaultLogFolder%, %IniFile%, Folders, LogFolder
        MsgBox, Finished, The settings.ini file has been updated with default settings. Please restart the script.
        ExitApp
    }
    else
    {
        MsgBox, Error, Please update the settings.ini file manually and ensure all settings are provided.
        ExitApp
    }
}

; MsgBox to inform users

msgBoxShown := 0
MsgBox, 1 --- Universal Benchmark Script for DCS ---`n`n1 Place your VR headset perfectly horizontal on a table.`n`n2 Select the DCS desktop mirror.`n`n3 Load the track in DCS you want to replay.`n`n4 Do NOT select FLY at the briefing screen YET!!!`n`n5 Select numpad 5 to center the view.`n`n6 Open the settings.ini file and configure the performance tool and log folder settings as needed.`n`n7 After you close this messagebox...`n`n>> ONLY Use the Pause Key to start replay in the briefing screen`n`n>> OpenXR stats recording will autostart and stop after %SleepSeconds% Seconds.`n`nSettings used during replay:`n- Use Frameview: %Frameview%`n- SleepSeconds: %SleepSeconds%`n- StartCommands: %StartCommands%`n- StopCommands: %StopCommands%`n- LogFolder: %LogFolder%
If (frameview = "Yes") {
    MsgBox, You enabled Nvidia Frameview.`n`nSet %SleepSeconds% for *Capture duration* in the Frameview confugration window`n`nSet [Scroll Lock] for *Benchmark Hotkey* in the Frameview confugration window` `n`nIn the briefing screen Press [Pause and Scroll Lock] simultaniously
}
msgBoxShown := 1

; Check if the DCS window exists
if !WinExist("ahk_exe DCS.exe") {
    MsgBox, 48, Error, DCS window not found. Please ensure DCS is running before starting the script.
    ExitApp
}

If (frameview = Yes) {
if !WinExist("ahk_exe Frameview.exe") {
    MsgBox, 48, Error, Frame not found. Please ensure Nvidia Frameview is running before starting the script.
    ExitApp
    }
}
if !WinExist("ahk_exe DCS.exe") {
    MsgBox, 48, Error, DCS window not found. Please ensure DCS is running before starting the script.
    ExitApp
}

; Activate the DCS window and show a tooltip
WinActivate, ahk_exe DCS.exe
 If (FrameView = "No") {
Tooltip, 1------- Load your track in Replay --------`n`n2------- Do NOT select Fly with mouse -------`n`n 3------ Press the [Pause] Key to Start -------
}
; Track replay
 If (FrameView = "Yes") {
Tooltip, 1------- Load your track in Replay --------`n`n2-------- Do NOT select Fly with mouse --------`n`n 3- Press [Pause and Scroll Lock] simultaniously to Start --
}

~Pause::
 if (msgBoxShown = 1) {
    Tooltip
    WinActivate, ahk_exe DCS.exe
    Run, %StartCommands%
;;    If (FrameView = Yes) {
   ; Send {ScrollLock}
;  Sendinput, {ScrollLock}
;    }
  remainingSeconds := SleepSeconds
       while (remainingSeconds > 0) {
            ToolTip, % "Countdown: " remainingSeconds " seconds remaining"
            Sleep, 1000
            remainingSeconds--
        }
        ToolTip

    Run, %StopCommands%

    msgbox, Finished! Open %LogFolder% for the stats CSV file
    Run, Explorer "%LogFolder%"
    exitapp


Return
}

 


Edited by Flextremes
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • Flextremes changed the title to Download now: Customizable DCS Benchmark Tool (v0.1: Open XR and Frameview)
  • 5 months later...

Nice work!  I would like to use this to capture dropped frames.  We were chatting in another thread about terrain stutters, and my theory is that the issue is caused by dropped frames.  I wonder if you have done a test where you are flying low over city terrain (Persian Gulf for example) while looking down to the terrain at 90 degrees.

Any chance of a youtube video walking through the process?

Thanks for this excellent work.

Link to comment
Share on other sites

For those who wish to try FrameView in 2D, it's very simple.  Download the app, and launch it.  This provides an overlay when you launch DCS.  I had to disable the F10 key under Misc in the Game Settings as I don't have a Scroll Lock key (F10 and Scroll Lock are the start/stop recording keys).  Launch DCS and launch a mission.  Press F10 and fly for a bit.  The app will create a .csv file in the designated folder.  Press F10 again to stop recording.  The App will create a summary file and a recording file for you to analyze. 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...