natf2 is shutting down, head over to teamfortress.tv for all of your TF2 coverage.

 
#1
37
Sigma  Steam
mid
Registered: October 2011
Posts: 123

It would be nice if, while watching SourceTV, you could catch all of the frags. spec_autodirector sort of does this, but it does it at the worst possible third person camera angles imaginable. I'm sure more people than just me have played around with "spec_autodirector 1;firstperson" binds to try to get around this, but the autodirector doesn't kick in until after a few seconds, so this doesn't really work. Hence, I decided to make my own, and wound up with the huge_status_monitor.

Download: http://dl.dropbox.com/u/29208222/huge_status_monitor.zip

What does this do, specifically? It uses a part of SourceLib https://github.com/frostschutz/SourceLib to mimic the request you make to a server when you do "view game info" on someone through steam and collects the results. It tracks the change in frags for each player over a number of intervals (default 9 intervals, 10s each if the tv_delay is 90s) and fills a queue with the top-fragging player over each interval (taking into consideration frags that occur in future intervals, but with a lower weight). Once the SourceTV has caught up to when those frags happened on the server, we write a cfg file to spectate the best player from that interval. Hence, all you need to do as a spectator is to bind a key to "exec spec_best" and press it periodically to switch to the view of whoever is about to go huge.

I find this particularly useful for when I'm casting and streaming, since I can pay minimal attention to the camera while talking and still get a good picture of what's going on. I'm happy enough just using this script for my own benefit, but it should also be useful for other casters, streamers, and really just anyone who wants to watch a match and catch the maximum number of frags in first person.

To use this, the first thing you'll need is python http://www.python.org/getit/ . I recommend getting python 2.x.x; the 3.x.x have some issues on windows that may prevent this script from running. Then, drop the files from the archive into your tf/cfg folder, run cmd, and cd your way into your tf/cfg folder (I might make a GUI for this someday, but this is command-line only!). You can check out the options with "huge_status_monitor.py -h". The minimum that this script needs to run is the server IP. If the port isn't 27015, you'll also need to provide that (note that you need to give the server info, not info for the SourceTV or relay -- on ESEA you can get the IP/port from viewing game info on a friend, or going into the client and viewing server info from there). The tv_delay is assumed to be 90s (what ESEA uses); you'll have to change that if there's a different delay (and possibly modify the period count as well, depending on what you're after -- more sprees, or more individual frags?). Once that's all taken care of, bind a key to "exec spec_best" while you're in game, and have fun. Here's some sample output from the match I watched tonight (you won't see this if you don't give -v, and you don't really need to see it if you're just pressing your bind ingame)

> huge_status_monitor.py -i 206.217.135.162 -p 27267 -v
Monitor initialized! Now running...
Best is Shwan.vec with 1 points
Best is Shwan.vec with 1 points
Best is Shwan.vec with 3 points
Best is DougyG.vec with 2 points
Best is DougyG.vec with 4 points
Best is thrckstr.vec with 4 points
Best is rb-^SYOPS with 1 points
...

Note that in its current implementation, it gives the next player to watch a bit earlier than the frags actually start happening. I prefer it this way because I get to see the leadup -- after trying it with it directly synced, I found that I'd just jump to a player who immediately killed someone and I couldn't see how they got into position. This does make it so that if you constantly press your bind, you'll switch away from some frags before they happen, so the best way to use it in practice is to hit the bind, wait until frags happen/it looks like they're not in position to do anything more, then hit the bind again. Also note that since this can't track ubers/damage at all (would be possible with log analysis, but you need rcon on the server to do that), you may end up watching a scout hiding in a corner who comes in late and gets 2 frags over a pocket who takes an uber and does a ton of damage. Hence, this isn't a perfect subsitute for good camera work, it's just a tool that helps out a bit.

Questions/issues? Ask in this thread. I'll update the OP if I make any changes to the script (good joke, I'll be playing D3).

Last edited: Mon, 14 May 2012, 05:39am by Sigma


Mon, 14 May 2012, 05:17am
#2
0
WithADanceNumber  Steam
mid+
Medium_698a5033464c3fe1d42bce34e7645bc3
Registered: September 2011
Posts: 429

nice work sigma, this is seriously great!

Mon, 14 May 2012, 05:19am
#3
0
noniss  Steam
mid
Medium_356c3e86530d2a4039431cd75ebf1814
Registered: November 2011
Posts: 232

holy shit thats a good idea

Mon, 14 May 2012, 05:21am
#4
3
foster  Steam
high
Registered: September 2011
Posts: 1019

sigma are you some sort of wizard?

Mon, 14 May 2012, 06:35am
#5
1
EWWV  Steam
mid+
Registered: September 2011
Posts: 437

amazing, someone give this man a tf2 scripting grant

Mon, 14 May 2012, 06:51am
#6
2
cinq  Steam
mid
Registered: November 2011
Posts: 142

s i g m a
i
g
m
a

nice man, that is amazing, and you chose to do it with python, like a boss.

Mon, 14 May 2012, 08:06am
#7
-7
FREIGHT_TRAIN  Steam
low
Registered: February 2012
Posts: 14

try hards zzzz

Mon, 14 May 2012, 08:55am
#8
0
Shwan  Steam
mid+
Registered: September 2011
Posts: 308

Got it working after I ran cmd as an admin! Good work sigma I look forward to using this for real.

Mon, 14 May 2012, 04:32pm
#9
0
Scholar  Steam
high-
Registered: January 2012
Posts: 884

good work sigma

Mon, 14 May 2012, 08:39pm
#10
7
defiance  Steam
high
Registered: September 2011
Posts: 1042

Sigma's next project is creating a program AI through python that can recreate his tf2 genius so he can have 5 teammates as good as him at every class.

Tue, 15 May 2012, 12:02am
#11
2
blueberrymuffin  Steam
mid
Medium_a964f79d1875906340481c69c4cd8315
Registered: September 2011
Posts: 165

send this to Valve

Tue, 15 May 2012, 08:43am
#12
0
Zigzter  Steam
high
Registered: September 2011
Posts: 1199

Monitor initialized! Now running...
Query failed after 3 retries, giving up on this period
Query failed after 3 retries, giving up on this period
Query failed after 3 retries, giving up on this period
Query failed after 3 retries, giving up on this period
Query failed after 3 retries, giving up on this period
Query failed after 3 retries, giving up on this period

What did I do wrong. :<

Thu, 17 May 2012, 02:30am
#13
2
Sigma  Steam
mid
Registered: October 2011
Posts: 123

Zigster -- that happens if the server IP or port are wrong. Make sure you're giving it the info for the server that the players are on, not the source tv info, and make sure you're giving the right port (it's not 27015 for esea servers).


Thu, 17 May 2012, 12:20pm
#14
0
Zigzter  Steam
high
Registered: September 2011
Posts: 1199

Ohhhh, I feel stupid now. I was giving it the STV IP.

Thanks. :D

Thu, 17 May 2012, 05:19pm
#15
0
fatmop  Steam
mid
Registered: January 2012
Posts: 209

AWESOME. So does this work for STV demos as well?

Tue, 22 May 2012, 03:05pm
#16
0
Freakin  Steam
mid+
Registered: February 2012
Posts: 365

fatmop wrote:

AWESOME. So does this work for STV demos as well?

Pretty sure it only works for live STV's since it accesses information from the match server itself.

Tue, 22 May 2012, 03:09pm
#17
0
nixnyte  Steam
mid-
Registered: October 2011
Posts: 99

Freakin wrote:

fatmop wrote:

AWESOME. So does this work for STV demos as well?

Pretty sure it only works for live STV's since it accesses information from the match server itself.

suggestion: a simple log file for this script. if someone runs it during a match (one of the players, for example), a simple file is output after the match to send along with the stv demo to casters that wish to use this script

so i guess it'd be a file that contains a timeline of the scores as they update

Tue, 22 May 2012, 03:19pm
#18
0
fatmop  Steam
mid
Registered: January 2012
Posts: 209

There is a public TF2 log file generator, right? That way even if someone didn't send me a log file I could just make my own and import it?

Tue, 22 May 2012, 08:13pm
#19
0
steelfire  Steam
mid
Registered: January 2012
Posts: 164

Love Python. Great programming language.

Thu, 24 May 2012, 04:28am