Bug reports
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
Re: Bug reports
by madmarcel » 30 Jul 2011, 02:31
Just got a message from Melvin about that, working on it now.beholder wrote:Goblins are reckless, that's all
BTW, when can we expect some of those changes you've done to show up in the official release?
I'm going to start of with 'easy' stuff, and upload some new smiple cards, that don't require huge changes in the code.
-
madmarcel - Posts: 18
- Joined: 17 Jul 2011, 03:18
- Location: New Zealand
- Has thanked: 0 time
- Been thanked: 0 time
Re: Bug reports
by beholder » 02 Aug 2011, 17:45
I suspected the computer from sometimes not playing a land while it can. I put in some debug code and it happened again just now.
I started this game and play a forest. The computer thinks and look... it passes all though it has 2 lands
Edit: This must be a bad day for the Ai .. same game, Ai start its turn:
I started this game and play a forest. The computer thinks and look... it passes all though it has 2 lands
- Code: Select all
Starting game...
LOG: Play Forest.
MCTS cached=0
MCTS index=1 life=20 time=6002 sims=1266
* [7/704/?] (pass)
[7/562/?] (Forest)
MCTS cached=704
MCTS index=1 life=20 time=6001 sims=1278
* [7/1089/?] (pass)
[7/892/?] (Forest)
Computer hand: Rancor - Forest - Maelstrom Pulse - Phyrexian Crusader - Rancor - Putrefy - Forest - Giant Growth -
LOG: Play Swamp.
LOG: Tap Swamp. Tap Forest. Pay {1}{B}. Play Bitterblossom.
LOG: Put Bitterblossom onto the battlefield.
MCTS cached=188
MCTS index=1 life=20 time=6003 sims=1403
* [6/830/?] (pass)
[6/760/?] (Forest)
MCTS cached=830
MCTS index=1 life=20 time=6003 sims=1445
* [6/1259/?] (pass)
[6/1015/?] (Forest)
Computer hand: Rancor - Forest - Maelstrom Pulse - Phyrexian Crusader - Rancor - Putrefy - Forest - Giant Growth - Vines of Vastwood -
LOG: You lose 1 life and put a 1/1 black Faerie Rogue creature token with flying onto the battlefield.
MCTS cached=1259
MCTS index=1 life=20 time=6003 sims=1507
* [6/1504/?] (pass)
[5/1261/?] (Forest)
MCTS cached=1504
MCTS index=1 life=20 time=6002 sims=1551
[5/1521/?] (pass)
* [5/1533/?] (Forest)
LOG: Play Forest.
MCTS cached=1533
MCTS index=1 life=20 time=6000 sims=1555
* [5/1614/?] (pass)
[5/1473/?] (Vines of Vastwood)
Edit: This must be a bad day for the Ai .. same game, Ai start its turn:
- Code: Select all
MCTS cached=417
MCTS index=1 life=20 time=6002 sims=1776
[4/738/?] (pass)
[4/709/?] (Vines of Vastwood)
* [4/745/?] (Forest)
LOG: Play Forest.
MCTS cached=745
MCTS index=1 life=20 time=6004 sims=1773
[4/1126/?] (pass)
* [4/1391/?] (Vines of Vastwood)
MCTS cached=0
MCTS index=1 life=20 time=6001 sims=1782
[4/280/?] (Vampire Nighthawk,0,null)
* [4/326/?] (Faerie Rogue,0,null)
[4/283/?] (Faerie Rogue,0,null)
[4/313/?] (Vampire Nighthawk,1,)
[4/294/?] (Faerie Rogue,1,)
[4/286/?] (Faerie Rogue,1,)
LOG: Pay {G}. Tap Forest. Play Vines of Vastwood.
LOG: Target creature (Faerie Rogue) can't be the target of spells or abilities your opponent controls this turn. If Vines of Vastwood was kicked (0), that creature gets +4/+4 until end of turn.
If debugging is the process of removing bugs, then programming must be the process of putting them in.
-
beholder - Programmer
- Posts: 123
- Joined: 17 Jul 2011, 17:56
- Location: Netherlands
- Has thanked: 16 times
- Been thanked: 25 times
Re: Bug reports
by melvin » 03 Aug 2011, 02:46
Thanks for the detailed report, especially the debug output
Yup, AI is having a pretty bad day, you can tell from the debug info. For those of your interested in the workings of monte carlo AI, the meaning of [X/Y/Z] before each move is
X = percentage that AI is going to win after making this move (0 - AI is losing, 100 - AI is winning)
Y = number of simulations that played this move
Z = win/lose if AI played this move (or the so called game theoretic value, this is independent of X and reflects the outcome assuming both players play optimally, usually only available near the end of the game).
Getting the monte carlo AI (MCTS) to play lands has been an interesting problem. It was the first problem I noticed with this AI when I started programming it. The trouble is that MCTS has no intrinsic value of a particular move or game situation. What it does is to make moves until one player loses. It does it as many times as possible (keeping under the time limit) and uses these simulations to figure out which moves have a better chance of winning.
In both games, the initial estimate is very low (7% in the first game and 4% in the second game). One simple hack is to use a heuristic: always play land if possible. There are two problems with this: 1) it may not always be the best option 2) this only solves the land problem but not the underlying AI problem.
Bad plays from the AI seems to occur when all the moves look equally bad/good , so the move made is almost random. One thing that I've done so far is to use the number of moves to win/lose as an additional way to differentiate between simulations that have the same win/lose result. The AI prefers losing games that takes as many moves as possible and winning games that take as little moves as possible. That seems to work well, but it does not completely solve the problem yet.
Currently, MCTS plays the move that has the largest number of simulation (greatest Y). I suspect this may be a cause of the problem as well, I'm going to experiment with different ways to picking the move.
Yup, AI is having a pretty bad day, you can tell from the debug info. For those of your interested in the workings of monte carlo AI, the meaning of [X/Y/Z] before each move is
X = percentage that AI is going to win after making this move (0 - AI is losing, 100 - AI is winning)
Y = number of simulations that played this move
Z = win/lose if AI played this move (or the so called game theoretic value, this is independent of X and reflects the outcome assuming both players play optimally, usually only available near the end of the game).
Getting the monte carlo AI (MCTS) to play lands has been an interesting problem. It was the first problem I noticed with this AI when I started programming it. The trouble is that MCTS has no intrinsic value of a particular move or game situation. What it does is to make moves until one player loses. It does it as many times as possible (keeping under the time limit) and uses these simulations to figure out which moves have a better chance of winning.
In both games, the initial estimate is very low (7% in the first game and 4% in the second game). One simple hack is to use a heuristic: always play land if possible. There are two problems with this: 1) it may not always be the best option 2) this only solves the land problem but not the underlying AI problem.
Bad plays from the AI seems to occur when all the moves look equally bad/good , so the move made is almost random. One thing that I've done so far is to use the number of moves to win/lose as an additional way to differentiate between simulations that have the same win/lose result. The AI prefers losing games that takes as many moves as possible and winning games that take as little moves as possible. That seems to work well, but it does not completely solve the problem yet.
Currently, MCTS plays the move that has the largest number of simulation (greatest Y). I suspect this may be a cause of the problem as well, I'm going to experiment with different ways to picking the move.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Bug reports
by beholder » 06 Aug 2011, 10:02
If debugging is the process of removing bugs, then programming must be the process of putting them in.
-
beholder - Programmer
- Posts: 123
- Joined: 17 Jul 2011, 17:56
- Location: Netherlands
- Has thanked: 16 times
- Been thanked: 25 times
Re: Bug reports
by melvin » 06 Aug 2011, 12:09
Thanks beholder, that's fast, I just test it myself this morning and it works. Just wondering, are you compiling directly from the source? cause the revision you mentioned haven't been released in a packaged form yet.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Bug reports
by beholder » 06 Aug 2011, 13:20
I use MercurialEclipse and TortoiseHg and pull the changes daily. I really should make a copy to experiment on because the merging is getting a PITA
Edit:
I like to make decks that have 60 cards but when saving and then later loading a duel, only 40 cards of a deck are loaded. All cards are saved but magic.model.MagicPlayerDefinition.load uses the constant DECK_SIZE=40.
Edit:
I like to make decks that have 60 cards but when saving and then later loading a duel, only 40 cards of a deck are loaded. All cards are saved but magic.model.MagicPlayerDefinition.load uses the constant DECK_SIZE=40.
If debugging is the process of removing bugs, then programming must be the process of putting them in.
-
beholder - Programmer
- Posts: 123
- Joined: 17 Jul 2011, 17:56
- Location: Netherlands
- Has thanked: 16 times
- Been thanked: 25 times
Re: Bug reports
by melvin » 06 Aug 2011, 15:43
That's pretty strange, I think it makes sense to just load as many cards as there are in the save file. Do you have a ready patch to fix this? We should look into getting some of your modifications into the repo to save you the trouble of merging PM me an email associated with a google account if you are interested in getting into the action.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Bug reports
by Huggybaby » 19 Aug 2011, 18:04
Here's a confusing bit:
On the right, my 6/9 is about to kill a 3/3...
After resolving, the 3/3 is dead and my 6/9 switches places with the 4/11.
That confused me when it happened. Hey, where did my card go? The card should always stay in its column shouldn't it, just like real life?
On the right, my 6/9 is about to kill a 3/3...
After resolving, the 3/3 is dead and my 6/9 switches places with the 4/11.
That confused me when it happened. Hey, where did my card go? The card should always stay in its column shouldn't it, just like real life?
-
Huggybaby - Administrator
- Posts: 3207
- Joined: 15 Jan 2006, 19:44
- Location: Finally out of Atlanta
- Has thanked: 701 times
- Been thanked: 594 times
Re: Bug reports
by ubeefx » 19 Aug 2011, 18:09
This behaviour is explainable.
Due to the card sorting, when the blocker is no longer attached to an attacker, the order can change.
So to fix this the sort ordering will need to be changed.
Due to the card sorting, when the blocker is no longer attached to an attacker, the order can change.
So to fix this the sort ordering will need to be changed.
Re: Bug reports
by melvin » 20 Aug 2011, 02:42
Thanks for the report Huggybaby, this is indeed somewhat confusing and should be fixed. I've entered it into our issue database.
And thanks to ubeefx's explanation, it is quite clear what must be done to fix it.
And thanks to ubeefx's explanation, it is quite clear what must be done to fix it.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Bug reports
by Huggybaby » 28 Aug 2011, 14:52
I have a critical issue with 1.17. After a few phases or turns the game just shuts down.
Playing Black/White against Blue/Green, Extended/Minimax.
Playing Black/White against Blue/Green, Extended/Minimax.
-
Huggybaby - Administrator
- Posts: 3207
- Joined: 15 Jan 2006, 19:44
- Location: Finally out of Atlanta
- Has thanked: 701 times
- Been thanked: 594 times
Re: Bug reports
by melvin » 28 Aug 2011, 15:30
How often does this occur?
Do you recall some of the cards in play at the point when the game went down?
I'm guessing it is a problem with the cards as this release had a major revision to the way cards are implemented in the engine.
Do you recall some of the cards in play at the point when the game went down?
I'm guessing it is a problem with the cards as this release had a major revision to the way cards are implemented in the engine.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Bug reports
by beholder » 28 Aug 2011, 15:36
Sounds bad
We really need a log file ...
We really need a log file ...
If debugging is the process of removing bugs, then programming must be the process of putting them in.
-
beholder - Programmer
- Posts: 123
- Joined: 17 Jul 2011, 17:56
- Location: Netherlands
- Has thanked: 16 times
- Been thanked: 25 times
Re: Bug reports
by Huggybaby » 28 Aug 2011, 16:05
It's repeatable every game, it only takes a few passes of priority.melvin wrote:How often does this occur?
How do I make a log file?
-
Huggybaby - Administrator
- Posts: 3207
- Joined: 15 Jan 2006, 19:44
- Location: Finally out of Atlanta
- Has thanked: 701 times
- Been thanked: 594 times
Re: Bug reports
by melvin » 28 Aug 2011, 16:11
beholder: Lol, I was thinking the exact same thing. I just put together something to create a crash log file when something bad happens.
Huggybaby: Can you try with the new build at http://magarena.googlecode.com/files/Magarena_1419.exe This new build creates a crash.log file in your Magarena folder (the same place where you find the game.cfg and tournament.cfg files) when the game goes down.
Huggybaby: Can you try with the new build at http://magarena.googlecode.com/files/Magarena_1419.exe This new build creates a crash.log file in your Magarena folder (the same place where you find the game.cfg and tournament.cfg files) when the game goes down.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Who is online
Users browsing this forum: Google [Bot] and 57 guests