Skip to content

Conversation

@bumfo
Copy link

@bumfo bumfo commented Jan 22, 2023

There are several improvements:

  1. Build with Gradle, and generate scripts automatically. JVM args of robocode is also fixed.
  2. Fix freeze when battle processes fail to init.
  3. Fix logic about 0/0 battles & other NaN scores.
  4. Fix some NPE.
  5. Fix XML reading corrupted battles.
  6. Fix APS computation to align with LiteRumble.

@evgmik
Copy link

evgmik commented Jan 22, 2023

Hi @bumfo
This patch set fails to run with the following output

./rrt.sh -bot zyx.nano.RedBull 1.0 -c competitions/sample_1v1.rrc -seasons 1 -t 1


Copying missing bots.... 1 JAR copies done!
Initializing engine: ./robocodes/r1... [./robocodes/r1] java.lang.ClassNotFoundException: net.sf.robocode.core.RobocodeMainBase
[./robocodes/r1]        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[./robocodes/r1]        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
[./robocodes/r1]        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
[./robocodes/r1]        at net.sf.robocode.security.HiddenAccess.init(HiddenAccess.java:86)
[./robocodes/r1]        at net.sf.robocode.security.HiddenAccess.initContainerForRobotEngine(HiddenAccess.java:250)
[./robocodes/r1]        at robocode.control.RobocodeEngine.init(RobocodeEngine.java:138)
[./robocodes/r1]        at robocode.control.RobocodeEngine.<init>(RobocodeEngine.java:72)
[./robocodes/r1]        at robowiki.runner.BattleProcess.<init>(BattleProcess.java:74)
[./robocodes/r1]        at robowiki.runner.BattleProcess.main(BattleProcess.java:47)
[./robocodes/r1]
[./robocodes/r1] java.lang.ClassNotFoundException: net.sf.robocode.core.RobocodeMainBase
[./robocodes/r1]        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
[./robocodes/r1]        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
[./robocodes/r1]        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
[./robocodes/r1]        at net.sf.robocode.security.HiddenAccess.init(HiddenAccess.java:86)
[./robocodes/r1]        at net.sf.robocode.security.HiddenAccess.initContainerForRobotEngine(HiddenAccess.java:250)
[./robocodes/r1]        at robocode.control.RobocodeEngine.init(RobocodeEngine.java:138)
[./robocodes/r1]        at robocode.control.RobocodeEngine.<init>(RobocodeEngine.java:72)
[./robocodes/r1]        at robowiki.runner.BattleProcess.<init>(BattleProcess.java:74)
[./robocodes/r1]        at robowiki.runner.BattleProcess.main(BattleProcess.java:47)
[./robocodes/r1]
[./robocodes/r1] Can't find robocode.core-1.x.jar module near to robocode.jar
[./robocodes/r1] Can't find robocode.core-1.x.jar module near to robocode.jar
[./robocodes/r1] Class path: lib/guava-30.0-jre.jar:lib/roborunner-2.0-SNAPSHOT.jar:robocodes/r1/libs/robocode.jar
[./robocodes/r1] Class path: lib/guava-30.0-jre.jar:lib/roborunner-2.0-SNAPSHOT.jar:robocodes/r1/libs/robocode.jar
[./robocodes/r1] ends.
failed!
Exception in thread "main" java.io.IOException: BattleProcess exited before sending READY_SIGNAL.
        at robowiki.runner.BattleRunner.initEngine(BattleRunner.java:81)
        at robowiki.runner.BattleRunner.<init>(BattleRunner.java:44)
        at robowiki.runner.RoboRunner.<init>(RoboRunner.java:172)
        at robowiki.runner.RoboRunner.main(RoboRunner.java:84)

I am not sure why it is looking for robocode.core-1.x.jar, the ./robocode/r1/libs/ has robocode.core-1.9.4.2.jar

@bumfo
Copy link
Author

bumfo commented Jan 22, 2023

Hi @bumfo This patch set fails to run with the following output

./rrt.sh -bot zyx.nano.RedBull 1.0 -c competitions/sample_1v1.rrc -seasons 1 -t 1

I am not sure why it is looking for robocode.core-1.x.jar, the ./robocode/r1/libs/ has robocode.core-1.9.4.2.jar

It has nothing to do with roborunner itself. I remembered a bug of robocode not being able to locate robocode.core-xxx.jar. Could you try newer versions e.g. 1.9.4.3?

Also note that if your path to robocode contains the word "build", it will fail.

A workaround may be copying roborunner/robocodes/r1/libs to roborunner/libs, which helps robocode finding the correct jars in some cases.

Btw, what is rrt.sh?

@bumfo
Copy link
Author

bumfo commented Jan 22, 2023

@evgmik I published a special version of robocode that prints more info when robocode-core jars aren't found. Please try this if the above doesn't work for you.

https://github.com/bumfo/robocode/releases/download/dev-1949-snapshot-1/robocode-1.9.4.9-setup.jar

@evgmik
Copy link

evgmik commented Jan 22, 2023

I am not sure why it is looking for robocode.core-1.x.jar, the ./robocode/r1/libs/ has robocode.core-1.9.4.2.jar

It has nothing to do with roborunner itself. I remembered a bug of robocode not being able to locate robocode.core-xxx.jar. Could you try newer versions e.g. 1.9.4.3?

You are correct! Everything goes smoothly, with robocode v1.9.4.8

Btw, what is rrt.sh?
It was modification of rr.sh to call particular version of java.

By the way, the gradle recipe does not work with old version of gradle (v4.4.1), I had to remove makeDistZip task, since gradle complains about missing named which is called in from tasks.named('makeDist'). I am not sure that there is a general solution except upgrading to a newer gradle from the current Debian stable.

@bumfo
Copy link
Author

bumfo commented Jan 23, 2023

@evgmik You can use gradle wrappers for separating project gradle versions with system gradle.

gradle wrapper --gradle-version 7.6

Then use ./gradlew instead of gradle for the newer version.

@bumfo bumfo changed the title Adapt RoboRunner to the modern age Adapt RoboRunner to 2023 Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants