ggtracker/sc2reader

Players getting identified as "Observer" instead of "Participant"

Andrene opened this issue · 7 comments

Recently was reworking my replay processor and trying to clean up some things and noticed that it looks like in alot of cases that players are classed as Observers when they probably should be Participants.

Im not sure how everyone accesses players (or if they do).

From what it looks like replay.entities is the only non-deprecated way? But thats returning players as Observers.

Just curious if anyone has a more reliable way to get players as participants, or if them showing as Observers is a bug or intended

Sorry I don't have a really clean answer for you, but in short, I'm not sure.

This sounds like a problem I had encountered or heard mentioned in the past, but I'm not sure if we ever got to resolution on it.

When Archon mode was more popular, I remember issues with tracking player-unit associations, but that ended up falling away with Archon mode.

Well, I did a bit more digging and it looks like something isn't getting handled right... To get "defined" as a participant, control should be 2 and observe should be 0.

From dumping "slot_data" while its building replay.entities it looks like all players should be getting classified as participants but they arent for some reason...

{'control': 2, 'user_id': 1, 'team_id': 0, 'colorPref': 2, 'race_pref': 0, 'difficulty': 3, 'ai_build': 0, 'handicap': 100, 'observe': 0, 'logo_index': 0, 'hero': '', 'skin': '', 'mount': '', 'artifacts': [{'type_struct': ''}, {'type_struct': ''}, {'type_struct': ''}], 'working_set_slot_id': 1, 'rewards': "snip", 'toon_handle': '1-S2-1-12465535', 'licenses': [], 'tandem_leader_user_id': None, 'commander': b'', 'commander_level': 1, 'has_silence_penalty': 0, 'tandem_id': 1, 'commander_mastery_level': 0, 'commander_mastery_talents': [0, 0, 0, 0, 0, 0], 'trophy_id': 1, 'reward_overrides': [], 'brutal_plus_difficulty': 0, 'retry_mutation_indexes': [0, 0, 0, 0], 'ac_enemy_race': 0, 'ac_enemy_wave_type': 0, 'selected_commander_prestige': 0}

[Observer 1 - GrandWood, Observer 2 - mindblow, Observer 3 - ajk, Observer 4 - TheUnity, Observer 5 - Luminous, Observer 6 - nerrelas, Observer 7 - iLLuS, Observer 8 - WeeWoO, Observer 10 - Kwop, Observer 11 - MudKing, Observer 13 - korneel, Observer 12 - Ichigo, Observer 9 - playerkp, Observer 0 - InitialLiMiT]

Figured it out, it looks like the gameheart plugin which is registered by default "fixes" entities by forcing them to observers.
Seems like its only supposed to affect observers, as they "aren't identified as observers" per a comment, although from my testing it looks like they are...

def fix_entities(self, replay, actual_players):

More info...
So the gameheart plugin looks like its supposed to exit if there are units born in frame 0. However, for arcade games it looks like Frame 0 never exists, and so it never meets the criteria needed to exit.

>>> for event in test.tracker_events:
...     if (event.frame == 0):
...             print("frame 0")
... 
>>> 

Melee games have a frame 0 though... In order to prevent gameheart from causing problems with arcade game processing it might be easiest to just have the plugin exit if frame 0 doesnt exist... Any thoughts?

Oh, man, the gameheart stuff is old.

The frame 0 test seems okay. Alternatively, I might suggest we could check to see if it's a HOTS replay or a LOTV replay. If it's LOTV, then it isn't using gameheart

Sounds good! I'll get a PR opened at some point today.

Thanks! I'll go ahead and close this as everything looks to be good now.