It is currently 29 Oct 2025, 02:56
   
Text Size

AI having problems choosing the Human as target player

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

AI having problems choosing the Human as target player

Postby Chris H. » 27 Feb 2011, 14:30

I spent some time trying to figure out the bugs with Tormod's Crypt in message:

Chris H. wrote:AI cast a Tormod's Crypt on it's first turn and both graveyards are empty. The stack only has "1." displayed and there is no additional text after these two characters.
`
and the Identity Crisis bug in message:

Jaedayr wrote:r6850

Code: Select all
An error has occured. You can copy/paste this message or save it to a file.
Please report this, plus what you tried to do, to:
   http://www.slightlymagic.net/forum/viewforum.php?f=26
If you don't want to register an account, you can mail it directly to
   mtgerror@yahoo.com


There is an error in the card code for Identity Crisis:



Version:
Forge -- official beta: $Date: 2011-01-06 11:34:48 -0500 (Thu, 06 Jan 2011) $, SVN revision: $Revision: 4891 $

OS: Windows XP Version: 5.1 Architecture: x86

Java Version: 1.6.0_24 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.RuntimeException: AllZone : getZone() invalid parameters Library null
   at forge.AllZone.getZone(AllZone.java:108)
   at forge.CardFactory_Sorceries$6.canPlayAI(CardFactory_Sorceries.java:196)
   at forge.ComputerAI_General.getPlayable(ComputerAI_General.java:178)
   at forge.ComputerAI_General.getMain1(ComputerAI_General.java:112)
   at forge.ComputerAI_General.playCards(ComputerAI_General.java:34)
   at forge.ComputerAI_General.main1(ComputerAI_General.java:21)
   at forge.ComputerAI_Input.think(ComputerAI_Input.java:46)
   at forge.ComputerAI_Input.showMessage(ComputerAI_Input.java:31)
   at forge.GuiInput.setInput(GuiInput.java:27)
   at forge.GuiInput.update(GuiInput.java:21)
   at java.util.Observable.notifyObservers(Unknown Source)
   at java.util.Observable.notifyObservers(Unknown Source)
   at forge.MyObservable.updateObservers(MyObservable.java:9)
   at forge.Phase.nextPhase(Phase.java:377)
   at forge.GuiDisplay4$25.actionPerformed(GuiDisplay4.java:740)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$1.run(Unknown Source)
   at java.awt.EventQueue$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$2.run(Unknown Source)
   at java.awt.EventQueue$2.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
`
These two cards are currently hard coded and have not been improperly converted to AF. Both of these bugs appear to be problems with the AI in respect to choosing the Human as a target player.

The Tormod's Crypt AI bug may appear in a few other places, have not had the time to investigate to see if this is more widespread. There are several cards using:

Code: Select all
if (card.getController().equals(AllZone.ComputerPlayer))
    setTargetPlayer(AllZone.HumanPlayer);
`
I wish that I was in a better position to figure this out. :(
Last edited by Chris H. on 27 Feb 2011, 14:38, edited 1 time in total.
Reason: Edited several times to make this message more readable.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 10 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 10 users online :: 0 registered, 0 hidden and 10 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 10 guests

Login Form