Grid Wars:
Project Functional Description:
Grid Wars is an original trading card game with an accompanying interactive game board. Grid Wars aims to automate sometimes complicated game mechanics and provide a more engaging user experience.
The board itself is a 27”x26”x3” wooden box. The board is split into three sections along its width. There are two sections where players will place cards each taking up 9” of the width. Sandwiched between the card sections is an 8” section that will contain the screen. The screen itself is a 13.3” LCD screen that is centered on the board (dimensions ≈ 12.8” x 8”). To the left of the screen in the center section there will be a large push button. To the right of the screen in the center section, the RFID sensor will be housed. Each of the card sections will have slots for 12 cards in a 6x2 matrix. Card positions are read into the system via IR sensors housed below the board surface, each card slot contains 2 IR sensors. The first IR sensor is used to determine whether a card is there or not, the second sensor is used to determine if a card is tapped or not (tapped is a colloquial term for turned 90 degrees in TCGs), therefore, the second IR sensor will be offset to the left of the first.
The game will be played with two opposing players. Each with their individual deck of cards, players will begin the game with 5 cards in their hand. Once plugged in, the screen will prompt users to start the game by pressing the push button. The game is turn-based, and the loop will remain until the game is finished. Players begin the game with 20 personal hitpoints, the game is over when a player's hit points reach zero.
The first part of the loop is the placement phase. The placement phase is the only part of the game where players are allowed to scan in cards. The aforementioned RFID sensor is the way the system will recognize cards and their types. Each card has an RFID sticker attached to it which the system will recognize, the specific ID of the card will be relayed to the microcontroller. There are two main types of cards: spell cards and creature cards. Creature cards are simple, they have health points and attack power. All creatures are placed on the board with summoning sickness (single turn “fatigue” which prevents creatures from attacking immediately after being placed). After scanning, if the card is a creature card, the player will be prompted to position the card on the board in one of their 12 available slots. The position of the card is important to game mechanics and is read into the system with IR sensors. If the card is a spell card its effects will either automatically activate or require a user input for targeting. Spells are cards that affect game stats without having a physical presence on the board e.g a spell card may buff the attack power of all the creatures in a lane. Players may scan as many cards as they want, provided they have enough mana to afford them. Every card has a mana cost which is subtracted from your total mana pool. Your mana pool is a resource that increases linearly with each turn (turn 1 your mana pool is 1, turn 2 your mana pool is 2, etc.). Once a player is finished placing cards they will press the push button to move to the next phase.
The second phase is the attack phase. Now, with cards placed on the board, the player will be able to attack their opponent. Provided the player has creatures on the board not under the effects of summoning sickness they will be prompted to select creatures to attack. To select a creature to attack, players will tap the card (rotate 90 degrees). They may tap any card not under the effect of summoning sickness to attack. The 6x2 card matrix can be broken down into 3 groups of 2x2, we’ll call each group a camp. Creatures can only attack camps that directly oppose them on the board. Therefore, there are three lanes that players can utilize each with opposing camps. Players may tap as many cards as they like to attack, once they are prepared to attack they will press the push button to move to the next phase.
The final phase of the loop is the passive defense phase. This phase is passive because the user isn’t required to make any inputs for the phase to progress. The attack power of all selected attackers in a camp is added together and will attack down its lane. Defenders in the opposing camp take on damage, the total amount of damage they can take before disappearing is their health points. Defenders have a camp priority which they adhere to. The front right card takes on damage first, then the front left, then back right, then back left. If the damage overflows past the camp's total hit points or there are no defending creatures the damage is absorbed directly by the player's health. Once this phase resolves the player will press the button to pass their turn. The loop will repeat until the end of the game. Once the game has terminated, the push button can be used once more to begin a new game.
All sensors will be managed by a microcontroller. The sensor data from the push button, RFID, and IR matrix will be collected by the microcontroller and transmitted, via USB, to a single-board computer. The SBC will handle the game logic and display graphics on the LCD screen. The device will be powered by a standard American outlet. Wall power will be transformed down to 12V to power the screen’s backlight. The 12V will be bucked down using a team-designed regulator to 5V. This 5V will power the SBC and the IR sensor matrix. The SBC will provide power to the microcontroller which will in turn power the RFID sensor and the push button.
As one of our team's stretch functionality, we would like to display graphical animations onto the LCD screen using a SBC. One possible implementation of these animations may include card interactions such as cards battling one another during the attack/defense phase. This would include images of the card art being displayed and clashing with one another until the victor card is still standing, then the screen would go back to its default state. Another possible implementation of these animations may include touchscreen functionality of the LCD. This would allow players to click-to-target spells onto individual creatures actively on the board, then a short animation would play based on the chosen spell being played.
As another one of our team's stretch functionality, we would like to output game audio with a speaker using a breakout speaker module. The speaker would be connected to the SBC which would both power the module and output a PWM signal.
Project Specific Design Requirements (PSDRs):
- PSDR #1(Hardware): An ability to convert 12V DC power from a wall transformer to 5V using a team designed DC buck regulator to supply the SBC.
- PSDR #2(Hardware): An ability to detect card placement/positioning using IR sensors with a matrix scanning system to demux the amount of GPIO pins utilized on the microcontroller.
- PSDR #3(Hardware): An ability for an RFID sensor to send data to an ESP32 microcontroller through SPI bus communication.
- PSDR #4(Software): An ability to determine the specific card abilities being played using data gathered from RFID Tag Identification.
- PSDR #5(Software): An ability to take input data from placement sensors and card identification from a sensor system, calculate game state, and output relevant game data to a touchscreen LCD.
- Stretch PSDR #1 (Software): An ability to display animations between card interactions via a touchscreen LCD.
- Stretch PSDR #2 (Software): An ability to output game audio via a speaker