Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making showScoreboard() imitate the actual ingame scoreboard you see at matchend #19

Open
Hareide opened this issue Feb 18, 2016 · 12 comments

Comments

@Hareide
Copy link

Hareide commented Feb 18, 2016

Love that you can get the scoreboard from a replay in under a second just by building the example "Show stats at the end of the game" from https://github.com/skadistats/clarity-examples/

The ingame scoreboard also list additional detail such as:

  • Witch team won
  • What team each player belong to.
  • Items in inventory
  • GOLD/MIN
  • XP/MIN

Would you consider adding the above to the example?
If not, would it be fairly simple to extend the example for someone with limited programming experience?

@spheenik
Copy link
Member

Glad you like the example :)

I will consider adding it, but have to admit that I am very time constrained at the moment, with a lot of backlog. So I won't be able to do this quickly.

To implement this, I think you need more knowledge of where to find the data.
Once you know that, it's a cakewalk to add that stuff to the scoreboard.

If you wanna try, I recommend looking at yasps parser.

@Hareide
Copy link
Author

Hareide commented Feb 18, 2016

Thanks for the quick replay. By looking at the yasp site you pointed me to, I now almost have everything I need (and more):
new ColumnDef("HeroID", new DefaultResolver("PlayerResource", "m_vecPlayerTeamData.%i.m_nSelectedHeroID")),
new ColumnDef("Team", new DefaultResolver("PlayerResource", "m_vecPlayerData.%i.m_iPlayerTeam")),
new ColumnDef("TeamSlot", new DefaultResolver("PlayerResource", "m_vecPlayerTeamData.%i.m_iTeamSlot")),
new ColumnDef("SteamID", new DefaultResolver("PlayerResource", "m_vecPlayerData.%i.m_iPlayerSteamID"))

Do you know how I can find what team that won?
I know the ingame console outputs the following line when a local server lobbygame ends:
good_guys_win: true

I would guess that it should be returned by the parser as a boolean value.

@spheenik
Copy link
Member

There is an entity "GameRulesProxy", it has a property:

"m_pGameRules.m_nGameWinner"

2 = Radiant
3 = Dire

iirc.

On 02/18/2016 09:19 PM, Hareide wrote:

Thanks for the quick replay. By looking at the yasp site you pointed
me to, I now almost have everything I need (and more):
new ColumnDef("HeroID", new DefaultResolver("PlayerResource",
"m_vecPlayerTeamData.%i.m_nSelectedHeroID")),
new ColumnDef("Team", new DefaultResolver("PlayerResource",
"m_vecPlayerData.%i.m_iPlayerTeam")),
new ColumnDef("TeamSlot", new DefaultResolver("PlayerResource",
"m_vecPlayerTeamData.%i.m_iTeamSlot")),
new ColumnDef("SteamID", new DefaultResolver("PlayerResource",
"m_vecPlayerData.%i.m_iPlayerSteamID"))

Do you know how I can find what team that won?
I know the ingame console outputs the following line when a local
server lobbygame ends:
good_guys_win: true

I would guess that it should be returned by the parser as a boolean value.


Reply to this email directly or view it on GitHub
#19 (comment).

@redfish88
Copy link

redfish88 commented Sep 2, 2021

excuse me,do you know how I can find what team that won?
i try the following in skadistats.clarity.examples.matchend.Main ,but return null
getEntity("GameRulesProxy").getDtClass().getFieldPathForName("m_pGameRules.m_nGameWinner")

@spheenik
Copy link
Member

spheenik commented Sep 3, 2021

Just checked, and m_pGameRules.m_nGameWinner should be there.
Your replay is from Dota 2, right? I think I'd need the replay.

@redfish88
Copy link

Thank you for your reply,yes,it's Dota2 replay,how to send you my replay ? email ?
image
image

@spheenik
Copy link
Member

spheenik commented Sep 3, 2021

Best to put it in some dropbox and share the link.
I'm unsure if my mailserver will gobble it, but you can try: [email protected]

@redfish88
Copy link

I have sent you an e-mail,and i still have the following questions

  1. Can i get the match id 、match start time、end time in matchend ?
  2. How to get the mapping relationship between heroId and heroName? or can i get the heroName from entity's field?
  3. How to get hero_damage、tower_damage 、killed_by and other info?
    Thank you again for your reply!

@spheenik
Copy link
Member

spheenik commented Sep 5, 2021

Checked your replay: The property is there. It has value 5 up until tick ~56700, then changes to 2 (radiant).
I ran the matchend-example, it spits out values.
Since in your screenshot, you get GameRulesProxy = null, it seems that you did not seek to the end of the replay?

This code here
https://github.com/skadistats/clarity-examples/blob/master/src/main/java/skadistats/clarity/examples/matchend/Main.java#L34-L36
is important!

@redfish88
Copy link

I'm sure there are no changes elsewhere,because getEntity("PlayerResource") works .
This my code
https://gist.github.com/redfish88/223cbc5f120b2e5942e6684a4627948f#file-main-java-L67-L69

@spheenik
Copy link
Member

spheenik commented Sep 5, 2021

Found the problem. The getEntity() function does not work, because it looks for CDOTA_GamerulesProxy.
But in this case, the underscore is missing from the entity name (it should be CDOTAGamerulesProxy)

So you can look it up via
runner.getContext().getProcessor(Entities.class).getByDtName("CDOTAGamerulesProxy")

@redfish88
Copy link

redfish88 commented Sep 6, 2021

Thank you very much,i get it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants