It is currently 20 Apr 2024, 01:14
   
Text Size

AI and development - ApplicationBuildFailure

Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins

AI and development - ApplicationBuildFailure

Postby 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:

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
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.

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
Smoof
 
Posts: 2
Joined: 23 Jan 2012, 13:50
Has thanked: 0 time
Been thanked: 1 time

Re: AI and development - ApplicationBuildFailure

Postby melvin » 04 Sep 2012, 12:13

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 :)
Thanks for the compliments :D 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:Great design decisions to manage the computational complexity btw.
You mean the decision to implement AI vs AI?

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?
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: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?
Oops, my bad the documentation is wrong it should be
Code: Select all
java -cp Magarena.exe magic.DeckStrCal --deck1 LSK_RW.dec --deck2 LSK_Jund.dec
The args parsing is in src/magic/DeskStrCal.java. Btw, where did you read about this?

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.
Only during its own turn, though it would be nice to utilize the player's thinking time as well.

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)?
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: 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
My bad :( I forgot to add a new file to the repo. Just fixed it.

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.
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: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?
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.

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
User avatar
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

Postby 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!
Smoof
 
Posts: 2
Joined: 23 Jan 2012, 13:50
Has thanked: 0 time
Been thanked: 1 time

Re: AI and development - ApplicationBuildFailure

Postby melvin » 07 Sep 2012, 14:28

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.
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.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times


Return to Magarena

Who is online

Users browsing this forum: No registered users and 49 guests


Who is online

In total there are 49 users online :: 0 registered, 0 hidden and 49 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 49 guests

Login Form