Skip to content

mzouhon/robocode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReadMe for Robocode

(5/28) I watched the video on beginning the Robocode and was finally able to get the play button to work to execute the code and be able to play the game. I spent the majority of my time playing with different robots and then looking through their specific fields to se ehow they did things like track other robots, and dodge bullets. I then created my own robot file and watched the rest of the video on diffeernt methods you could code for your robot.

(5/30) The first thing I did was figure out how to make the entire robot pink. I then created my while true loop. The various forwards movements and truns serve to create an unpredicatble movement pattern that is difficul to track and allow for the robot to scan different directions for other robots. The firing logic is handled in the onScannedRobot method, which is triggered whenever your robot scans another robot. The firing power is determined based on the distance to the scanned robot which enures that the robot's energy is used efficiently and that more damage is dealt to robots that are closer and can be more accurately shot at. The robot's win percentage against some of the test robots was around 45 percent which led to start thinking of a slightly diffeernt approach to execute my startegy of "randomness".

(5/30) I adjusted the moves in my while true loop to make the robot's movement more unpredicatble. Before, while to moves and turns had been unpredicatble, they were still part of a loop and would repeat after several lines. By using instances of the Random class and using bounds, I was able to ensure that every loop through the moves was different from the one before, ensuring that robots tracking patterns would have difficulty guessing my robot's movements. I also tweeked my onScannedRobot method to minimize energy loss and ensure that my robot rarely became disabled from firing too many times ta target that were far away. I then wrote my onHitByBullet method similar to two other robot that kept beating mine to ensure that my robot was turning away from robots thta were shooting at it. I also wrote the onHitWall method to ensure that my robot was changing it's direction whenever it hit a wall. My robot now has a 90 percent win rate with simple robots such as Crazy and wins more of the time with more complex robots such as Fire.

About

The popular Robocode programs with some additional config files for use in VSCode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 68.1%
  • HTML 25.3%
  • Shell 6.6%