Menu

robot does not show in battle list

Clarence
2012-06-26
2020-10-16
  • Clarence

    Clarence - 2012-06-26

    Hi I am new to robocode. I installed java and robocode with no problem. But
    when I create a new robot, the robot would not even show on the list when
    creating a battle. The java file compiled correctly, I even copied the sample
    robot file to another and saved it in a different folder but it won't still
    show on the list. Tried pressing F5 and Ctrl+r to refresh but still the robot
    does not appear. Please help me. Thanks in advance

     
  • Flemming N. Larsen

    This sound serious, and I haven't heard or seen this problem with Robocode.

    Does the sample robots appear in your list?

    Which operating system are you using and which version number of Java? (Oracle
    or OpenJDK?)

    What package name do you use for your robot? If you haven't specified one,
    your robot should appear under "(no package)" in the list of robots.

    I should like you to attach the robot here so I could check it out. E.g. at
    copied sample robot that will not appear.

     
  • Flemming N. Larsen

    Alternatively, you can send your robot to fnl(at)users.sourceforge.com

     
  • Clarence

    Clarence - 2012-06-27

    I am using Fedora 12 Constantine. I typed the java -version command on the
    terminal and this is what appears:

    java version "1.6.0_0"

    OpenJDK Runtime Environment (IcedTea6 1.6) (fedora-31.b16.fc12-i386)

    OpenJDK Server VM (build 14.0-b16, mixed mode)

    The package that I used is cge and I think thats why the cge folder has
    appeared in the robots folder, the same folder where the sample folder has
    appeared.

    What I did was, in the Robot Editor, I went to new and chose robot and I
    entered Jipjip in the first prompt and cge on the second promt. I did not edit
    the code the source code of Jipjip.java and simply saved it in cge. I then
    compiled the source code. But when I start a battle the package cge does not
    appear nor will the robot appear in the (No Package).

    The Jipjip.java file compiled succesfully but I got a warning though. These
    are what appears when I compiled the java source code:

    Compiling...

    warning: bootstrap class path not set in conjunction with -source 1.5

    1 warning

    Compiled successfully.

    ---- Codesize ----
    Codesize: 116 bytes

    Robot weight class: NanoBot (codesize < 250 bytes)

    Hope this helps.

    Thanks in advance.

     
  • Flemming N. Larsen

    The warning appears as the compiler option -source 1.5 is set, which
    requires a _-bootclasspath _ to be added to the compiler options, which points
    to a real Java 5.0 (1.5.0) rt.jar file. Read more about it here, if you want
    to know the details:

    https://blogs.oracle.com/darcy/entry/bootclasspath_older_source

    However, I recommend that you just remove the -source 1.5 from your compiler
    options in Robocode:

    Select Robot > Editor from the menu of the Robocode window, and then
    Compiler > Options > Preferences in the Robocode Editor window that appears.

    Now, change the Compiler Options from:

    -deprecation -g -source 1.5 -encoding UTF-8
    

    ...into...

    -deprecation -g -encoding UTF-8
    

    Then try to recompile your robot again and check that the robot appear in the
    battle list when starting a new battle.

    Your robot will not appear, if Robocode cannot find a compiled .class file for
    the robot. The .class file will not be generated, if the compiler does not
    generate it, of course. ;-)

     
  • Dennis Chase

    Dennis Chase - 2019-04-10

    Thanks Flemming,
    changing the Compiler Option to

    -deprecation -g -encoding UTF-8

    fixed my issue that I couldn't make robots.

    edit- created an account just to say thanks, I was really getting upset trying to do some homework.

     

    Last edit: Dennis Chase 2019-04-10
    • Flemming N. Larsen

      Thank you Dennis for taking time to write back about this issue. I really appreciate that. Recently, other people have run into the same problem. But I haven´t got a clue before your reply. :-)
      The current version of Robocode (1.9.3.5) uses this Compiler Option:

      -version

      Was this your original option before chaning it to "-deprecation -g -encoding UTF-8"?

      I am wondering if it is the "-g" og "-encoding UTF-8" that makes the difference. -deprecation is just for notification about using deprecated Java methods.

       
  • Felipe RS

    Felipe RS - 2020-10-16

    Greetings, I have the same problem of creating a Robocode and it does not appear as an option at the time of creating a battle, I tried the solution above but it did not solve it. Would you help me?

    The code is the standard generated by the Robocode tool itself in the current version, which is 1.9.3.9

    Java 1.8.0_162 (64 bits) da Oracle Corporation
    (JDK)

    Windows 10

    My robocode name's "Tony"

    both the Tony.java file and the Tony.class file were generated

    I don't know what to do anymore, help me, please

     

    Last edit: Felipe RS 2020-10-16
  • Flemming N. Larsen

    Hi Felipe,
    That is strange. I am running Windows 10 and the same Java version, and I can run your robot just fine?!

    You could try to both reset the Compiler (Robot -> Source Editor | Compiler -> Options -> Reset Compiler.

    My options (after a reset) is this:

    Compiler Binary:
    javac

    Compiler Options:
    -verbose -encoding UTF-8

    Compiler Classpath:
    -classpath libs\robocode.jar;C:\robocode\robots

    You could also try to Reset Compiler and choose the built-in ECJ compiler, and see if this makes a difference.

    And thirdly, you could try Options -> Clean robot cache, which recreates the robot database.

    Also try to see in the Help -> About and check which Java Runtime version you are using. Currently, I am running on Running on:
    Java 14.0.1 (64-bit) by Oracle Corporation

    I guess the newest version 15 should also work.

     

Log in to post a comment.