sc2reader Tracker events not correctly parsed

114 views
Skip to first unread message

Matthias Lantsch

unread,
Aug 20, 2015, 10:19:01 AM8/20/15
to sc2reader
Hello I hope someone is still active here in this group.
I was using the s2protocol to parse replay for quite some time, then decided to switch to the sc2reader, since it does present me with so much more information.
But now as I am using it, I noticed a strange "Bug"?? in the program. I wrote my own plugin to handle TrackerEvents.
But somehow the event does only contain the income rates and not other important values like minerals_army_used.
(event.name) => PlayerStatsEvent
(event.pid) => 8
(event.player) => Player 8 - DarthAlasar (Protoss)
(event.ff_minerals_lost_army) => 0
(event.ff_minerals_lost_economy) => 0
(event.ff_minerals_lost_technology) => 0
(event.ff_vespene_lost_army) => 0
(event.ff_vespene_lost_economy) => 0
(event.ff_vespene_lost_technology) => 0
(event.food_made) => 26.0
(event.food_used) => 19.0
(event.frame) => 3360
(event.load_context) => <bound method PlayerStatsEvent.load_context of <sc2reader.events.tracker.PlayerStatsEvent object at 0x7f5b8c99cc50>>
(event.minerals_collection_rate) => 600
(event.minerals_current) => 215
(event.minerals_killed) => 0
(event.minerals_killed_army) => 0
(event.minerals_killed_economy) => 0
(event.minerals_killed_technology) => 0
(event.minerals_lost) => 0
(event.minerals_lost_army) => 0
(event.minerals_lost_economy) => 0
(event.minerals_lost_technology) => 0
(event.minerals_used_active_forces) => 0
(event.minerals_used_current) => 1500
(event.minerals_used_current_army) => 0
(event.minerals_used_current_economy) => 1500
(event.minerals_used_current_technology) => 0
(event.minerals_used_in_progress) => 450
(event.minerals_used_in_progress_army) => 0
(event.minerals_used_in_progress_economy) => 450
(event.minerals_used_in_progress_technology) => 0
(event.resources_killed) => 0
(event.resources_lost) => 0
(event.resources_used_current) => 1500
(event.resources_used_in_progress) => 450
(event.second) => 210
(event.stats) => {0: 215, 1: 0, 2: 600, 3: 0, 4: 18, 5: 0, 6: 450, 7: 0, 8: 0, 9: 0, 10: 0, 11: 0, 12: 1500, 13: 0, 14: 0, 15: 0, 16: 0, 17: 0, 18: 0, 19: 0, 20: 0, 21: 0, 22: 0, 23: 0, 24: 0, 25: 0, 26: 0, 27: 0, 28: 0, 29: 77824, 30: 106496, 31: 0, 32: 0, 33: 0, 34: 0, 35: 0, 36: 0, 37: 0, 38: 0}
(event.vespene_collection_rate) => 0
(event.vespene_current) => 0
(event.vespene_killed) => 0
(event.vespene_killed_army) => 0
(event.vespene_killed_economy) => 0
(event.vespene_killed_technology) => 0
(event.vespene_lost) => 0
(event.vespene_lost_army) => 0
(event.vespene_lost_economy) => 0
(event.vespene_lost_technology) => 0
(event.vespene_used_active_forces) => 0
(event.vespene_used_current) => 0
(event.vespene_used_current_army) => 0
(event.vespene_used_current_economy) => 0
(event.vespene_used_current_technology) => 0
(event.vespene_used_in_progress) => 0
(event.vespene_used_in_progress_army) => 0
(event.vespene_used_in_progress_economy) => 0
(event.vespene_used_in_progress_technology) => 0
(event.workers_active_count) => 18
Here's a debugging output from one of the events.
At first I thought it was a damaged replay file, but running it over all replays in the test_replays folder generated similiar output for all Trackerevents (for replays that do feature TrackerEvents, of course).
You cannot tell me that sc2reader has these fields, but is not able to correctly fill them, cause even s2protocol can do that.
Am I missing something stupid?
System info:
Ubuntu 14, python 2.7, mypq per pip installed, test replays all of the in the git repo included replay files
Thanks for your help in advance
Matthias

David Joerg

unread,
Aug 20, 2015, 11:07:39 AM8/20/15
to sc2reader
I see in your output:
(event.minerals_used_current_army) => 0

is that the same as what you're looking for, minerals_army_used ?


--
You received this message because you are subscribed to the Google Groups "sc2reader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sc2reader+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthias Lantsch

unread,
Aug 20, 2015, 11:41:51 AM8/20/15
to sc2reader
Ah yes it is, but it remains 0 throughout the whole replay, which it clearly is not.

David Joerg

unread,
Aug 20, 2015, 11:45:53 AM8/20/15
to sc2reader
Sure, but the 0 might be from the replay file itself, or it might be a bug in sc2reader.  To find out you'd use s2protocol.

If you can positively identify a field that's in s2protocol but not in sc2reader, then it's not hard to add it to sc2reader.


Matthias Lantsch

unread,
Aug 20, 2015, 5:57:04 PM8/20/15
to sc2reader
Ok I am 100% positive (tested with 5 different replays) that s2protocol can read a number where sc2reader reads 0.
I am just wondering because there is some code in the tracker.py to get the value from the raw bytestream:
76        #: An ordered list of all the available stats        
77        self.stats = data[1]
...
121       #: The total mineral cost of current army units (buildings?)
122      self.minerals_used_current_army = clamp(self.stats[11])



I will check if the value is being read correctly and is just being overwritten, even though I really don't think so.

Matthias Lantsch

unread,
Aug 21, 2015, 5:29:39 AM8/21/15
to sc2reader
In addition to confirming with s2protocol, I uploaded the replay to ggtracker, which seems to see the numbers as well.
http://ggtracker.com/matches/6067220

David Joerg

unread,
Aug 21, 2015, 7:40:44 AM8/21/15
to sc2reader
Hi, I'm the GGTracker developer... if you are saying that it "seems to see the numbers as well" because it is showing the total army value throughout the game: GGTracker computes that directly itself from the army composition, rather than taking it from tracker events.


Reply all
Reply to author
Forward
0 new messages