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.
Half life 2/ Counter Strike: Source bot Charlie Cross CIS
Cutnell/Johnson Physics 8th edition Reading Quiz Questions
This Week Cover as much Robocode strategy as we can Monday: Robocode
Artificial Intelligence in Game Design Hierarchical Finite State Machines.
Graduate Capstone Project Breaking Walls: Developing a Successful Robot in Robocode Chris Velez Summer 2011 Advisor :Dr. Xiang.
Ramrod III Micro mouse. The Team  Andrew Igarashi – software  Kevin Li – hardware  Stephen Nakamura – hardware  Quang Ngu – software.
Ramrod III Micro mouse. The Team  Andrew Igarashi – Hardware  Kevin Li – Programming  Stephen Nakamura – Hardware  Quang Ngu - Programming.
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.
Chapter Assessment Questions
Great teaching/ learning aid … OO Threading Packaging Inheritance Polymorphism Calling API code Event handling Inner classes Java docs How to duck… Consume.
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.
Energy – The capacity to do work
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.
1 Programming James King 12 August Aims Give overview of concepts addressed in Web based programming module Teach you enough Java to write simple.
MOTION.
How does Robocode work? In short it is a framework
Lesson 2: Compositions and Animations CMM204 – Digital Media Effects.
Motion  1 Position, Speed and Velocity  2 Graphs of Motion  3 Acceleration.
CSE AI Game Programming. Installation 
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?
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
Linear Momentum Impulse & Collisions. What is momentum?  Momentum is a measure of how hard it is to stop or turn a moving object.  What characteristics.
Chapter 6.1 Review. 1. What is needed to cause a change in momentum?
University of Limerick1 Computer Applications CS 4815 Robocode.
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.
Seminar for Participants An Introduction on Robocode.
1 Programming 2 Aims Give overview of concepts addressed in Web based programming module Teach you enough Java to write simple web and network applications.
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.
Chapter 2 Motion in One Dimension. Motion is relative.
(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
EV3 Programming: Moving and Turning CONFIDENTIAL © 2014 Cymer, LLC.
Chapter 3 Two-Dimensional Motion and Vectors. Section 3-1: Introduction to Vectors Physical quantities such as length, area, volume, mass, density, and.
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.
ATS Application Programming: Java Programming
Applications and models
MOTION.
BEARINGS.
Winning Strategy in Programming Game Robocode
It depends on the direction of the crosswind
What type of angle is it?.
The monkey and the hunter
Projectile Motion Created by Craig Smiley (Harrison HS, West Lafayette, IN) Supported by grant PHY from the National Science Foundation and by.
Robotics Getting Started with
Speed & Velocity.
Debugging with Eclipse
MTAT , 2CP Seminar Ilja Livenson
Motion in 1D, Vectors and Velocity
FORCE and MOTION Force – push or pull
Projectile Motion Created by Craig Smiley (Harrison HS, West Lafayette, IN) Supported by grant PHY from the National Science Foundation and by.
Forces And Friction.
Motion, Speed & Velocity
Forces and Friction.
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!

Work 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

Work 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  Body  Gun  Radar

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.

Events  ScannedRobotEvent - When the radar scanned another robot  HitByBulletEvent - When your robot is hitted by bullet  HitRobotEvent - When your robot hit another robot  HitWallEvent - when your robot hit the wall

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.

Advices  Friendly Fire!  Please Use AdvancedRobot  Artificial Intelligence  Be a Team

Further reading 

Hope you enjoy Robocode!