DOTA2 Configuration and timing adjustments (#23)

- Track configuration file
- Update script timings
- Update README and LICENSES
This commit is contained in:
derek-hirotsu
2023-12-07 10:40:12 -08:00
committed by GitHub
parent 2738cc2c3d
commit 07c59f095e
5 changed files with 108 additions and 20 deletions

View File

@@ -1,11 +1,13 @@
# Dota 2
Follows the benchmarking guide ["Benchmarking Dota 2" by JJ “PimpmuckL” Liebig](https://medium.com/layerth/benchmarking-dota-2-83c4322b12c0)
Based on the benchmarking guide ["Benchmarking Dota 2" by JJ “PimpmuckL” Liebig](https://medium.com/layerth/benchmarking-dota-2-83c4322b12c0).
The test uses a modified version of the guide's `benchmark.cfg` file originally provided by https://github.com/AveYo/D-OPTIMIZER
## Prerequisites
- Python 3.10+
- Dota 2 installed
- Keras OCR service
- Replay file named `benchmark.dem` copied to harness directory. This is the same file used by the benchmarking guide mentioned above. It can be downloaded [here](https://mega.nz/file/2ZlTiSaZ#byo4nSBjcsP8wsfKQAhFDuOMd0N9flUxtB8QZ4C5tSM)
## Options

95
dota2/benchmark.cfg Normal file
View File

@@ -0,0 +1,95 @@
push_var_values
showconsole
sv_log 0
sv_alternateticks 0
dota_spectator_use_broadcaster_stats_panel 0
dota_spectator_mode 0
dota_spectator_hero_index ""
cl_showdemooverlay 0; // still broken, no other command usable to hide demo overlay
demo_usefastgoto 1
fps_max 0
playdemo replays\benchmark
sleep 15000
//// DISABLE ALL CONSOLE SPEW SOURCES FOR A CLEAN SCRIPT OUTPUT ( VALVE PLZ GIFF SINGLE CMD FOR IT )
log_flags Console +DoNotEcho | grep %
log_flags General Developer DeveloperConsole Panel Panorama PanoramaScript VScript VScriptDbg VScriptScripts CustomUI CustomGameCache CustomNetTable +DoNotEcho
log_flags AnimationGraph AnimationSystem AnimGraphManager AnimResource Assert "BitBuf Error" BoneSetup Client "Combat Analyzer" CommandLine D3D Decals Demo DeveloperVerbose DotaGuide DOTAHLTVCamera +DoNotEcho
log_flags DOTAHLTVDirector DOTA_CHAT DownloadManager EmitSound EngineInitialization EngineServiceManager "Entity Dump" "Entity Load Unserialize" "Entity System" Filesystem GameEventSystem GCClient GlobalState HangWatchdog "HLTV Server" Host +DoNotEcho
log_flags HostStateManager IME InputService InputSystem InstantReplay LOADING MaterialSystem MeshSystem ModelCombiner modellib NavMesh NetworkClientService Networking "Networking Reliable" NetworkP2PService NetworkServerService +DoNotEcho
log_flags NetworkService Particles ParticlesLib Physics PostProcessing PostProcessPipeline RenderPipelineDota RenderPipelineVr RenderService RenderSystem ResourceSystem SaveRestore SaveRestoreIO Scaleform "Scaleform IME" ScaleformAS +DoNotEcho
log_flags ScaleformParse ScaleformScript SceneSystem SchemaSystem SchemaSystemUtils Server ServerLog SignonState SndEmitterSystem SndOperators SoundOperatorSystem SoundOpGameSystem SoundSystem SoundSystemLowLevel SpawnGroup SplitPacket +DoNotEcho
log_flags SplitScreen Steam SteamDatagramClient SteamDatagramServer SteamUnifiedMessages ToneMapping ToolGameSimulation TypeManager Vfx VguiCallQueue VolumetricFog VProf VR WeekendTourney Workshop WorldRenderer +DoNotEcho
log_flags Console +consoleonly | grep %
clear
echoln Starting Benchmark
demo_resume
demo_goto 98500 pause
sleep 10000
dota_spectator_mode 0
log_flags General -DoNotEcho
echoln Starting benchmark in 5...
sleep 1000
echoln Starting benchmark in 4...
sleep 1000
echoln Starting benchmark in 3...
sleep 1000
echoln Starting benchmark in 2...
sleep 1000
echoln Starting benchmark in 1...
sleep 1000
echoln Started...
log_flags General +DoNotEcho
sleep 1000
demo_resume
sleep 75000
log_flags General -DoNotEcho
echoln Benchmark stopping in 5
sleep 1000
echoln Benchmark stopping in 4
sleep 1000
echoln Benchmark stopping in 3
sleep 1000
echoln Benchmark stopping in 2
sleep 1000
echoln Benchmark stopping in 1
sleep 1000
demo_pause
echoln Exiting in 3...
sleep 1000
echoln Exiting in 2...
sleep 1000
echoln Exiting in 1...
sleep 1000
log_flags General +DoNotEcho
disconnect
//// RESTORE CONSOLE SPEW
log_flags Console +DoNotEcho | grep %
log_flags Developer DeveloperConsole Panel Panorama PanoramaScript VScript VScriptDbg VScriptScripts CustomUI CustomGameCache CustomNetTable -DoNotEcho
log_flags AnimationGraph AnimationSystem AnimGraphManager AnimResource Assert "BitBuf Error" BoneSetup Client "Combat Analyzer" CommandLine D3D Decals Demo DeveloperVerbose DotaGuide DOTAHLTVCamera -DoNotEcho
log_flags DOTAHLTVDirector DOTA_CHAT DownloadManager EmitSound EngineInitialization EngineServiceManager "Entity Dump" "Entity Load Unserialize" "Entity System" Filesystem GameEventSystem GCClient GlobalState HangWatchdog "HLTV Server" Host -DoNotEcho
log_flags HostStateManager IME InputService InputSystem InstantReplay LOADING MaterialSystem MeshSystem ModelCombiner modellib NavMesh NetworkClientService Networking "Networking Reliable" NetworkP2PService NetworkServerService -DoNotEcho
log_flags NetworkService Particles ParticlesLib Physics PostProcessing PostProcessPipeline RenderPipelineDota RenderPipelineVr RenderService RenderSystem ResourceSystem SaveRestore SaveRestoreIO Scaleform "Scaleform IME" ScaleformAS -DoNotEcho
log_flags ScaleformParse ScaleformScript SceneSystem SchemaSystem SchemaSystemUtils Server ServerLog SignonState SndEmitterSystem SndOperators SoundOperatorSystem SoundOpGameSystem SoundSystem SoundSystemLowLevel SpawnGroup SplitPacket -DoNotEcho
log_flags SplitScreen Steam SteamDatagramClient SteamDatagramServer SteamUnifiedMessages ToneMapping ToolGameSimulation TypeManager Vfx VguiCallQueue VolumetricFog VProf VR WeekendTourney Workshop WorldRenderer -DoNotEcho
log_flags ServerLog Workshop +DoNotEcho
log_flags Console -DoNotEcho | grep %
pop_var_values

View File

@@ -86,15 +86,15 @@ def run_benchmark():
setup_end_time = time.time()
elapsed_setup_time = round(setup_end_time - setup_start_time, 2)
logging.info("Harness setup took %f seconds", elapsed_setup_time)
time.sleep(25)
time.sleep(23)
# TODO -> Mark benchmark start time using video OCR by looking for a players name
if kerasService.wait_for_word(word="120", timeout=30, interval=0.1) is None:
logging.error("Didn't see the gold tick up to 120 to start the benchmark. Check settings and try again.")
if kerasService.wait_for_word(word="121", timeout=30, interval=0.1) is None:
logging.error("Didn't see the gold tick up to 121 to start the benchmark. Check settings and try again.")
sys.exit(1)
test_start_time = time.time()
time.sleep(75) # sleep duration during gameplay
time.sleep(73) # sleep duration during gameplay
if kerasService.wait_for_word(word="430", timeout=30, interval=0.1) is None:
logging.error("Didn't see 430 Gold. Did the benchmark run?")

View File

@@ -66,13 +66,6 @@ def copy_replay() -> None:
raise err
def copy_config_from_network_drive():
"""Copy benchmark config from network drive to harness folder"""
src_path = Path(r"\\Labs\labs\03_ProcessingFiles\Dota2\benchmark.cfg")
dest_path = SCRIPT_DIRECTORY / "benchmark.cfg"
shutil.copyfile(src_path, dest_path)
def copy_config() -> None:
"""Copy benchmark config to dota 2 folder"""
try:
@@ -82,14 +75,6 @@ def copy_config() -> None:
src_path = SCRIPT_DIRECTORY / "benchmark.cfg"
dest_path = config_path / "benchmark.cfg"
logging.info("Copying: %s -> %s", src_path, dest_path)
shutil.copy(src_path, dest_path)
return
except OSError:
logging.error("Could not copy local config file; Trying from network drive.")
try:
copy_config_from_network_drive()
logging.info("Copying: %s -> %s", src_path, dest_path)
shutil.copy(src_path, dest_path)
except OSError as err:

View File

@@ -10,6 +10,12 @@ Licenses with included binaries are also located within the directory of the tes
| FLAC Audio Encode | [FLAC](https://xiph.org/flac/index.html) | [BSD](https://xiph.org/flac/license.html) |
| y-cruncher | [y-cruncher](http://www.numberworld.org/y-cruncher/) | [Unique](http://www.numberworld.org/y-cruncher/license.html) |
## Required files
| Test | Link | License |
| --------------------------------- | ---------------------------------------------------- | ---------------------------------------------------------------- |
| DOTA 2 | [D-OPTIMIZER](https://github.com/AveYo/D-OPTIMIZER) | [MIT](https://github.com/AveYo/D-OPTIMIZER/blob/archive/LICENSE) |
## Python
| Project | License |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |