top of page

HTC Vive / Oculus Wizard School

2017-2018

Liar's Brew is a VR wizard academy game with a focus on spell casting, potion making, and mischief!

OBJECTIVE

Create a wizard school VR game where cheating is an encouraged mechanic. Using a mix of iconic and inventive pillars for how magic is used in the world, we want to narrow the focus of the gameplay into the first 5-10 minutes of the player putting on the headset. 

My personal objective as both a systems designer and AI programmer is to guide the team down a path I feel allows them the most flexibility in honing the experience. Most VR experiences are under 10 minutes. This being said, I want to share my experience of developing a 10-30 minute experience, with an intense focus on the first 5 minutes of play.

Working in UE4 makes it very easy to develop for both Oculus and Vive. It also makes development when using blueprints extremly quick. Most of the team picked up blueprint programming within the first 2 weeks. This has allowed us to make great progress that is already leaps and bounds ahead of my first VR game in terms of schedule.

AI & Systems

While I have begun developing AI, most of my work has been in prototyping and designing what desired behaviors the NPCs should posses. I've spent a good portion of my time on the project working with one of the designers to create a mini crafting system where the player prepares ingredients to cook up potions.

I've also worked with procedural mesh slicing in my VR Ninja project, so the process has been pretty quick to implement. I've worked on the ingredient system as well as the potion crafting system with the designers so that we can plan the system out first, and avoid creating an unstable groundwork. Through inheritance, modular functionality, and pre-meditated groundwork building we've created a system that allows us to easily tweak and modify the goodies the player gets to chop up and toss in the cauldron.

 

While working on the project, I often try to walk designers through my path of reasoning so that they fully comprehend how I arrive at the decisions I do. This helps them to become better problem solvers as they learn to think for themselves, but it also allows them to ask the big questions of how their systems should function, before a single line of code or blueprint is made.

Procedural Student Personalities

One of our goals with AI, was to deliver a believable experience via the other students at the school. The player interacts with other students by helping them or even sabotaging them. These interactions that are on opposite ends of the morality scale often flutter within the grey area between good and evil. We wanted to create student AI that reflects the human like personalities. People often abide by genetic characteristics while also maintaining a dynamic view of the world around them that influences how they act in certain situations.

Our Classmate AI allows us to procedurally generate students with human-like traits to influence their interactions with the player. Using Fable's Reputation system as a foundation, we designed a system that uses both a Global and Local Heuristic to influence the player's "reputation" within an individual's eyes. When you combine the result of this influence with the student's personal trait influence, we get an 'Absolute Opinion' of the player.

The Absolute Opinion drives the AI to enable or disable certain actions/responses as the game progresses. For example:

Stealing a potion ingredient from a student reduces the Local Opinion of the player for this specific student; simultaneously increasing certain personality properties such as anger and antisocial behavior. This influence now causes the player to be unable to study with this student, as their Absolute Opinion is now out of favor of the player.

Tools for Creating Better AI

I've spent a large portion of our development working on a tool for our designers to generate personalities of AI. Using procedural generation in combination with the Reputation System mentioned above, AI will react differently to the player with human-like variance. 

One topic we've wrestled with before is, "how much AI is too much AI?" 

We were speculative of making  the AI dependent on so many random variables that the game experience becomes clouded and chaotic to the player. To mitigate this, we came up with an assortment of personality traits that can be viewed as positive and a list of opposing traits that were viewed as negative.

Using two opposing traits rather than a single trait with negative and positive values allows us to create a more realistic individual. For example: somebody might be primarily lawful and think that cheating in school is wrong. This means that they are prone to recognizing suspect behavior and reporting it in to the teacher. However, if their personal view of the player + their unlawful nature outweigh that general desire to be lawful, they will refrain from telling on the player. This better reflects a human's personality than say, a single value boiling down to: "I'm always kind of lawful in any situation..."

AI Behaviors

A large portion of my work on this project involves creating the AI's behaviors. Unreal Engine has a strong visual editor for behavior trees that allows for close control of how our students interact with the player and world around them. Since cheating is a large focus of our game, we grouped together as a team to decide what behaviors made sense and under what conditions they could occur.

Above is an example of how our students react when distracted. The player has various means of distracting their colleagues, that when used properly, can assist the player in cheating. On the other hand, distractions can draw attention to the player, and make it more difficult to bend the rules.

The red debug bounding box creates Distraction events. The pink debug box in the background creates a different type of event called Suspicion events. Distraction events override the AI's behavior while Suspicion events raise the classroom's Suspicion level. The player will be caught by the professor and be forced to retake the test if the Suspicion level gets too high. While events can happen anywhere, they are only useful if someone is there to observe them. Suspicion/Distraction events that are not seen by the AI are ignored, encouraging the player to be crafty in their approach. 

The students operate primarily in a state machine, carrying on from one task to the next in a sequence until they've completed a potion.

Part of what makes behavior trees messy is their ability to abort a behavior. The state of that behavior must some how be remembered in order to return to it after the aborting task is completed. For example, when a student's cauldron begins to boil over (lights on fire), the students stop what they're doing and reach for their spoon in an effort to quell the flames.

This kind of behavior works very well for a simple state machine pattern, but becomes increasingly complex as trees get larger and it becomes more unclear where the AI should resume after being interrupted.

© 2020 Josh Painter

bottom of page