Bewildered

Bewildered is a 3rd person combat-adventure game where you play as an adventurer who with the help of a monster has to save the island it inhabits. 


Link to the game: https://store.steampowered.com/app/1768540/Bewildered/

Details:

3rd-year project

Team: 21 people

Time: 16 weeks

Engine: Unreal Engine 4


Team Composition:

PR: 5

DP: 6

VA: 10

My biggest contribution to this project is the work I have done on the AI of the monster. At first, we had to figure out which AI architecture we were going to use which required research. The ones we were deciding between at the start were: GOAP(Goal Oriented Action Planning), Utility theory, and HTN(Hierarchical Task Networks). While researching we discovered STUP(Short Term Utility Planning) which appears to work the best for the AI we want. STUP is a combination of GOAP and Utility theory which allows the AI to think slightly ahead and evaluate multiple options until it decides what it will do.

This video is the inspiration for STUP that we used. We made some slight changes those being the order in which we do the algorithm. Unlike in the video where they start by creating plans for each goal we first eliminate those that cannot be done/aren't desired at the given time. Now we make plans for all of the remaining goals which saves time because we already eliminated some goals that were never going to happen. I will go into more detail about how this works below.

Explanation on how STUP works

To explain STUP I will be using the flowchart that can be seen above here. If the image is hard to read you can click it to enlarge the image. To make it easy to understand I will show which step we are at with an example on the right side. There is a more detailed explanation and an in-depth one that has code snippets for those interested.


STUP works by making a goal for every action it can do on every object in the world. All these goals are scored based on how useful they are at the moment and if they are currently possible. STUP uses these goals which each have a state which you need to reach to do the action used to complete the goal. Before we start STUP we need to know in what state we are, what action we can do and conditions those actions have for activation and their effects.


Now we have everything to start STUP and we get to Utility Step 1 where we remove every goal we cannot do or are very undesirable given the current situation. Each goal has a given rank based on the action used to achieve it the higher the rank the more important it is so in Utility step 2 we remove every goal aside from the goals with the highest rank. Now we have reached the GOAP step where we make a plan for every goal using the given actions that can be done. With this, we can eliminate the goals that couldn't be reached and get the cost for completing the plan.


Next, we do Utility step 3 where we put all the goals that are very irrelevant on a list to be removed based on a certain threshold. If the relevance of these goals combined exceeds the threshold they will not be removed. This is explained best in the in-depth explanation. Lastly, we reach Utility step 4 where we pick a random goal but the importance of the goal has an impact on how likely it is to be chosen. Now we have a plan we can do to reach the goal and we can start executing it.