MCTS AI Update
Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins
21 posts
• Page 2 of 2 • 1, 2
Re: MCTS AI Update
by fireshoes » 11 Mar 2015, 02:36
Doing my testing tonight, I'm getting NPEs for Exception in Rules Generation on all of the cards. The cards seem to work ok, but everything was super laggy and my computer's fan kicked onto full speed.
- Code: Select all
ERROR 2015-03-10 21:14:30,015 Exception in rules generation for card: Mountain =>[AWT-EventQueue-0] CardImpl.getRules
java.lang.NullPointerException
at mage.cards.CardImpl.getRules(CardImpl.java:225)
at mage.view.CardView.<init>(CardView.java:201)
at mage.view.CardView.<init>(CardView.java:124)
at mage.client.util.CardsViewUtil.convertSimple(CardsViewUtil.java:71)
at mage.client.game.GamePanel.showRevealed(GamePanel.java:786)
at mage.client.game.GamePanel.updateGame(GamePanel.java:681)
at mage.client.game.GamePanel.updateGame(GamePanel.java:536)
at mage.client.remote.CallbackClientImpl$1.run(CallbackClientImpl.java:288)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Re: MCTS AI Update
by BetaSteward » 23 Mar 2015, 18:39
I just committed a change that modifies how abilities are added to cards. Nothing too major but there are some things to be aware of. Since this is part of my effort to make Cards immutable you can no longer add abilities to a Card outside of the constructor. Some abilities attempted to add additional abilities when they were added to a Card. This can now be accomplished by adding sub-abilities to an ability. When the main ability is added to a card all sub-abilities will also be added.
I also moved the additional abilities property from GameState to CardState.
Additionally I added a bunch of new tests. Some of them are failing but this is due to existing defects not ones that I introduced.
I also moved the additional abilities property from GameState to CardState.
Additionally I added a bunch of new tests. Some of them are failing but this is due to existing defects not ones that I introduced.
- BetaSteward
- DEVELOPER
- Posts: 129
- Joined: 28 Mar 2010, 13:15
- Has thanked: 6 times
- Been thanked: 29 times
Re: MCTS AI Update
by BetaSteward » 24 Mar 2015, 02:05
Or it appears that I can't write testsAdditionally I added a bunch of new tests. Some of them are failing but this is due to existing defects not ones that I introduced.

Thanks LevelX2!
- BetaSteward
- DEVELOPER
- Posts: 129
- Joined: 28 Mar 2010, 13:15
- Has thanked: 6 times
- Been thanked: 29 times
Re: MCTS AI Update
by BetaSteward » 04 May 2015, 19:52
I've done everything I can for the MCTS AI without performing major surgery on the game engine.
The unit of measure I'm using for performance is simulations/second (sim/s). Right now, with an AMD 8320 (8 cores, 3.5GHz), I can get about 100 sim/s. Before I started the current round of optimizations I was getting around 30 sim/s so I think that's some good progress.
The advantage of higher sim/s is that the MCTS algorithm can explore deeper into the decision tree giving it a greater chance of finding the optimal move.
There is still lots of work to do since the algorithm is not using chance nodes and it is not considering responses to triggered abilities.
I'm going to move on to improving server performance and maybe sometime later I will get back to the MCTS AI
The unit of measure I'm using for performance is simulations/second (sim/s). Right now, with an AMD 8320 (8 cores, 3.5GHz), I can get about 100 sim/s. Before I started the current round of optimizations I was getting around 30 sim/s so I think that's some good progress.
The advantage of higher sim/s is that the MCTS algorithm can explore deeper into the decision tree giving it a greater chance of finding the optimal move.
There is still lots of work to do since the algorithm is not using chance nodes and it is not considering responses to triggered abilities.
I'm going to move on to improving server performance and maybe sometime later I will get back to the MCTS AI
- BetaSteward
- DEVELOPER
- Posts: 129
- Joined: 28 Mar 2010, 13:15
- Has thanked: 6 times
- Been thanked: 29 times
Re: MCTS AI Update
by North » 05 May 2015, 10:27
Related to the introduced 1.8 incompatibility. I'm guessing you were using an IDE that is not NetBeans. I broke the build in a similar manner when I gave IntelliJ a try.
Now to the important things: this thread is pure gold. I love refactoring and seeing all the talk on immutability and finding solutions for improving performance on a project this scale is beyond awesome. I've been out of touch with MAGE for quite a while now; I'm itching to get my hands dirty again.
Now to the important things: this thread is pure gold. I love refactoring and seeing all the talk on immutability and finding solutions for improving performance on a project this scale is beyond awesome. I've been out of touch with MAGE for quite a while now; I'm itching to get my hands dirty again.
Re: MCTS AI Update
by BetaSteward » 05 May 2015, 12:38
Actually I am using NetBeans. I don't remember why I did it now, but I changed my default JDK to 1.8 and then came across the putIfAbsent convenience method but I didn't realize how new it was.North wrote:Related to the introduced 1.8 incompatibility. I'm guessing you were using an IDE that is not NetBeans. I broke the build in a similar manner when I gave IntelliJ a try.
I took me a while to get back into it. It's amazing how quickly you can forget things. If you want to help with the conversion to Netty I could use some help. I'm thinking about abstracting the network IO layer from the client and server so that if and/or when it needs to be changed the client and server logic won't be affected so greatly.North wrote:I've been out of touch with MAGE for quite a while now; I'm itching to get my hands dirty again.
- BetaSteward
- DEVELOPER
- Posts: 129
- Joined: 28 Mar 2010, 13:15
- Has thanked: 6 times
- Been thanked: 29 times
21 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 3 guests