AI Play Improvements
The current system we have for AI is to have it check for everything in canPlayAI, leaving a very bloated function and a system that doesn't know which SA is "best" to play. We just know all of them that we can play and take one at random.
As per Issue http://code.google.com/p/cardforge/issues/detail?id=124 I'd like to start a discussion about the possibility of moving over to a two pronged system.
The first prong will be the same as the structure we currently have in place. canPlayAI will check to see if the AI is able to play a spellAbility. This would take care of things that the AI would never play. And also handle situations where the AI is unable to play them due to lack of resources.
The second prong would be a new set of functions that would be called for each SA that passes the canPlayAI step. Let's tentatively call this "shouldPlayAI()". Basically in the AF we would "rate" how good this AF would be. If our rating is <= 0, this represents something that is a waste of resources or bad for the AI. The higher our rating goes represents positive use of an ability. Of course casting Terror on a Shivan Dragon should have a much better rating then casting Terror on a Llanowar Elves. Each AF could have a base rating and gain or lose points on the situation.
Casting Fog? The rating should be improved based on how much damage relative to your current life you would take.
Feel free to add any other thoughts or ways to go about things here, since this is probably even more complex than that.
As per Issue http://code.google.com/p/cardforge/issues/detail?id=124 I'd like to start a discussion about the possibility of moving over to a two pronged system.
The first prong will be the same as the structure we currently have in place. canPlayAI will check to see if the AI is able to play a spellAbility. This would take care of things that the AI would never play. And also handle situations where the AI is unable to play them due to lack of resources.
The second prong would be a new set of functions that would be called for each SA that passes the canPlayAI step. Let's tentatively call this "shouldPlayAI()". Basically in the AF we would "rate" how good this AF would be. If our rating is <= 0, this represents something that is a waste of resources or bad for the AI. The higher our rating goes represents positive use of an ability. Of course casting Terror on a Shivan Dragon should have a much better rating then casting Terror on a Llanowar Elves. Each AF could have a base rating and gain or lose points on the situation.
Casting Fog? The rating should be improved based on how much damage relative to your current life you would take.
Feel free to add any other thoughts or ways to go about things here, since this is probably even more complex than that.