270 likes | 425 Vues
Remote-Controlled “Pac-Man” Game. Timothy Sperr Yuriy Dragonuv Nathaniel Pearson. Agenda. Overview & System Diagram – Tim Game Design – Tim Vehicle – Tim Construction – Nate Image Processing – Yuriy Multidisciplinary Aspects – Nate Testing Strategy – Tim
E N D
Remote-Controlled “Pac-Man” Game Timothy Sperr YuriyDragonuv Nathaniel Pearson
Agenda • Overview & System Diagram – Tim • Game Design – Tim • Vehicle – Tim • Construction – Nate • Image Processing – Yuriy • Multidisciplinary Aspects – Nate • Testing Strategy – Tim • Integration Strategy – Yuriy
Overview • Our goal: to design a system that is both entertaining and technically interesting • The solution: • A “robotic” Pac-Man game • Pac-Man is a player-controlled R/C vehicle • The maze is a real, physical object • The ghosts and items are software items projected down onto the maze • Image recognition is used to locate Pac-Man
Game Design The game: Pac-Man • Player’s character Pac-Man navigates a maze • The goal is to collect all the “pellets” in the maze while avoiding 4 AI ghosts • By eating “power pellets” Pac-Man powers up and can then chase & eat ghosts
Game Design • Our game will be implemented in Visual C# • It will be the same game, without a Pac-Man graphic • Software will operate on “time slices” • For each time slice, the game will find the Pac-Man vehicle, run game logic algorithms, and update object positions • DirectX and/or XNA game studio may be required
Game Design Performance considerations: • Certain in-game constants and variables are highly dependent on the vehicle’s performance (speed, turning, etc) • Each time slice must be processed fairly quickly (in 30 milliseconds or less) to ensure a decent framerate
Vehicle VSTank*R 1/48th scale R/C battle tank
Vehicle Size: • 2.75” by 1.75” • Game maze will be split into 10x12 grid of squares • Maze must be smaller than 8’ by 8’ • Thus, the vehicle must be smaller than 7” by 7” • Also, vehicle turning radius must be accounted for
Vehicle Speed & Maneuverability: • 3 tests were done on the vehicle to gauge performance • A straight-line speed test • A 360-degree turn test • A zig-zagging path test • Preliminary tests resulted in: • 0.77 feet per second • 0.4 seconds for a 90 degree turn
Vehicle Battery Life: • R/C vehicle does not use commerically-available batteries • Charges its internal battery using the remote control • Battery lifespan averages 2 minutes • Modifications are most likely going to be necessary to extend battery life
Construction • Mounting Structure • Box • Legs • Leg attachment assembly • Maze Mat • Floor • Walls
Mounting Structure • Box • Sides • Bottom • Ventilation
Mounting Structure • Legs • Diameter • Material
Mounting Structure • Leg attachment assembly • Hinge Joint • Adjustment
Maze Mat • Floor • Peg board division • Peg board coloring • Peg board connection • Walls • Pvc division • Dowel division • Dowel slotting • Pvc coloring
Image Processing • Objective: • Find Pac-Man’s position in the maze • Tools: • Logitech Quickcam Communicate MP • 960 x 720 “effective pixels” • AForge.NET • .NET Image capture and manipulation library
Image Processing • Aside: HSB color space http://en.wikipedia.org/wiki/File:HSV_cylinder.png http://en.wikipedia.org/wiki/File:Barns_grand_tetons_HSV_separation.jpg
Image Processing • Image Capture • Handled by AForge.NET. Just need to write event handler to receive video frames. • Processing for each frame • Median filter to filter noise • Conversion to HSB color space • Filter by hue, then run algorithm to find “blobs” • Filter by blob size • Should now have X and Y coordinate of Pac-Man’s position.
Image Processing • Coordinate conversion • Game software uses a 2-D array for the entire maze. • Linear scaling and offsets are planned to be used, but: • Perspective may cause issues. • Based on math, expect Pac-Man to take ~20-25 pixels on the captured frames, which is expected to be enough to find it.
Multi-Disciplinary • Hardware • Mechanical Engineering • Electrical Engineering • Civil/Structural Engineering • Computer Engineering • Software • Electrical Engineering • Computer Science
Testing Pre-Build Testing: • Vehicle performance • Projector angle • Webcam resolution & angle
Testing Software Testing: • Unit tests on individual components • Thorough test of game logic • Integration tests: • Game logic ↔ coordinate change algorithm • Game logic ↔ maze traversal algorithm • Coordinate change algorithm ↔ image recognition • Various tweaks to balance gameplay
Testing Post-Build Testing: • Lighting conditions test • Projector housing structural tests • Maze construction structural tests • Whole system integration tests
Integration • Integration of individual software components • Integration of projector/webcam with supporting mounting structure and maze • Integration of game software with projector display and webcam video capture.