dreignier / cg-brutaltester Goto Github PK
View Code? Open in Web Editor NEWA local arena for codingame multiplayer puzzles
License: GNU General Public License v3.0
A local arena for codingame multiplayer puzzles
License: GNU General Public License v3.0
I've tried using Java 21 virtual threads locally, and it seems faster. However, even with Java 8, I'm unable to run brutal-tester with more than one thread, as most games end up timing out...
Furthermore, to run older games, one needs to adapt the referee or have Java 21 and Java 8 installed...
As the title says ... i currently try to get LegendsOfCodeAndMagic running.
But it does not seem to be compatible
or is the 'How do I make my own referee?' documentation just not up to date?
I tried a couple of different things but didn't put my hands into the code (yet). I took the released jars on github and also tried with a local compiled version. Same thing.
I just hope someone knows what this is about by just looking at those lines (I'm not familiar with java).
Thx.
22:33:21,063 ERROR [com.magusgeek.brutaltester.GameThread] Problem with referee output in game1. Output content:WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
null
null
22:33:21,064 ERROR [com.magusgeek.brutaltester.GameThread] Error during game 1
22:33:21,065 ERROR [com.magusgeek.brutaltester.GameThread] Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
at com.google.inject.internal.cglib.reflect.$FastClassEmitter.(FastClassEmitter.java:67)
at com.google.inject.internal.cglib.reflect.$FastClass$Generator.generateClass(FastClass.java:72)
at com.google.inject.internal.cglib.core.$DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:216)
at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create(FastClass.java:64)
at com.google.inject.internal.BytecodeGen.newFastClass(BytecodeGen.java:204)
at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.(ProviderMethod.java:256)
at com.google.inject.internal.ProviderMethod.create(ProviderMethod.java:71)
at com.google.inject.internal.ProviderMethodsModule.createProviderMethod(ProviderMethodsModule.java:275)
at com.google.inject.internal.ProviderMethodsModule.getProviderMethods(ProviderMethodsModule.java:144)
at com.google.inject.internal.ProviderMethodsModule.configure(ProviderMethodsModule.java:123)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:349)
at com.google.inject.spi.Elements.getElements(Elements.java:110)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
at com.codingame.gameengine.core.RefereeMain.start(RefereeMain.java:62)
at com.codingame.gameengine.runner.RefereeAgent$1.run(RefereeAgent.java:68)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @60285225
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at com.google.inject.internal.cglib.core.$ReflectUtils$2.run(ReflectUtils.java:56)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at com.google.inject.internal.cglib.core.$ReflectUtils.(ReflectUtils.java:46)
... 21 more
java.lang.RuntimeException: Invalid Referee command:
at com.codingame.gameengine.runner.GameRunner.readCommand(GameRunner.java:318)
at com.codingame.gameengine.runner.GameRunner.readGameInfo(GameRunner.java:302)
at com.codingame.gameengine.runner.GameRunner.runAgents(GameRunner.java:127)
at com.codingame.gameengine.runner.GameRunner.runGame(GameRunner.java:453)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at com.codingame.game.CommandLineInterface.main(CommandLineInterface.java:68)
The GameRunner class is now abstract, replaced by MultiplayerGameRunner. I updated it here if you want to see. I disabled the refereeInput part ('-d') option. The MultiplayerGameRunner has a setSeed() method that should be enough in most cases, if needed.
Hello, weird double number of games when setting the initial seed.
Steps to reproduce:
java -jar brutal.jar -r "java -jar -Dleague.level=2 cg_fall_2022.jar" -p1 "python3 do_nothing_bot.py" -p2 "python3 do_nothing_bot.py" -n 1 -t 1
java -jar brutal.jar -r "java -jar -Dleague.level=2 cg_fall_2022.jar" -p1 "python3 do_nothing_bot.py" -p2 "python3 do_nothing_bot.py" -n 1 -t 1 -i 0
The do_nothing_bot.py
:
width, height = [int(i) for i in input().split()]
while True:
my_matter, opp_matter = [int(i) for i in input().split()]
for row in range(height):
for col in range(width):
(
scrap_amount,
owner,
units,
recycler,
can_build,
can_spawn,
in_range_of_recycler,
) = [int(k) for k in input().split()]
print("WAIT")
Adding -i 0
to set the seed for consistent testing also double the number of games as if the -s
arg was present. This double the testing time for no reason. Failed games, for a timeout, show a command to reproduce the failed game that contains -s
in it (don't know if that helps).
Cheers
Because of the new way of making referees, at the moment -i and -s (initial seed and swap) won't works if you are not using an old referee.
Hello, I tried the brutaltester with the spring challenge 2021 referee, I compile my bot made in Rust, launched the command and it's just looping, no information...
I compiled the referee and I was really confused how to use the cg-brutaltester (e.g. how to set level.league, or how to run multiple times), because it wasn't the brutaltester, but the referee for brutaltester, that I had to also compile.
Hi, two questions:
Thanks
I have a problem with cg-brutaltester. I have built the project both locally and using docker. But when I try to run it I get this error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ReflectionUtil
at org.apache.logging.log4j.jcl.LogAdapter.getContext(LogAdapter.java:39)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:48)
at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:40)
at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:55)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
at com.magusgeek.brutaltester.Main.<clinit>(Main.java:16)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.util.ReflectionUtil
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 6 more
Are there plans to build a version of the referee of Botters of the Galaxy compatible with the brutal tester?
I see the message 14:25:21,171 ERROR [com.magusgeek.brutaltester.GameThread] Negative score during game 7 p1:-1
. But the player with a negative score is p2, not p1.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.