First off, I’m wondering if the developer, Bruno Albuquerque, is available for questions about the behavior patterns of the Hexenwood AI programming, because I have so many questions that I wouldn’t be skilled enough to answer from trying to pull apart the program language behind the scenes itself. If you visit this forum, Bruno, I would love to have a conversation with you!
On to my main topic… I believe Hexenwood itself is one of the best games on the system so far, but the addition of the AI functionality just puts it so many tiers above the rest of what we have right now! I love playing the game myself versus AI, versus my wife, and WITH my wife against the AI, but I have to admit that my favorite thing to do is to make various AI vs AI boards and scenarios and watch games play out.
While watching the AI, I’ve done my best to try to understand optimal strategies based on the behavior of the level 3 AI, and have tried to figure out what the AI considers the best thing to do in each varied scenario. The following observations are currently all based on the level 3 AI because I assume that Bruno programmed it with the most optimal (and thus most predictable) behavior, but once I get a better grasp of level 3, I’m curious to explore level 2 and level 1 to see how they vary. I assume that all 3 levels of AI probably include a few lines of code that allow for randomness, especially if there are multiple movement options that all have similarly beneficial outcomes, but I may be wrong there. At its core, I have to assume that most of the AI programming runs on some sort of points-based priority system where it maps out the beneficial outcomes of each potential next move on the board, assigns that outcome some sort of numerical value based on how beneficial the move is, and then chooses the action with the highest beneficial value… at least that is what makes sense to my fleshy human brain. I also assume that, at least with level 3, there might be some level of beneficial value attributed to what the AI assumes the nearby opponents next moves will be, but since this is more complicated and sophisticated, and since blinks don’t have infinite space for programming, I am less confident about this. I’m even less sure if each AI might start the game with some kind of variant “personality”–things like being defensive versus aggressive, for example, which could be totally randomly assigned at the start of game, or could even be assigned based on color. So far I haven’t seen compelling evidence to suggest such a “personality” feature, but I can’t say it is outside the realm of possibility. Anyways…
There are still many behaviors, especially during mid-game, that I can’t quite find a pattern for, but the early game seems to reveal a few more simple logic patterns. For example, when I create a game board where each AI starts with a single space equally far apart at the absolute edges of the board, the AI seems to consistently use “spread” moves to fill in all nearby available spaces that are available outside the current “hopping” distance away from the nearest enemy player. Once those spaces are filled up and two players are within “hopping” distance of each other, it seems like the first player that has the ability to “hop” and convert at least 2 enemy spaces will take that opportunity. After this point, all hell breaks loose and I’m less able to observe particularly consistent behavior patterns… so far. One thing that I do seem to observe is that the AI might place a slightly higher value on being able to possess board pieces that are on the outside edge of the board. This makes sense to me because those pieces aren’t at risk of being “hopped” over.
When playing with 3 or 4 AI players, I don’t think that each AI is sophisticated enough to calculate its moves against 1 particular enemy while considering whether counter-moves against itself are potentially unlikely because of threats on that enemy from other AI on a different front. For example, if Red was on the left, Blue was in the middle, and Purple was on the right, I feel like Red would not make a more “risky” move on its battlefront with Blue despite (to a human) Red having a very obvious move that needs to be made against Purple. I hope that makes sense if you think about it… but my point is that battles on separate fronts might be a place where the AI, no matter how “smart”, might act suboptimally compared to a skilled human player.
Finally, I get the feeling that the AI might not be programmed to recognize and exploit opportunities related to “walling off” parts of the board with a line of spaces at least 2-spaces deep so they can’t be “hopped” over. On a similar note, it doesn’t seem like the AI is able to anticipate (or at least doesn’t put priority in preventing) getting trapped in a corner and losing the ability to move on future turns. I may be wrong, but I feel like I’ve witnessed several examples where the AI takes a move that provides a numerically greater advantage on that specific turn, but by doing so allows itself to be locked in a corner and lose the rest of the game rather than taking a move which is less advantageous in the moment, but allows future movement opportunities. Once again, I’m no programmer, and I have NO idea what kind of programming complexity would have to be added to change this behavior, so I totally understand if this was unreasonable to program into the AI behavior given the space limitations… I just point it out as an interesting observation.
So in conclusion, what have I potentially learned? It seems that spreading, rather than hopping, is optimal for as long as possible at the start of the game, but hopping becomes by far the dominant strategy once players get within 2 empty spaces of each other’s territory, and throughout the rest of the game. I do believe that pieces along the outside of the game board are slightly more valuable than central pieces because they’re easier to fortify against being stolen later in the game. Other than that… I’m still learning!
I would love to hear the strategies and observations from others in this community, and hopefully you found this read at least somewhat entertaining!