CSE 348 - AI Game Programming. Installation 

Slides:



Advertisements
Similar presentations
PHYS16 – Lecture 6 Physics of 2D Motion September 20, 2010 To run or walk???
Advertisements

Robocode Some Methods and Ideas. Robot anatomy 101 Just like the real thing … it has a gun that rotates a radar on top that also rotates tank, gun and.
Robocode. What is Robocode? Robocode is an easy-to-use robotics battle simulator. You create a robot, put it onto a battlefield, and let it battle to.
2-D Kinematics. Drop-Shoot predictions Clicker questions about the drop-shoot demonstration Do this AFTER talking about components, and why we split things.
Cutnell/Johnson Physics 8th edition Reading Quiz Questions
This Week Cover as much Robocode strategy as we can Monday: Robocode
Ramrod III Micro mouse. The Team  Andrew Igarashi – software  Kevin Li – hardware  Stephen Nakamura – hardware  Quang Ngu – software.
Using a GA to Create Prey Tactics Presented by Tony Morelli on 11/29/04.
SMDEP Physics Projectile Motion continued, Uniform circular motion, Centripetal acceleration.
Evolving Killer Robot Tanks Jacob Eisenstein. Why Must We Fight? Giving the people what they want Essence of embodiment: Moving around and surviving in.
1 An intro to programming concepts with Scratch Session 1 of 10 sessions Looks and Motion.
A-Mazers Team Members Isaiah Grigos Chris Hart Erick Rua Eddie Miner.
Debugged!.  You know that old line about an ounce of prevention?  It’s true for debugging.
Eclipse IDE. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as teaching.
03 Using Eclipse. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as.
SuperCorners. Problem The Corners sample robot has a simple strategy: first, move into a corner of the arena, and second sweep the gun back and forth.
MOTION.
How does Robocode work? In short it is a framework
Lesson 2: Compositions and Animations CMM204 – Digital Media Effects.
MOTION. Chapter Four: MotionMotion  4.1 Position, Speed and Velocity  4.2 Graphs of Motion  4.3 Acceleration.
Motion  1 Position, Speed and Velocity  2 Graphs of Motion  3 Acceleration.
Kinematics in 2D… Projectile Motion. Think About It… What happens when you are driving at a constant speed and throw a ball straight up in the air? How.
CSE 332: C++ debugging in Eclipse C++ Debugging in Eclipse We’ve now covered several key program features –Variable declarations, expressions and statements.
Angle Relationships What do angles tell us? How can angles help us?
CSE AI Game Programming. Installation 
A 25kg block slides down a 20 degree ramp. What is the normal force? A N B. 230 N C. 245 N D N.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Eclipse debugger.
Assignments. AnatomyBot.java Create a robot that turns all of it parts independently (vehicle, gun, and radar). Turn the vehicle left 360 o Turn the gun.
Earth Science Intro Unit
Chapter 6.1 Review. 1. What is needed to cause a change in momentum?
My Second Robot. Anatomy of a Robot A robot consists of 3 independently moving parts: Vehicle - determines the direction in which the robot will move.
CS324e - Elements of Graphics and Visualization Timing Framework.
Projectile Motion AIM: how do we solve projectile problems in 2 dimensions? DO NOW 1.What do you notice about the horizontal spacing of the dots? 2.What.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Slide 1 What we'll cover here l Using the debugger: Starting the debugger Setting.
Seminar for Participants An Introduction on Robocode.
Linear Momentum Problems MC Questions Linear Momentum 07 LH.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Kinematics.
 You will be able to explain the relationship between motion and a frame of reference  You will be able to relate speed to distance and time  You will.
TOOLS FOR DESIGN AND DEVELOPMENT ENVIRONMENTS. Case study - ECLIPSE Lecture notes 5.
(1) Introduction to Robocode Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Robocode. Robocode: basics Coords. are (x,y), with bottom left as (0,0) Heading: degrees, straight up = 0, pos. clockwise (0
MOTION. Chapter Four: Motion  4.1 Position, Speed and Velocity  4.2 Graphs of Motion  4.3 Acceleration.
EV3 Programming: Moving and Turning CONFIDENTIAL © 2014 Cymer, LLC.
CONTENTS  Scalars and Vectors.  Bearings & Compass headings.  Drawing Vectors.  Vector addition & subtraction.  Relative velocity.  Change in.
Basic Animation What you need to try is in the yellow boxes! Save this presentation in your BTA30A.
CSE 332: Scientific debugging in C++ Scientific Debugging in C++ (with Eclipse & gdb) By now we’ve covered several key C++ features –Variable declarations.
ATS Application Programming: Java Programming
Applications and models
MOTION.
Winning Strategy in Programming Game Robocode
It depends on the direction of the crosswind
What type of angle is it?.
Distance-Time Graph Notes
Robotics Getting Started with
Important terms Black-box testing White-box testing Regression testing
Speed & Velocity.
Important terms Black-box testing White-box testing Regression testing
Debugging with Eclipse
Physical Science Agenda: 03/17/15: Velocity and Acceleration
MTAT , 2CP Seminar Ilja Livenson
Velocity & Acceleration
Motion in 1D, Vectors and Velocity
MOTION.
FORCE and MOTION Force – push or pull
Domination Game.
Motion in Scratch 1.
Motion, Speed & Velocity
Velocity & Acceleration
Debugging with Eclipse
Robocode A robot is made up of 3 things:
Presentation transcript:

CSE AI Game Programming

Installation 

First robot!  A simple robot can be written in just a few minutes - but perfecting a robot can take months or more  You have two weeks!

Debug in Eclipse  First add jars from “C:\robocode\libs\”  Add VM arguments: -Xmx512M -Dsun.io.useCanonCaches=false - Ddebug=true ○ -Xmx512M: tells the Java VM that Robocode can use up to maximum 512 MB RAM ○ -Dsun.io.useCanonCaches=false: to prevent SecurityExceptions to occur when robots try to access a file ○ -Ddebug=true: tells Robocode that it should not give you skipped turns just because you paused robot in debugger

Debug in Eclipse 2  Add a robot project from another IDE into Robocode Select Preferences from the Options menu, select the Development Options tab  Useful shortcut Ctrl+space : invoke the content assistant Ctrl+shift+G : find references in workspace Ctrl+shift+T : open type Ctrl+T : Open hierarchy Drop to frame : re-enter the currently stack frame Skip All Breakpoint

Frames and ticks  tick = turn The gun turns at 20 degrees per tick. The radar turns 45 degrees per tick.  You can control the frame rate. If too fast, you will miss some frames of animation. This won't affect the robots' behavior  During one turn, you may perform one action as a Robot, or multiple (independent) actions as an AdvancedRobot

Rules.java  ocode/robocode/Rules.html ocode/robocode/Rules.html

Basic  Coords. are (x,y), with bottom left as (0,0) robocode.Robot.getX() robocode.Robot.getY()  Heading: degrees, straight up = 0, pos. clockwise (0 <= heading <= 360) Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 2 means West.  Bearing: relative angle from your heading, pos. clockwise (-180 <= bearing <= 180)  Hitting a wall or another bot ends turn 0 1.5*Pi 0.5*Pi Pi

Move  Maximum speed of 8.0 units/tick  Accelerate at 1 unit/tick, decelerate at 2 units/tick. For example, if you are moving at an speed of 8.0 and reverse your direction your velocities will be [6.0, 4.0, 2.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0].  The faster you go, the slower you turn. See: robocode.Rules.getTurnRate(double) Turn rate in degree: * abs(velocity)

Energy  You lose energy when: hit a wall ○ max(abs(velocity) * , 0) damage. hit an robot ○ 0.6 damage hit by an bullet ○ 4 * bullet power + 2 * max(bullet power - 1, 0) you fire your gun ○ equal to the power of the bullet fired  You get energy when: Your bullet hit other robot. ○ collect back 3 * bullet power energy moving forward hits an opponent robot (ramming) ○ 1.2 energy points

Energy (Disabled)  You can't kill yourself, so when your energy drops to zero because you hit a wall or you fire, your bot gets disabled.  Another case in which you can get disabled is throwing an exception, which may disable your bot, even if you catch the exception.

Bullet physics  Bullet power: 3.0~0.1  Bullet speed:11.0 ~19.7 velocity = 20 - (3 * power). bullet velocity is not affected by robot velocity  Heat & cools down heat: 1 + (firepower / 5) cools down: 0.1 per turn(default) ○ you can fire a 3.0 power bullet every 16 ticks

Radar

  Radar is mounted on gun setAdjustRadarForGunTurn(true); setAdjustRadarForRobotTurn(true);  The radar scans robots up to 1200 units away.  The closest bot is detected first, while the furthest bot is detected last.  By default, the onScannedRobot() method is the last one to be triggered each tick.

Radar 2  1-vs-1 Radars “Wide lock” see demo

Robot, AdvancedRobot & TeamRobot  AdvancedRobot is a more advanced type of robot than Robot that allows non- blocking calls, custom events, and writes to the filesystem.  TeamRobot gives robot the tools to distinguish friend from enemy, as well as communicate with their teammates.

Further reading 