Project: Tanks CSE/IT 107. NMT Department of Computer Science and Engineering. Intro to Tank! Tank! Tank!, Bandai Namco

Similar documents
Based on a handout by Eric Roberts

Assignment #3 Breakout! Due: 12pm on Wednesday, February 6th This assignment should be done individually (not in pairs)

Assignment #3 Breakout!

CS 351 Design of Large Programs Zombie House

Assignment 3: Breakout!

Background Summary Kaibab Plateau: Source: Kormondy, E. J. (1996). Concepts of Ecology. Englewood Cliffs, NJ: Prentice-Hall. p.96.

[CROSS COUNTRY SCORING]

Tru Flight TRUFLIGHT INSTALLATION GUIDE TRUGOLF.COM

Standard League WRO Football Simple Simon EV3 Training Curriculum

Step 1. CoderDojo Milltown Exercise 1 Pong Page 1 of 13

Simple Simon GEN II Robot Soccer EV3 -Tris 10 Training Curriculum

GAMES & ACTIVITIES L.CO.NZ

5. The magnitude of a vector cannot be smaller than the magnitude of any of its components. TRUE FALSE

Chapter 13. ANTY: the robotic ant

ROSE-HULMAN INSTITUTE OF TECHNOLOGY Department of Mechanical Engineering. Mini-project 3 Tennis ball launcher

FRDS GEN II SIMULATOR WORKBOOK

Line Following with RobotC Page 1

Queue analysis for the toll station of the Öresund fixed link. Pontus Matstoms *

[CROSS COUNTRY SCORING]

Intro. Basics. Pilots. Fighters

A GUIDE TO THE LOOSE ENDS HOCKEY LEAGUE WEBSITE PAGE

Assignment A7 BREAKOUT CS1110 Fall 2011 Due Sat 3 December 1

PROGRAMMING LINX LEARNING GAME

How to use the waypoint module

Overview. 2 Module 13: Advanced Data Processing

3. Select a colour and then use the Rectangle drawing tool to draw a rectangle like the one below.

Modeling Traffic Patterns using Java

MoLE Gas Laws Activities

5.1A Introduction, The Idea of Probability, Myths about Randomness

Lab #1 Pressure: Bubblers and Water Balloons CEE 331 Fall 2003

How Do You Swing? You should be working with new lab partners starting with this lab.

A Hare-Lynx Simulation Model

GOLFER. The Golf Putting Robot

GN21 Frequently Asked Questions For Golfers

By Jason Fitzgerald

SomnoSuite FAQ. Setup. Calibration 4. What are the calibration requirements for the SomnoSuite? Settings

[MYLAPS INTEGRATION]

Project 2 Evaluation 32 Second Year Algebra 1 (MTHH )

Ranger Walking Initiation Stephanie Schneider 5/15/2012 Final Report for Cornell Ranger Research

Outside linebacker drills

Overview. Components. Robotics Team Card

Iteration: while, for, do while, Reading Input with Sentinels and User-defined Functions

MoLE Gas Laws Activities

Taking Your Class for a Walk, Randomly

EYE DOMINANCE. You WILL be one of the three. If you re not sure, use the provided test sheet to check.

Ninth - Twelfth Grade Foxtrot Dance Project

OVERVIEW: DESIGN PROCESS:

Investigating the Bubble Behavior in Pool Boiling in Microgravity Conditions Thilanka Munasinghe, Member, IAENG

Rescue Rover. Robotics Unit Lesson 1. Overview

Ozobot Bit Classroom Application: Boyle s Law Simulation

XII.A-D. Basic Attitude Instrument Flight

Basic CPM Calculations

Chapter 6 Handicapping

Allen's Guide to the AMX 13 90

Catapult Project. Even though we will be wearing safety glasses, the catapult must not have any sharp edges that could injure yourself or others.

U9-U10 Teaching Formation

A Developmental Approach. To The Soccer Learning Process

ShuttlE. Schools Badminton

Wire Buddy Manual IOpath Software

AEROSPACE MICRO-LESSON

ORF 201 Computer Methods in Problem Solving. Final Project: Dynamic Programming Optimal Sailing Strategies

Friction. Experiment 1 A Soleful Experiment

Module 3 Developing Timing Plans for Efficient Intersection Operations During Moderate Traffic Volume Conditions

FIBA Europe Coaching Website. Manual. Practice Section

Technology. Using Bluetooth

MOOLOOLABA YACHT CLUB YOUTH SAILING PROGRAM DRILL BOOK 1

The Soccer Guy. By Marcus Hilgers Faisal Ahmad Jacob Borer

The ICC Duckworth-Lewis-Stern calculator. DLS Edition 2016

Ball Toss. Vernier Motion Detector

Table of Contents Diagnosis ICD9 to ICD10 GEM Report... 1 Diagnosis Form... 5 Helpful Hints on Correcting Issues... 8 Disclaimer...

Robot Soccer Challenge

Team Manager's Manual

Project 1 Those amazing Red Sox!

Docking & Harbor Handling Techniques

X.B. S-Turns. References: FAA-H The student should develop knowledge of the elements related to S-turns as necessary in the Private Pilot PTS.

Season Ticket Basketball 2003

USER HANDBOOK. Computerized Jigging Reel

GEN II Robot Soccer EV3 Compass Training Curriculum Brian Thomas

Overview. In Test Matches and One Day International series, if no 4 th umpire has been appointed, the 3 rd umpire duties shall also include:

i9 Sports Soccer Rules

Wiimote in Physical Etoys

Microsoft Windows Software Manual for FITstep Stream Version 4

Gas Pressure and Volume Relationships *

U11-U12 Activities & Games

1 PIPESYS Application

Saturated-Unsaturated Consolidation

Sesam HydroD Tutorial

UNIQUE ADVANTAGES OF PIPENET

RM-80 respiration monitor

User Guide. Two-Wheeled Add-on. Created By: A-Lab Software Limited. Date Created: Feb Date Modified: Feb Revision: 1.

LOW PRESSURE EFFUSION OF GASES revised by Igor Bolotin 03/05/12

Lab 4: Root Locus Based Control Design

Shedding Light on Motion Episode 4: Graphing Motion

To Logon On to your tee sheet, start by opening your browser. (NOTE: Internet Explorer V. 6.0 or greater is required.)

CS Problem Solving and Object-Oriented Programming Lab 2 - Methods, Variables and Functions in Alice Due: September 23/24

General Physics - E&M (PHY 1308) - Lecture Notes. General Physics - E&M (PHY 1308) Lecture Notes

Robot Activity: Programming the NXT 2.0

Reactor Networks. D. G. Goodwin Division of Engineering and Applied Science California Institute of Technology. Cantera Workshop July 25, 2004

The First Shots of the War

CSE 154: Web Programming Spring 2017 Homework Assignment 5: Pokedex. Overview. Due Date: Tuesday, May 9th

Transcription:

CSE/IT 107 NMT Department of Computer Science and Engineering TANK TANK TANK Intro to Tank! Tank! Tank!, Bandai Namco 1 Tanks Dirtbags Tanks This project is inspired by Dirtbags Tanks by Neale Pickett. More information is available at http://woozle.org/tanks/intro.html. 1.1 Project Overview You will be provided with several files comprising the Tank project. This is the skeleton of a game involving several tanks. It consists of the files game.py, sample_tank.py, sensor.py, tank.py, and tankutil.py. For a description of what each of these files do, stay here. For a description of your assignment, see Section 1.2. 1.1.1 game.py game.py contains two important things: class Game and the main() function of the program. Game contains the code that controls the interaction between tanks (collision detection and firing) as well as the drawing of objects to the tkinter window. You should not have to worry about how it does these things. The main() function, however, you will need to edit, slightly. This is where you will add your own tanks to the Game instance that is already being created. To do this, simply imitate how the SampleTanks are being added. Note that you will also need to add an import at the start of the file in order to be able to access your tanks from other files. 1.1.2 tank.py tank.py contains class Tank, which includes all the methods and attributes needed for general functionality of tanks. All of your custom tanks should inherit from Tank. You should not edit this 1

file whatsoever. Each tank has a large collection of attributes that control its behavior. Most of these you should not touch, but for some of the required tanks you may need to change the values of specific attributes in your custom constructor. For your tanks, you will need to redefine ai(self, delta), which is the method called each simulation step to determine what the tank should do. Inside of this method, the only other methods you should call are those in the section of tank.py labeled METHODS TO BE USED BY AI. They allow you to set the desired speed of the tank treads, the desired angle of the turret, and whether the tank should fire. They also allow you to check the current status of the treads, turret, and the sensors (described in Section1.1.4). Not using these methods will result in your tank not behaving properly, as properties such as tread acceleration, max speed, and turret speed may be ignored. You should also redefine \_\_init\_\_ to specify the tank s sensors as well as any other attributes that may differ from the default tank (left to your discretion). 1.1.3 tankutil.py tankutil.py contains a few miscellaneous functions used by the other files. It is relatively inconsequential and you won t need to use it, though it may be useful to look at if you want to set custom colors for your tanks. 1.1.4 sensor.py sensor.py contains class Sensor, which is used to define the sensors for tanks. Sensor contains nothing but a constructor and a few attributes. The actual logic for sensors resides inside game.py. A sensor is defined from four attributes: Direction A value in degrees that determines what direction the sensor is facing. This direction will indicate the middle of the sensor. 0 means directly in front of the tank, while 180 means directly behind the tank. Width A value in degrees that determines how wide the sensor is. The sensor will detect tanks in half this number of degrees in each direction from the direction chosen above. Size How far the sensor reaches. This distance is in pixels. For reference, the default range of a tank s gun is 50. Tracking Whether or not the sensor will move as the gun s turret moves. This value should be either True or False. If this value is False, then the sensor s direction will be relative to the tank s current facing. If this value is True, then the sensor s direction will be relative to the turret. This allows you to have sensors that, for example, check if there is something to the left or right of the turret that could be shot if the turret was moved slightly. The sensors for your custom tanks should be created inside of the tank s constructor. To check whether the sensor has detected a tank, use self.read_sensor(num), where num is the index of the sensor inside of self.sensors. Each sensor will be shown graphically, and if it detects a tank then it will be filled in with the color of its parent tank to indicate that it is active. 2

1.1.5 sample_tank.py sample_tank.py is an example of how you might go about making your own custom tanks. You are free to edit this file, but your final submissions should be in separate files (as described in Section 1.2). class SampleTank defines two methods: init and ai(self, delta). init is be used to define two sensors: one large one that looks for anything in front of the tank and one smaller one that follows the turret to check for anything that can be shot. It also determines whether the turret will turn clockwise or counter-clockwise. ai is used to control the tank s behavior. The first thing this tank does is get the current angle of the turret, then set the desired angle to be higher or lower, depending on what chosen in the constructor. This results in the turret continuously turning in one direction at a constant rate. Next, the turret reads from sensor 1 and checks if the turret is able to fire. Sensor 1 is the smaller sensor that is following the turret. If both values are true, then the turret fires. Finally, sensor 0 is checked. This is the large one in front of the tank. If anything is detected, the tank reverses. If not, it continues forward, with the left tread at a slightly higher speed than the right one. This results in the tank slowly turning to the right. 3

1.2 Your Mission You will be submitting 6 tanks that inherit from the Tank class in tank.py. Each of your tanks should override, at the very least, the init and ai(self, delta) methods of the parent class. You will be graded primarily on code quality, so remember to follow PEP-8 and to document everything! Each tank file should give an overview of how its logic works and why you made it work that way. Exercise 1.1 (README.txt). You should have a README file briefly describing the logic behind each of your tanks. If you changed anything in the given files besides the main() of game.py, mention it here and explain why. Mention some changes you found that made tanks more or less successful. Exercise 1.2 (coward.py). This tank is nervous and doesn t like social interaction. It should do its best to avoid all interaction with other tanks and evade them as much as possible. Remember, this means more than simply going backwards if something is in front of it think about what your tank should do if there s one tank in front of it and another behind it! Exercise 1.3 (charger.py). This tank is very enthusiastic to show you how well its turret works! It should chase down any tank it sees and give them a demonstration of how well its gun works! a If the gun isn t ready, it should try to stay away from others so as not to reveal that the gun is not completely reliable. a By shooting them. Exercise 1.4 (turret.py). This tank got its treads stuck in the mud. It should never move at all and should move its turret, shooting anyone who comes near. It should also attempt to track tanks as they approach if there isn t anyone currently in range to be shot at. Exercise 1.5 (elephant.py). The Elephant is a new experimental heavily armored tank. It is far slower and larger than the other tanks while also being harder to kill. To accomplish this, you will need to change some of the default tank attributes, namely shape, radius, tread_accel, and tread_max. You will also need to redefine kill(self), which is called whenever a tank is shot or runs into another tank. Exercise 1.6 (mouse.py). The Mouse is a new experimental hyper fast tank. It is far more agile and petite than the other tanks, attempting to succeed by dodging around other tanks. Similarly to with the Elephant, you will need to change some of the default tank attributes. 4

Exercise 1.7 (custom.py). Finally, design your own custom tank that works however you wish. Try to give it an AI that lets it combine the strategies of the other tanks in a way the makes it better than all of them! 1.3 Bug Bounty The provided code was written fairly quickly and probably has some bugs. As such, if you report a bug that are not previously known, you will be given 5 points of extra credit. If you can provide a fix to a bug, you will be given 10 points. Report all bugs/fixes to Russell if you want to receive credit. 2 Submitting You should submit your code as a tarball. It should contain all files used in the exercises for this lab. The submitted file should be named cse107_firstname_lastname_tanks.tar.gz Upload your tarball to Canvas. List of Files to Submit 1.1 Exercise (README.txt)...................................... 4 1.2 Exercise (coward.py)........................................ 4 1.3 Exercise (charger.py)........................................ 4 1.4 Exercise (turret.py)......................................... 4 1.5 Exercise (elephant.py)....................................... 4 1.6 Exercise (mouse.py)........................................ 4 1.7 Exercise (custom.py)........................................ 5 5