Hearthstone-Deck-Tracker icon indicating copy to clipboard operation
Hearthstone-Deck-Tracker copied to clipboard

[dev] API for combat simulation results

Open InsaneDoggo opened this issue 2 years ago • 6 comments

Would be nice to have API for combat simulation results:

float PlayerLethalRate 
float WinRate 
float TieRate 
float LossRate 
float OpponentLethalRate 

int Iterations

It's useful in general, but my usecase is to detect opponent's high roll when player lose match. e.g. if (OpponentLethalRate < X) {...}

IIRC it's calculated right before combat begins (Opponent's TurnStart), if i'm wrong than would be nice to have additional event: OnCombatSimulationReady(...)

InsaneDoggo avatar Jul 07 '21 19:07 InsaneDoggo

https://github.com/HearthSim/Hearthstone-Deck-Tracker/blob/0bd5bac9f62bfb8ec94e6eaa650467572b9d874b/Hearthstone%20Deck%20Tracker/BobsBuddy/BobsBuddyInvoker.cs#L445-L456

All those methods, classes and the BobsBuddy library are either private, internal or source unavailable - I'm not sure if that means something. You may still find some way to patch the existing method :)

sgkoishi avatar Jul 08 '21 21:07 sgkoishi

have u already solved this problem? I am faced with the same problem ( want to get the win/tie/loss rate after each turn simulation done ) for developing an analyze plugin thanks a lot!!

KkEeVvIiNnn avatar Sep 01 '21 18:09 KkEeVvIiNnn

have u already solved this problem? I am faced with the same problem ( want to get the win/tie/loss rate after each turn simulation done ) for developing an analyze plugin thanks a lot!!

Both the BobsBuddy library and all related methods and classes are either private, internal or source unavailable. I would guess they are intended to keep those data secretly without public access.

~~You could still try to 'patch' them using tools like Harmony~~

sgkoishi avatar Sep 01 '21 20:09 sgkoishi

have u already solved this problem? I am faced with the same problem ( want to get the win/tie/loss rate after each turn simulation done ) for developing an analyze plugin thanks a lot!!

Both the BobsBuddy library and all related methods and classes are either private, internal or source unavailable. I would guess they are intended to keep those data secretly without public access.

~You could still try to 'patch' them using tools like Harmony~

so does it means that i need to run my own simulation? ( can't just fetch the results that HDT already calced )

KkEeVvIiNnn avatar Sep 01 '21 20:09 KkEeVvIiNnn

have u already solved this problem? I am faced with the same problem ( want to get the win/tie/loss rate after each turn simulation done ) for developing an analyze plugin thanks a lot!!

Both the BobsBuddy library and all related methods and classes are either private, internal or source unavailable. I would guess they are intended to keep those data secretly without public access. ~You could still try to 'patch' them using tools like Harmony~

so does it means that i need to run my own simulation? ( can't just fetch the results that HDT already calced )

By patching you can change the logic of HDT itself, thus 'steal' those results once the simulation is done. Without patching you could still get the result from Hearthstone_Deck_Tracker.BobsBuddy.BobsBuddyInvoker.Output using reflection, but there's no way to know when the simulation is done. Of course, you can run your own simulation, but since BobsBuddy is non-public you still need reflection, otherwise, you may write your own simulator.

sgkoishi avatar Sep 01 '21 20:09 sgkoishi

have u already solved this problem? I am faced with the same problem ( want to get the win/tie/loss rate after each turn simulation done ) for developing an analyze plugin thanks a lot!!

Both the BobsBuddy library and all related methods and classes are either private, internal or source unavailable. I would guess they are intended to keep those data secretly without public access. ~You could still try to 'patch' them using tools like Harmony~

so does it means that i need to run my own simulation? ( can't just fetch the results that HDT already calced )

By patching you can change the logic of HDT itself, thus 'steal' those results once the simulation is done. Without patching you could still get the result from Hearthstone_Deck_Tracker.BobsBuddy.BobsBuddyInvoker.Output using reflection, but there's no way to know when the simulation is done.

Thank you very much. I have to learn more about what you've mentioned.😅 And if I can use Hearthstone_Deck_Tracker.Controls.Overlay.BobsBuddyPanel.WinRateDisplay (the problem is that this property is not static)

KkEeVvIiNnn avatar Sep 01 '21 20:09 KkEeVvIiNnn