Robocode Download

Setup

  1. [Optional] Build Robocode 1.8.3.0 from sources:

    • Extract robocode-1.8.3.0-src.zip
    • Open the resulting directory (robocode-1.8.3.0)
    • Run ./mvn.sh clean install -Dmaven.javadoc.skip=true -DskipTests.Note that you will need Internet connectivity, as the installer downloads dependencies from various websites.If everything went well, you should see a message indicating that the build was successful.
    • Open the directory robocode-1.8.3.0/robocode.distribution/target
    • You should see a file named robocode-1.8.3.0-setup.jar which can then be used for the installation of Robocode 1.8.3.0, instead of the provided file in the next step.
  2. Install Robocode 1.8.3.0:

    • Run java -jar ./setup/robocode-1.8.3.0-setup.jar and follow the installation steps.
    • Ensure you keep a note of where Robocode was installed.
  3. Run from IDE:

    • Eclipse: follow the steps described on this page

    • IntelliJ:

      • Go to Run > Edit Configurations... > Click + (Add New Configuration) > Select Application

      • Configure with the below parameters:

        • Name: Robocode
        • Main class: robocode.Robocode
        • VM options: -Xmx512M -Dsun.io.useCanonCaches=false -Ddebug=true
        • Working directory: /path/to/robocode (from previous step)
        • Use classpath of module: robocode
    • In Robocode, go to Preferences > Development Options

      • Add > /path/to/project/robocode/target/classes
      • Add > /path/to/robocode/robots

Resources

RoboCode Academy provides STEM education courses to kids aged 4 to 18 years old, including well-designed coding and robotics programs. We offer regular courses on a weekly basis, holiday camps and various STEM workshops. Sep 10, 2018  Download Robocode for free. Robocode is a programming tank game for Java and.NET. Robocode is a programming game, where the goal is to develop a robot battle tank to battle against other tanks in Java or.NET. The robot battles are running in real-time and on-screen.

Download
  • http://www.ibm.com/developerworks/library/j-robotips/index.html

Robocode Robot Code

Modules‎ > ‎

Robocode

Contents

  1. 2 Resources
  2. 3 Experiential learning
    1. 3.1 Assignment A10: Robocode Code Katas
    2. 3.2 Assignment A14: A competitive robot

Learning objectives

  • To continue to develop your skill with programming in the Java language.
  • To continue to develop facility with the Eclipse interactive development environment.
  • To become acquainted with a form of component oriented development.
  • To have fun working with an interesting and engaging game engine.

Resources

Readings

  • http://robocode.sourceforge.net/. The home page for Robocode. Provides direct access to downloads, wiki, etc.
  • http://en.wikipedia.org/wiki/Robocode. Wikipedia entry for Robocode. Nice summary of the system, with pointers to open source bots, explanations of scoring and useful links.
  • http://www.ibm.com/developerworks/java/library/j-robocode/. Excellent introductory article on getting started with Robocode, though somewhat dated.
  • http://robowiki.net/wiki/Main_Page. The Robocode wiki. Primary source of detailed information. To get started, you will want to read Robocode Basics, the FAQ, Radar, Movement, Targeting, Using Eclipse, and any other Tutorials that look interesting to you.
  • http://www.clarku.edu/~djoyce/trig/. Robocode programs generally involve trigonometry. Don't remember trigonometry? Go through this tutorial to remind yourself.
  • http://robowiki.net/w/index.php?title=Robocode/Articles. A collection of articles on Robocode. The 'secrets of the robocode masters' series provides strategy insights.
  • http://sourceforge.net/forum/forum.php?forum_id=116459/. Forum regarding robocode. Hopefully you won't need to look here.

Screencast


Slides

Note that these slides do not cover all the material presented in the screencast.

Experiential learning

Assignment A10: Robocode Code Katas

Task

For this assignment, you will develop a set of simple robots that enable you to become familiar with the fundamental skills of Robocode: movement, targeting, and firing. Your development of these robots constitutes a form of 'code kata' for Robocode.
Here are the steps:
1. Watch the screencast and look through all of the readings.
Some of it is repetitive, and you won't understand all of it at first, but if you skim over all of it at first you'll know where to look later. This might easily take you a couple of hours.
The screencast will also hopefully be worth your time.
2. Download and install Robocode.
To test your installation, bring up the robocode system from the command line and run a match.
3. Set up a Robocode-<ID> project in Eclipse.
Define a new Eclipse project called 'Robocode-<ID>', where <ID> is the three letter ID associated with your name in the Directory page.
4. Build simple robots to learn how to control robot movement, targeting, and firing.
Your goal is not to create a competitive robot. Instead, you will create a variety of simple robots that will enable you to learn the fundamental skills: movement, targeting, firing, etc.
When developing these robots, please observe the Robocode Developer Guidelines, with the following exceptions: (1) your simple robot does not have to contain original code (though you should still indicate where you found it); (2) You don't have to make a blog entry for each simple robot.
Note that if you reuse code from a sample robot, you must make sure that you replace any 'old' constructs with 'modern' Java constructs, as discussed in the Intermediate Java lecture.
You will find that evaluating your simple robots works better if you have at least two robots in a battle. Choose an appropriate predefined sample robot. For example, 'SittingDuck' is a good robot to use with your simple movement robots, since it doesn't do anything. For simple robots that 'pick one enemy', you should create a battle matching your simple robot with at least two other predefined Robocode sample robots.
The following list contains the simple robot specifications. Make sure they are developed in your package (three letter ID). Each robot should implement only the specified behavior and nothing else!
  1. Position01: The minimal robot. Does absolutely nothing at all.
  2. Position02: Move forward a total of 100 pixels per turn. When you hit a wall, reverse direction.
  3. Position03: Each turn, move forward a total of N pixels per turn, then turn right. N is initialized to 15, and increases by 15 per turn.
  4. Position04: Move to the center of the playing field, spin around in a circle, and stop.
  5. Position05: Move to the upper right corner. Then move to the lower left corner. Then move to the upper left corner. Then move to the lower right corner.
  6. Position06: Move to the center, then move in a circle with a radius of approximately 100 pixels, ending up where you started.
  7. Follow01: Pick one enemy and follow them.
  8. Follow02: Pick one enemy and follow them, but stop if your robot gets within 50 pixels of them.
  9. Follow03: Each turn, Find the closest enemy, and move in the opposite direction by 100 pixels, then stop.
  10. Boom01: Sit still. Rotate gun. When it is pointing at an enemy, fire.
  11. Boom02: Sit still. Pick one enemy. Only fire your gun when it is pointing at the chosen enemy.
  12. Boom03: Sit still. Rotate gun. When it is pointing at an enemy, use bullet power proportional to the distance of the enemy from you. The farther away the enemy, the less power your bullet should use (since far targets increase the odds that the bullet will miss).
  13. Boom04: Sit still. Pick one enemy and attempt to track it with your gun. In other words, try to have your gun always pointing at that enemy. Don't fire (you don't want to kill it).
You can and should work with a classmate on this exercise, as it will be more fun and you'll get done sooner. You must type in all code yourself, but you can look at code done by your classmate and type it in as long as you understand how it works. Don't email code to a classmate. If they want to use your code, they have to physically look at your screen and copy it over. That way you have a chance to talk about it and share experiences.

Submission instructions

By 8:00am of the due date specified on the Schedule page, you must create a blog entry detailing your experiences with this assignment. Make sure you 'write it for the world, not the instructor'. Do not assume that the reader knows about Robocode or this assignment in advance. You should summarize what you learned from this assignment, what difficulties you encountered, and how you overcame them. What did you learn about Robocode robot behaviors? What ideas do you have for building a competitive robot? What do you think about code katas as a general learning device for software engineering?
Your blog entry should indicate whether or not you finished all assigned simple robots. If you did not finish all of them, you must indicate which ones you did not finish in your blog. If one of your simple robots implements only part of the assigned behavior, indicate that as well.
You must also package your code for evaluation. To do this, create a .zip file containing your entire Eclipse Robocode project, which should contain your 13 simple robot implementations. Use Eclipse to generate this .zip file using File | Export | General | Archive File. This ensures that all of the relevant files, and only the relevant files, are included in the .zip file. Name this file robocode-<ID>.zip. Email that file to kendyll.doi@gmail.com.
Finally, send me an email with a link to your blog entry when it is ready for me to read. If you do not send me this email, I will not know that you turned it in on time and you will not receive credit, so don't forget this step. Make sure to provide the complete URL to your blog entry (i.e. start it with 'http:') in your email.

Assignment A14: A competitive robot

Task

Design and implement a single robot that can reliably beat as many of the following eight sample robots as possible: Walls, RamFire, SpinBot, Crazy, Fire, Corners, Tracker, SittingDuck.
Do not simply download an advanced robot from the Internet and submit it. Your entry should reflect your current state of understanding of Robocode. If I have any questions about your implementation, I reserve the right to interview you about your code before giving you credit. It is possible to receive full credit for this assignment even if your robot cannot beat all of the sample robots.
I encourage you to get together with classmate(s) to work on this assignment and share ideas. However, all code must be physically typed in by you. If you are adapting code from another classmate or sample robot, please attribute it.
Your code should obey all design and coding standards for this class:
  • Elements of Java Style
Note that I have changed the robocode standards to allow the use of Advanced Robot under certain circumstances.

Submission instructions


By 8:00 am on the date specified on the schedule page, send me a link to your blog entry summarizing this assignment. Your blog entry should include the following 4 types of material:
1. Overview. A general introduction to what you were attempting in this project.
2. Design: Summarize the design of your robot by writing one paragraph on each of the following:
  1. Movement: What is your strategy for moving the robot?
  2. Targeting: How are you targeting other robots?
  3. Firing: Under what circumstances do you fire at another robot?
3. Results: Indicate which of the sample robots (Walls, RamFire, SpinBot, Crazy, Fire, Corners, Tracker, SittingDuck) it can reliably beat, and which of them it cannot. You might run 5 battles against each and see what percentage of the battles your robot won. After summarizing the results, try to explain why your design worked (or didn't work) against the sample robots, and what you would improve in your design in order to do better.
4. Testing. Discuss your testing approach, as implemented in A18.
5. Lessons learned: Finally, provide your 'lessons learned' from this development experience. What have you learned about software engineering from this project? From a software development perspective, what would you do differently next time?
Code submission:
Use 'ant -f dist.build.xml' to create a distribution of your robot system, and then send the resulting .zip file (in build/dist) to both philipmjohnson@gmail.com and kendyll.doi@gmail.com. Your distribution file will contain a jar file for your robot in the top-level directory. Make sure that this jar file can be loaded into robocode. To test, bring up robocode manually from the command line, then use Robot | Import downloaded robot to add it to the system. Try running it in a battle to make sure everything is OK. If you find problems, check your jar.build.xml file where the packaging code is found.
If I do not have your robot distribution by 8am on Tuesday morning, your robot may not be able to compete in the tournament.
Evaluation:
Your grade will be based upon a combination of the following:
  • Sophistication of the robot. Your robot should be more complicated than SittingDuck, for example. It does not have to beat every sample robot (although many students achieve that).
  • Adherence to coding standards. Your ability to write readable code that conforms to our standards is a major goal of this assignment.
  • Adherence to Java design practices. I will be looking to see if your robot design uses Java constructs in the appropriate way.
  • Appropriateness of testing. You should implement both behavioral and acceptance tests, and potentially unit tests.
  • Quality of blog entry. Your ability to write in a clear, concise, and grammatically correct way about this assignment will be a major component of your grade. Remember: write for the world!