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

Add Python script to parse replays using sc2reader to easily import it on the website #9

Open
BurnySc2 opened this issue Jun 14, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@BurnySc2
Copy link
Owner

See title.

Python script: reads a SC2 replays which reads the actions (make scv, drop mule, put scv into gas) and converts it to JSON format which can be easily read by typescript on the website.

@BurnySc2 BurnySc2 added the enhancement New feature or request label Jun 14, 2020
@jtsauls
Copy link

jtsauls commented Oct 31, 2020

Is the .json format the same as the one exported by "Copy SC2 Bot Instructions"?

Using the spawningtool code mentioned in #1 , this seems relatively straight forward and I could take a stab at it.

I am only confused what "frame" is in that .json. It's around 22-23 x elapsed seconds? Whats the formula for that?

@BurnySc2 Thoughts?

@BurnySc2
Copy link
Owner Author

The formula is time_in_seconds * 22.4 == frames, based on 16 frames per second of the SC2 engine, and because they used the 'faster' mode which multiplies it by 1.4 -> 16 * 1.4 = 22.4.

My goal was to host a separate site (with backend this time) where people could upload their replays and it would spit out a sc2-planner link. I have already started working on it a month ago but have less time recently.
I have made the repo public if you want to take a look at it, I'm using ggtracker/sc2reader
https://github.com/BurnySc2/sc2-replay-analyser

Now is just the frontend + backend interaction missing for the website (which I would write in React + Typescript + Sanic backend framework) - while the backend uses the sc2-replay-analyser library to parse/analyse replays.

If you purely use the BO instructions from spawning tool, there will be a lot of actions missing - e.g. chronoboost or dropping mules or injects, and sometimes there are weird artifacts in their output (e.g. line with leading comma, sometimes x2).

@jtsauls
Copy link

jtsauls commented Oct 31, 2020

Yeah, that would be a really nice solution with a separate website. Looks like you kind have done all the heavy lifting--I was basically just thinking to write the function sc2planner.create_link. Using sc2reader is definitely the right way to go.

I'll poke around--but don't want to oversell my skills or time. I'm not sure how helpful I can be as I don't have any website experience.

Parsing of the text output from Spawning Tool would definitely be challenging and require assumptions.

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

No branches or pull requests

2 participants