enzanki-ars / rocket-league-replay-analysis

UNMAINTAINED - Creating videos for Analyzing Rocket League Replays (https://gitlab.com/enzanki_ars/rocket-league-replay-analysis)
https://gitlab.com/enzanki_ars/rocket-league-replay-analysis
GNU Affero General Public License v3.0
24 stars 2 forks source link

Runtime error: "KeyError: 'team'" #43

Closed jeromepl closed 6 years ago

jeromepl commented 6 years ago

No matter what parsed replay I feed into rocketleaguereplayanalysis (through python -m ...), I get back the following:

Parsing Player Info: 100%|#####################################################| 9190/9190 [00:00<00:00, 592937.08it/s]
Parsing Frame Data: 100%|########################################################| 9190/9190 [00:01<00:00, 6698.25it/s]
Minimap Render:   0%|                                                                         | 0/9190 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "C:\Users\Jerome\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Jerome\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\User\Dropbox\programming\rocket-league-replay-analysis\rocketleaguereplayanalysis\main.py", line 138, in <module>
    main()
  File "D:\User\Dropbox\programming\rocket-league-replay-analysis\rocketleaguereplayanalysis\main.py", line 122, in main
    do_render_minimap(video_prefix)
  File "D:\User\Dropbox\programming\rocket-league-replay-analysis\rocketleaguereplayanalysis\util\do_render.py", line 8, in do_render_minimap
    render_field(video_prefix)
  File "D:\User\Dropbox\programming\rocket-league-replay-analysis\rocketleaguereplayanalysis\render\minimap.py", line 22, in render_field
    out_prefix=out_prefix)
  File "D:\User\Dropbox\programming\rocket-league-replay-analysis\rocketleaguereplayanalysis\render\minimap.py", line 65, in render_frame
    player_team = get_player_team_name(car_id)
  File "D:\User\Dropbox\programming\rocket-league-replay-analysis\rocketleaguereplayanalysis\data\object_numbers.py", line 67, in get_player_team_name
    if get_player_info()[player_id]['team'] == team_blue:
KeyError: 'team'
enzanki-ars commented 6 years ago

I am making massive updates to the code, so I am not sure I have already addressed the issue. Sadly, I can’t tell you to run that branch, as it was partially gutted and doesn’t do any renders yet. If possible, could you provide a copy of the replay file?

enzanki-ars commented 6 years ago

Also, you may not want to run that version in Dropbox. It will create an image for every single one of those 9190 frames in that replay. Might take up a lot of space and bandwidth... Next version will remove that entirely.

jeromepl commented 6 years ago

Alright, guess I am better off waiting on the next version then! I will also move this out of my dropbox folder just in case.

Here is one of the replay files anyway: replay.zip

enzanki-ars commented 6 years ago

Sorry about that... I typed my message to quickly, and forgot to apologize for all of that. I posted the program to Reddit a bit too soon it seemed... People liked it, but it was very broken: documentation was very lacking, the code was very inefficient and abused resources, and didn't even work that well on Windows...

The next version will not use the file per frame SVG creation anymore, and instead will interface with FFmpeg for the entire video process. Also, it will now use pure python without dependencies to make creating binaries and distributing them a lot easier (hopefully...).

enzanki-ars commented 6 years ago

Can confirm the issue is present on my end. I see the fix, and will apply it now.

enzanki-ars commented 6 years ago

This fix is only in the new branch, as I do not feel it is worth moving to the current broken code in master as I am nearly ready to release an alpha version of 1.4.0 either tomorrow night or during the week.

enzanki-ars commented 6 years ago

I have just released v1.4.0-alpha1 at https://github.com/enzanki-ars/rocket-league-replay-analysis/releases/tag/v1.4.0-alpha1, though it is missing the minimap output. Mind testing to see if that fixes the issues?

jeromepl commented 6 years ago

Tried running the new version but ended up with a new error. See #44