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

Parsers #8

Open
jaagupkymmel opened this issue Feb 24, 2014 · 29 comments
Open

Parsers #8

jaagupkymmel opened this issue Feb 24, 2014 · 29 comments

Comments

@jaagupkymmel
Copy link
Contributor

When writing parsers for non-production purposes, make sure you make them as strict as possible, to make it easier to find errors in wiki.

@lukegb
Copy link
Contributor

lukegb commented Feb 24, 2014

👍

@themasch
Copy link
Member

I totally agree with that. lol-observer is way to generous. Needs to be fixed :D

@tyscorp
Copy link
Member

tyscorp commented Mar 1, 2014

Perhaps we should write a "reference parser" and include unit tests for everything, then run it through all featured games for every region.

@themasch
Copy link
Member

themasch commented Mar 1, 2014

@tyscorp i really like this idea. We should use a language everyone understand and thats easy to work with and easy to depoly. Ideas? I'd vote for js..

@tyscorp
Copy link
Member

tyscorp commented Mar 1, 2014

I'd vote for node ;)

@Zero3
Copy link

Zero3 commented Mar 1, 2014

I plan on expanding https://github.com/Zero3/LolSpecAnalyzer to include a proper parser once I get some free time. It's Java.

@jaagupkymmel
Copy link
Contributor Author

The one problem that I have with JS is dynamic typing. It's harder to figure out of which type a parameter for a function should be. If you're willing to add comments about params and return types, or switch to something like http://www.typescriptlang.org/ (Never used, just Googled), which is essentially JS, but has static typing, then I guess I'll be fine with JS, even though I'd prefer Java.

@Zero3, if you don't feel like writing a new parser from scratch, you may contribute to https://github.com/loldevs/lol-spec, it does fail some keyframes, but this is intentional, as it means everything that does not correlate with the information in wiki should raise an exception and thus making it easier to find edge-cases/errors in wiki. Right now, it needs to collect information about sections we know nothing about, and maybe analyse this data.

@themasch
Copy link
Member

themasch commented Mar 2, 2014

@jaagupkymmel I understand your point even when I'm a pretty big fan of dynamic typing. But I'm 100% with you regarding comments, if we write one "standard loldev leaguespec parser" there need to be a lot of comments everywhere!

I'm not really sure about typescript because its one of these "compile to js" languages. Developing with them always feels awkward.

Personally I'd prefer C++ over Java if we choose to not use JS but I'm fine with anything thats a "common used language". So no Haskell/COBOL/Basic/brainfuck pls.
If you bring really good weapons I might even be okay with .NET. Maybe. If I'm drunk...

@Divi
Copy link
Member

Divi commented Mar 2, 2014

I'm clearly not good with data sniffing, but Java is often used for these uses. Fast to develop, and good objects typing. I'm ok with JS too.

@jaagupkymmel
Copy link
Contributor Author

C++ seems a bit of an overkill for such task. Looking at the codebase we have right now, we should stick to either JS or Java.

@themasch
Copy link
Member

Okay, should we put the parser inside this repo (since the documentation is in the wiki anyway) or should we create a new one?

@jaagupkymmel
Copy link
Contributor Author

I think we should have a seperate one.

@vafrederico
Copy link

I think we should put it in this one, since the parser will be directly related to the wiki.

By the way, i have a parser written in Python. In case anyone need it.

@themasch
Copy link
Member

themasch commented Apr 2, 2014

Maybe we could just prepare some structured language-agnostic test data and provide multiple implementations ins various languages. Every one of them tested against the same set of tests.

@toulouse
Copy link
Member

toulouse commented Apr 9, 2014

More importantly, can we have a test set of data to write parsers against? I'm interested in writing a parser, myself, but can't find *.rofl files, and the PBE seems to be broken and disallowing replay downloads.

EDIT: Er. What @themasch said.

@vafrederico
Copy link

I have three replays saved, already decrypted. And i could download a few more.
Where should I commit them? In this repo, or we will have another repo for parsers?

@Divi
Copy link
Member

Divi commented Apr 12, 2014

I don't think that commit decrypted file is a good idea. But you can add links to pastebin or gist to your decrypted files in the wiki.

@themasch
Copy link
Member

I think we should create a parser-spec repo & collect some inputs & expected outputs decoupled from full files. Does someone know a good format for language agnostic tests? I'd suggest base64 encoded input & json output but we need to agree over a meta format.

@Divi
Copy link
Member

Divi commented Apr 14, 2014

Json is understood by all languages (with libs or not) and can be easily read by developpers : 👍

@Zero3
Copy link

Zero3 commented Jun 17, 2014

Regarding my comment @ 01-03-2014: Exams are almost over, so I've started my work on a proper parser. I've piggybacked on the downloader by @jaagupkymmel (https://github.com/loldevs/lol-spec) to fetch and decrypt all keyframes for a game which worked great. So I have a test game to work with now.

My plan so far is to import keyframes from disk, parse them into Java objects and output the data in JSON format, keeping the framework modular so that one may easily add additional importers and exporters.

If you guys have any preferences/ideas/notes before I get too far, be sure to let me know! I agree about the strict parsing comment, which I will keep in mind. And the JSON comment as well, of course.

@Divi
Copy link
Member

Divi commented Jun 17, 2014

Good luck for the end of your exams :)
Great idea about output formatter. For the input, maybe you should create an input which parse a keyframe directly from an URL, without downloading the keyframe (on the disk), for people who don't want to keep the keyframe.

@themasch
Copy link
Member

Do you guys think its a good idea to agree on a standard output format for keyframes and chunk? Like a JSON schema?

@jaagupkymmel
Copy link
Contributor Author

Yeah, JSON seems the way to go.

@akuseru
Copy link

akuseru commented Jun 18, 2014

I would recommend trying to match the /timeline endpoint shown in #12, while more data could be made available it would allow for some degree of switching out the official api with the custom data without too much effort.

@themasch
Copy link
Member

That sounds reasonable. do we know if all informations from that timeline
exist in key frames, too?

@Divi
Copy link
Member

Divi commented Jun 18, 2014

I think all data are in keyframes except the events part which are in chunks. There is no string like WARD_PLACED, etc, in keyframes.

The output should be the same as the timeline, with data from https://acs.leagueoflegends.com/v1/stats/game/NA1/1414415714, particularly the part ['participants'][n]['stats'].

I'll check this week-end if another data are available.

@akuseru
Copy link

akuseru commented Jun 22, 2014

@Divi events are available in the keyframes. Just because it's missing WARD_PLACED doesn't mean that the information is not there.

SightWard YellowTrinket do show up in the data.

@Divi
Copy link
Member

Divi commented Jun 22, 2014

I just took WARD_PLACED as example, I didn't find anything about kill or
death. Maybe I miss something if you found a part talking about wards, I'll
check this tonight.

@avborhanian
Copy link

Actually, I think the bottom section below turrets has more to deal with loading models and their placement for the game. Don't have a hundred percent proof, but Yonkey is listed twice as well as ShopMale, which are the models for the shopkeeper and his pet.

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

No branches or pull requests

10 participants