Fire Mbed Beta

Creators: Jake Ramey, Julio Morales-Perez, Milo Pan

Overview

Fire Mbed Alpha is an implementation of a player versus AI lightweight version of Fire Emblem on a single mbed. Combat is simplified but does include the series's iconic weapon triangle. The game is controlled using an analog joystick similar to those found in PlayStation controllers and pushbuttons. A toothbrush motor was wired up to create a makeshift rumbler for haptic feedback. There are 7 chapters or scenarios to play through, and it is possible to start playing from any of the maps.

GUI

The GUI implemented for this project serves as an additional screen for the game. It has four buttons: Load Game, Save Game, Transfer Map, and Start.

Load Game opens a file open dialog, requesting a text file to process. The save file consists of a 12-character array, the first character designating the level and the subsequent 11-characters denoting the status of the characters on the map. The GUI sends a "Load file" command to the mbed, sending the array to the mbed while saving the level. Transfer Map sends a "Send Data" command to the mbed, sending level-specific map and character data to the mbed, which then loads the rest of the game.

Start updates the GUI's map with the relevant map and characters and awaits a signal that combat has begun. Once combat begins, the mbed sends a three-character array. The first character indicates whether combat is over, and the latter two characters represent the attacking and defending characters, respectively. The frames on the right of the map update with new battles as long as combat continues on the game. When combat ends, the mbed determines whether it wants to save progress. The Save button is then pressed if the player wishes to save data; it opens a file dialog, asking for a file name to save to. The mbed will have sent a 12-character array to the GUI, which then saves it to a text file.

Parts

  1. uLCD-144-G2
  2. 3x pushbuttons
  3. Sparkfun Analog Joystick
  4. Standard DC Motor
  5. H-Bridge
  6. mbedLPC1768

Pin Outs

uLCD Pinmbed Pin
+5vVU
RXp9
TXp10
GNDGND
RESp11
Analog Joystickmbed Pin
VccVOUT
VERTp18
HORZp19
SELp20
GNDGND
H-bridgembed Pinmini USB
breakout board
motor
VMVCC
VCCVOUT
GNDGNDGND
AO1+ lead
AO2- lead
PWMAp21
AIN2p25
AIN1p24
STBYVOUT

Pin Outs for second Mbed

uLCD Pinmbed Pin
+5vVU
RXp9
TXp10
GNDGND
RESp11

Pushbuttons

unit select pbmbed Pin
Top pinsp5
bottom pinsGND
end action pbmbed Pin
Top pinsp7
bottom pinsGND
end turn pbmbed Pin
Top pinsp8
bottom pinsGND

How to Load a Map on the MBED

  1. Press "Load Game", and select a save file (.txt).
  2. Press "Transfer Map" and wait for the mbed to flash LED2.
  3. Press "Start" to mirror the map on the uLCD screen to the GUI
  4. Use the buttons and joystick to start playing!

How to Play the Map

Player take turns moving units and doing combat against the AI. The joystick stick is used to move the cursor and move units. Moving the analog stick towards an enemy will do combat. Blue units are the player's, red units are the AI's. Each unit is only allowed to move a set number of spaces based on class. Push button 5 selects the unit for movement. Push button 7 ends unit movement for when no combat has occurred. Push button 8 ends the player turn. After combat the mbed's USB serial port prints combat results to the computer. When the player tries to move onto a friendly unit or onto a impassable object, the motor vibrates. Victory is achieved when the enemy is routed.

Future Work

Problems:
We ran into a couple of problems trying to make this game work. Sound refused to work. The readable flag triggered prematurely when the two mbeds attempted to communicate. The LCD screen only had one drawing layer, which made creating complex maps extremely difficult. With two drawing layers, one layer could be the entire map, and the second could be the individual sprites moving around. This would not require redrawing portions of the map every single time a unit moved.
Future Work:

  1. Use a two layer LCD screen. This would increase our variety of units, because currently our drawing limitation prevents us from having sprites bigger than 16x16 pixels
  2. Make the link to the mbed wireless, and package the setup into small handheld. The true end goal is to have this portable game device where you can download maps from the GUI and have open source scenario design for anyone quickly create custom maps.

/media/uploads/jaymp16/gui.png

Import programFire_Mbed_2_0

test with new stuff ai, healing, ranged units, magic, sending char for next map untested


Please log in to post comments.