yangyuan/hearthrock

Interface to simulate the playOptions?

Closed this issue · 3 comments

zzk0 commented

I am making a python bot. The scene has many infomation, awesome! However, I want the next scene when I make a playOptions.(I am not a native English Speaker. Maybe my word confused you, just tell me and I will try to explain). That is , If I want to get what playOptions I can make after I make a playOptions, I have to send the message to Hearthstone and get the next scene. That means I cannot make another playOptions. So I try to simulate the playOptions using python, emmm, that's not a good idea, It works not well.

Are there exist interface to simulate the playOptions? Or some direction to guide me to develop the interface I want?? I think it's not good to develop the simulator in the bot, maybe I can try to realize the project code and develop the interface to python.
Any help would be appreciated.

zzk0 commented

After reading some pieces of source code, I realize that I have to change the GameState if I want to simulate the playOptions(RockAction), right?

        /// <summary>
        /// Snapshot Scene
        /// </summary>
        /// <param name="sessionId">The Session Id.</param>
        /// <param name="actionId">The Action Id.</param>
        /// <returns>The RockScene.</returns>
        public static RockScene SnapshotScene(string sessionId, int actionId)
        {
            var rockScene = new RockScene();

            Player self = GameState.Get().GetFriendlySidePlayer();
            Player opponent = GameState.Get().GetFirstOpponentPlayer(GameState.Get().GetFriendlySidePlayer());

            rockScene.Self = SnapshotPlayer(self);
            rockScene.Opponent = SnapshotPlayer(opponent);
            rockScene.PlayOptions = SnapshotOptions();
            rockScene.Turn = GameState.Get().GetTurn();
            rockScene.SessionId = sessionId;
            rockScene.ActionId = actionId;
            return rockScene;
        }

The direct answer is: no, there is no such interface.

For Client, they don't have enough information to predict the next scene. And actually, it's not really predictable because of Secret spells and many other things.

Last year I tried to use Machine Learning to do prediction but doesn't work well. Lack of data is the main problem.

zzk0 commented

Thanks for your reply. It's not predictable indeed.