skadistats / clarity-examples

Example code for clarity
BSD 3-Clause "New" or "Revised" License
113 stars 37 forks source link

How to get all info contained in the replay as text output? #61

Closed RuiLiFeng closed 5 months ago

RuiLiFeng commented 5 months ago

I want to exactly recover all info in the replay .dem file. Is there any package can do this?

spheenik commented 5 months ago

There is so much "info" in the replay, that it's impossible to extract "everything as text". You'll have to be more specific on what you want.

RuiLiFeng commented 5 months ago

Thank you for your reply, precisely, I want the below info

  1. at each frame, the state of all heroes, units, buildings in the game
  2. at each frame, what action each hero, unit, building take, like attack, move, buy
  3. hero names, appearance, their skills and corresponding visual effects
  4. at each frame what actions each player take to their heroes, units, or buildings

I want those info so that I can create something like the dota2 web replay viewer https://chromewebstore.google.com/detail/dota-2-replay-viewer/bkkpkppjgjgfnjpfohcmclijikaeonjo?hl=id

Is that possible? Thank you so much for your reply!

spheenik commented 5 months ago

I think a very good starting point would be the parser OpenDota uses: https://github.com/odota/parser

spheenik commented 5 months ago

To add to that, what you're trying to achieve is not a small feat. Here is my implementation of a "replay viewer": https://github.com/spheenik/clarity-analyzer

RuiLiFeng commented 5 months ago

Thank you for your kind help!

I still have a question about getting massive replays. How can I download replays using matchids? I need a replay_salt parameter but I cannot find it using the steamAPI GetMatchDetails.

spheenik commented 5 months ago

@noxville Hey Ben, the salt is on the API somewhere, right?

Noxville commented 5 months ago

You need to make a GC request to get the salt (k_EMsgGCMatchDetailsRequest -> k_EMsgGCMatchDetailsResponse).

This is heavily rate-limited (100 per account per day && 500 per IP per day).

spheenik commented 5 months ago

Thanks Ben! <3

RuiLiFeng commented 5 months ago

Thank you all so much!

RuiLiFeng commented 5 months ago

Thank you so much Maritin!

Martin Schrodt @.***> 于2024年4月20日周六 17:01写道:

Thanks Ben! <3

— Reply to this email directly, view it on GitHub https://github.com/skadistats/clarity-examples/issues/61#issuecomment-2067609642, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIBFY75KKIVSG7C5BJQMBQDY6IVFPAVCNFSM6AAAAABF533FBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXGYYDSNRUGI . You are receiving this because you authored the thread.Message ID: @.***>