Finally finding some time again

Work always goes crazy at the end of the year. In typical fashion, the clients wanted to spend every last dime they had of their budgets by the end of the year. So my employer decided to happily accept the money and projects and informed me I was working way more then I should. I do have a vivid memory of my boss asking why I had almost 60 hours in one week (~54 of it was billable hours to a client). But alas, I do enjoy the work and am rather happy having a paycheck this day in age. So I cannot complain to much.

What I can complain about however, it the inability to get the next version of MatchMod out the door. Truth be told, there are not a whole lot more features to add in at this point, but there are some really annoying bugs I need to work out.

  • Attack/Defend scoring is wonky in the second half

What I need to do is get some lobbies together and play Attack/Defend maps. The issue is something in the events that the server are out of whack. In a nutshell, here is how TF2 notifies you of Attack/Defend.

The game uses an event system, simply put, when something happens, say a flag gets tocuhed, or a checkpoint is chanign hands and so forth, the game send events to all the clients to they can interprest the event and display it to you visially, a hud element or something along those lines. For the purpose of MatchMod, it literraly sits there and listens to the events and performs work on its own, sometimes I stop events from occuring (the F4 menu when Ready-Up is on), or modify there behavior slightly.

The match sequence itself actually hinges off some of the events, mostly the beginning of the rounds, end of the rounds and the match start. But attack/defend was a little strange. It was slightly different formatted events, on top of the fact attack defend can exist as single stage (GravelPit) or multistage (Dusbowl) so I could not account the end of a round was the end of the entire round like in a push style map, so I had to dig into the events in a bit more detail.

The explanation gets really ugly, but here is what happens in the short version

  • The Match sequence is tracked internally to the mod (Pre-match/first half/halftime/etc). This is represented as a number. 0 meaning no match and the mod does nothing, and if that internal flag increments, it lets the mod know where things are. This aspect generally works.
  • For Attack/Defend, I am hooking into the event that actually displays the Score panel on your client, but only if the previously mentioned match is in certain states (only the first half, second half or overtime).
  • The event lets me know if it was a completed round or simply a mini-round (1st stage of dustbowl). I am looking for the completed round and also the event that triggers the teams to swap.
  • I use the team swap to determine where the match is within the first half, since the game basically happens twice.

The first half works without any issues, in testing the second half works fine, it is when a second game is started I think is where things get wonky. I think the issue lies in TF2 is tracking the teams on its own, so on occasion the teams when a round begins are internally swapped and I might not be catching the correct event, or something is getting out of sequence in the balancing act I am doing. I will have to pull the event output from a couple of matches and see if I can sort out the exact scenario that is occuring. This entails creating new plugin solely to output the events and look at a bunch of numbers. That or enable cheats, dump events to the logs, disable cheats, have players join, play game, download MASSIVE log file and read.

In a nutshell, I haven’t abandoned this mod by any stretch, but have not had a few hours to sit and dig into this for quite some time. Will try to get this done in a few weeks, besides that bug the new release is done and has been done. The config files are complete, except for the white-lists since they are releasing more and more weapons then I care to think about and sort out. We’ll see what I can get through this weekend.

 

Leave a Reply