Anyone know of some ways I could learn how to make an AI for a card game? The game is sort of like hearthstone but I made up my own rules, and the way it plays is a lot different. It’s an Elder Scrolls game(I know they are making one) by the way. Anyways I’m an absolute beginner in c#, well not absolute but fairly new. I’ve manage to make draggable cards from your deck to the table and i’m working on a deck. Again AI anyone?
You have to think of the AI as having a Behavior Tree. First, it needs to find out in what situation it is currently in. How much health does it have? how much mana? Are there any threatening creature cards on the table? Any ongoing effects that harm and and which it needs to stop? Are thre present threats negligible, so it can focus on the offense? Does the player have any weaknesses, or magic shields protecting him against, say, fire balls? You have to weigh all these factors and decide which one needs attention the most, and see if it can be done with the current resources. Then you can act going from the most important task at hand to the lowest, until you run out of mana (or don’t have enough mana after what you want to save for the next round). More advanced would be if you also take into account how the situation might unfold in the next rounds; Are any effect ending, so that powerful spell that is useless now can be saved until next turn? Do I need to save any mana for it as well? Another advanced feature would be personality profiles, where different AI characters act according to it. A Dragon focuses on fire spells, a Succubus uses mostly charming and seducing spells, a Summoner summons minions to fight for him… And any combination of that and more. It’s also comparatively easy to make the AI act perfect, but that wouldn’t be realistic, so to be more human-like, it needs a random element influencing it’s actions, and a difficulty rating that lets it make mistakes or less-than-ideal actions.