redraskal / r6-dissect

Match Replay API/CLI for Rainbow Six: Siege's Dissect (.rec) format.
MIT License
68 stars 12 forks source link

Win condition "TIME" possibly assigned to wrong team #21

Closed stnokott closed 1 year ago

stnokott commented 1 year ago

Describe the bug When the win condition is TIME, sometimes, the wrong team gets the the won=true boolean set. See this simple example of an exported JSON (exported with r6-dissect commit b593acf):

  [...]
  "teams": [
    {
      "name": "YOUR TEAM",
      "score": 0,
      "won": true,
      "winCondition": "TIME"
    },
    {
      "name": "OPPONENTS",
      "score": 1,
      "won": false
    }
  ],
  [...]

This is the first round of the match. Since the score after this round is 0:1, won=true should be on the team with score=1, not score=0.

To Reproduce Steps to reproduce the behavior:

  1. Export a round replay that ended on win condition "TIME" (I can't attach match replay files due to GitHub file type restrictions, if you need a file, I will PM it to you)
  2. See how the won=true value is sometimes* wrong

*note on "sometimes": I don't have enough match replay files to find out under what conditions it is wrong, I suspect it does not always happen. It might be related to whether the observing player starts as defender or attacker.

Expected behavior won=true should be set on the winning team.

Additional context All other win conditions seem correct, thus, I assume that the issue is related to this section: https://github.com/redraskal/r6-dissect/blob/b593acfca32cb2929be6164f81a3ed23c9db007f/dissect/time.go#L102-L107 This in turn relies on alliances which is set here: https://github.com/redraskal/r6-dissect/blob/b593acfca32cb2929be6164f81a3ed23c9db007f/dissect/time.go#L56-L60

I think this all boils down to the TeamIndex field being wrong as already partly discussed in #20, but I wanted to put this out there just to be sure in case it's actually related to a different issue.

Let me know if I can help with anything. I'm confident in Go, but not with the match replay file format, but I'll try my best.

redraskal commented 1 year ago

Can you send a replay to me @ ben@ryben.dev?

redraskal commented 1 year ago

Thank you for the context! Should be stable by the next release. I'll look into this tomorrow

stnokott commented 1 year ago

Can you send a replay to me @ ben@ryben.dev?

Done.

redraskal commented 1 year ago

@stnokott I think this may be resolved. There was a player with 2 records because of slightly different usernames. Dissect should now properly merge these weird records. It looks like the data is now accurate.

stnokott commented 1 year ago

Looks resolved to me, at least based on the replays available to me. Love that you included a non-integer team role too, lovely stuff.

Feel free to close the issue if you feel it is resolved.