Nostrademous / Dota2-WebAI

MIT License
33 stars 6 forks source link

[WEB SERVER] Implement DotaBuff Scraper #4

Open Nostrademous opened 7 years ago

Nostrademous commented 7 years ago

Let's use current 6500+ MMR results for a specific hero and role played by the pro to determine appropriate Item Builds and Ability Leveling Progression for our bot as scraped from dotabuff.com.

RabidCicada commented 7 years ago

I'll take this up

RabidCicada commented 7 years ago

dotabuff character builds seem straight forward so far.

We'll start out scraping the simple starting items from the first entry to match the bots lane type (offlane, safe etc).

RabidCicada commented 7 years ago

Initial checking and code beginnings in #16

Beginning of item purchasing scraper/system in place. For now the concept is an item knowledge base that you can ask questions or request info from like getStartingItems("bristleback"). Perhaps this will evolve to include character skills.

For now we'll make decisions in isolation and get code written to get basic item ordering for purchases. Ultimately more knowledge should be leveraged (who's on opposing team -- get oov to counter faceless void)

Currently only have getStartingItems('heroname').

It looks like DotaBuff bounce unrecognized User-Agents with a 429 error (throttled/too-many-requests). This is a fake response for user agents they don't recognize. This immediately sent me down the hole of getting selenium/Chrome up and running. Then I thought to try changing useragent with requests/lxml...and it worked. So I checked in the selenium/Chrome plumbing too in case we need to adapt later.

RabidCicada commented 7 years ago

There we go. Got lane filtering in #19 . Now we need to work out a realtime query system.

I think world.py can track state of character. Can pass that character object to ItemKB. itemKB can simply return the next item set in the chain.

To prevent bandwidth hogging I think it would be good to locally cache the result in lua until the item/itemset has been purchased.

Each update of world state can tell us through flags whether it wants item purchase information and we don't calculate or return if not asked for it.

Nostrademous commented 7 years ago

I put in the plumbing to pass the "starting items" back to the bot and they actually buy it now - with some fixes still needed (checkin f7ce20f)

for antimage - he tries to buy "item_healing_salve"... which he fails to buy b/c that item doesn't exist by that name, it is called "item_flask" instead. We will have a lot of these issues I fear until we map things correctly. Is there no other name provided on Dotabuff that's correct with respect to in-game name strings?