Search Unity

Game state management for MCTS AI

Discussion in 'Scripting' started by Kethis, Jun 23, 2010.

  1. Kethis

    Kethis

    Joined:
    Sep 10, 2009
    Posts:
    28
    Hello, I have an open question on Unity Answers that produced a few responses but no solutions. The relevant information is duplicated in this post, but links are provided for the curious.

    http://answers.unity3d.com/question...-details-of-montecarlo-ai-playout/13018#13018

    I am making a tile and turn based game whose game mechanics are a close spiritual successor of Final Fantasy Tactics. Example game play below (skip to 0:30)

    http://www.youtube.com/watch?v=UjChhYtQ2Mg&feature=related

    I am using a Monte Carlo Tree Search (MCTS) for the AI in my game, after consultation by the wonderfully helpful people at Game Dev.

    http://www.gamedev.net/community/forums/topic.asp?topic_id=573999

    This approach requires me to rapidly run thousands of playouts (pseudo-random possible ways the game could unfold) each time it is the enemy AI's turn. I have developed what I believe is a good strategy for implementing this but have caught a snafu.

    I want a way to easily save and "roll back" the state of the entire scene (well, most of it). This way I can easily start my playouts from the same place, and have the AI actually make its final move from the same game state it was in when it began analyzing the board.

    As for keeping what the player sees static while this is going on, I plan to create a texture with the main camera when it becomes the AI's turn, put it on a plane in front of the camera, turn rendering off on the game objects, and display some indicator of how close the AI is to being done with thinking by using a GUI control.