It is currently 08 Sep 2025, 11:35
   
Text Size

r22665 - ai vs ai games can be run from command line

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

r22665 - ai vs ai games can be run from command line

Postby Max mtg » 22 Jul 2013, 21:07

usage: forge.exe sim <deck1> <deck2> [N]

sim - game mode
deck1/2 - either names of constructed decks created in game or paths to deck files.
N - number of games, defaults to one.

Note:
  • filenames must end with dot and three-symbol extension (works fine for most .dck, .txt files)
  • deck names are case-sensitive, have to be quoted if contain multiple words. (ex: "Tempered Steel")


Feedback? Opinions?
Last edited by Max mtg on 24 Jul 2013, 08:24, edited 2 times in total.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: r22665 - ai vs ai games can be run from command line

Postby Max mtg » 24 Jul 2013, 08:22

Added number of games parameter.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: r22665 - ai vs ai games can be run from command line

Postby Max mtg » 25 Jul 2013, 08:13

Works fine with eclipse console, but the compiled forge.exe does not produce any output to the console, where I launched it.
Will have to test if the output should be explicitly redirected to an outfile (like:
Code: Select all
forge.exe [paramters] > outfile.txt
) so that user would have to open that file to read the results.

If this doesn't work, we'll have to delay announcement of this feature till next beta.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: r22665 - ai vs ai games can be run from command line

Postby Max mtg » 25 Jul 2013, 21:31

does not work outside of eclipse =((
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: r22665 - ai vs ai games can be run from command line

Postby Max mtg » 26 Jul 2013, 06:05

Ok, latest news.
Since Forge in a GUI application (and console command prompt does not wait for it to finish) I cannot get the output in the same window.

However, since all output is dumped to forge.log, It's that file where one can find the simulation results.

So, it's not a very convinient way to use the feature, but may be fair for a few enthusiasts.
This has to be improved, of course. Still don't know which way would be the best one.

It looks like a best one to split actual forge project into a gui shell and a different jar with libraries to create a console application using the same libs.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: r22665 - ai vs ai games can be run from command line

Postby timmermac » 26 Jul 2013, 12:26

Why not set it up so that you can actually see the match being played out on the screen? That would be more fun, IMO.
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: r22665 - ai vs ai games can be run from command line

Postby friarsol » 26 Jul 2013, 12:29

timmermac wrote:Why not set it up so that you can actually see the match being played out on the screen? That would be more fun, IMO.
You can do that already and have been able to for a few releases. Someone requested a feature to be able to simulate lots of matches in a row (via a script) without needing to sit there and watch the UI update, which is slow.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 86 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 86 users online :: 0 registered, 0 hidden and 86 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 86 guests

Login Form