Advertisement

Prototype II

Not rated 19,930

#GPS #digital compass #WiFi #central server #movement tracking #laser tag #position vector #game system
Prototype II
Prototype II

Description: The objective is to develop a system that enables residents to engage in a movement-based game akin to laser tag. By utilizing GPS and a digital compass, the system tracks the localized movements and position vectors of players. This information is then employed when a player wishes to target another player. All data is communicated via WiFi to a central server, which processes the information and generates gameplay statistics. The device comprises an Arduino Uno that gathers data from a GPS module and a magnetometer, transmitting the data wirelessly to a router through a WiFly Shield. Most of the components are securely housed within a custom-designed enclosure for the Arduino. The server application is programmed in Python 2.7, utilizing libraries such as Pygame, Twisted, Zope Interface, and PGU-0.1.8 (pygame GUI). The application operates using Twisted’s reactor as the foundation, which periodically invokes PGU’s event handler. The reactor manages networking and real-time scheduling, while the event handler oversees GUI interactions and rendering. A flow chart illustrating this process is provided below. The program is structured based on Andrew's multiplayer game framework from a previous class, which offered an asynchronous reactor with networking and GUI capabilities. A straightforward functional GUI was incorporated, and data is retrieved from the Arduino at two-second intervals.

The proposed system incorporates several key components to facilitate the gameplay experience. The Arduino Uno serves as the central microcontroller, interfacing with both the GPS module and the magnetometer to obtain real-time positional data and orientation. The GPS module provides latitude and longitude coordinates, while the magnetometer offers directional information, allowing for accurate tracking of player movements.

The WiFly Shield is integrated with the Arduino to enable wireless communication. This shield connects to a local WiFi network, allowing the Arduino to send data packets to the central server. The server, running a Python application, processes incoming data and updates the game state accordingly. The use of the Twisted framework allows for efficient handling of multiple connections and asynchronous operations, ensuring smooth gameplay without lag.

The user interface, developed using Pygame and PGU, provides players with visual feedback on their positions and game status. The GUI displays essential gameplay elements, such as player locations on a map, scores, and other statistics. The event-driven architecture of the application ensures that the interface remains responsive to player actions.

Data retrieval from the Arduino occurs at regular two-second intervals, ensuring that the server maintains an up-to-date view of player movements. This frequent polling allows for real-time updates, enhancing the interactive nature of the game. The overall design emphasizes modularity and scalability, enabling future enhancements and additional features.

In summary, the movement-based game system leverages a combination of GPS technology, wireless communication, and an interactive user interface to create an engaging experience for players. The careful integration of hardware and software components results in a robust platform suitable for multiplayer gameplay.The idea is to create a system that allows the residents to play a movement based game similar to laser tag. Using GPS and a digital compass we track their localized movements and position vector. That information is used when the player wants to fire` upon another player. All the information communicated via WiFi to central server, which processe s the data and outputs game play statistics. What did you build How did you build it Be as specific as possible. Include pictures and or video that directly illustrate description. Give enough explanation that somebody of your capabilities could duplicate your results. A step-by-step set outline of what you did is appropriate. The device consists of an Arduino Uno that collects data from a GPS and Magnetometer and sends the data wirelessly to a router using a WiFly Shield. Most of this is safely stored inside a box custom designed for the Arduino. The server program is coded in Python 2. 7 using the following libraries: Pygame, Twisted, Zope. Interface, PGU-0. 1. 8 (pygame gui). The program uses Twisted`s reactor as the base, which periodically calls PGU`s event handler. The reactor controls networking and realtime scheduling and the event handler controls the GUI interactions and rendering.

A flow chart of this activity is shown below. This program is designed using the core structure of Andrew`s multiplayer game from another class. This core structure provided an asynchronous reactor with networking and GUI support. A simple functional GUI was added and then data was retrieved from the Arduino at 2 second intervals. Here is the code:

Related Circuits