130 likes | 239 Views
Xi Breakthrough Player. CSE 486 B Fall 2012 Miami University. Team. Mike Jacobs Jiang Nuo Reuben Smith. Components. Search Threading Depth control Storage optimization Features Feature weight optimization Funny messages. Search. Negamax with alpha-beta
E N D
Xi Breakthrough Player CSE 486 B Fall 2012 Miami University
Team • Mike Jacobs • Jiang Nuo • Reuben Smith
Components • Search • Threading • Depth control • Storage optimization • Features • Feature weight optimization • Funny messages
Search • Negamax with alpha-beta • Negamax is minimax “simplified” • State evaluation is from the perspective of the player associated with the current depth • Scores are negated as search moves up the tree
Threading • Threading is used to split up the search workload evenly between search workers • The number of workers created is based on the number of processor cores available less one • Workers use copies of state, so no concurrency issues are possible
Depth Control • We dynamically adjust depth limit after each move • targetMoveTime = gameTimeLimit / averageGameMoves • targetMoveTime is calculated at the start of each game • averageGameMoves is updated after each game
Depth Control, cont. • If search finishes in less than targetMoveTime, then the depth limit increases • If search finishes in more than targetMoveTime, then the depth limit decreases • Depth control uses coefficients to affect how easily the depth limit can be changed again • This sometimes allows us to search to a max observed depth of 25+, we can also potentially search as shallow as 1 deep
Storage Optimization • Instead of creating a move object for each possible move at every node in the search tree, move data is encoded inside a short • Bits 0-2 represent starting row • Bits 3-5 represent starting column • Bits 6-8 represent ending row • Bits 9-11 represent ending column • Bits 12-15 represent move flags (like capture)
Features • 7 features implemented • Notable: • Squares owned • Penetration • Spread • Conflict • Cover
Parametric Feature Weights • Feature weights can also be passed into the object • This can be used to easily set a difficulty for the engine • Ex: easy = only 1 feature on hard = multiple features optimally weighted
Feature Weight Optimization • To optimize feature weights, we could use hill climbing • We would be hill climbing in two different places • Hill climb to determine optimal weight for each feature in a set of features • Hill climb to choose the set of features that are turned on (we will choose sets of 2, 3, or 4 features) • We would be using hill climb #1 to find a high peak for scoring a trial in hill climb #2 • Momentum would be used to terminate an instance of a climb • This would take a lot of computational power and a lot of time… so we didn’t do it…
Funny Taunts • In conclusion, we also send intimidating messages to your AI at the beginning of the game • “Hello, %s. Nice to beat you.“ • “Spill the blood of the innocent!”