saul / demofile

Node.js library for parsing Counter-Strike: Global Offensive demo files
https://demofile.dev
MIT License
484 stars 53 forks source link

Improved handling for ESEA demos #60

Closed mavrick closed 3 years ago

mavrick commented 6 years ago

Hey mate,

This is a bit of an odd request but ESEA and bot is resetting the match at halftime and overtime so it breaks round counts and overtime triggers in the game, including m_gamePhase.

I've written my own phase and overtime detection logic, do you think it's worth adding this into the demofile parser? It's very edge case but a lot of games are played on ESEA these days. Would also be nice to have an auto overtime lo3/lo5 detection.

Cheers,

Mav

thorebear commented 6 years ago

Don't know if you are aware, but the team scores are usually not reset, so you could get the current round number by something like team1.score + team2.score + 1.

saul commented 6 years ago

@thorebear has a solution so I'll leave it at that - I don't want to start implementing workarounds for funny things some server providers are doing. I'd rather have the demo parser be as barebones as possible in that regard

mavrick commented 6 years ago

Yea, no worries.

What I've had to do is set a default lo3 for overtime and each round detect to see if the teams have swapped sides since the event doesn't get triggered. Then just calc the diff in rounds to see if the match is actually over or not. ESEA have demos that go for 39 rounds but it actually finished on the 37th round..

Getting the current round isn't an issue, it's working out when the game is actually over vs what the demo file is telling me using the default game events.

I think Faceit have an lo5 overtime system, but their bot doesn't mess with the games default events.