haxball / haxball-issues

116 stars 43 forks source link

How to analyze replay file? #1998

Open kadavrahaxball opened 1 year ago

kadavrahaxball commented 1 year ago

I can code everything for haxball bot. But i dont know how people make replay analyzer which get stats for players. I have a stat system in my room which analyze accurate shoot, accurate pass, goalkeeping, dribbling, total run distance but it causes lag. so i want to get player stats by reading replay file. how can i start coding replay analyzer?

basro commented 1 year ago

There's no official API to do this at the moment, Those who do it are modifying the replayer source code. I do not recommend this approach since any kind of gameplay update would break it.

What I would recommend you do is to extract the relevant position data and events from the room in real time but only to store it without analyzing it, Defer the analysis for later.

AnddyAnddy commented 1 year ago

Would it be possible to have something public to work around hbr2 files ? So it would not be room dependant or hacky solution

basro commented 1 year ago

It would be possible, yes. Definitely something I'd consider implementing someday.