Am 10.05.2010 um 14:49 schrieb Dan Kegel:
(I hesitate to use Steam or Battle.net for any of these benchmarks because autoupdates and login problems make games hard to script.)
Steam is pretty nice in this regard. Everything you need can be controlled via Command line, e.g.
Steam.exe -login <user> <pass> -applaunch 220 -novid -console -window -w 1024 -h 768 -dxlevel 90 +timedemo mytimedemo
Everything after -applaunch 220 is a game argument. With Source engine games you can pass anything you can enter on the console via "+command". You can't make the game quit that way though, because if you pass "+timedemo xxx +quit" it will quit right after starting the timedemo - the timedemo command doesn't block.
For killing Steam I'm using "killall Steam.exe".
This page has the game appids: http://developer.valvesoftware.com/wiki/Steam_Application_IDs
However, this won't fix any issues caused by autoupdates. The updates might have an impact on performance, and especially with the newer games(TF2, L4D) the timedemo format changes, and your recorded demo becomes useless. This didn't happen recently with TF2 though, I am still using my timedemo from 2006
Also, there's an add popup after the game quits, which can be annoying if you run multiple tests without restarting Steam. It can be disabled via a Steam setting(or registry key)