Login

russian armor

Introducing vault and flank

25 Sep 2015, 09:16 AM
#1
avatar of Inverse
Coder Red Badge

Posts: 1679 | Subs: 5

Hey guys!

Just wanted to share some stuff I've been working on recently. This is mostly interesting for developers, but I wanted to post it here in case someone working on a CoH2-related project finds it useful.

vault


vault is a Rust library for parsing CoH2 replays. Basically you give it a CoH2 replay and it runs through the replay pulling out information, such as map, players, and chat messages. Once it's done, you get back an object that you can use for some task. For instance, as of version 19545 vault has been powering COH2.ORG's replay system. When you upload a replay here, an application gets run (more on that later) that gives vault the replay and gets back a string representation of the replay information. This information is stored and displayed every time you view a replay on the site.

A few things make vault interesting. First, it can parse zipped archives of replay files and entire directories of replays on top of parsing single files. Each file in an archive or directory is parsed on its own thread, so parsing large numbers of replays at once is extremely fast. Furthermore, vault exposes a C-like interface, which means it can be called from any language that can call into C libraries. This lets you use vault from C# or a web application running Python or node.js without having to port the code, and means you can take advantage of the threading and fast parsing that vault gives you without having to learn or write your entire application in Rust.

Unfortunately, vault does not currently parse useful information about player commands and actions. I'm in touch with Relic about getting more information on the way commands are structured in replays, but if you have any knowledge on this subject please get in touch with me! I'd really appreciate it.

More information and further documentation for vault can be found at https://github.com/ryantaylor/vault

flank


flank is the parsing application I mentioned above. It's mostly a proof of concept and reference for using the vault library, but because it writes replay data as JSON to standard output it can be used like it is on this site, to parse replays, capture the JSON output, and then do something with it. Output isn't pretty-printed yet so it's not too useful on its own, but it can give you a sense of how quickly vault can parse large numbers of replays in directories and archives.

More information and further documentation for flank can be found at https://github.com/ryantaylor/flank

Thanks for reading guys! I'll be keeping this thread updated as I make changes and improvements. Let me know if you have any questions! If you try the library or the application and have issues or notice areas that could be improved, please post here or create a GitHub issue.

Special thanks to Seb and pingtoft, this would have taken a lot more time if I didn't have their code to look at for reference.
25 Sep 2015, 09:45 AM
#2
avatar of topperharley_42
Donator 11

Posts: 61

jump backJump back to quoted post25 Sep 2015, 09:16 AMInverse
Hey guys!

... When you upload a replay here, an application gets run (more on that later) that gives vault the replay and gets back a string representation of the replay information. This information is stored and displayed every time you view a replay on the site.

...


So do I understand it right, that replays can be watched within .org without further need of downloading?

As far as I get it, your works perfectly goes in line with the recent analysis of the OCF :sibHyena:
25 Sep 2015, 09:50 AM
#3
avatar of Inverse
Coder Red Badge

Posts: 1679 | Subs: 5

Nope, it means information like map, players, factions, chat, etc. is stored and then shown when you view a replay thread on COH2.ORG. vault takes a replay and gives this information to COH2.ORG, they store it and show it in the replay section of the site.

Eventually vault will be able to get information on build orders and player commands, but that will take some more work.
Seb
25 Sep 2015, 09:53 AM
#4
avatar of Seb
Admin Black Badge

Posts: 3709 | Subs: 2

Approved. :thumbsup:

And yeah basically there is no use to this unless you are a developer.

25 Sep 2015, 10:15 AM
#5
avatar of Cabreza

Posts: 656

jump backJump back to quoted post25 Sep 2015, 09:50 AMInverse
Nope, it means information like map, players, factions, chat, etc. is stored and then shown when you view a replay thread on COH2.ORG. vault takes a replay and gives this information to COH2.ORG, they store it and show it in the replay section of the site.

Eventually vault will be able to get information on build orders and player commands, but that will take some more work.


It sounds like Vault integration would be really useful if you wanted to search for replays featuring a specific build order or to find the worst chat BM to make it into the replays section.
25 Sep 2015, 10:23 AM
#6
avatar of Inverse
Coder Red Badge

Posts: 1679 | Subs: 5

Chat is already shown on replay threads. Once I finish the command parsing stuff like build orders will be available, but actually displaying them is a question of design for the guys responsible for the site. Searching based on this information is also something that would have to be designed into the site and implemented.
1 user is browsing this thread: 1 guest

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

895 users are online: 895 guests
0 post in the last 24h
12 posts in the last week
26 posts in the last month
Registered members: 49989
Welcome our newest member, LegalMetrologyConsul
Most online: 2043 users on 29 Oct 2023, 01:04 AM