timkurvers / redota

Revisit past Dota 2 matches in the browser
https://timkurvers.github.io/redota
MIT License
51 stars 7 forks source link

Support patch 7.32e #93

Closed timkurvers closed 1 year ago

timkurvers commented 1 year ago

Issues with patch 7.32e in ReDota:

Tsury commented 1 year ago

Help Tim <3

timkurvers commented 1 year ago

Crash is prevented with 6f9d67ae86acad5691ea50191fe234d9c544c852, but the game clock is seemingly completely off.

Will have to investigate a bit more.

Tsury commented 1 year ago

I saw a Clarity commit related to the issue, seems to be pretty much what you did. I wonder if it means that they suffer from this clock issue as well.

timkurvers commented 1 year ago

Yeah, that's definitely the same. I would imagine any parser that exposed m_fGameTime in any way (like Redota does) is gonna have this clock problem.

Tsury commented 1 year ago

Seems like m_flGameStartTime is still there, but yeah no sign of m_fGameTime or GameTime_t in any of the new replays. Could this be related to protobufs? Clarity also updated those.

Sorry if it's entirely irrelevant, I'm pretty clueless here.

EDIT: Well, we're not the only ones looking for it...

STRATZ-Ken commented 1 year ago

Following, I think we could determine how many tick per second, we could just calculate based on the ticks in the replay. I thought it was 30 ticks, but seems to not be the case. I think its very close to 30.

image

22841 / 30 = 761.366 seconds. Which is incorrect.

22841 / 768.3334 = 29.72 ticks per second?

Tsury commented 1 year ago

Yeah I remember getting this number as well - I'll double check just in case. Do note that you have to account for m_bGamePaused since ticks continue even when the game is paused.

STRATZ-Ken commented 1 year ago

Correct, but I think we may run into a problem during the pick stage. As the first number comes once the game pre-loads. So we won't know how long it took all players to load into the game successfully.

Tsury commented 1 year ago

Can maybe use m_flGameStartTime and count backwards. Depends on game mode - non turbo is 1:30 and turbo is 1:00 (IIRC).

Edit: Also have m_flPreGameStartTime

Tsury commented 1 year ago

From my tests right now it's exactly 1/30, and previously fGameTime was sent every 2 ticks.

timkurvers commented 1 year ago

Tick interval is part of the CSVCMsg_ServerInfo message, but I am a bit unsure whether it's reliable.

For a sample 7.32e patch game, parser.tickInterval holds 0.03333333507180214, which would effectively be 29.999998435378156 ticks per second if my math is correct.

STRATZ-Ken commented 1 year ago

I took these values (the last is the tick value it updated) and the first value is the time in game for PreGameStartTime

image

So for example : 878.500061 @ 26149 * 0.033333333 = 871.63 which is about 7 seconds off the correct number.

timkurvers commented 1 year ago

Bit of a busy day ahead, but hope to have this implemented (with backwards compatibility) either today or tomorrow.

timkurvers commented 1 year ago

Fixed in 4c5fd883107ada259d185033d67238b11a06cf9e.

Version 1.7.0, with these changes, available on the website now.