EmoSphere

This project was made in 2017. It’s made in C# and Unity. This was a group assignment of 6 people and was made for an external client which was handled through my school.

Because were working as a team, we used Unity Collab as our source control solution.

The idea of this project was to create a classroom simulator. A teacher in training could use this game to improve his reactions when a student would, for example, hit another student.

Trailer

Gameplay

You are a teacher and your job is to keep your students happy and get them to make their homework.

The game uses a turn-based system in which the teacher starts and can observes his students or assign them different seats.

Class layout

When the teacher clicks the Next Frame button, the students will act and probably start a fight with each other. You can then click on any student and address their behavior by performing an action.

Students

Code

My job during this project was to implement a behavior tree for the students, and add emotions to the tree. The emotions should influence the actions a student would want to perform.

To create the Behavior Tree I used the NPBehave Library.

The implementation of a emotional behavior tree was based on Anja Johansson and Pierangelo Dell’Acqua’s Emotional Behaviour Trees.

The code below shows how I implemented this.

Emotional Class

After I implemented the Emotional Behavior Tree I had to make it work with NPBehave. In order to do so I had to change the Node class so that it would inherit the Emotional class. This meant that every Node in this behavior tree would have Risk, Plan and Time values. These values are used to calculate the weight each action has, and determine which action has the least weight for the student to perform.

Method to decide an action