AI and development - ApplicationBuildFailure
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
AI and development - ApplicationBuildFailure
by Smoof » 04 Sep 2012, 10:55
Hi,
first of all: fantastic Project! After a little playtesting and reading about the AI implementation, I was hooked! I should continue writing my dissertation, but man, this project is awesome I'd love to contribute to the AI in the future, maybe implement some domain knowledge into the Simulation part to benefit from non-random choices, for example with the "Mana Spent" Theory as a heuristic:
www .channelfireball. com/articles/woo-brews-building-better-decks-with-mana-sum-theory/
a) It's so awesome that even AI-vs-AI is already implemented, comparing implementations should be easy. Great design decisions to manage the computational complexity btw. What was the runtime for the simulations on the "AIComparison" wikipage? Was computational efficiency the primary design rationale for choosing the LSK_x.dec Decks to benchmark AI-vs-AI?
b) When trying to do some AI-vs-AI testing, at first try I couldn't get it to run by invoking for example:
java -jar Magarena.exe magic.DeckStrCal --deck1 LSK_RW.dec --deck2 LSK_Jund.dec
It just starts the Game and logs to the console (e.g. "Initialization of engine took 2.121s"). Also, when looking at MagicMain.java, I can't see where args[] are parsed? Could AI-vs-AI perhaps be disabled in Magarena 1.29?
c-1) Does the AI only scan the game-tree during it's own turn, or also during player-think-time? For example, if the AI does temporarily cheat during player think-time by looking at the player's hand to determine his next probable play, it could precompute it's next move(s) and save the player a lot of waiting time.
c-2) Concerning flashback/graveyard cards: shouldn't sorcery-speed flashback cards, e.g. Lingering Souls, or cards like Gravecrawler, be the same as having 1 extra card in hand? They shouldn't be too problematic for the AI then, should they? Especially if you could profit from pre-computation during player think-time (see c-1)?
d) For starters, I was trying to add a few new cards, like e.g. Thragtusk (should be easy with templates like Blade Splicer, Fiend Hunter, etc.), but when trying to build the codebase via ANT, I get the following error, missing MagicEventActionFactory:
e) Have you thought about using something like Groovy as a dynamic scripting language, so new cards with new card-logic could be added on the fly?
Mmh, the post got bigger then I expected...
Keep up the great work, Magarena is awesome!
Smoof
first of all: fantastic Project! After a little playtesting and reading about the AI implementation, I was hooked! I should continue writing my dissertation, but man, this project is awesome I'd love to contribute to the AI in the future, maybe implement some domain knowledge into the Simulation part to benefit from non-random choices, for example with the "Mana Spent" Theory as a heuristic:
www .channelfireball. com/articles/woo-brews-building-better-decks-with-mana-sum-theory/
a) It's so awesome that even AI-vs-AI is already implemented, comparing implementations should be easy. Great design decisions to manage the computational complexity btw. What was the runtime for the simulations on the "AIComparison" wikipage? Was computational efficiency the primary design rationale for choosing the LSK_x.dec Decks to benchmark AI-vs-AI?
b) When trying to do some AI-vs-AI testing, at first try I couldn't get it to run by invoking for example:
java -jar Magarena.exe magic.DeckStrCal --deck1 LSK_RW.dec --deck2 LSK_Jund.dec
It just starts the Game and logs to the console (e.g. "Initialization of engine took 2.121s"). Also, when looking at MagicMain.java, I can't see where args[] are parsed? Could AI-vs-AI perhaps be disabled in Magarena 1.29?
c-1) Does the AI only scan the game-tree during it's own turn, or also during player-think-time? For example, if the AI does temporarily cheat during player think-time by looking at the player's hand to determine his next probable play, it could precompute it's next move(s) and save the player a lot of waiting time.
c-2) Concerning flashback/graveyard cards: shouldn't sorcery-speed flashback cards, e.g. Lingering Souls, or cards like Gravecrawler, be the same as having 1 extra card in hand? They shouldn't be too problematic for the AI then, should they? Especially if you could profit from pre-computation during player think-time (see c-1)?
d) For starters, I was trying to add a few new cards, like e.g. Thragtusk (should be easy with templates like Blade Splicer, Fiend Hunter, etc.), but when trying to build the codebase via ANT, I get the following error, missing MagicEventActionFactory:
- Code: Select all
Buildfile: C:\Projects\workspace\magarena\build.xml
init:
build:
[javac] Compiling 1782 source files to C:\Projects\workspace\magarena\build
[javac] C:\Projects\workspace\magarena\src\magic\model\event\MagicSpellCardEvent.java:44: cannot find symbol
[javac] symbol : variable MagicEventActionFactory
[javac] location: class magic.model.event.MagicSpellCardEvent
[javac] final MagicEventAction action = MagicEventActionFactory.build(args[0]);
[javac] ^
[javac] C:\Projects\workspace\magarena\src\magic\model\event\MagicSpellCardEvent.java:46: cannot find symbol
[javac] symbol : variable MagicEventActionFactory
[javac] location: class magic.model.event.MagicSpellCardEvent
[javac] final MagicTargetChoice choice = MagicTargetChoice.build(MagicEventActionFactory.hint(args[0]) + args[1]);
[javac] ^
[javac] 2 errors
BUILD FAILED
C:\Projects\workspace\magarena\build.xml:22: Compile failed; see the compiler error output for details.
Total time: 5 seconds
e) Have you thought about using something like Groovy as a dynamic scripting language, so new cards with new card-logic could be added on the fly?
Mmh, the post got bigger then I expected...
Keep up the great work, Magarena is awesome!
Smoof
Re: AI and development - ApplicationBuildFailure
by melvin » 04 Sep 2012, 12:13
Thanks for the compliments Would be cool to see if some of the ideas from Magic Theory can improve the AI. Funny that you mentioned your dissertation, I was writing my thesis when I started work on Magarena's AI.Smoof wrote:first of all: fantastic Project! After a little playtesting and reading about the AI implementation, I was hooked! I should continue writing my dissertation, but man, this project is awesome
You mean the decision to implement AI vs AI?Smoof wrote:Great design decisions to manage the computational complexity btw.
It took a couple of hours, luckily running AI vs AI simulations is an embarrassingly parallel problem, I just distributed the jobs in a compute cluster. No particular reason for choose the LSK_* series of decks, I wanted something with a wide range of archetypes from the same author, I didn't really check whether these requires less computation to simulate.Smoof wrote:What was the runtime for the simulations on the "AIComparison" wikipage? Was computational efficiency the primary design rationale for choosing the LSK_x.dec Decks to benchmark AI-vs-AI?
Oops, my bad the documentation is wrong it should beSmoof wrote:When trying to do some AI-vs-AI testing, at first try I couldn't get it to run by invoking for example:
java -jar Magarena.exe magic.DeckStrCal --deck1 LSK_RW.dec --deck2 LSK_Jund.dec
It just starts the Game and logs to the console (e.g. "Initialization of engine took 2.121s"). Also, when looking at MagicMain.java, I can't see where args[] are parsed? Could AI-vs-AI perhaps be disabled in Magarena 1.29?
- Code: Select all
java -cp Magarena.exe magic.DeckStrCal --deck1 LSK_RW.dec --deck2 LSK_Jund.dec
Only during its own turn, though it would be nice to utilize the player's thinking time as well.Smoof wrote:Does the AI only scan the game-tree during it's own turn, or also during player-think-time? For example, if the AI does temporarily cheat during player think-time by looking at the player's hand to determine his next probable play, it could precompute it's next move(s) and save the player a lot of waiting time.
Yes, it is the same as having extra cards, but if you have many of these in your graveyard it would create many possible choices. Since it is not supported now there is no way to test. We do welcome contributions to implement this so that we can do a proper test of the effect on the AI's gameplay.Smoof wrote:Concerning flashback/graveyard cards: shouldn't sorcery-speed flashback cards, e.g. Lingering Souls, or cards like Gravecrawler, be the same as having 1 extra card in hand? They shouldn't be too problematic for the AI then, should they? Especially if you could profit from pre-computation during player think-time (see c-1)?
My bad I forgot to add a new file to the repo. Just fixed it.Smoof wrote: For starters, I was trying to add a few new cards, like e.g. Thragtusk (should be easy with templates like Blade Splicer, Fiend Hunter, etc.), but when trying to build the codebase via ANT, I get the following error, missing MagicEventActionFactory
Sorry, but I'm not familiar with Eclipse. Try asking on our mailing list, I think some of the folks there use Eclipse.Smoof wrote:Since I'm new to Mercurial, I imported the project as shown in the tutorial, but the build-path configuration I get does not support code completion in Eclipse (Juno). This makes digging into the code difficult, do you have a solution? Otherwise I'd to rebuild the project manually to have an easier time browsing the code.
Yes! Unfortunately I'm not familiar enough with Groovy to check if it can be used to create classes like those we use for card code. I suspect it can, but then I couldn't figure out how to have groovy load a script and get back a class. I'd appreciate any advice on this topic.Smoof wrote:Have you thought about using something like Groovy as a dynamic scripting language, so new cards with new card-logic could be added on the fly?
Usually for more dev related topics we try to do in our mailing list. Do consider joining our google groups http://groups.google.com/group/magarena
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: AI and development - ApplicationBuildFailure
by Smoof » 07 Sep 2012, 13:42
Build is working now, thanks! Also solved my Eclipse issue, if it comes up for anyone else, you can point them to me.
Read about the AI-vs-AI syntax in your post at:
viewtopic.php?f=82&t=6035#p86156
With "Great design decisions to manage the computational complexity btw.", I meant to only implement cards the AI can handle well and exclude the other's for now, like e.g. Planeswalkers.
I'll try to use google groups for dev topics from now on, thanks!
Read about the AI-vs-AI syntax in your post at:
viewtopic.php?f=82&t=6035#p86156
With "Great design decisions to manage the computational complexity btw.", I meant to only implement cards the AI can handle well and exclude the other's for now, like e.g. Planeswalkers.
I'll try to use google groups for dev topics from now on, thanks!
Re: AI and development - ApplicationBuildFailure
by melvin » 07 Sep 2012, 14:28
Ah, yes. That was what attracted me to the project as well, the focus on competitive AI over adherence to rules or having many cards.Smoof wrote:With "Great design decisions to manage the computational complexity btw.", I meant to only implement cards the AI can handle well and exclude the other's for now, like e.g. Planeswalkers.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests