Multidisciplinary Design Project: Remote--

hotdogrelishnoseSoftware and s/w Development

Nov 4, 2013 (3 years and 10 months ago)

87 views

Timothy Sperr

Yuriy Dragonuv

Nate Pearson

tss1319@rit.edu

ypd1467@
rit.edu

nrp8523@rit.edu

(585) 314
-
8057

(207) 232
-
8772

(703) 314
-
9210




















Multidisciplinary Design Project:

Remote
-
Controlled “Pac
-
Man” Game


CE Design Projects I

0306
-
654
-
01

Instructor Dr. Roy Czernikowski

Submitted 04/15/2009

















2


Table of Contents


Project Overview

................................
................................
................................
................................
...........

3

System Design

................................
................................
................................
................................
...............

4

A. Game Design

................................
................................
................................
................................
.........

4

B. Vehicle
................................
................................
................................
................................
...................

6

C. User Interface

................................
................................
................................
................................
.......

7

D. Coordinate System

................................
................................
................................
...............................

7

E. Projection System

................................
................................
................................
................................
.

8

F. Maze
Construction

................................
................................
................................
................................

9

Testing Strategy

................................
................................
................................
................................
..........

10

Materials

................................
................................
................................
................................
.....................

10

Risk Factors

................................
................................
................................
................................
.................

12

Multidisciplinary Design Aspects

................................
................................
................................
................

12

Other Considerations

................................
................................
................................
................................
..

12

Conclusion

................................
................................
................................
................................
...................

13

Acknowledgements

................................
................................
................................
................................
.....

14






















3


Project Overview


The goal of this multidisciplinary design project is to envision a system that is entertaining and
incorporates some vehicular or robotic elements. To achieve this goal, a new perspective on the classic
arcade game “Pac
-
Man” was created, in which both Pac
-
Man himself and the maze he navigates are
actual physical objects, with the player controlling Pac
-
Man via simple R/C joysticks. A maze
will be
constructed out of PVC pipe

and will constitute the game’s playing field. Above the playing field, a digital
pro
jector will be mounted facing downward, such that it is able to project the game onto the playing
field.
Using graphical programming libraries, a Pac
-
Man game will be implemented on a Windows PC
that will be connected to the projector, with enemies and pow
er
-
ups, along with a second maze,
projected onto the playing field. A small R/C tank will be modified to have Pac
-
Man’s appearance, and
will allow the player to navigate the maze. The tank will be tracked via a webcam mounted on the
projector and a color
-
r
ecognition algorithm. By using an internal coordinate system that links the
webcam’s positioning of the player vehicle to the known coordinates of enemies and power
-
ups, it will
be possible to craft a game that is both entertaining and technically interest
ing.




Fig. 1


Overall Diagram of Proposed System


4


System Design


A. Game Design


Traditionally, the game of Pac
-
Man consists of 5 characters


Pac
-
Man and four “ghost” enemies (Inky,
Pinky, Blinky, and Clyde) within a maze. The maze is littered with
“pellets,” all of which Pac
-
Man must
eat by moving over to win. The ghosts chase Pac
-
Man around the maze, and cause the player to lose a
life if they come in contact with Pac
-
Man. If the player loses a life, the game resets the positions of Pac
-
Man and the

four ghosts, but remembers which pellets have been eaten. In addition to the standard
pellets, there are larger pellets placed around the maze that, when consumed by Pac
-
Man, cause all
ghosts to change color and run away from Pac
-
Man for a limited amount
of time. If Pac
-
Man touches a
ghost during this phase, the ghost is “eaten” and returns to its starting point to chase Pac
-
Man again.

There also exist fruits that randomly appear on the playing field, which may be collected for bonus
points.


Such a game i
s fairly simple to implement using modern high
-
level programming languages and
graphical drawing libraries. A PC running Windows has been chosen as the platform for development,
and Java and Visual C# are both high
-
level programming languages that possess
robust drawing libraries,
and either may be selected as a programming environment. Both programming languages are both
capable of interfacing with webcams relatively easily as well, which is of importance when considering
the image
-
processing aspects of th
is project.


A graphical PC version of Pac
-
Man will be created using one of the languages described above, with the
maze, ghosts, and pellets all represented graphically. Pac
-
Man himself will not appear
graphically on the
playing field


his position will
be known to the program as a result of image processing and coordinate
conversion algorithms acting to locate the player
-
controlled vehicle
. In addition to the basic game
representation programming and scorekeeping, the game software will require a maze tr
aversal
algorithm that allows the ghost characters to navigate in the game maze. This algorithm must allow the
ghosts to both chase Pac
-
Man during normal play and avoid him when a large pellet has been
consumed. Furthermore, the algorithm cannot be “perfec
t;” that is, the ghosts should make occasional
mistakes when deciding how to traverse the maze, allowing for the player to more easily avoid or chase
them, as the situation calls for. Finally, the speed of the ghosts must be scaled down considerable from
t
he arcade version of the game, as full
-
speed ghosts would easily outrun the player
-
navigated vehicle.
The ghosts navigating the maze will possess two speeds


one “fast” speed in which they are chasing the
Pac
-
Man vehicle (and travel with the same approxim
ate speed as the vehicle’s average speed, to be
determined experimentally), and one “slower” speed that allows the player’s vehicle to outrun and
“eat” ghosts when chasing them after a large pellet has been eaten.


The game’s primary algorithm will procee
d on a basis of “time steps.” At each discrete time step during
the game’s execution, it will obtain an image from the webcam, use image processing to find the player
vehicle, figure out whether a collision has occurred, update the appropriate parameters,
update
positions of in
-
game objects, and then repeat the whole process during the next time step. The amount
of time to take place between time steps is yet to be determined, as is whether or not the amount of
time will be constant. Fig. 2 on the fol
lowing

page contains a flowchart that describes a simplified
version of the game’s main algorithm.



5



Fig. 2


Pac
-
Man Game Algorithm Flowchart

6


B
.

Vehicle


Of primary consideration in the design of the Pac
-
Man game is the vehicle that will fill the role of Pac
-
Man within the game. At time of conception, it was decided that the playing area could have dimensions
no greater than 8 feet by 8 feet. Due to the fac
t that the classic Pac
-
Man maze is somewhat complex, a
grid of 10 squares by 12 squares was created that contained the entire maze. The larger dimension of 12
squares means that the maximum size of a square is 96 in. / 12 squares = 8 in. on each side.
Fact
oring in
enough space for one half
-
inch of wall on each side to bound the maze, the vehicle is left with a 49
square inch area. Thus, a vehicle was required that had no dimension larger than 7 inches. A tank was
chosen due to the fact that R/C tanks typica
lly are capable of 360 degrees of rotation in place, which is
necessary if the vehicle is to move as Pac
-
Man does in the arcade game. Initial investigations have
revealed that several micro
-
R/C tanks exist that fit within the specified dimensions, and are
available
from a wide selection of online hobby retailers. Fig. 2 shows one such tank,
which is 4.5” long by 2”

wide


well within the desired dimensions. By removing the turret from the top of the tank, and fitting
some form of material (possibly Styrofo
am) shaped into a circle over the top of the vehicle, a replica of
Pac
-
Man may be created at relatively low cost.



Fig. 3



Selected
Miniature
“R/C Battle Tank”

and Remote


One problem with miniature R/C vehicles in general is their low battery life. The tank shown in Fig. 2
boasts a small rechargeable battery with a fully
-
charged lifespan of 2 minutes. After two minutes, the
performance of the vehicle can be expected to degr
ade, and its speed may no longer be assumed to be
constant. As such, it will be necessary to further modify the vehicle by adding additional batteries or
finding alternative batteries with a longer lifespan. By removing unnecessary plastic components, it i
s
hoped that the weight of the vehicle will also be reduced sufficiently to further expand battery life.


Beyond the cosmetic changes detailed above, and the increase in battery life, no further modifications
are expected to be necessary to the vehicle. T
he included remote control may undergo slight cosmetic
modifications as well, but otherwise already possesses all of the necessary controls to allow the player
to control Pac
-
Man as would be possible at an arcade.





7


C.
User
Interface


There will be a com
puter screen with text prompting the user to start. The user can hit any key except
escape and the game will begin. Once a game has started the user will navigate Pac
-
man using the
controller trying to eat all the dots and not get caught by the ghosts. Th
e wall will ensure that the user
stays in bounds of the maze. The projected image will display something similar to Fig. 4, seen below,
including score, lives, the ghosts, dots, and fruit.



Fig. 4


Screenshot of Sample Pac
-
Man Game


Pressing escape at a
nytime will reset the game bringing it back to the ready state. The computer will be
used as a control mechanism allowing the user to start a game and reset the current game displaying
the ready and running dialog full screen to the user.


The maze mat its
elf is part of the interface and should not be interfered with during game play.


D. Coordinate System


In order to combine information obtained from the webcam with the internal representation of the
maze, and then translate all of that into an image that

can be displayed by a projector, coordinate
systems must be analyzed and methods to convert between them must be determined. The envisioned
coordinate systems of the webcam and the projector are simple: they are rectangular coordinates, with
the origin at

the top
-
left corner and the resolutions of the video feeds driving them defining their
maximum sizes. The coordinate system used by the internal representation of the maze stems directly
from its internal representation


a two
-
dimensional array. Indexes
into the array will be the
“coordinates”.


8


Converting from one coordinate system to another will be simple.

The feed from the webcam will result
in a series of still images each time step
. Both the x
-

and y
-
positions of that point can be divided by a
constant number that specifies how many pixels correspond to a single square (to be determined by
experimentation). Those numbers can then be offset to account for the maze not taking up 100%
of the
webcam’s field
of vision. That will obtain Pac
-
M
an’s position in the maze.


To convert from internal maze coordinates to projector coordinates,
should it be necessary,
the reverse
process will be used. The maze coordinates will be multiplied by
another experimentally determined
constant that specifies how many projector pixels match up to a single square of the maze. Offsets will
be added to account for the physical position of the maze relative to the position of the projected
image. More offset
s will then also be used to position objects in the middle of squares rather than on
the edges.

The most complicated aspect of these conversions is experimentally determining the
constants required, and this is not anticipated to be difficult.


E.
Projecti
on System


The dimensions for the playing field for this project
have been determined to be 80 inches wide by 96
inches long. Taking this into account, it was found that, for a typical digital projector available at any
major retailer, the projector lens m
ust be mounted at a vertical height of approximately 8 feet from the
floor of the playing field. As most commercially available webcams have a wider angle of view than any
projector’s projection angle, it was decided that mounting the webcam at the same he
ight as the
projector would be sufficient. Note that, due to the 4:3 aspect ratio of standard definition digital
projectors, the actual projected area will be approximately 80” by 107,” which is slightly larger than 8
feet on its longer dimension. However,

the area of the playing field remains smaller than that of an 8
foot by 8 foot playing area. The additional projected area will be utilized as a scoreboard, as outlined in
the section on User Interface.



Fig. 5


Proposed
Projector Mounting Structure


T
he projector and w
eb camera will be mounted in a

box
, as shown in Fig. 5,

with holes cut in the bottom
to fit the appropriate device. The box will be approximately one foot cubed. The box

will be mounted
on four evenly
-
spaced

3” PVC pipes so that the bott
om of the box is eight feet in the air. The 4 legs will
9


be nine feet long and extend approximately five feet from the center of the projector in each direction.
The projector will be mounted vertically closest to the box wall facing away from the maze mat,

to
project the image down to the mat on the ground. The projector will have its VGA and power cable
s

run
out of the box and down one of the legs of the stand. The we
bcam will be mounted opposite

the
projector closest to the maze and will have the USB ext
ension cable run down the same leg as the
other cables.
Please note that the exact vertical height of the projector box may vary somewhat (on the
order of one or two inches) at time of actual construction, depending on the exact projector used.


Please n
ote that the system diagram in Fig. 1 does not exactly portray this mounting structure, and is
only to be used as a rough reference of component placement.


F. Maze Construction


The maze mat will be constructed to look like the original Pac
-
man game. The

left picture of Fig. 6
shows the original Pac
-
man maze. The maze will be constructed of pegboard painted black and cut into
a total of 12 sections pictured to the right. There will be 3 different sided sections as shown. The walls
will be constructed of ¾
” PVC cut into 8
-
inch sections

and painted blue with two holes

drilled in the
bottom towards each end, for pegs. The pegs will be cut from 1/8” dowel to approximately one inch
sectio
ns. In total there will be79

wall sections and 198 pegs. The walls will b
e fitted with pegs and then
attached to the pegboard. Breaking the walls up into small pieces allows the map to be modified in the
future.



Fig. 6


Proposed Maze Construction







10


Testing Strategy


Prior to the project’s construction, several experimental factors must be determined. Calculations have
been made to determine the height of the projector and webcam that produces the desired projected
playing area. However, before finalizing construction
of the mounting it is necessary to determine
whether these heights are correct. Furthermore, it is necessary to determine whether or not the
webcam can obtain images of sufficient quality to perform image processing at such heights. Finally, the
average
sp
eed of the vehicle

(at full power)

must be determined experimentally, as must expected
battery life at full speed.


Testing and debugging of the game software prior to system integration will be done to ensure correct
functionality. All paths of the flowch
art in Fig. 2 will be traversed in software, inserting the appropriate
values where necessary to simulate action of the player
-
controlled vehicle. The software will be re
-
tested after integration with the projection system to ensure that it still functions

as expected.

The image
-
processing and coordinate
-
changing algorithms must both be thoroughly tested, as they
constitute a key part of the game’s functionality. Because the image
-
processing algorithm is going to be
acting by recognizing color in a system t
hat contains a projector, it becomes necessary to test whether
the player vehicle can be recognized under a variety of game situations (such as in various positions in
the maze, and when in contact with ghosts/pellets), as well as under various lighting co
nditions. The
color
-
recognition algorithm will be tested under low
-
light, average (fluorescent) light, and well
-
lit
(sunlight and indoor lights) conditions.


Finally, prior to permanent construction, the projector mounting system will be subjected to mild
stress
testing



the mounting framework will be pushed from all sides, to verify that it is not easily knocked
over. This will help to ensure a modicum of safety for one potentially dangerous component of the
project.


Materials


Fig. 7 contains a table d
isplaying the overall projected cost estimates for this project.
The most
expensive component of the project at this time is the projector that will be used to project the digital
parts of the Pac
-
Man game. It is hoped that one may be found or donated at n
o cost, but this is not
currently the case.

A/V projectors are being considered as a low
-
cost alternative to the digital projector
described in this system.


The design team is already in possession of a variety of computers running Windows XP, along with

all
other required hardware (keyboard, mouse, speakers, etc).
A webcam of appropriate resolution may be
found at any major retailer at low cost, as may any required extension/converter cables not already in
the team’s possession.


A number of R/C vehicles

were researched for this project; the one currently selected costs
approximately $20 per tank. Due to the low construction costs of such a vehicle, it has been decided
that multiple tanks will be purchased initially, due to their high probability of failu
re. Additional tanks
may be purchased as necessary by the team.




11


Item

Sub
-
item

Description

Quantity

Cost

Total Cost

Est. Cost

Maze Mat


Pegboard

4’x8’

2

$14

$28

$28


印牡礠P慩aW

䉬B捫

1








印牡礠P慩aW

䉬Be

1








Mo睥l

1/8” x 36”

6








P噃

¾” x 10’





$20

$20








噥V楣汥


瑡湫

剥RoW攠con瑲o氠瑡湫

2

$20

$40

$40


P慣
-
m慮⁦慣e

䍡牤bo慲a⁣uWouW

1





Ton慴aT








坥b捡m


Log楴散栠兵楣欠
捡c
捯mmun楣i瑥


1

$37

$37

$37


L楦敃im vx
-
3000

䅬瑥牮慴a


$34










P牯j散eor


䉥湑BMP512S
T

diagonal 133.6”

1

$549

$549

$549


䕮瑥牴慩Em敮e
P牯j散eor

䅬瑥牮慴a,⁁ 嘠楮pu琬
diagonal 112.5” with WA
L敮e


$120




坩P攠䅮g汥lL敮e

0⸷.砠T楳瑡ice


$75










P牯j散eo爠却慮T


P噃

3”x10’

4

$9⸲5

$37

$37


坯oT⁳ 牡r

1’x1’x5/8”

5







䉯砠n慩aV

1 ¼”

1





Ton慴aT


啓䈠B硴敮e敲

12’

1

$12

$12

Ton慴aT


䕸E敮獩on⁣o牤

20’

1





Ton慴aT


噇V⁥硴敮e敲

12’

1

$25

$25

Ton慴aT








Ho獴VCompu瑥r


塰a捨cne

M楮: 1䝨zⰠ

1

$200

$200

Ton慴aT


Mon楴or

17”

1

$100

$100

Ton慴aT


䭥ybo慲a


1

$10

$10

Ton慴aT


MouVe


1

$10

$10

Ton慴aT








呏呁T





$1089

$719

Fig. 7


Estimated Bill of Materials






12


Risk Factors


Three primary risk factors have been identified during the initial design phases of this project. The
battery life

of the vehicle declines greatly after 2
-
5 minutes of use, and must somehow be addressed if
the R/C vehicle is to be effective for the duration of one or more games. The mounting of the projector
and camera at an effective distance, while still maintaining

safety and the navigation of the ghosts
within the playing area, must not interfere with anything in the playing area.

Finally, the image
-
processing algorithm used to locate the player vehicle by color is not known to the design team at this
time, and res
earch into such algorithms must be conducted.


Some other design concerns include the lighting conditions that the c
amera will have to face in order to
obtain

the position of Pac
-
man. The construction of the mat maze with sufficient precision and proper
a
lignment with the projector and camera

is also of concern.


Multidisciplinary
Design
Aspects


This project is required to be a multidisciplinary design project. The following multidisciplinary design
aspects will be part of it:

1.

Hardware

a.

Maze Design &
Construction

b.

Vehicle Selection & Modification

c.

Projector Support

d.

Integration of webcam & projector

2.

Software

a.

Image Processing


determining where Pac
-
Man is via color
-
recognition

b.

Artificial Intelligence


maze transversal by ghosts

c.

Other Algorithms


collisi
on detection

The project
was designed specifically as a more mechanical approach to what would normally be a
purely software
-
based game. As such, it incorporates a number of mechanical challenges, including the
construction of a maze that it is possible to

project the Pac
-
Man game onto and a support structure that
can safely hold the projector and webcam at a suitable height. Computer Engineering as a discipline
already contains many software considerations within it; as such, it was decided to use image pr
ocessing
to widen the variety of algorithms present in the project as well.


Other Considerations


Per requirements, the project has been analyzed with respect to the following aspects:

1.

Economic:

This project is not expected to have any significant econom
ic impact, even if it were
to go into full
-
scale production. Pac
-
Man is a decades
-
old, classic arcade game. This project
simply provides a new spin on the game’s original incarnation, and is not expected to have any
wide
-
reaching effects.

13


2.

Environmental:

T
he components of this project that present any environmental concerns are
PVC pipes and electronics. PVC, in and of itself, creates pollutants when it is produced and
disposed. However, much effort has been put into developing ways of recycling PVC, so the

environmental effects of this project are expected to be minimal. The electronics of the project
that could have environmental effects are the projector and the batteries used by the remote
-
controlled vehicle. For all environmental aspects, proper disposa
l and/or recycling are more
than enough to mitigate concerns.

3.

Ethical:

Patents and/or copyrights are an ethical concern for this project because it recreates a
game whose rights are owned by an existing company. However, the small scale and non
-
profit
goa
ls of the project are expected to remove all such ethical risks. No other ethical risks are
foreseen.

4.

Health and Safety:

There is a safety concern with the fact that a projector will be mounted
around eight feet above the ground. If it falls, damage and/o
r injury may result. This will be
addressed by careful design of the mounting mechanism to maximize rigidity and strength and
minimize the possibility of collapse or breaking. Nevertheless, user and onlooker caution will be
necessary to avoid knocking the
supporting structure over.

5.

Manufacturability:

At the current design stage, there is no method specified that would allow
this project to be quickly and easily manufactured. It must be hand
-
assembled. To enable
manufacturability, the maze would have to be created from modular walls that would allow
re
configuration and the support stand would have to be foldable and/or possible to be
assembled and disassembled. Such considerations are currently beyond the scope of this
project.

6.

Sustainability:

Sustained use of this project runs into the following issue
s: vehicle battery life,
projector filter, projector bulb, and general wear
-
and
-
tear of various components. Battery life is
a significant issue because the battery life of a small vehicle is only on the order of several
minutes. The projector filter will n
eed to be replaced every several months and the projector
bulb will need to be replaced every several years. Wear
-
and
-
tear, assuming considerate use of
the project, will not present a significant problem except on the order of years of use. Of all of
these

issues, battery life is the only one that will be addressed.


The project was found to have few, if any, social or political ramifications.


Conclusion


The
project proposed above

is a recreation of the classic Pac
-
M
an arcade game, except with a
mechanical
twist that has the player controlling a physical, remote
-
controlled Pac
-
Man robot. A webcam
will be used to track Pac
-
Man’s position in the playing field
, and a

host
-
PC will be used to run the game
application, whic
h will keep track of game
-
play status and project it onto the playing field. The game will
continue until the player is caught by a ghost or the player gets to all white pellets.
This project was
chosen due to its expected wide appeal and due to the fact t
hat it brings several different technical
areas together.
The project is expected to be a design experience that will produce a fun, playable game.


14


Acknowledgements


The Pac
-
Man arcade game was originally developed by Namco and is copyright Namco
-
Bandai G
ames,
Inc.