So.. I ‘ve kind of hit a wall with the AI. I just realized that the paradigm shift I talked about in the last posts is incompatible with my elegant solution for spell effects. Currently, I use the .Net IEnumerable type with the yield keyword so that I can very briefly write the code for a spell. See my post on Shock for an example of this. But, to construct the minmax tree, one has to try all the possible answers whenever there is a choice involved. Which happens a lot during a spell is played (targeting, paying costs, etc…). But with IEnumerables, I can’t “go back” and try to “play the cost” differently. So I’m stuck with destroying my beautiful scheme 😦 but I can’t resolve myself to do it. There must be a way around it 🙂
I have this hunch that there is something wrong with my basic hypothesis and that there is a better way to handle the game flow.
For those implementing minmax, how did you resolve this problem? How do you describe the flow of the game in your engine? How do you code card rules?