ggtracker / sc2reader

Extracts gameplay information from Starcraft II replay files
http://pypi.python.org/pypi/sc2reader
MIT License
145 stars 144 forks source link

Help with incorrect times and fetching upgrade start times #76

Closed KelvinThaslim closed 5 years ago

KelvinThaslim commented 5 years ago

I'd submit a fix myself but I lack the skills to do so

StoicLoofah commented 5 years ago

Thanks for submitting this! This project is not too active for improvements, but we are still maintaining it for bugs.

Regarding, the last point about upgrade timing, that is the way that I'm handling it. You can see the logic at https://github.com/StoicLoofah/spawningtool/blob/c9e6a658e6e55adee796906f712ec7ffb2fea145/spawningtool/parser.py#L639 where I pull all of the data coded in at https://github.com/StoicLoofah/spawningtool/blob/master/spawningtool/lotv_constants.py#L315

If you want to get precise timings for when the upgrade started, I believe there are command card events for when they clicked on a specific upgrade in the bottom right hand side of hte screen. However, I never used it that data because it always seemed messier to try to correlate those command cards (different depending on building selected) to specific things in production.

Regarding the first two, I would believe that those are both real bugs and worth addressing. May I ask what skills you think you are lacking? It seems like you have diagnosed the data issues, so is the question about how to submit pull requests or how to navigate the sc2reader library? Happy to help with either or anything else.

KelvinThaslim commented 5 years ago

So the limit of my skill is to have sc2reader parse the replay, and to grab relevant pieces of info that i need. I have no clue on how to even start modifying the library unfortunately. I only noticed these issues because my output doesn't match the actual replay when i manually checked.

Thanks for the advice on the upgrade timings!

As for the time variable, would you advise me to get the frame data and dividing it by fps instead? If I were to do it this way, is the fps constant at 16.4 for all replays?

Thanks for your time!

KelvinThaslim commented 5 years ago

I would also really appreciate it if you could point me towards how I could solve these bugs myself.

Thanks again!

StoicLoofah commented 5 years ago

@Reaumur95

  1. Regarding modifying the library, is the issue that you don't know how to fork the repository to submit pull requests, or is the issue that you don't know where to get started in reading the sc2reader source code. Happy to help with either or both.

  2. Regarding the FPS, yeah, that's how I'm doing it. I have the FPS specified as 22.4 for LotV https://github.com/StoicLoofah/spawningtool/blob/c9e6a658e6e55adee796906f712ec7ffb2fea145/spawningtool/lotv_constants.py#L6 and just do the math https://github.com/StoicLoofah/spawningtool/blob/c9e6a658e6e55adee796906f712ec7ffb2fea145/spawningtool/lotv_constants.py#L873 It isn't frame-perfect, but it's presumably within +/- 22.4

cclauss commented 5 years ago

Can we change the title of this issue?

KelvinThaslim commented 5 years ago

title changed. Sorry about the ambiguous title

@StoicLoofah The issue is both, but now that I have a direction to go, I think I can look around on google and organically learn how to do all this. Thanks for your help! I'll ask u questions if I have trouble with this in the future if you don't mind

StoicLoofah commented 5 years ago

@Reaumur95 No worries. Let me point you in a few useful directions:

For contributing, you need to first fork this repository to Reaumur98/sc2reader. Then, whenever you have a change to make, you should:

  1. Update your master branch to match ggtracker/sc2reader/upstream
  2. Checkout a new branch
  3. Make your changes and commit them
  4. Push your branch to GitHub
  5. Create a pull request against ggtracker/sc2reader/upstream with your branch

Depending on you familiarity with git, that will either sound very normal or very confusing

For the codebase, there's an outdated docs site that you can check out https://sc2reader.readthedocs.io/en/latest/ . It's still pretty true, so maybe that will be a useful reference. Other than that, i recommend using pdb a lot: Configure it using these instructions https://github.com/ggtracker/sc2reader#for-contributors and just set breakpoints all over the code to see how it flows.

My email address is on my GitHub profile, so feel free to email me anytime with questions