peter1591 / hearthstone-ai

A Hearthstone AI based on Monte Carlo tree search and neural nets written in modern C++.
301 stars 49 forks source link

Hi, how can I run it? #78

Closed wonderkid27 closed 7 years ago

wonderkid27 commented 7 years ago

Can you explain more detail for me how to run it? I don't understand about "Open the C# project under 'ui' folder and run it". I do that but I still can't run it.

wonderkid27 commented 7 years ago

Is this complete? I can't compile it.

wonderkid27 commented 7 years ago

Ok, I successfully compile it. But when I run hearthstoneAI.exe, it crashes. I cannot compile MCTS, is something wrong there?

peter1591 commented 7 years ago

Maybe try again the ToT commit 3f9852a2fa3c6bab21941bca21ce346325c2e20b. I use random playout for simulation phase, so no need to train a neural network beforehand. But indeed it might need more computation power to achieve the same strength? See another demo video here: https://youtu.be/yVX8nTo8o00

wonderkid27 commented 7 years ago

Sorry, but I don't understand. What does "try again the ToT commit 3f9852a" mean? One more question, can it run on windows 7?

wonderkid27 commented 7 years ago

I successfully build every things in vs_projects but I still cannot run herathstoneAI

peter1591 commented 7 years ago

What's the error message? What I mean is, try to do a git repo update, and then compile the C# project 'HearthstoneAI' again, and run.

wonderkid27 commented 7 years ago

It crashes when I run it. Here is the logs when I debug:

An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in GameEngineCppCLI.dll External component has thrown an exception.

Unhandled Exception: System.Runtime.InteropServices.SEHException: External component has thrown an exception. at ui.GameEngine.{ctor}(GameEngine* ) at GameEngineCppWrapper.CLI.GameEngine..ctor() in c:\users\administrator\desktop\hearthstone-ai-master\vs_projects\gameenginecppcli\source.cpp:line 34 at HearthstoneAI.AI.AIEngine..ctor(AILogger logger) in C:\Users\Administrator\Desktop\hearthstone-ai-master\vs_projects\HearthstoneAI\AI\AIEngine.cs:line 30 at HearthstoneAI.frmMain..ctor() in C:\Users\Administrator\Desktop\hearthstone-ai-master\vs_projects\HearthstoneAI\Form1.cs:line 71 at HearthstoneAI.Program.Main() in C:\Users\Administrator\Desktop\hearthstone-ai-master\vs_projects\HearthstoneAI\Program.cs:line 19 The program '[9112] HearthstoneAI.exe' has exited with code 0 (0x0).

wonderkid27 commented 7 years ago

I still cannot run it. Is something wrong with GameEngineCppCLI? Can you update the readme?

wonderkid27 commented 7 years ago

Can you tell me how to build it? Is run vs_projects.sln and build? Please respond me, I need more detail. Thank you!

peter1591 commented 7 years ago

It seems to be something wrong with the CppCLI.

Please enable native code debugging for project HearthstoneAI, and try to run a debug build (rather than a release build)

wonderkid27 commented 7 years ago

ifndef CNN_NO_SERIALIZATION

std::ifstream ifs(filename.c_str(), std::ios::binary | std::ios::in);
if (ifs.fail() || ifs.bad()) throw nn_error("failed to open:" + filename);

The error appears in tiny_dnn/network.h. Do I need training file to run this?

peter1591 commented 7 years ago

I think ToT does not need this neural network now. Could you do a repo sync again?

Or, you can simply follow the instruction here to train your own neural network.

peter1591 commented 7 years ago

This issue should be fixed now in commit 0d60835e.

Please try again. No need to train neural network anymore.

wonderkid27 commented 7 years ago

Yes, you fix the right issue. Finally, I can use it. It's great. Thank you!