Page 1 of 1

Improving the AI

PostPosted: 15 Apr 2010, 16:28
by Beached As
Is there a thread relating to suggestions for improving the AI? I was testing out a few decks and noticed a few improvements that could be made.

1) If the computer has a card with landfall in hand with enough mana to cast it, then the computer should play the card before putting down a land.

2) Greater attention must be paid to using activated abilities which doesn't cause permanents to tap. For example: I was in a game where the computer played Lich Lord of Unx and every turn the AI would use all its mana to activate Lich Lord of Unx 's two abilities and not play any cards in its hand. Other cases include where the AI keeps giving a creature the same ability over and over again (e.g. in the case of Boros Guildmage)

Ultimately, i'm sure people have thought of this already but, i think the AI should somehow incorporate keywords into the decisions it makes. However programming this i would imagine would be very difficult so i guess its more of long term goal (a very long term goal :()

Re: Improving the AI

PostPosted: 15 Apr 2010, 18:31
by Rob Cashwalker
In the case of Boros Guildmage, if it's using the abPump keyword, then the AI takes into consideration both the number of times it has activated an ability on the card and whether the card already has the keyword..

Lich Lord of Unx is done in pure code. Any mana-only abilities should include something like the below, to prevent complete run-away activations, but still allow at least two times.
Code: Select all
  Random r = new Random();
  if(r.nextFloat() <= Math.pow(.6667, card.getAbilityUsed())) return CardFactoryUtil.AI_doesCreatureAttack(card);
.6667^0 = 1 (first time is guaranteed)
.6667^1 = .6667 (second time is likely)
.6667^2 = .4445 (third time isn't likely)
.6667^3 = .2963 (fourth time probably not)

Re: Improving the AI

PostPosted: 15 Apr 2010, 19:40
by mtgrares
Improving the AI is just hard (to near impossible) to do with this version of Forge. It is like watching a movie and saying that the plot needs to be changed. If you and the computer are each given equally powerful decks the AI will lose 80% of the time, so Forge allows you to "smooth the AI's land" which will give the AI a small edge or play quests, where the AI has better decks.

Everyone (even me) wants a better AI and Magic is a great game but very complicated also. :D

Re: Improving the AI

PostPosted: 18 Apr 2010, 02:49
by frwololo
I think you can spend months fine-tuning the AI, that's not what makes a game enjoyable. The idea of an "interesting game" is progressive challenge.
I know Forge is more of a "simulation" than an actual game, but I'm thinking for example of the quest mode.

Rather than tweaking the AI, the fun could be increased with the following techniques:
- giving a personality to the AI (it gets angry when it loses, taunts you , etc...)
- Increasing challenge: you start with a crappy deck that you improve over time, AND your opponents get stronger (they have stronger decks, it doesn't mean the AI gets smarter, but they have decks more adapted to the AI's limitation). I think that's already what the quest mode does.
- Add a story
-...

Chess games with a perfect AI are still boring because your opponent is a machine with no feelings.
My point being that Forge wouldn't necessary be better with a perfect AI, despite the time it would take to improve it. In other words, I'm suggesting it could be some wasted time for the developers...

Think of all the games you enjoyed in your life that had a crappy AI but lots of other interesting factors :)

Re: Improving the AI

PostPosted: 18 Apr 2010, 05:25
by Beached As
A challenge is always good :). I think variety is a key point also. Games are less boring if each time you play the game, somethings always new and i guess if the AI knows how to use more cards effectively then there's more variety in the decks the AI can use. Just a thought

I wonder how you could add personality to the computer lol. maybe have it rambo with all its creatures if u use too many counterspells.

Re: Improving the AI

PostPosted: 18 Apr 2010, 06:20
by Rob Cashwalker
I give tha AI a lot of credit sometimes... I played a quest for the first time to test the card shop and didn't win a single game out of 10. (even without land stacking)
The AI is only good with certain situations. When it has a complex board position, it takes a while to decide how to handle First Main Phase and then combat. Combat is actually calculated repeatedly in most canPlayAI methods... which is probably responsible for much of the slowdown.

I'm not so sure that the better way to fix the AI is to try to make it smarter (like thinking ahead) rather, the ideal would be to make sure the AI has ability and logic to react to the stack and other instant-speed phase stops. For instance, an instant pump spell would have the logic changed to either react during combat or in response to a damage spell.. as opposed to strictly a pre-combat energy drink. Likewise, Sorcery pumps would have to make their move during Main1. The more opportunity given to the AI to make decisions, the more opportunity for the AI to play differently every game.

Random taunting and storyline sound interesting....

Re: Improving the AI

PostPosted: 18 Apr 2010, 06:28
by DennisBergkamp
Yeah I like the idea of a storyline... I've been busy working on a bunch of changes in the quest mode, hopefully I'll finish those soon (in the next week or two). Anyway, they're mostly changes that add a few extra RPG aspects to the game, a storyline would fit in well with that.

Re: Improving the AI

PostPosted: 18 Apr 2010, 07:41
by Marek14
I was wondering about having storylines played from the point of view of a specific Legend or planeswalker...

A RPG aspect might include sidequests given by NPCs... it should be possible to find a card for almost any purpose :)

For example, a Merchant of Secrets could sell hints telling what strategy is good against what opponent. Transguild Courier could give you quest to carry message... etc.