redraskal / r6-dissect

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

Consider calculating `role` for each operator #28

Closed stnokott closed 1 year ago

stnokott commented 1 year ago

As continued from #27 :

I think we just need a way to calculate what role each operator is part of, so we can assign the team role based on what the players pick.

@redraskal

stnokott commented 1 year ago

I think I understand now what you are suggesting. Is the following correct?

The current approach for deriving the team role:

  1. Determine the spawn (seems unreliable)
  2. If the spawn is empty, set the role to ATTACK, otherwise "DEFENSE"

Your suggested new approach:

  1. Keep a map of map[operatorName]role or something similar (possibly automatically generated in some way)
  2. Find out which operator a player picked
  3. Find out which role this operator belongs to, thus finding out which role the player has
  4. Assign the team's role based on the player's/the player's operator's role
stnokott commented 1 year ago

If the role is not actually present in the replay file or not easy to find or subject to change, then I think this is a good idea.

If you like, I can try implementing this.

redraskal commented 1 year ago

If the role is not actually present in the replay file or not easy to find or subject to change, then I think this is a good idea.

If you like, I can try implementing this.

The name in the map could be the uint64 operator id (recently pushed this). I think we are in sync with this.

You can implement this idea, I appreciate the help!

stnokott commented 1 year ago

Is it ok if I bump Go to 1.20 for this PR? There are a few function I want to use that only became available in 1.20.

redraskal commented 1 year ago

Yes