Transcript Yard Wars
Yard Wars
David Greer
Alex Gross
Ahsen Uppal
Goals
• Wireless, Portable
Development
• Real Time Voice
Conferencing
• Exciting, Expandable
Game Engine
Wireless, Portable Development
• Real-time, asynchronous networking
between many clients, using TCP/IP
• Client/server architecture in emBedded and
Visual C++, using MFC
• Found and improved Microsoft bugs:
– CCeSocket
– CAsynch + Csocket
– MFC Key Handler
Real Time Voice Conferencing
• Account for network delays by buffering on
both ends, handling network problems
gracefully.
• Use non-blocking calls to avoid long waits.
• Minimize delay between recording and
playing by separating the threads.
• Manage time delays between users by
maintaining input and output queues.
Exciting, Expandable Game
Engine
• Object-oriented model for all components:
users, scenery, background, flags.
• Uses GAPI, the Pocket PC Game API, for
full control of all parts of the user interface.
• Easily upgradeable to include sprites
(animations), sound effects, and other
features.
System Specifications
• Tested for Two-Player Mode
• Code is fully expandable, but our group was only provided
with two clients to test.
• Wireless Voice Communications
• Nominal two second delay
• Zero packet loss, using dynamic buffering
• Game Engine Response Time
• Multi-threaded, event-driven program waits for data before
updating state.
• Since the system spends most of its time waiting for data, it
can manage all threads more efficiently.
Dynamic Buffering
Avoiding the Readers/Writers Problem
OnReceive:
• Allocates new
memory for each
incoming audio packet
• Adds new packet to
the tail of a priority
queue (stream), unique
to each player
OnTimer:
• Checks all streams for
data
• If !empty, adds packet
to buffer
• If buffer full, send to
clients
• Clean up memory
Low-Delay Send / Record
Minimizing Delays in Transmission
OnReceive:
• Adds packet into twosecond buffer
• When two-second
buffer fills, play buffer
OnTimer:
• Finishes recording
• Sends recorded buffer
(non-blocking!)
• Starts Recording
Modular Game Engine
Error Correction, Rules Enforcement, Communication
Error Correction:
• Boundary Checking (edges, flag oasis, trees)
• Safe Zones / Sides
Rules Enforcement:
• Capturing Opponents / Flags
• Distance Calculation
Communication:
• Creates character matrix with symbols ($, -, 1, 2 …)
which correspond to graphics in the game
• Handling each player’s moves, rules, and transmitting
data between client and server.
• Player Screen vs. Server Screen
DEMO