This repository contains the code developed for the ELEC50009 Information Processing Module as part of the 2nd year EIE course.
The IoT system designed by our group is a multiplayer maze game. The game consists of 2 modes: The Maze Race and Dodgeball. The Maze Race is a race between players to reach the goal to progress to the next level. Dodgeball is a competition between players where, upon collision, the slower moving ball loses a life. The gamecurrently supports up to 4 players but can be played with players missing. The game uses the FPGA as a controller for the balls. Simultaneously, on the machine runninggame.py, the player can view the position/movement of their ball relative to others in the GUI on a local PC.
- Muhammad Haaris Khan
- Mahanoor Syed
- Brendon Ferra
- Ifte Chowdhury
- Savraj Sian
- Emma Wardle
The Maze Game Rules:
- Use your FPGA to guide the ball through the maze to the goal.
- Do not fall into any other holes or you will lose points.
- Pick up powerups to gain an advantage and extra points.
- Reach the goal before other players to get the maximum points.
Dodgeball Rules:
- Tilt the FPGA towards the other balls, where the faster ball kills the slower ball.
- Pick up powerups to gain an advantage over other players.
- Keep playing until all other players have 0 lives left.
The AWS EC2 server hosts the scores database and python scripts controlling the score database. It is also responsible for sending game information to the FPGA and vice versa. Scripts: CreateKillsTable.py CreateScoresTable.py LoadKills.py LoadScores.py UpdateKills.py UpdateScores.py DeleteKill.py DeleteScore.py
The game is written in Python and uses the Pygame library for the GUI. The game is run on a local machine and the FPGA is used as a controller for the balls. The game is run by executing the game.py file. Communication between server and game was done using secure TCP sockets. Communication between server and FPGA was done using serial communication.
The movement of the ball is directly related to the movement of the FPGA. The game conceptually presents the FPGA as the surface on which the ball is rolling, where increasing the tilt (at any angle) increases the ball’s acceleration in the direction of that angle. Steps for running the NIOS II code:
-
Compile the
Golden_Top/DE10_LITE_GOLDEN_Top.qpffile as the top-level entity to generate the.sopcinfoand.elffiles. Click the blue play button to initiate the compilation. -
Establish a connection with the DE10 board by accessing
Tools > Programmer. Use the Auto Detect option to locate and run the appropriate file. -
Launch Eclipse within Quartus.
-
Create a new NIOS II project by right-clicking on an empty area and selecting the project template option. Utilize the previously generated
.sopcinfofile and choose the Hello World template (not Hello World Small). -
Replace the contents of the
hello-world.ctemplate file provided by Eclipse with the code from thelocalProcessing/finalfile namedhello_world_final.c. -
Generate the Board Support Package (BSP) by right-clicking on the
_bspfolder and selecting 'NIOS II > Generate BSP'. -
Build the project by right-clicking on the main folder and selecting 'Build Project'.
-
Run the code by right-clicking on the same folder and selecting 'Run As > NIOS II process'.