Final Project Report – Void ()

Concept 

At first, I was pretty much clueless as to what to do for the final project. The idea to do a game came to mind while the others in class were pitching their own ideas. However, since this is Interactive Media, and not Computer Science, I wanted to showcase my hardware knowledge and build some level of interaction between my game and the outside world that doesn’t involve a keyboard. And, so I decided to build an external controller too, a simple joystick in a box. My initial idea was to create a button as well, but since Michael asked us to produce a simple take on our original idea, I decided to scrap the idea of including a button. 

The inspiration behind my game was essentially my childhood memories. Having grown up in the Gameboy Color/Advance generation, I was exposed to games from franchises such as Pokemon, The Legend of Zelda,  Dragon Ball, Dragon Quest and Final Fantasy. These games had very simple graphics, sounds and storylines, unlike the current generation of high spec AAA rating games. However, it was these retro games that left a lasting impact on my mind, and it only felt right to pay homage to the games that made my childhood so memorable.

The structure of the game is simple. Your character, the hero, is on the moon and he fights off space bats and lizards that have invaded the moon. He ultimately discovers a dragon, a.k.a the final boss of the game, and his goal is to eliminate the dragon. 

Implementation

I implemented the game using PyProcessing, which is Processing that executes native Python code. The reason why I chose this over standard Processing that runs on Java is because I was more confident of my programming skills in Python as opposed to Java. Ultimately, this turned out to be a major inhibitor which I’ll explain later. 

The controls of the game were simple, the player moves the characters left, right or up, and if the player comes into contact with any foe with his dagger facing the right direction, the player would inflict damage onto the foe. Otherwise, the player would lose some health instead. In order to create the necessary software aspects of the game, I used the following :
1) PyProcessing IDE – To program the actual game logic
2) Arduino IDE – To program the hardware aspect of the project to receive input
3) Adobe Photoshop – To crop and resize images
4) Character Generator to create Hero Sprite – Can be found here 
5) Sithjester’s RXMP Resources for the enemy sprites – Can be found here.

The actual code itself is below. I used Object Oriented Programming to implement the vast majority of functions, considering how versatile it is to duplicate elements of the same type with slightly different characteristics. Since I had learnt OOP in Intro to CS, and had implemented a game of similar nature, it didnt prove to be too difficult to come up with the logic for the game.

In addition to the Processing code, I also had 4 CSV files, from which I read the contents for each stage. The contents of the CSVs are below.

———————————————————————————

Stage1.csv

Tonberry,800,400,20,585,tonberry1.png,40,40,4
Tonberry,200,400,20,585,tonberry1.png,40,40,4
Silverbat,700,100,16,585,silverbat1.png,32,32,4
Silverbat,500,100,16,585,silverbat1.png,32,32,4
Silverbat,250,75,16,585,silverbat1.png,32,32,4
Tonberry,1280,400,20,585,tonberry1.png,40,40,4
Platform,150,400,200,52
Platform,200,400,200,52
Platform,400,400,200,52
Platform,540,200,200,52
Platform,1000,350,200,52
Platform,1200,350,200,52
Music,openWorld2.mp3

——————————————————————————–

Stage2.csv

Platform,200,350,200,52
Platform,400,350,200,52
Platform,800,450,200,52
Platform,1000,350,200,52
Platform,1200,350,200,52
Platform,1400,450,200,52
Silverbat,800,200,16,585,silverbat1.png,32,32,4
Silverbat,600,200,16,585,silverbat1.png,32,32,4
Tonberry,650,350,20,585,tonberry1.png,40,40,4
Tonberry,900,150,20,585,tonberry1.png,40,40,4
Silverbat,300,150,16,585,silverbat1.png,32,32,4
Music,openWorld2.mp3

——————————————————————————-

Stage3.csv

Bahamut,740,400,47,585,bahamut1.png,94,94,4
Silverbat,150,150,16,585,silverbat1.png,32,32,4
Silverbat,200,200,16,585,silverbat1.png,32,32,4
Silverbat,300,550,16,585,silverbat1.png,32,32,4
Silverbat,1000,250,16,585,silverbat1.png,32,32,4
Silverbat,1200,350,16,585,silverbat1.png,32,32,4
Silverbat,150,350,16,585,silverbat1.png,32,32,4
Silverbat,475,450,16,585,silverbat1.png,32,32,4
Silverbat,875,275,16,585,silverbat1.png,32,32,4
Tonberry,650,50,20,585,tonberry1.png,40,40,4
Tonberry,750,75,20,585,tonberry1.png,40,40,4
Tonberry,900,450,20,585,tonberry1.png,40,40,4
Tonberry,950,300,20,585,tonberry1.png,40,40,4
Tonberry,650,375,20,585,tonberry1.png,40,40,4
Tonberry,1000,750,20,585,tonberry1.png,40,40,4
Platform,50,200,350,52
Platform,150,300,300,52
Platform,250,400,300,52
Platform,450,350,300,52
Platform,450,250,300,52
Platform,850,250,300,52
Platform,750,350,350,52
Platform,650,450,300,52
Potion,175,300,16,585,potion.png,31,31,8
Potion,425,225,16,585,potion.png,31,31,8
Music,boss.mp3

——————————————————————————————-

Stage4.csv

Splash,endingScreen.png,375,200,750,75

——————————————————————————————-
The Arduino code was simpler than I thought. It was just a matter of performing a Serial.print() each time the user moves the joystick. Since I wanted only left, right, up and the button press to be recorded, I ignored the bottom joystick movement.
The code is as follows :

For the hardware part of the implementation, I used a RedBoard, a prototyping shield, and an Adafruit joystick housed inside a laser cut box made of acrylic, However, since he connections to the joystick were very close, it was extremely difficult to solder them securely and Michael’s help is what saved the joystick in the end.
The schematic is as below

.

The main problems I encountered

  1. Cropping the sprite sheets turned out to be quite troublesome, because I’d often end up with half-cropped frames and it wouldn’t animate properly. I think cropping sheets like this comes with practice, since I got it right only after dozens of unsuccessful attempts
  2. PyProcessing does not produce meaningful error messages when code compiles, which means that I might have parse through dozens of lines of code to spot a tiny error.
  3. PyProcessing does not have standard documentation for the Serial library, which meant that I had to use the Java documentation to translate the code into Python, and just hope it works.
  4. Soldering the ends of the joystick proved to be ultra challenging, since they were thin leads close together. Michael showed me a soldering technique for such joints and it worked well.

Further Improvements.

1. I would use have preferred to use Processing in Java, considering the vast availability of documentation for the original version of Processing

2. I would include a button and functionality to make the player able to control when the Hero slashes. I skipped out on this due to time constraints.

3. I would also like to create a better storyline for the game itself, to make it more enriching and engaging.

 

Acknowledgements

Professor Michael Shiloh for his constant support, encouragement and advice throughout the whole journey,
James and Ume for always being there around the lab to make sure we knew the resources we had, plus advice on how to make use of them.
Alex for teaching me how to use Photoshop to crop images,
Jennifer for helping me out with getting the Serial library to work with PyProcessing,
Diego and Laine for helping me out with the joystick and designing the box using http://www.makercase.com/,
Mateo for helping me resolve errors in the logic of my code,
And lastly, the community at the IM Lab who created an amazing work environment and acted as a strong support system throughout the entire process!

Leave a Reply

Your email address will not be published. Required fields are marked *