Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The draft_timings parser sometimes assigns the first pick to the wrong team #2439

Open
DMzda opened this issue Oct 30, 2021 · 0 comments
Open

Comments

@DMzda
Copy link

DMzda commented Oct 30, 2021

Current Behavior
The first pick is assigned to the same team as the second pick. This along with an incorrect/outdated draft side assignment in odota/web led to the draft sides to only be correct when the first pick was incorrect (see odota/web#2863 )

Example:
GET https://api.opendota.com/api/matches/6227419633

"draft_timings": [
        {
            "order": 1,
            "pick": false,
            "active_team": 3,
            "hero_id": 129,
            "player_slot": null,
            "extra_time": 130,
            "total_time_taken": 5
        },
        {
            "order": 2,
            "pick": false,
            "active_team": 3,
            "hero_id": 114,
            "player_slot": null,
            "extra_time": 130,
            "total_time_taken": 2
        },
        {
            "order": 3,
            "pick": false,
            "active_team": 2,
            "hero_id": 119,
            "player_slot": null,
            "extra_time": 130,
            "total_time_taken": 2
        },
        ...
]

See active_team above.

Expected behavior/code
The first pick's active_team should be 2.

Possible Solution
This is probably due to this line:

// update the team that had the first pick/ban
draftTimings[0].active_team = ((sumActiveTeam % 2) + 2);

I don't currently have a good setup to test any potential fixes, but I may be able to in the future if needed.

Additional context/Screenshots
I wrote a small python script to identify broken matches:
https://gist.github.com/DMzda/9fb7cafa48e03e09c7eda00c73d754b8

You need requests and a /json subfolder to run it. The output looks like this:

6227492909
Result: {1: (3, True), 2: (2, True), 3: (3, True), 4: (2, True), 5: (3, True), 6: (2, True), 7: (2, True), 8: (3, True), 9: (3, True), 10: (2, True), 11: (3, True), 12: (2, True), 13: (3, True), 14: (2, True), 15: (2, True), 16: (3, True), 17: (3, True), 18: (2, True), 19: (3, True), 20: (2, True), 21: (3, True), 22: (2, True), 23: (3, True), 24: (2, True)}
Errors: {}

6227419633
Result: {1: (3, False), 2: (3, True), 3: (2, True), 4: (3, True), 5: (2, True), 6: (3, True), 7: (3, True), 8: (2, True), 9: (2, True), 10: (3, True), 11: (2, True), 12: (3, True), 13: (2, True), 14: (3, True), 15: (3, True), 16: (2, True), 17: (2, True), 18: (3, True), 19: (2, True), 20: (3, True), 21: (2, True), 22: (3, True), 23: (2, True), 24: (3, True)}
Errors: {1: (3, False)}

6227305557
Result: {1: (3, False), 2: (3, True), 3: (2, True), 4: (3, True), 5: (2, True), 6: (3, True), 7: (3, True), 8: (2, True), 9: (2, True), 10: (3, True), 11: (2, True), 12: (3, True), 13: (2, True), 14: (3, True), 15: (3, True), 16: (2, True), 17: (2, True), 18: (3, True), 19: (2, True), 20: (3, True), 21: (2, True), 22: (3, True), 23: (2, True), 24: (3, True)}
Errors: {1: (3, False)}

6227203516
Result: {1: (3, False), 2: (3, True), 3: (2, True), 4: (3, True), 5: (2, True), 6: (3, True), 7: (3, True), 8: (2, True), 9: (2, True), 10: (3, True), 11: (2, True), 12: (3, True), 13: (2, True), 14: (3, True), 15: (3, True), 16: (2, True), 17: (2, True), 18: (3, True), 19: (2, True), 20: (3, True), 21: (2, True), 22: (3, True), 23: (2, True), 24: (3, True)}
Errors: {1: (3, False)}

6227105229
Result: {1: (3, True), 2: (2, True), 3: (3, True), 4: (2, True), 5: (3, True), 6: (2, True), 7: (2, True), 8: (3, True), 9: (3, True), 10: (2, True), 11: (3, True), 12: (2, True), 13: (3, True), 14: (2, True), 15: (2, True), 16: (3, True), 17: (3, True), 18: (2, True), 19: (3, True), 20: (2, True), 21: (3, True), 22: (2, True), 23: (3, True), 24: (2, True)}
Errors: {}

6226873670
Result: {1: (3, True), 2: (2, True), 3: (3, True), 4: (2, True), 5: (3, True), 6: (2, True), 7: (2, True), 8: (3, True), 9: (3, True), 10: (2, True), 11: (3, True), 12: (2, True), 13: (3, True), 14: (2, True), 15: (2, True), 16: (3, True), 17: (3, True), 18: (2, True), 19: (3, True), 20: (2, True), 21: (3, True), 22: (2, True), 23: (3, True), 24: (2, True)}
Errors: {}

6226789510
Result: {1: (3, True), 2: (2, True), 3: (3, True), 4: (2, True), 5: (3, True), 6: (2, True), 7: (2, True), 8: (3, True), 9: (3, True), 10: (2, True), 11: (3, True), 12: (2, True), 13: (3, True), 14: (2, True), 15: (2, True), 16: (3, True), 17: (3, True), 18: (2, True), 19: (3, True), 20: (2, True), 21: (3, True), 22: (2, True), 23: (3, True), 24: (2, True)}
Errors: {}

6226709723
Result: {1: (3, False), 2: (3, True), 3: (2, True), 4: (3, True), 5: (2, True), 6: (3, True), 7: (3, True), 8: (2, True), 9: (2, True), 10: (3, True), 11: (2, True), 12: (3, True), 13: (2, True), 14: (3, True), 15: (3, True), 16: (2, True), 17: (2, True), 18: (3, True), 19: (2, True), 20: (3, True), 21: (2, True), 22: (3, True), 23: (2, True), 24: (3, True)}
Errors: {1: (3, False)}

Errors shows unexpected side assignments according to the latest captains mode rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant