Skip to content

Instantly share code, notes, and snippets.

@JonBons
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonBons/a08178c5e9ba0d44f571 to your computer and use it in GitHub Desktop.
Save JonBons/a08178c5e9ba0d44f571 to your computer and use it in GitHub Desktop.
AGM Mod - PBO FPS Hit - Benchmark
$gameArgsVanilla = "-window -nosplash -world=empty -noPause -mod=; -autotest=A3_AGM_UnitTest.cfg"
$gameArgs = "-window -nosplash -world=empty -noPause -mod=@CBA_A3;@agm; -autotest=A3_AGM_UnitTest.cfg"
$gameDir = "C:\SteamApps\SteamApps\common\Arma 3" #change to your A3 directory
$logDir = "C:\Users\JonBons\AppData\Local\Arma 3" #change JonBons to your windows username
$targetMod = "@agm"
$pboFps = @()
$pboList = @()
$pboList += ,@('agm_core', @())
$pboList += ,@('agm_interaction', @("agm_core"))
$pboList += ,@('agm_ai', @("agm_core"))
$pboList += ,@('agm_aircraft', @("agm_core"))
$pboList += ,@('agm_armour', @("agm_core"))
$pboList += ,@('agm_attach', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_backblast', @("agm_core"))
$pboList += ,@('agm_backpacks', @("agm_core"))
$pboList += ,@('agm_ballistics', @("agm_core"))
$pboList += ,@('agm_captives', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_difficulties', @("agm_core"))
$pboList += ,@('agm_disposable', @("agm_core"))
$pboList += ,@('agm_explosives', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_fastroping', @("agm_core"))
$pboList += ,@('agm_firecontrolsystem', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_gforces', @("agm_core", "agm_medical"))
$pboList += ,@('agm_goggles', @("agm_core"))
$pboList += ,@('agm_grenades', @("agm_core"))
$pboList += ,@('agm_hearing', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_inventory', @("agm_core"))
$pboList += ,@('agm_logistics', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_magazinerepack', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_map', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_markers', @("agm_core"))
$pboList += ,@('agm_medical', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_movement', @("agm_core"))
$pboList += ,@('agm_nametags', @("agm_core"))
$pboList += ,@('agm_nightvision', @("agm_core"))
$pboList += ,@('agm_noradio', @("agm_core"))
$pboList += ,@('agm_overheating', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_parachute', @("agm_core"))
$pboList += ,@('agm_ragdolls', @("agm_core"))
$pboList += ,@('agm_realisticnames', @("agm_core"))
$pboList += ,@('agm_recoil', @("agm_core"))
$pboList += ,@('agm_reload', @("agm_core"))
$pboList += ,@('agm_respawn', @("agm_core", "agm_interaction"))
$pboList += ,@('agm_resting', @("agm_core"))
$pboList += ,@('agm_safemode', @("agm_core"))
$pboList += ,@('agm_scopes', @("agm_core"))
$pboList += ,@('agm_smallarms', @("agm_core"))
$pboList += ,@('agm_switchunits', @("agm_core"))
$pboList += ,@('agm_thermals', @("agm_core"))
$pboList += ,@('agm_topdownattack', @("agm_core"))
$pboList += ,@('agm_vector', @("agm_core"))
$pboList += ,@('agm_vehicles', @("agm_core"))
$pboList += ,@('agm_weaponselect', @("agm_core"))
$pboList += ,@('agm_wind', @("agm_core", "agm_interaction"))
function disableAllMods
{
$addonDir = "$gameDir\$targetMod\addons\"
foreach($pbo in $pboList)
{
$file = $addonDir + $pbo[0] + ".pbo"
if (Test-Path $file) {
Rename-Item $file ($pbo[0] + ".pbo.disabled")
}
}
}
function testAllMods
{
$addonDir = "$gameDir\$targetMod\addons\"
Write-Host ("Testing without AGM")
#start game and wait for finish
Start-Process -FilePath ($gameDir + "\arma3.exe") -ArgumentList $gameArgsVanilla -NoNewWindow -Wait
#get log file
$latestFile = gci $logDir | sort LastWriteTime | select -last 1
$latestFile = Get-Content ($logDir + "\" + $latestFile)
$logValue = [regex]::match($latestFile, '<AVERAGE FPS>(.*?)</AVERAGE FPS>').Groups[1].Value
$pboFps += ,@('vanilla', $logValue)
Write-Host "Test ran and got $logValue FPS"
foreach($pbo in $pboList)
{
$file = $addonDir + $pbo[0] + ".pbo.disabled"
if (Test-Path $file) {
# enabled dependancies
foreach($dep in $pbo[1]) {
$file2 = $addonDir + $dep + ".pbo.disabled"
if (Test-Path $file2) {
Rename-Item $file2 ($dep + ".pbo")
}
}
#enable mod
Rename-Item $file ($pbo[0] + ".pbo")
Write-Host ("Testing mod pbo:" + $pbo[0])
#start game and wait for finish
Start-Process -FilePath ($gameDir + "\arma3.exe") -ArgumentList $gameArgs -NoNewWindow -Wait
#get log file
$latestFile = gci $logDir | sort LastWriteTime | select -last 1
$latestFile = Get-Content ($logDir + "\" + $latestFile)
$logValue = [regex]::match($latestFile, '<AVERAGE FPS>(.*?)</AVERAGE FPS>').Groups[1].Value
$pboFps += ,@($pbo[0], $logValue)
Write-Host "Test ran and got $logValue FPS"
}
}
}
disableAllMods
Write-Host "Disabled mod pbos"
testAllMods #test all mods via adding more one at a time
#testEachMod #test only one mod pbo enabled at a time
Write-Host "Tested all mod pbos"
foreach($data in $pboFps)
{
Write-Host ($data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment