jjbott / RocketLeagueReplayParser

MIT License
109 stars 20 forks source link

Question: Is it possible to turn json back into replay file #44

Open markduk opened 2 years ago

markduk commented 2 years ago

I'm interested to know if it is possible to turn the json back into a replay file? This would open a whole world of editing replays that can then be viewed via RocketLeague.

tfausak commented 2 years ago

Hopefully @jjbott won't mind me shilling my own project here :)

Rattletrap can do that.

jjbott commented 2 years ago

Yeah, I never implemented that. In theory you could use my library to fiddle with the deserialized replay in memory, and then re-serialize it.

markduk commented 2 years ago

I see the Serialize method in the library, does it work? If so I could easily extend the console to convert from .json to .replay.

jjbott commented 2 years ago

Sorry I'm slow. Yeah, in theory Serialize works to output a replay.

I don't remember why deserializing from JSON was tough. Deserializing from "Pretty" JSON might be tricky, since it does some data mangling to generate it. "Raw" JSON might not be so bad. Could just be that no one uses my library, so no one asked for it, so why bother. 😄

Gutbuster commented 2 years ago

It's being used. But I think altering the replays is a slightly obscure need. I also looked into it at some point out of curiosity. Can't remember why. Maybe for adding some debug strings or playing a prank. Can't exactly recall.

jjbott commented 2 years ago

Yeah, I've always thought it'd be fun to create a completely custom replay from scratch. But unless you're doing something simple like changing someone's name in an existing replay, it's crazy complicated. Like, if you want to inject a player and have it move around, it's possible but you wont have a fun time. :)

markduk commented 2 years ago

I'm interested to hear how you and others use this library and why you wrote it in the first place. What problem were you trying to solve? Are you trying to extract data from the replay files for some reason? I can see value in doing that.

jjbott commented 2 years ago

I personally don't use it. I don't even play Rocket League anymore. 😄 But keeping the library up to date is a fun challenge.

Ages ago I thought it'd be interesting to see what kind of stats you could generate if you could parse the replays. There was a thread on the old Rocket League Forums where people were trying to figure out how to parse them, with a tiny bit of dev help. I joined that, and it was a lot of fun. At the end it felt like a race to see who would get a working parser first. 😄

Once I was able to parse them, I tried generating some visualizations for them. Like, there is code for generating heatmaps in the git history somewhere. But I found them useless, and the "race" was over, so I mostly lost interest.

Long story short, I ultimately never generated anything useful from this. I hope someone out there is!

somecsharp commented 1 year ago

I think it's pretty cool and appreciate your hard work on this. Has anyone ever tried to persist a replay to a relational database? Much easier to manipulate or analyze after that. The biz objects and models look merged here but easy to separate out. I may give it a shot for fun...