Giter VIP home page Giter VIP logo

287project's Introduction

BattleBoard

ECE287 Final Project for Dr. Jamieson's Fall 2021 Section B
Authors: Rob Lytton ('24) & Erik Johnson ('24)

Project Description

Our project is a 2-player turn-based strategy game inplementing a PS2 keyboard as an input and a VGA display as output. The goal is to defeat the other player by attacking.

Background

For our project, we wanted to replicate Rob's own personal game he had programmed in Java. The original game was a side-project with the inspration being to further explore the use of Java, and to create a lineup of characters akin to the Marvel Cinematic Universe.

The game is played on a grid of squares output on a VGA output. Each player is a character that has its own unique set of abilities and base stats. The game is played in a turn-based fashion. Each player takes their turn to move and attack. The turn ends when one player is done attacking, allowing the other player a chance to move and attack. The game ends when one player's health reaches 0. The winner is the player with the highest health value.

Design

VGA Output

VGA Output is controlled via a driver module that uses an address translator to translate x and y coordinates to a pixel address in the VGA memory space. It also accepts a color value and writes it to the pixel. (Depending on the size of the color values and the sizes of pixels, the FPGA may run out of memory.) To avoid any issues with memory, the color values are 3 bits, therefore the VGA output is limited to 8 colors. (black, white, red, green, blue, yellow, cyan, and magenta)

PS/2 Keyboard Input

The PS/2 Keyboard is connected to the FPGA via its onboard PS/2 port. The signals from the keyboard are sent as 8-bit values to the FPGA. Referencing the datasheet for the keyboard and the PS/2 Protocol, the values for the specific keys we need were hardcoded into the controller. The arrow keys are used to adjust the position of the characters and cycle through attacks. The enter key is used to confirm the attack and movement of the characters.

LCD Display

The Altera DE2-115 FPGA board has an onboard 16 character x 2-line liquid crystal display (LCD). The Hitachi HD44780 (in this instance) has specific controls for different functions and has 36 spaces for 5x8 dot characters. The LCD driver module accepts a 256 bit character string and writes it to the LCD.

Video Demo

Link to video demo

Controls

Key Description
Enter Advance Screen/State
Backspace Reset Game
W/S Cycle through characters, attacks, aim, and y-axis movement
A/D Used to select x movement
P Show speed of character (character selection) or spread of attack
H Show health of character
I Show distance between p1 and p2
L Show ammo left in an attack
O Show the dodge value of a player
R Show the range of an attack (attack selection)
1 Show Player 1 Position
2 Show Player 2 Position

Gameplay Example

Each player selects their character. Players select be the same character, however it is not recommended as it could create confusion between who is who.

Potential Improvements

This game is far from perfect. The hardware limits of the Altera DE2-115 FPGA board and verilog in general makes it difficult to implement a fully-functional game with complex graphics even close to the java version. However, this doesn't mean that there aren't other ways to improve the game. A small list of things:

  • Add more characters
  • Add more attacks
  • Improve graphics (centered grid, character models, etc.)

Credits

LCD Controller - Isaac Budde
VGA Controller - Sibo

287project's People

Contributors

ejohnson9912 avatar roblytton avatar

Watchers

 avatar Isaac Budde avatar

Forkers

roblytton

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.