yangyuan / hearthrock

Hearthstone® Bot Engine
https://yangyuan.github.io/hearthrock/
MIT License
259 stars 69 forks source link

guide #51

Open Nachojb opened 6 years ago

Nachojb commented 6 years ago

is it possible to create a small guide how to setup?

AiSatan commented 6 years ago

Hi, what type of guide do you want? about installing hsrock or about writing a bot?

Nachojb commented 6 years ago

Installing is basicly no problem. As far as i understand : i can create a seperate custom bot and run it through hearthrock client. I just dont get how to bring it all together and make it work , just with a sample / test bot. Im sorry for newbie questions but i just started out with hearthstone ai / bot / sim and just have really rusty coding skills. Is there a possibilty to read the debug of the bot and just let it predict and i play the game? thanks for your help in advance 👍

AiSatan commented 6 years ago

yes, you should create your own bot, hearthrock have build-in bot, but it's not perfect and just show you how will your bot work

you have to choose some programming language for start (I prefer C# or python) and just start with bot that will randomly choose some action in current scene, it's exist in the example folder, it's look very easy:

def do_play(scene):
    print(scene)
    if len(scene['PlayOptions']) == 0:
        return []
    return create_action(random.choice(scene['PlayOptions']))
  1. patch the game with rock.client and select "remote bot" - write in tetbox your server url ("like http://localhost:6969/ ")
  2. create a web server with behavior like here: https://github.com/yangyuan/hearthrock/blob/master/examples/python/base/service.py
  3. add the code above (do_play) in your play method
  4. run the game and click start, you'll see how bot work with random actions

than you can read and look here #18 for more information and try, try, try win the innkeeper bots :)

Nachojb commented 6 years ago

Thanks , thats really helping me 👍 Is it possible to add ai from other riposterys and combine it with hearthrock ? So i can try other developers AI? Im trying to make more a prediction tool.

AiSatan commented 6 years ago

Yes, just patch your game with rock, and use any Ai in your own bot, so Ai will be make some choice from current active actions and rock will be play it

Nachojb commented 6 years ago

It worked with my remote instantly. Now im trying to integrate this AI , but its not really working. https://github.com/peter1591/hearthstone-ai.git

allocro commented 5 years ago

I am sorry to bother one year after this conversation ended, but I have a similar problem. I am confident I will get my head around how to make the methods work, but I really cant figure out this client. I use WampServer, I imported your python example code in http://localhost/hearthrock/python/ . Now when I start the client I select the "Custom" option on "bot" and paste that address. I see from your code that it is supposed to mulligan away every card that has a cost >3, so I made a 4-cost cards deck to try it out, but it doesnt do anything, ergo I didn`t link the remote bot. Could you help me out?