Some of you remember my cg-arena tool to run multiple games in local. Forget it. cg-arena is dead.
Here come cg-brutaltester. Why creating cg-brutaltester instead of just improving cg-arena ? Because cg-arena has a big problem, the referee are coded in java directly in cg-arena. But now CodinGame gives the referee code for the contest. And there’s no guarantee that the referees will always be coded in Java.
cg-brutaltester take the referee as an external process, exactly like the players codes. This say, cg-brutaltester can accept any runnable referee and players codes. In any langage. If you can run a code with a simple command line, cg-brutaltester can run it too.
It is also easier to create your own referee for cg-brutaltester. See the readme file for more informations.
Keep in mind that cg-brutaltester is slower than Agade Ghost in the Cell arena. Java will always be slower than C++. But cg-brutaltester is already prepared for the future ! If CodinGame give the next contest referee the same way they did for Ghost in the Cell, it will take something like 30 minutes to code a compatible referee for cg-brutaltester.
Nice. A question.
The CG referee code you use for Ghost in the Cell is similar to the CG.
What are the steps for converting a CG referee on a “brutal” referee?
Not sure if I’m using it wrong or misunderstanding end result stats, but this doesn’t look right to me:
$ java -jar cg-brutaltester.jar ... -t 1 -n 1
08:01:24,979 INFO [com.magusgeek.brutaltester.GameThread] End of game 1: 0 1
08:01:24,980 INFO [com.magusgeek.brutaltester.Main] *** End of games ***
08:01:24,980 INFO [com.magusgeek.brutaltester.Main] *** Statistics for player 1:
08:01:24,980 INFO [com.magusgeek.brutaltester.PlayerStats] Position 1 : 1 (100%)
08:01:24,980 INFO [com.magusgeek.brutaltester.PlayerStats] Position 2 : 0 (0%)
08:01:24,980 INFO [com.magusgeek.brutaltester.PlayerStats] Position 3 : 0 (0%)
08:01:24,980 INFO [com.magusgeek.brutaltester.PlayerStats] Position 4 : 0 (0%)
08:01:24,980 INFO [com.magusgeek.brutaltester.Main] *** Statistics for player 2:
08:01:24,980 INFO [com.magusgeek.brutaltester.PlayerStats] Position 1 : 0 (0%)
08:01:24,980 INFO [com.magusgeek.brutaltester.PlayerStats] Position 2 : 1 (100%)
08:01:24,980 INFO [com.magusgeek.brutaltester.PlayerStats] Position 3 : 0 (0%)
08:01:24,980 INFO [com.magusgeek.brutaltester.PlayerStats] Position 4 : 0 (0%)
Does each “game” here mean actually running every position combination? If no, then how can both players have 100% in some position? If yes, then how can 1-1 in positions lead to 0-1 end of game 1 result?
it fails with
NoSuchElementException: No line found
the log file states:
“Player 1 error: Errore: impossibile trovare o caricare la classe principale Player.jar”
(impossible to load main class Player.jar)
I’m actually using Intellij Idea community edition and i was unable to get a jar for the brutaltester, i’m receiving a
“java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory”
that i can’t solve even inserting the apache jar in the project.
however, when i press the “play” button it actually works and i think its very good, i can set my pc to make 2 ais fight all night and see result on 10000 games.
(p.s. it seldom can crash one thread. when it happens, the program waits forever and won’t give the final stats…)
cg-brutaltester is build with maven. I don’t know how to use maven in Intellij. But you don’t have to build it yourself except if you want to modify it.
I’ve got an error:
java -jar cg-brutaltester.jar -r “java -jar cg-mm.jar” -p1 “MeanMax.exe” -p2 “MeanM
ax.exe” -p3 “./MeanMax.exe” -l “./logs/” -v
18:06:32,422 INFO [com.magusgeek.brutaltester.Main] Verbose mode activated
18:06:32,423 INFO [com.magusgeek.brutaltester.Main] Referee command line: java -jar cg-mm.jar
18:06:32,424 INFO [com.magusgeek.brutaltester.Main] Player 1 command line: MeanMax.exe
18:06:32,426 INFO [com.magusgeek.brutaltester.Main] Player 2 command line: MeanMax.exe
18:06:32,426 INFO [com.magusgeek.brutaltester.Main] Player 3 command line: ./MeanMax.exe
18:06:32,426 INFO [com.magusgeek.brutaltester.Main] Number of games to play: 1
18:06:32,427 INFO [com.magusgeek.brutaltester.Main] Number of threads to spawn: 1
18:06:32,524 ERROR [com.magusgeek.brutaltester.GameThread] Exception in game 1
java.util.NoSuchElementException: No line found
at java.util.Scanner.nextLine(Unknown Source) ~[?:1.8.0_151]
at com.magusgeek.brutaltester.GameThread.run(GameThread.java:86) [cg-brutaltester.jar:?]
18:06:32,528 INFO [com.magusgeek.brutaltester.Main] *** End of games ***
18:06:32,531 INFO [com.magusgeek.brutaltester.Main] *** Statistics for player 1:
18:06:32,533 INFO [com.magusgeek.brutaltester.Main] *** Statistics for player 2:
18:06:32,533 INFO [com.magusgeek.brutaltester.Main] *** Statistics for player 3:
You can also get that error if the referee doesn’t run correctly - which is very common on cg-mm.jar as it’s compiled with a very recent version of java so most people get a version error.
01:04:26,797 ERROR [com.magusgeek.brutaltester.GameThread] Exception in game 100
java.util.NoSuchElementException: No line found
at java.util.Scanner.nextLine(Unknown Source) ~[?:1.8.0_131]
at com.magusgeek.brutaltester.GameThread.run(GameThread.java:86) [cg-brutaltester-0.0.1.jar:?]