From UBC Wiki

Battle Simulator

Authors: Wyatt Verchere and Gurjosh Jhinger


What is the problem?

To determine if Haskell is suitable for building a simple battle simulator, similar to Pokemon.

In a game like Pokemon you battle an enemy using various moves to win. Certain enemies may be weak to one type of attack but strong against another kind, while the player may be vulnerable to a certain kind of type and strong against another type (similar in idea to rock paper scissors, but instead of losing automatically it would just determine how much damage is done.)

What is the something extra?

The enemy must pick moves that make sense for the situation. It will also want to take advantage of the players weaknesses to get the upper hand.

To implement this will attempt to utilize machine learning for the enemy ai to pick what moves it will use. This will be done either through a decision tree that the enemy ai will go through when deciding what to do on it's turn.

What did we learn from doing this?

What is the bottom line?

The bottom line is Haskell allowed us to create a battle style game similar to Pokemon that works well as demonstrated in our final project. We found Haskell's libraries by utilizing Cabal were useful in our project, however more documentation would be helpful.

Haskell allowed us to modify values with relative ease, allowing for things such as damage and inventory to work well as opposed to something like Prolog where it would've been more difficult to implement things like this.

We organized our code by separating it into distinct files (ex: one for our decision tree, one for our player, one for the battle) and brought the whole thing together in RPG.hs which worked really well for our project.

Overall, we learned Haskell is a powerful language with the ability to do a lot of interesting things, it just takes a little more effort than if it was a more popular language with more support and documentation.