Running AI vs AI matches headless (without gui)
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Running AI vs AI matches headless (without gui)
by errevs » 07 Mar 2017, 14:14
Hi! I am doing my master thesis on evolutionary deckbuilding in MTG and I am trying to figure out how to calculate the strength of a deck in a population (known as a "fitness function"). Is it possible to run AI vs AI matches in forge from the command line or through an API without the need to interact with the GUI?
All other insights into this are also very welcome.
All other insights into this are also very welcome.
- errevs
- Posts: 4
- Joined: 07 Mar 2017, 14:10
- Has thanked: 0 time
- Been thanked: 0 time
Re: Running AI vs AI matches headless (without gui)
by friarsol » 08 Mar 2017, 00:14
Yep Forge definitely has that capability. We had a pretty big discussion about it last year
viewtopic.php?f=26&t=18446
I can help with any details you can't figure out.
viewtopic.php?f=26&t=18446
I can help with any details you can't figure out.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Running AI vs AI matches headless (without gui)
by errevs » 08 Mar 2017, 09:14
Thanks! I am currently trying to run the sim with the .jar file, as I am developing on a Mac. I cannot seem to get the decks loaded. I am testing with the burn deck and the goblins deck from the thread you linked. The error I get is:
- Code: Select all
could not load deck - Burn.dck, match cannot start
- Code: Select all
-D /absolute/path/to/decks
- errevs
- Posts: 4
- Joined: 07 Mar 2017, 14:10
- Has thanked: 0 time
- Been thanked: 0 time
Re: Running AI vs AI matches headless (without gui)
by friarsol » 09 Mar 2017, 00:52
What's the exact command line you are running? And can you give me an 'ls' of that decks folder?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Running AI vs AI matches headless (without gui)
by errevs » 09 Mar 2017, 16:56
The exact command I use is
ls of that folder:
By placing the decks I want to check in /Users/my_username/Library/Application Support/Forge/decks/constructed/ I was able to test them, but ideally I would like to use a folder structure for the experiment.
- Code: Select all
java -Xmx1024m -jar forge-gui-desktop-1.5.61-SNAPSHOT-jar-with-dependencies.jar sim -D /Users/my_username/testdecks -d Jund.dck enchantress.dck -q -n 10
- Code: Select all
java -Xmx1024m -jar forge-gui-desktop-1.5.61-SNAPSHOT-jar-with-dependencies.jar sim -d Jund.dck enchantress.dck -q -n 10 -D /Users/my_username/testdecks
ls of that folder:
- Code: Select all
Jund.dck
enchantress.dck
By placing the decks I want to check in /Users/my_username/Library/Application Support/Forge/decks/constructed/ I was able to test them, but ideally I would like to use a folder structure for the experiment.
- errevs
- Posts: 4
- Joined: 07 Mar 2017, 14:10
- Has thanked: 0 time
- Been thanked: 0 time
Re: Running AI vs AI matches headless (without gui)
by friarsol » 11 Mar 2017, 01:48
Ah I haven't looked at this code in a while. The directory parameter is only if you are using the tournament flag. Soo.. you could either run a two deck tournament with (-t Bracket), which might not make as much sense for your setup.
It looks like the -d parameter isn't working because you just have the .dck files at a random location, and the simulator tries to infer the deck directory for you. So by saying
Once you have your Forge user directory, your decks should be either in decks/constructed or decks/commander as appropriate.
You can use a folder structure for the experiment as long as that folder lives within that root directory. I bet you could even just have a softlink from your existing location inside Forge's constructed folder
It looks like the -d parameter isn't working because you just have the .dck files at a random location, and the simulator tries to infer the deck directory for you. So by saying
- Code: Select all
-d Jund.dck enchantress.dck
Once you have your Forge user directory, your decks should be either in decks/constructed or decks/commander as appropriate.
You can use a folder structure for the experiment as long as that folder lives within that root directory. I bet you could even just have a softlink from your existing location inside Forge's constructed folder
- Code: Select all
ln -s <your home directory>/Library/Application Support/Forge/decks/constructed/testdecks <your home directory>/testdecks/
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Running AI vs AI matches headless (without gui)
by errevs » 14 Mar 2017, 10:19
Cheers, that works! Thanks a lot for your help!
- errevs
- Posts: 4
- Joined: 07 Mar 2017, 14:10
- Has thanked: 0 time
- Been thanked: 0 time
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 39 guests