I can give some more in depth information about this behavior.
First, Mad Wizard is a years-long evolution of Magarena, this also applies for the AI.
There are currently two difficulties, low and high.
Low difficulty will look for 2 main phases with 5 second thinking time.
High difficulty will look for 6 main phases with 10 second thinking time.
When the thinking time is passed, the AI will pick whatever it thinks is best at that moment.
This can explain for complex state that it chooses something non optimal.
The low difficulty needs to look less far ahead, so it will have less chance to timeout.
This mainly applies for MiniMax, Vegas just runs simulations until it thinks it knows what to do.
The other reason is the lookahead of 6 main phases or around 3 turns.
The AI does not take into account hidden state like drawing a board wiper.
So by just scoring the game state it could think by taking the extra turn it wins even more.
For instance by playing some more creatures or dealing even more damage.
There is actually some code in place to prevent this in the scoring, here is the comment in code.
- Code: Select all
Loss score is modified in function of the turn and phase when it occurs. Encourages AI to win as fast as possible.
But it might need more tweaking. I tweak the scoring rarely as it is hard to know side effects without playing or simulating lots of games.
This problem should not occur with low difficulty as that only looks for 2 main phases or around 1 turn.