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

parseEvent 'round_end' returning undefined reason and winner #157

Open
tiagorigoletto opened this issue Apr 4, 2024 · 1 comment
Open

Comments

@tiagorigoletto
Copy link

Hello, I was testing your example for finding clutches in a demo, and I bumped on the following issue:

Running
let round_ends = parseEvent(pathToDemo, 'round_end')

Returns

round_ends: [
  {
    event_name: 'round_end',
    reason: null,
    round: 1,
    tick: 0,
    winner: null
  },
  {
    event_name: 'round_end',
    reason: 'bomb_exploded',
    round: 2,
    tick: 9451,
    winner: 'T'
  },

The reason and winner for the first round are missing, but they appear incorrectly in the second round instead.
I encountered this issue on all 3 maps from the Copenhagen Major's final.

Awesome library by the way, thanks for putting it together.

@Halva773
Copy link

As far as I understand, this happens for several reasons:

  1. Restart of the round (There can be many empty values in round ended and not only in 1 round)
  2. I also found that if a knife round is played, then it is also taken into account in this dataframe

I write in python, so I don't know how to fix it in js. In Python it looks like this:

df = parser.parse_event("round_end", other=["total_rounds_played", 'round_win_status'])
df = df[df.winner.isna() == False].drop_duplicates(subset='total_rounds_played', keep='last').reset_index()

Principle: first you delete empty values, and then duplicates (according to the total_rounds_played parameter), where you leave only the last value (if total_rounds_played = 1 more than 1 time, then you need to leave only the last one, since it is correctly relevant)
If something is unclear, then ask GPT to rewrite the code in js and figure it out

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

2 participants