Crazy Drivers

Feb. 2021 - Jun. 2021

Back to engineering page

miniature This project targeted the execution of a multiplayer video game onto DE10-Nano boards.

Setup

The setup was the following: 2 DE10 boards, with each its MTL touch screen and linked by an Ethernet connection. The boards contain a Cyclone V (dual Cortex-A9 + 110k LEs of reconfigurable logic) and numerous I/Os like SPI, UART, HDMI, GPIO, etc. They also embedded an acceleration sensor. The boards were configured with mAbassi, a real-time OS that simplifies the task scheduling for the programmer. With these devices we were supposed to think of a game and implement it using C and the FPGA portion of the board (coded in Verilog).

The rules

We came up with the idea of a car chasing game, where 2 taxis would battle for winning clients. The rules were simple:

  1. A client would randomly appear on the map. Both drivers would run to get to him.
  2. The first taxi to hit the client catches him and must now deliver him to his destination. This destination is not shown to the driver not carrying the client
  3. The goal of this last player is to hit the taxi containing the client so that the client leaves the cab in anger.
  4. The G-sensor was used as a nitro boost.
  5. If the cab holding the client makes it to the flag, he wins points.

Demonstration

Click the image herebelow to see a short demonstration of the beta version of the game!   Demonstration of crazy drivers  

How it works

The following figure shows the top-level organization of the game. Each box is a mAbassi task, i.e. a proto-thread with a given task to execute. To implement the timer we used a PIO block embedded in the FPGA logic. The Ethernet connection is divided in two functions, one that sends and the other that receives. task_orga

To optimize performances, we used different strategies like dual frame processing, where data for the next image is processed while the current one is diplayed. dual_frame To detect the collisions between the players and between the cars and the walls, we used a mask. collision_handling