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

Use dynamic HearthArena values? #1

Open
rrwoods opened this issue Jun 5, 2015 · 30 comments
Open

Use dynamic HearthArena values? #1

rrwoods opened this issue Jun 5, 2015 · 30 comments

Comments

@rrwoods
Copy link

rrwoods commented Jun 5, 2015

Does HearthArena maybe have some sort of API we could access to be able to use the site's full functionality, instead of the static tier list?

@rembound
Copy link
Owner

rembound commented Jun 5, 2015

HearthArena does not currently have a public API. For future development of this plugin, support could be added for custom tierlists or strategies and synergies using the existing data.

@n4ru
Copy link

n4ru commented Jun 5, 2015

I asked HearthArena about an API and they're adamant about keeping their algo to themselves. Some GET and AJAX trickery could get around this, though.

@corlettb
Copy link

corlettb commented Jun 7, 2015

I've forked the project to add HearthArena scores by default (https://github.com/corlettb/Arena-Helper). It also displays the heartharena "tip". Its a bit of a horrible hacky change. My C# skills are pretty lacking but it works. This does come from looking at what the heartharena javascript does and reproduces the important parts. This means that if they change anything it could break.

Using their webpage a login is required, however the backend calls do not require a login, which is what this uses.

If the call to HearthArena fails it will revert to using the tier list.

I wouldn't ask you to take this change as its not the best as it stands. What do you think about this Rembound?

@azeier
Copy link

azeier commented Jun 7, 2015

I'm not too sure how I feel about this.

From a HDT-user point of view, sure, this is great... but I think we should respect their choice in not wanting to share their algorithms.

@rembound
Copy link
Owner

rembound commented Jun 7, 2015

I explicitly did not implement this feature, because it appears they don't want others to use their API. If this feature would be used on a larger scale, the plugin could be banned from the API instantly. Without their permission, I can't really add this feature.

Furthermore, I've heard they are working on a program of their own that integrates with their site. If they ever release a public API, of course I would implement it in my plugin.

@corlettb
Copy link

corlettb commented Jun 7, 2015

I can remove my repo if you like and keep the changes to myself.

@rembound
Copy link
Owner

rembound commented Jun 7, 2015

I think your repo is fine. I do like that it is possible. I just can't add it to the plugin.

@corlettb
Copy link

corlettb commented Jun 7, 2015

Their api is quite simple actually.

Make a GET call like:

http://draft.heartharena.com/arena/option-multi-score/3/325-220-789-331-831-463-425-774-341-94-436-216-337-105-294-418-412-405-383-773-327-110-751-432-432-787-691-760-533/826-788-704

Where its:

http://draft.heartharena.com/arena/option-multi-score/ [classid 1-9] / [card ids already picked seperated by "-"'s] / [card ids of the 3 cards to pick seperated by "-"'s]

and it will return you some json.

I appreciate this is a contentious issue and completely respect you for not using it without their permission. Most things with HDT seem to be walking a fine line :)

This was just a bit of a fun yesterday afternoon to get it working to be honest.

Thanks for all your hard work on this plugin btw :)

@n4ru
Copy link

n4ru commented Jun 7, 2015

@corlettb awesome! Was going to dig through it myself but didn't have the time to yet. Will be trying out your fork, but I get why they'd wanna keep their algo to themselves so I guess an official release wouldn't be very respectful.

@rrwoods
Copy link
Author

rrwoods commented Jun 7, 2015

I really don't understand what's contentious about this. You're still
using their algorithm -- it's not like you hacked into their servers and
got their source code! You still don't have access to the internals of
their algorithm, how any of it actually works, etc. The only thing of
theirs you're not using is the interface. What's the issue?

Not trying to be sarcastic, I just legitimately don't understand what the
problem is.

On Sun, Jun 7, 2015 at 10:39 AM, George Kushnir [email protected]
wrote:

@corlettb https://github.com/corlettb awesome! Was going to dig through
it myself but didn't have the time to yet. Will be trying out your fork,
but I get why they'd wanna keep their algo to themselves so I guess an
official release wouldn't be very respectful.


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

@n4ru
Copy link

n4ru commented Jun 7, 2015

The reason developers choose to keep certain APIs private is to prevent their applications from being accessed externally or another application developed with their API. After all, it is their intellectual property, and while it is THEIR responsibility to protect it, it's still not a cool thing to just steal it.

For example, I can take the API corlettb found and create an entire clone of HearthArena without their permission, using their API, and stealing their server resources to do so in the process as well (all those GET requests).

@n4ru
Copy link

n4ru commented Jun 7, 2015

Also it's quite silly that their API requires no authentication whatsoever :/

@corlettb
Copy link

corlettb commented Jun 7, 2015

Well I suspect they always intended for people to be able to use the drafting without a login:

"Welcome to the HearthArena version 2.6 ! At this time, HearthArena is still in limited release. Please use our Reddit page to report any problems or bugs you come across. Drafting without registering is disabled during the limited release. If have any questions or comments about HearthArena, feel free to visit /r/HearthArena and join the conversation!"

@n4ru
Copy link

n4ru commented Jun 7, 2015

Ah. Didn't realize that.

Do you happen to have a compile of your version @corlettb? Don't have a compiler on this machine and pretty excited to try yours out.

@corlettb
Copy link

corlettb commented Jun 7, 2015

Usual disclaimers: No promises on quality. Limited testing and all that. Oh the "tip" placement probably isn't great. Consider it a test.
....
https://mega.co.nz/#!ApdQTT5L!TkFUMEGIYukDH4dYoJ02Bjo1sT8H8XgwbnesHLoPn6M

@n4ru
Copy link

n4ru commented Jun 7, 2015

Cheers.

@n4ru
Copy link

n4ru commented Jun 7, 2015

@corlettb You should allow issues to be opened on your fork. I'll be playing with your version and already found some crashing on your fork only.

@corlettb
Copy link

corlettb commented Jun 7, 2015

Like I said my C# is pretty dreadful. Published it as soon as I got it mostly working. Only did a couple of drafts with it in the end.

@heartharena
Copy link

as @rembound said, we are preparing something ourselves. The problem is that if an external party would be using our server resources we would be unable to maintain heartharena as it would only cost us money. Currently HearthArena is not subscription-based so our only way to keep it maintainable is if people go to the actual website or tools that we make that would contain our sponsors.

@corlettb
Copy link

corlettb commented Jun 9, 2015

@heartharena I'm just an over eager fan of HearthArena, HDT and Arena helper. If you would like me to remove my fork from github I'll do it. Although as @rembound has said, this functionality will never go mainstream without your permission.

I don't know how far your own project is away. Obviously ArenaHelper is pretty new and although its got a few issues it is pretty good.

I appreciate the need to pay for dev/server costs and keep HearthArena going. I could increase the integration further by at the end of the draft it would popup a browser to show your deck summary page displaying your ads and link it to an account. Possibly work in your donation button somewhere as well.

The HearthArena integration makes ArenaHelper so much better, it seems such a shame to not do it.

@n4ru
Copy link

n4ru commented Jun 9, 2015

@heartharena I'm with @corlettb on this one - I love HearthArena but HDT is very integrated into my gameplay and perfect automation is what I strive for. I'm even willing to donate a few bucks to continue using the API for personal use via @corlettb's fork.

@rrwoods
Copy link
Author

rrwoods commented Jun 9, 2015

@heartharena -- I appreciate this response. I hadn't thought of the issue from the perspective of sponsors/advertising; I know the service is free, so what is the user circumventing by not using the site directly? As it turns out, quite a bit. Thanks for helping me (and possibly others) understand.

Are you open to talking about what such a feature might look like in-game? I know I (... and possibly others (again)) probably have a vision of their ideal version of this kind of tool. And of course you can't satisfy 100% of the people 100% of the time, but getting ideas from the community might help the feature be something that gets more people using HearthArena.

As @corlettb and @n4ru talked about, automation is the biggest thing. I love HDT (thanks @Epix37 !) and every deck I play goes into it -- including arena decks. What this means right now is that my workflow for a draft is to load up hearthstone on my phone (I don't have a second monitor and it's quicker than Alt-Tab'ing) and HA on my laptop, do the draft, then type the deck into HDT. The fact that I even use the word "workflow" to describe the draft process... ugh :-P What I'd really really love is for my deck to be already loaded up into HDT after I'm done the draft (preferably with a customizable naming scheme... not at all critical). It looks like ArenaHelper does this but I haven't had the time to check it out yet.

Anyway, this response is getting long-winded. Regardless, thanks again to @Epix37 for this tool, thanks to @heartharena for making me a better drafter, and I look forward to what you guys are working on!

@n4ru
Copy link

n4ru commented Jun 9, 2015

@rrwoods I actually created a tool to skip that last step - typing the deck into HDT. Once you have your draft page open you can use my tool Netdeck - https://github.com/n4ru/NetDeck - to import directly into HDT from your browser. It works with every major HearthStone site

@rembound
Copy link
Owner

rembound commented Jun 9, 2015

Released a new version v0.2.0. From the changelog:

  • Added an experimental plugin system within the plugin. Site owners can possibly integrate their site APIs. Check out the source of TestPlugin.dll.

Anyone can make a plugin to do something with the detected cards and other events. Like using other tierlists or adding site integration.

@corlettb
Copy link

corlettb commented Jun 9, 2015

Plugins within plugins... It's getting a bit inception ;)

@n4ru
Copy link

n4ru commented Jun 9, 2015

I was going to comment just that ^

@rembound
Copy link
Owner

rembound commented Jun 9, 2015

I named it Pluginception, but changed it later ;)

@n4ru
Copy link

n4ru commented Jun 9, 2015

The overlay looks great, but I think the font needs to be bigger and less of the debug stuff should be there (like indices, and [I think it's part of your plugin-plugin stuff] the * and ^ symbols).

@rembound
Copy link
Owner

rembound commented Jun 9, 2015

When the debug mode is off, there should be no debug text on the screen. The symbols * and ^ are part of the tierlist. They have a meaning, like first-pick bonus or bad to pick multiple times.

@corlettb
Copy link

Looking at the plugin interface it looks okay. A couple of things I noticed:

  • The CardPicked function gets passed the cardid string rather than the Card object. The Card Object would be better. Otherwise plugins may need to load the data jsons again themselves.
  • How do you want plugins to handle resumes (crashes/restarts mid-pick)?
    = Do you want them to save their own state data somewhere?
    = Call back into the main plugin to pull in the current hero/pick list?
    = Get passed the current hero/pick list in the constructor on startup?
    = On startup the HeroPicked gets called followed by a series of CardPicked calls for however far in the draft we are?

Couple of additional things:

  • I like the shift to the overlay for the UI. I think ideally it would all go into the overlay rather than a stay ontop dialog. Having the save of the deck and selection of that deck should be automatic ideally at the end of the draft Not sure what is possible in the current HDT api.
  • I'm guessing anything that blocks in these plugins will have the same restriction as the main plugin? I ask because these plugins may be making http calls which most of the time will be quick .... but from time to time they could take a few seconds invoking the ban stick from HDT.

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

No branches or pull requests

6 participants