Game Engine EECS 150 Spring 2006 Lab Lecture
Game Engine EECS 150 Spring 2006 Lab Lecture #10 Guang Yang 3/24/2006 EECS 150 Lab Lecture #10 1
Project Status Check Point 1 Check Point 2 Video RAM NTSC Video N 64 Controller Interface Video RAM Check Point 3 Check Point 4 Chipcon RF Game Engine Transceiver Block Diagram of the Design 3/24/2006 EECS 150 Lab Lecture #10 2
Checkpoint 4 n Basic Requirements n n Extra Credits n n 3/24/2006 2 -player wireless Tron Being able to find an opponent and start playing Display the game and scores There is a list of features in cp 4 doc Feel free to add extra features. Talk to TAs about extra credits BEFORE you do it. EECS 150 Lab Lecture #10 3
First thing first n n 3/24/2006 100% Freedom EECS 150 Lab Lecture #10 4
Game Setup n 3/24/2006 Game Board Setup EECS 150 Lab Lecture #10 5
Game Board (1) Internal game board representation n It is in the engine. You can decide. n One possible way n Use RAM to store the board data n See the reference RAM implementation in cp 4 zip file n 3/24/2006 EECS 150 Lab Lecture #10 6
Game Board (2) n For each point on the board, use 2 bits to represent its status Value 3/24/2006 Meaning 00 Not yet visited 01 Visited by myself 10 Visited by opponent(s) 11 Board border EECS 150 Lab Lecture #10 7
Wireless Tron Two main phases In channel 0 • Initialize the board • Find an opponent • Select another channel for playing the game • Maintain a Game. Index • Go there • Send your position and Game. Index • Receive those from your opponent • Update the game • Game over. Go back to Initialization phase Initialization Phase Game Playing Phase 3/24/2006 EECS 150 Lab Lecture #10 In channel 1~15 8
Initialization Phase Listen to Channel 0 for 1 sec Init Board Timeout Listen to Channel 0 for 1 sec 3/24/2006 Send Acknowledge with (random) ch#1~15 Timeout Send Invitation Receive an Acknowledge Play Game Receive an Invitation Send Confirmation Save ch# Listen to Channel 0 for 1 sec Player 1 Wait 1 sec EECS 150 Lab Lecture #10 Receive a Confirmation Player 2 Change to new channel 9
Initialization Phase n n 3/24/2006 Packet formats standardize the 32 -bit payload. You need to decide the proper source address and destination address. Invitation Packet 8’h 80 8’h 00 Acknowledge Packet 8’h 80 8’h 0 F 8’h 0 N Confirmation Packet 8’h 80 8’h 00 8’h. F 0 8’h 0 N where N is the channel number ranging from 1 to 15. EECS 150 Lab Lecture #10 10
Wireless Communication n 3/24/2006 !!! UNRELIABLE !!! You must add redundancy to make it reliable Send every packet multiple times. We start with packet. Repeat. Times = 3. You can experiment later on to find out the optimal value. EECS 150 Lab Lecture #10 11
Administrative Info (1) n n n Checkpoint 3 due in the week after spring break in lab 50% off one week later Plan out a design for checkpoint 4 n n No design review, but should be useful for project writeup Considering extra credit? Plan for it n n 3/24/2006 Design consideration Time allocation EECS 150 Lab Lecture #10 12
Administrative Info (2) n Project grade breakdown n n 3/24/2006 Checkpoint 1: 10% Checkpoint 2: 15% Checkpoint 3: 30% Checkpoint 4 / Final Checkoff: 30% Report: 15% EECS 150 Lab Lecture #10 13
Administrative Info (3) n Extra credit n n n 3/24/2006 Up to 20% of total project grade Due at the same time as your CP 4 check -off (either early or standard check-off) Not eligible unless you complete all previous required project work. (Single student groups can submit the blackboxes we gave you. ) EECS 150 Lab Lecture #10 14
Game Playing Phase n Parameters n Packet repetition times packet. Repeat. Times = 3 n Car moving speed = 10 n n 3/24/2006 pixel/second You could try different values later To synchronize the moves of both players, introduce a Game. Index. It starts from 0, and increment after moving one pixel ahead EECS 150 Lab Lecture #10 15
Game Playing Phase Start Game. Index does not match Receive Position Update Packets Game. Index=0 Set init position Init Phase 3/24/2006 Both alive You need to arbitrate Send Position Update Packets Check Game Status for the New Positions Game. Index matches Make the move; Increment Game. Index No valid packet received in one second At least one dies End Game. Update Score Start button pressed on N 64 EECS 150 Lab Lecture #10 16
Game Playing Phase n Packet Format Position Update Packet 3/24/2006 1’b 0 15’b Game. Index EECS 150 Lab Lecture #10 8’h col 8’h row 17
Video. RAM n n n 3/24/2006 You are free to choose any implementation For your reference, in our implementation, we have dedicated groups of signals for Read/Write car positions, and for Write characters on the screen Refer to the Checkpoint assignment for detailed port information EECS 150 Lab Lecture #10 18
Extra Credit n Some extra credit options n n n n 3/24/2006 EARLY CHECKOFF (5%) n Week of 4/10 to 4/14 Multiplayer (>=4) game (7%) For this one, you need to modify communication protocols and/or packet formats Audio (5%) Viewpoints (5%) Finite wall (like snake) (3%) … Check webpage for more options Up to 20% EECS 150 Lab Lecture #10 19
Project Tips (1) n Design n n Testing n 3/24/2006 Get used to debugging An unverified module is useless Refer to lab 4 and lab 5 Start from SIMULATION Multiple boards, different addresses, different orderings, etc. EECS 150 Lab Lecture #10 20
Project Tips (2) n Requirements n n Finish these first Make sure it works well n n n Extra Credit n n Finish early, it’s worth 5% Keep your required version separate n 3/24/2006 Shouldn’t depend on a certain N 64 controller Should work on multiple boards Don’t touch it while you work on extra credit! EECS 150 Lab Lecture #10 21
Project Writeup n Includes n n n Documentation helps you debug n n 3/24/2006 Block diagrams Bubble-and-arc diagrams Comments NO SCHEMATICS (They’re too detailed) Use your design reviews! Also makes it easier for us to help you More details will be posted later EECS 150 Lab Lecture #10 22
Enjoy your spring break and/or Wireless Tron 3/24/2006 EECS 150 Lab Lecture #10 23
- Slides: 23