AR Board Game Demo
Posted on December 6, 2018 • 4 minutes • 825 words
Table of contents
As a part of my senior project at UCF, I craeted a demo using AR to augment the board game Betrayal At House On the Hill . I’ve always enjoyed gaming of both the digital and phyiscal variety, and was excited about the opportunity to bring a digital twist to one of my favorite board games.
As a part of this project, I created digital recreations of several of the room tiles, created an AR tracking on the game parts in Unity 3D, using Vuforia to handle the minutia of the AR, and created a tool to allow me to snap the digital tiles together, to help optimize the AR tracking elements of the project.
3D Models (Autodesk Maya, Substance Designer, and Substance Painter)
When I started working on assets for this project, I knew one thing for sure: I would want to be able to re-use as much of my work as possible. Betrayal has dozens of uniquie room tiles, and even though I was only planning to make a demo, with a handful of these rooms, I knew that I wanted to have a few room models templates that I could re-use, and I wanted to have some materials that I could use in substance painter that I could use to paint each room uniquely, and still let me have a consistent overall style.
For the rooms, I started off creating two template rooms, one with a wainscoting on the lower half, and one without. These would server as the templates that I could then texture as many different ways as I could come up with, and would cover 75% of the rooms. I also needed to create a few “hero” rooms, where the card art doesn’t fit the description of “box” or “box with extra extrusion”.
After that I made a bunch of props that would be used to fill in the rooms, and add life and story to the scene.
Once I had some models, I needed to design some substances to paint onto my models. (see what I did there?) I wanted to create something that was stylized, to fit with the painted aesthetic of the game, and ended up creating three materials that I would use as a base to paint over in Substance Painter. To make them more flexible, I also wanted to set up a series of controls that would allow me to tweak the design in Substance Painter so that I could re-use the setup, and have lots of different effects, while maintaining a consistent style.
Once I had completed all of these, it was pretty simple to import them into Substance Painter as smart materials, and create an awesome variety of rooms and props for bringing the game to life.
Implementation (Unity 3D)
When it was finally time to put all of this together, I ended up using Vuforia to handle the AR implementation. It’s a great framework, has great tools for managing AR scenes and multiple types of tracking. For my project, I made use of the image target tracking, and the tiles from the game made great tracking targets!
The real challenge of this for me, was coming up with a long term solution for managing multiple game tiles in way that wouldn’t bog down vuforia. Basically, the more image targets the system has to keep track of at once, it starts to slow down as they all take up more and more processing cycles. Since this game would often have dozens of targets on the board at any point in time, I wanted a way to consolidate what the engine had to look for.
To solve this problem, I set up a tool that would allow the tiles to snap to one of the root tiles for the game. Once they were attached, the engine could stop tracking those targets, and just focus on the four root tiles from the game. When I implemented this, I set up a base Tile object that would know if it was a root tile, and if it had openings on the North, South, East and West borders of the card, which could be specified in the Unity editor.
From there, the root tiles would create colliders on any direction that featured a door, and when a new room object collided with that tile, it would find out the orientation of the new tile, attach it to the socket in that direction, let the new tile know which of its sockets was being used for the tile it was connecting to, and instruct it to set up new colliders for the doors on the new room that weren’t already occupied.
I thought it was a clever solution that would help streamlime the performance of the
system. It also had an added gameplay benefit of remembering what piece goes where after
your cat jumps on the table during game night, because you aren’t paying him enough
attention.