• Add Review
  • Subscribe
  • Nominate
  • Submit Media
  • RSS

Coding the AI player

  • Marrend
  • 01/15/2020 02:34 PM
  • 298 views
I've pretty well satisfied with how the human player works in this game. I've a demo on my end that I can distribute, if there is interest in how this is shaping up so far. The AI player currently has no interaction, but, there is an in-game way to increment the human player turn sequence. Though, now that I say this, I realize that the method is spammible, and could be considered "cheating". It would be especially so if there was a victory condition programmed outside of having zero or less Tower, but, that's beside the point right now.

Right now, I'm staring down at the hard part: programming the AI. To be honest, I'm not sure how the AI of MM7/MM8/AcroMage determines what card in it's hand to play. To be fair, the human player cannot even see the AI's hand. There is no way to determine if the card it's playing is optimized for a certain strategy, or if it's a completely random card that it happens to be able to afford to pay for.

I know that whatever card, or cards, the AI plays, the human player sees. They become public information. I'm semi-worried about the card display, as it's generally tied to the hand display. The intent of the AI player's hand display is to display "????" for all of it's cards. I'll need to look at my own code, and see how, exactly, the card display is set up. If I can set it to whatever the AI is playing (instead of referring to it's virtual hand), I'll probably be fine.

I clearly want players to be able to see the card that was played by the AI before (or after) it's affect is resolved. Or, if a card is discarded for whatever reason, players would see that. So, either I let players read at their own pace, and allow the game to continue play after they have pressed the action button, or the card stays on the screen for maybe 15-20 seconds before play continues. ArcoMage proper did something similar to the latter idea, but, cards could be more identifiable by their art. This game doesn't have art, so, the action button method might be the way to go. Not 100% sure how to implement that, though.

Though, you could probably argue that I'm not 100% sure how to implement the AI in general!