Robo Code

29
Robocode Chapter 1 Introduction Robocode is an Open Source educational game started by Mathew Nelson (originally provided by IBM). Currently contributions are being made by various people; officially Flemming N. Larsen and Pavel Šavara are working on Robocode to keep it current and fix the bugs. The game is designed to help people learn to program in Java or, starting in version 1.7.2, .NET Framework programming languages (C#, VB.NET, etc.), and enjoy the experience. It is very easy to start - a simple robot can be written in just a few minutes - but perfecting a bot can take months or more. Competitors write software that controls a miniature tank that fights other identically-built (but differently programmed) tanks in a playing field. Robots can move, shoot at each other, scan for each other, and hit the walls (or other robots) if they aren't careful. Though the idea of this "game" may seem simple, the actual strategy needed to win is not. Good robots can have thousands of lines in their code dedicated to strategy. Some of the more successful robots use techniques such as statistical analysis or attempts at neural networks in their designs. Division of Computer Engineering, SOE Page 1

Transcript of Robo Code

Page 1: Robo Code

Robocode

Chapter 1

Introduction

Robocode is an Open Source educational game started by Mathew Nelson (originally provided by IBM). Currently contributions are being made by various people; officially Flemming N. Larsen and Pavel Šavara are working on Robocode to keep it current and fix the bugs. The game is designed to help people learn to program in Java or, starting in version 1.7.2, .NET Framework programming languages (C#, VB.NET, etc.), and enjoy the experience. It is very easy to start - a simple robot can be written in just a few minutes - but perfecting a bot can take months or more.

Competitors write software that controls a miniature tank that fights other identically-built (but differently programmed) tanks in a playing field. Robots can move, shoot at each other, scan for each other, and hit the walls (or other robots) if they aren't careful. Though the idea of this "game" may seem simple, the actual strategy needed to win is not. Good robots can have thousands of lines in their code dedicated to strategy. Some of the more successful robots use techniques such as statistical analysis or attempts at neural networks in their designs.

Division of Computer Engineering, SOE Page 1

Page 2: Robo Code

Robocode

Chapter 2

Basic Principles used in Robocode

There are three basic principles used in the game of Robocode. These are Artificial intelligence, Finite state machines and computer graphics for standard display.

2.1 Artificial Intelligence

Artificial intelligence (AI) is the intelligence of machines and the branch of computer science that aims to create it. AI textbooks define the field as "the study and design of intelligent agents" where an intelligent agent is a system that perceives its environment and takes actions that maximize its chances of success. John McCarthy, who coined the term in 1956, [ defines it as "the science and engineering of making intelligent machines."

The field was founded on the claim that a central property of humans, intelligence—the sapience of Homo sapiens—can be so precisely described that it can be simulated by a machine. This raises philosophical issues about the nature of the mind and limits of scientific hubris, issues which have been addressed by myth, fiction and philosophy since antiquity. Artificial intelligence has been the subject of optimism, but has also suffered setbacks and, today, has become an essential part of the technology industry, providing the heavy lifting for many of the most difficult problems in computer science.

AI research is highly technical and specialized, deeply divided into subfields that often fail to communicate with each other. Subfields have grown up around particular institutions, the work of individual researchers, the solution of specific problems, longstanding differences of opinion about how AI should be done and the application of widely differing tools. The central problems of AI include such traits as reasoning, knowledge, planning, learning, communication, perception and the ability to move and manipulate objects. General intelligence (or "strong AI") is still among the field's long term goals.

Cognitive science is the interdisciplinary study of mind and how information, e.g., concerning perception, language, reasoning, and emotion, is represented and transformed in the brain. It consists of multiple research disciplines, including psychology, artificial intelligence, philosophy, neuroscience, learning sciences, linguistics, anthropology, sociology, and education. It spans many levels of analysis, from low-level learning and decision mechanisms to high-level logic and planning; from neural circuitry to modular brain organization. The term cognitive science was coined by Christopher Longuet-Higgins in his 1973 commentary on the Lighthill report, which concerned the then-current state of Artificial Intelligence research. In the same decade, the journal Cognitive Science and the Cognitive Science Society were founded.

Division of Computer Engineering, SOE Page 2

Page 3: Robo Code

Robocode

2.2 Computer graphics

Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer.

The development of computer graphics, has made computers easier to interact with, and better for understanding and interpreting many types of data. Developments in computer graphics have had a profound impact on many types of media and have revolutionized animation, movies and the video game industry.

For the purpose of Robocode we are essentially dealing with 2-D graphics .

2D graphics are the computer-based generation of digital images—mostly from two-dimensional models, such as 2D geometric models, text, and digital images, and by techniques specific to them. The word may stand for the branch of computer science that comprises such techniques, or for the models themselves.2D computer graphics are mainly used in applications that were originally developed upon traditional printing and drawing technologies, such as typography, cartography, technical drawing, advertising, etc.. In those applications, the two-dimensional image is not just a representation of a real-world object, but an independent artifact with added semantic value; two-dimensional models are therefore preferred, because they give more direct control of the image than 3D computer graphics, whose approach is more akin to \photography than to typography.

The advance in computer graphics was to come from one MIT student, Ivan Sutherland. In 1961 Sutherland created another computer drawing program called Sketchpad. Using a light pen, Sketchpad allowed one to draw simple shapes on the computer screen, save them and even recall them later. The light pen itself had a small photoelectric cell in its tip. This cell emitted an electronic pulse whenever it was placed in front of a computer screen and the screen's electron gun fired directly at it. By simply timing the electronic pulse with the current location of the electron gun, it was easy to pinpoint exactly where the pen was on the screen at any given moment. Once that was determined, the computer could then draw a cursor at that location.

Sutherland seemed to find the perfect solution for many of the graphics problems he faced. Even today, many standards of computer graphics interfaces got their start with this early Sketchpad program. One example of this is in drawing constraints. If one wants to draw a square for example, s/he doesn't have to worry about drawing four lines perfectly to form the edges of the box. One can simply specify that s/he wants to draw a box, and then specify the location and size of the box. The software will then construct a perfect box, with the right dimensions and at the right location. Another example is that Sutherland's software modeled objects - not just a picture of objects. In other words, with a model of a car, one could change the size of the tires without affecting the rest of the car. It could stretch the body of the car without deforming the tires.

Division of Computer Engineering, SOE Page 3

Page 4: Robo Code

Robocode

These early computer graphics were Vector graphics, composed of thin lines whereas modern day graphics are Raster based using pixels. The difference between vector graphics and raster graphics can be illustrated with a shipwrecked sailor. He creates an SOS sign in the sand by arranging rocks in the shape of the letters "SOS." He also has some brightly colored rope, with which he makes a second "SOS" sign by arranging the rope in the shapes of the letters. The rock SOS sign is similar to raster graphics. Every pixel has to be individually accounted for. The rope SOS sign is equivalent to vector graphics. The computer simply sets the starting point and ending point for the line and perhaps bend it a little between the two end points. The disadvantages to vector files are that they cannot represent continuous tone images and they are limited in the number of colors available. Raster formats on the other hand work well for continuous tone images and can reproduce as many colors as needed.

Division of Computer Engineering, SOE Page 4

Page 5: Robo Code

Robocode

2.3 Finite state machines

Artificial intelligence is modelled as a sequence of mental states. World events force a change in state. Let us see what finite state machines basically are.

A finite-state machine (FSM) or finite-state automaton (plural: automata), or simply a state machine, is a mathematical abstraction sometimes used to design digital logic or computer programs. It is a behavior model composed of a finite number of states, transitions between those states, and actions, similar to a flow graph in which one can inspect the way logic runs when certain conditions are met. It has finite internal memory, an input feature that reads symbols in a sequence, one at a time without going backward; and an output feature, which may be in the form of a user interface, once the model is implemented. The operation of an FSM begins from one of the states (called a start state), goes through transitions depending on input to different states and can end in any of those available, however only a certain set of states mark a successful flow of operation (called accept states).

Finite-state machines can solve a large number of problems, among which electronic design automation, communication protocol design, parsing and other engineering applications. In biology and artificial intelligence research, state machines or hierarchies of state machines are sometimes used to describe neurological systems and in linguistics — to describe the grammars of natural languages.

Acceptors and recognizers (also sequence detectors) produce a binary output, saying either yes or no to answer whether the input is accepted by the machine or not. All states of the FSM are said to be either accepting or not accepting. At the time when all input is processed, if the current state is an accepting state, the input is accepted; otherwise it is rejected. As a rule the input are symbols (characters); actions are not used. The example in figure 2 shows a finite state machine which accepts the word "nice". In this FSM the only accepting state is number 7.

The machine can also be described as defining a language, which would contain every word accepted by the machine but none of the rejected ones; we say then that the language is accepted by the machine. By definition, the languages accepted by FSMs are the regular languages—that is, a language is regular if there is some FSM that accepts it.

A further distinction is between deterministic (DFA) and non-deterministic (NDFA, GNFA) automata. In deterministic automata, every state has exactly one transition for each possible input. In non-deterministic automata, an input can lead to one, more than one or no transition for a given state. This distinction is relevant in practice, but not in theory, as there exists an algorithm which can transform any NDFA into a more complex DFA with identical functionality.

The FSM with only one state is called a combinatorial FSM and uses only input actions. This concept is useful in cases where a number of FSM are required to work together, and where it is convenient to consider a purely combinatorial part as a form of FSM to suit the design tools.

There are four kind of finite state machines. They are :

Division of Computer Engineering, SOE Page 5

Page 6: Robo Code

Robocode

Stack based FSM

Hierarchical FSM

Non deterministic hierarchical FSM

Fuzzy state FSM

There are two methods of debugging FSM. They are online and offline debugging. Offline debugging mainly consists of logging and checking verbosity levels.

Verbosity is the product of making a text verbose, a process which is the exact opposite of being concise. A verbose text is one that has a larger than necessary amount of words, usually the inflation being due to a higher number of adjectives. Verbose texts tend to be more descriptive, but at the cost of blurring the information, to the point where excessively verbose texts have only description, and are often unreadable.

Individual words which are excessive, and unnecessary, are referred to as pleonasms, whereas incidents of excessive verbosity are referred to as logorrhoea.

Verbosity is also a term used to describe a feature of screen-reading programs that support vision-impaired computer users. Speech verbosity controls enable users to choose how much speech feedback they wish to hear. Specifically, verbosity settings allow users to construct a mental model of web pages displayed on their computer screen. Based on verbosity settings, a screen-reading program informs users of certain formatting changes, such as when a frame or table begins and ends, where graphics have been inserted into the text, or when a list appears in the document.

Some screen reading programs also include language verbosity, which automatically detects verbosity settings related to speech output language. For example, if a user navigated to a website based in the United Kingdom, the text would be read with a British accent.

Online debugging mainly deals with on the run graphical representation altering. Command line alters the behaviour.

Division of Computer Engineering, SOE Page 6

Page 7: Robo Code

Robocode

Chapter 3

Initial version of Robocode

Robocode is an easy-to-use robotics battle simulator that runs across all platforms supporting Java 2. You create a robot, put it onto a battlefield, and let it battle to the bitter end against opponent robots created by other developers. Robocode comes with a set of pre-fab opponents to get you started, but once you outgrow them, you can enter your creation against the world's best in one of the leagues being formed worldwide.

Each Robocode participant creates his or her own robot using elements of the Java language, enabling a range of developers -- from rank beginners to advanced hackers -- to participate in the fun. Beginning Java developers can learn the basics: calling API code, reading Javadocs, inheritance, inner classes, event handling, and the like. Advanced developers can tune their programming skill in a global challenge to build the best-of-breed software robot. In this article, we will introduce Robocode and start you on your way to conquering the world by building your very first Robocode robot. We will also take a peek at the fascinating "behind the scenes" machinery that makes Robocode tick.

Robocode is the brainchild of Mathew Nelson, a software engineer in the Advanced Technology, Internet division at IBM. First, head to the Robocode page. Here, you will find the latest executables of the Robocode system. Once you have downloaded the distribution, which is in a self-contained installation file, you can use the following command to get the package installed on your system (assuming you have a Java VM (JDK 1.3.x) pre-installed on your machine, of course):

java -jar robocode-setup.jar

During installation, Robocode will ask you if you'd like to use this external Java VM for robot compilations. The other alternative is the Jikes compiler that is supplied as part of the Robocode distribution.

After your installation, you can start the Robocode system from either the shell script (robocode.sh), batch file (robocode.bat), or icon on the desktop. At this point, the battlefield will appear. From here, you can invoke the Robot Editor and compiler using the menu.

When you activate Robocode, you will see two interrelated GUI windows, which form Robocode's IDE:

The battlefield The Robot Editor

Figure 1 shows the battlefield and the Robot Editor in action.

Division of Computer Engineering, SOE Page 7

Page 8: Robo Code

Robocode

Fig 1 Robot editor

The battlefield is where the battle between the robots plays itself out. It houses the main simulation engine and allows you to create, save, and open new or existing battles. You can pause and resume the battle, terminate the battle, destroy any individual robot, or get the statistics of any robot using the controls available in the arena. Furthermore, you can activate the Robot Editor from this screen.

The Robot Editor is a customized text editor for editing the Java source files that make up a robot. It integrates both the Java compiler (for compiling robot code) and the customized Robot packager in its menu. Any robot created with the Robot Editor and successfully compiled is in a ready-to-deploy location for the battlefield.

A robot in Robocode consists of one or more Java classes. These classes can be archived into a JAR package. The latest version of Robocode provides a "Robot Packager" that can be activated from the battlefield GUI window, for just this purpose.

Division of Computer Engineering, SOE Page 8

Page 9: Robo Code

Robocode

Following are the basic commands used in Robocode.

Let's begin with the basic commands to move the robot and its accoutrements:

turnRight(double degree) and turnLeft(double degree) turn the robot by a specified degree.

ahead(double distance) and back(double distance) move the robot by the specified pixel distance; these two methods are completed if the robot hits a wall or another robot.

turnGunRight(double degree) and turnGunLeft(double degree) turn the gun, independent of the vehicle's direction.

turnRadarRight(double degree) and turnRadarLeft(double degree) turn the radar on top of the gun, independent of the gun's direction (and the vehicle's direction).

None of these commands will return control to the program until they are completed. Furthermore, when the vehicle is turned, the direction of the gun (and radar) will also move, unless indicate differently by calling the following methods:

setAdjustGunForRobotTurn(boolean flag): If the flag is set to true, the gun will remain in the same direction while the vehicle turns.

setAdjustRadarForRobotTurn(boolean flag): If the flag is set to true, the radar will remain in the same direction while the vehicle (and the gun) turns.

setAdjustRadarForGunTurn(boolean flag): If the flag is set to true, the radar will remain in the same direction while the gun turns. It will also act as if setAdjustRadarForRobotTurn(true) has been called.

Many methods exist for getting information about the robot. Here is a short list of frequently used method calls:

getX() and getY() get the current coordinate of the robot.

getHeading(), getGunHeading(), and getRadarHeading() get the current heading of the vehicle, gun, or radar in degrees.

getBattleFieldWidth() and getBattleFieldHeight() get the dimension of the battlefield for the current round.

Division of Computer Engineering, SOE Page 9

Page 10: Robo Code

Robocode

Once you have mastered how to move the robot and its associated weaponry, it's a good time to consider the tasks of firing and controlling damage. Each robot starts out with a default "energy level," and is considered destroyed when its energy level falls to zero. When firing, the robot can use up to three units of energy. The more energy supplied to the bullet, the more damage it will inflict on the target robot. fire(double power) and fireBullet(double power) are used to fire a bullet with the specified energy (fire power). The fireBullet() version of the call returns a reference to a robocode.Bullet object that can be used in advanced robots.

Whenever the robot moves or turns, the radar is always active, and if it detects any robots within its range, an event is triggered. As the robot creator, you can choose to handle various events that can occur during the battle. The basic Robot class has default handlers for all of these events. However, you can override any of these "do nothing" default handlers and implement your own custom actions. Here are some of the more frequently used events:

ScannedRobotEvent. Handle the ScannedRobotEvent by overriding the onScannedRobot() method; this method is called when the radar detects a robot.

HitByBulletEvent. Handle the HitByBulletEvent by overriding the onHitByBullet() method; this method is called when the robot is hit by a bullet.

HitRobotEvent. Handle the HitRobotEvent by overriding the onHitRobot() method; this method is called when your robot hits another robot.

HitWallEvent. Handle the HitWallEvent by overriding the onHitWall() method; this method is called when your robot hits a wall.

That's all we need to know to create some pretty complex robots. You can find the rest of the Robocode API in the Javadoc, which can be accessed from either the battlefield's help menu or the Robot Editor's help menu.

To create a new robot, start the Robot Editor and select File->New->Robot. You will be prompted for the name of the robot, which will become the Java class name. Enter DWStraight at this prompt. Next, you will be prompted for a unique initial, which will be used for the name of the package that the robot (and potentially its associated Java file) will reside in. Enter dw at this prompt.

The Robot Editor will display the Java code that you need to write to control the robot.

Area1 In this space we can declare class scope variables and set their value. They will be available within the robot's run() method, as well as any other helper methods that you may create.

Division of Computer Engineering, SOE Page 10

Page 11: Robo Code

Robocode

Area2 The run() method is called by the battle manager to start the robot's life. It typically consists of two areas (designated Area 2 and Area 3 in Listing 1) where you can add code. Area 2 is where you will place code that will run only once per robot instance. It is often used to get the robot into a pre-determined state before starting repetitive action.

Area3 This is the second part of a typical run() method implementation. Here, within an endless while loop, we'll program the repetitive action that a robot may be involved in.

Area4 This is the area where you add helper methods for the robot to use within its run() logic. It's also where you add any event handlers that you wish to override. For example, the code in Listing 1 handles the ScannedRobot event and simply fires directly at the robot whenever one is detected by the radar.

From the Robot Editor menu, select Compiler->Compile to compile your robot code. We are now ready to try our first battle. Switch back to the battlefield and select menu Battle->New to display a dialog similar to the one in Figure 2.

Add our robot, dw.DWStraight to the battle, then add an opponent robot, such as sample. SittingDuck. Click Finish, and the battle will begin. Admittedly, doing battle with SittingDuck is not too exciting, but you get to see what the DWStraight robot does by default. Experiment with other robots in the sample collection, and see how DWStraight fares against them.

When you're ready to examine the coding of another robot, check out the dw.DWRotater robot code that is supplied with the code distribution in Resources. This robot will, by default:

Move to the center of the battlefield Keep spinning its gun until it detects a robot Fire slightly ahead of the detected robot, trying different angles each time Move rapidly back and forth whenever it is hit by another robot.

Division of Computer Engineering, SOE Page 11

Page 12: Robo Code

Robocode

Fig 2. New battle dialogue.

A look behind the scenes at Robocode reveals a sophisticated simulation engine that is both high performance (in order to render the battle at realistic speed) and flexible (enabling the creation of complex robotics logic without getting in the way). A special thanks to Robocode creator Mathew Nelson for graciously providing the inside information on the architecture of the simulation engine.

A battle manager thread manages the robots, bullets, and rendering on the battlefield. The simulation "clock" is marked by the number of frames rendered on the battlefield. The actual frame rate is adjustable by the user.

Division of Computer Engineering, SOE Page 12

Page 13: Robo Code

Robocode

For a project that debuted as recently as July 12, 2001, Robocode's climb to fame is nothing short of phenomenal. While the latest version available has yet to hit 1.0 (at the time of writing it is version 0.98.2), it is already becoming a very popular pastime on university campuses and corporate computers throughout the world. Robocode leagues (or roboleagues), in which people pit their custom creations against each other over the Internet, are springing up fast. University professors are tapping Robocode's educational properties and have incorporated it into their computer science curriculum. Robocode user groups, discussion list, FAQs, tutorials, and Webrings can be found throughout the Internet.

Evidently, Robocode has filled a void in the popular gaming and educational arena -- supplying a simple, fun, non-intimidating, yet competitive way for students and midnight engineers to unleash their creative energy and potentially fulfill their fantasy to conquer the world.

Chapter 4

Division of Computer Engineering, SOE Page 13

Page 14: Robo Code

Robocode

Bot Design

A typical Robocode bot has three basic parts. Gun, radar and a tank body.

Fig 3. A typical bot

C++ is the best programming language in general for most bots. It is the most powerful and expansive. However, it also can get very complicated and to a new programmer. It talks a lot of detailed code to do what you want.

 If one has not programmed before, a language like Visual Basic 6 is good. It is MUCH simpler to learn. However, it is less powerful when it comes to handling lots of data and working on a low level with the game. (But it's fine for sending mouse clicks and keyboard presses.) It can even read application's memory fine.

 

Division of Computer Engineering, SOE Page 14

Page 15: Robo Code

Robocode

It is recommend against Java. It is not as tailored for accessing OS specific functions like mouse overrides, memory writing, etc.

One should start by learning one of the languages via a web tutorial (many very decent ones around) or a book.  Then, coding bots will just make intuitive sense to you. Learning how to bot and THEN program does not work well.

In Robocode however, the coding is usually done in Java. The bot has three basic entities. The gun, the radar and the body.

Constraints are drawn on the gun and radar movements as they have to be synchronized as one unit. Gun is used to fire the bullets. Radar is used for scanning purpose of other bots present in the vicinity. The coding is done in a manner that the tanks not only avoid hitting bullets but also the walls of the simulator.

Division of Computer Engineering, SOE Page 15

Page 16: Robo Code

Robocode

Chapter 5

Typical bots

1. Druss GT

It uses a unique method of storing the Visit Count Stats. I set up a bunch of different dimensions and slices, and randomly generated 100 buffers, which should cover all the attributes quite well.

It is very competitive. No. 1 in the main rumble.

It dodges bullets by keeping tabs on which angles (actually Guess Factors) the enemy is most likely to shoot at in different circumstances, and avoiding them

Between rounds it saves all the targeting and movement data, between matches nothing

Druss The Legend was an axe warrior, the hero in several books by David Gemmell. The 'GT' is because it uses GoTo style Wave Surfing.

The next few steps in its advancements can be speeding it up, and a refactor! Perhaps make a truesurfing variant?

2. Diamond

What's special about it?

   

It took the Melee throne from Shadow. It may have the strongest 1v1 gun against random movers. The Melee and Anti-Surfer guns use displacement vectors. It has pretty debugging graphics.

It is currently #2 in both Melee and 1v1.

It uses a Minimum Risk Movement, evaluating a bunch of points around itself and choosing the "safest" (least bad / most good) one. I'm still (endlessly, perhaps) tweaking the parameters, but some of the elements are:

Considers points in a (randomized radius) circle around itself. Stay far away from other bots, weighted by their energy. Stay perpendicular to other bots. Don't be the closest bot to any other bots (avoid being targeted). Some randomizing based on past locations.

Division of Computer Engineering, SOE Page 16

Page 17: Robo Code

Robocode

In 1v1, it uses Wave Surfing (algorithm derived from Dookious) with Dynamic Clustering for data analysis. The gun uses Dynamic Clustering for data analysis - i.e., k-nearest neighbors to find similar states, and kernel density among those states to settle on a firing angle. It uses displacement vectors for recording and reconstructing firing angles. It fires a wave for each scan and records the vector the enemy traveled along (interpolating missed scans, if necessary), relative to his initial heading and divided by bullet ticks. To reconstruct a firing angle, it applies one of these vectors to the enemy's current location, heading, and distance (bullet ticks). I thought this made more sense for Melee than GuessFactors, and it's a lot simpler and more efficient than real play-it-forward.

As of 1.30, it no longer does. It aims at everyone on the battle field at once and tries to hit as many enemies as possible. (Big thanks to Shadow/Melee Gun for the excellent idea.)

In 1v1, it switches to a Wave Surfing movement and switches to its 1v1 Virtual Guns.

It saves nothing between matches. Between rounds, it saves all its targeting and movement data, which includes general info about each enemy, a bunch of kd-trees, and maps of the trees' data points to displacement vectors and/or Guess Factors.

Diamond is the ex-superhero name of the main character in Powers, my favorite comic book series. That's how it initially occurred to me, as I like to name all my bots after warriors of some sort.

3. Shadow

What's special about it?

It is the first robot that uses this type of gun as describe below, and it is the first Wave Surfer ever.

Also, it is my first ever competitive bot redone with "modern" technologies.

Shadow is the first robot that features Wave Surfing.

This gun is firstly describe as Tron's Gun. I call it a "forward pattern matcher".

But later this gun is named Dynamic Clustering Play-It Forward gun.

It dodges bullets by surfing enemy's waves.

Division of Computer Engineering, SOE Page 17

Page 18: Robo Code

Robocode

It uses a Minimum Risk Movement

v3.84: with the HOT-avoidance system

It doesn't, instead it uses the strategy describe at Shadow/Melee Gun.

It doesn’t save any information between matches, although it saves all the information between rounds.

Division of Computer Engineering, SOE Page 18

Page 19: Robo Code

Robocode

Chapter 6

Educational Importance

Improving learning effectiveness has always been a constant challenge in software education andtraining. One of the primary tasks educators face is to motivate learners to perform to their best abilities. One method of motivating learners is the game-based exercise. In this research, we conducted a field study in a community of software participants in the IBM Robocode game. Thecharacteristics of the Robocode game and the Robocode community were examined. Our research could shed some light on how computer-programming games – such as the Robocode game - could be used in software programming education to increase learning effectiveness.

As a Java-based environment, Robocode provides a well-defined domain for students to learn and apply concepts of object-oriented design and programming, such as proper design of classes, extension and re-use of existing codes using inheritance mechanisms, event handling and message passing (Bonakdarian & White, 2004). Robocode has been implemented in the classroom to stimulate student learning-outcomes. One study found that when Robocode was utilized in the classroom, students really enjoyed the project and also produced some very creative solutions (Bierre, Ventura, Phelps & Egert, 2006). Research also found that Robocode enabled students to develop skills for each stage of the software development process and fostered critical thinking (O'Kelly & Gibson, 2006).

Moreover, the results of the student’s efforts in Robocode can be seen instantly. Such instant gratification can speed up the learning cycle and is analogous to the “prototyping model” used in software development (O'Kelly & Gibson, 2006). Robocode also forces students to consider issues of "computer intelligence", i.e., how do agents sense and react to their environment to maximize their goals? Thus, it is useful for courses related to artificial intelligence (Bonakdarian & White, 2004). By incorporating an enjoyable game into an artificial intelligence class and providing students with tools for developing practical versions of the algorithms, students appreciated the theory better and developed greater confidence in their understanding of it (Hartness, 2004).

Division of Computer Engineering, SOE Page 19

Page 20: Robo Code

Robocode

Chapter 7

Conclusion

The trends in Robocode are increasing the diversity and heterogeneity of gamers and their

constituent devices. The newer version is expected to bring an explosion in terms of use of newer

ideas in our local environments. This paper presents one of the few applications in which

artificial intelligence can be put into use. This paper also provides a discussion of the challenges

associated with such a vision, framed around our conceptual model of computing. With more

progress in the fields like FSM, Artificial Intelligence and graphics , the infrastructure limitation

present currently is supposed to be broken as far as its mechanical analogy implementation is

concerned.

Division of Computer Engineering, SOE Page 20

Page 21: Robo Code

Robocode

Chapter 8

References

1. robocode.sourceforge.net/

2. en.wikipedia.org/wiki/Robocode

3. Artificial intelligence : A Philosophical Introduction by Jack Copeland

4. Synthesis of finite state machines: functional optimization by Timothy Kam

Division of Computer Engineering, SOE Page 21