MekaMon: AR Skirmish
Description
AR skirmish is a single player battle mode, which uses augmented reality (AR) to create an immersive 3D battle environment in your own living room. A custom tracking solution using OpenCV is used identify and track the robot’s movements within this virtual space. AR skirmish was a collaborative effort by the entire games team. As a result, I was involved in some way with nearly every aspect of this game mode during it’s development.
Early versions of this mode were based on Vuforia: a marker based tracking solution used to establish a floor plane. With the release of ARKit and ARCore, I converted our project to use an experimental Unity wrapper—ARInterface—that targeted these new technologies. The initial results were so promising that we decided to switch entirely to this markerless tracking solution. We later moved to ARFoundation—Unity’s replacement for ARInterface—when it was stable.
To build an immersive 3D world we took advantage of the feature point set made available by ARCore/ARKit to build a map of what areas of the playspace were walkable. I then used this information to build a dynamic NavMesh generator to create and update NavMeshes—used for enemy pathing—at runtime. In addition, I created a scenery placement system that also uses this data to build a more immersive world as you explore your playspace. Virtual scenery initially posed a problem in that the physical robot could walk through it. I solved this by detecting collisions with the tracked position of the physical robot and then adapting the robot’s input so that it would attempt to walk around any objects blocking it’s path.
To allow players to explore the possibilities of augmented reality, we added a new mode, called AR Freeplay. This mode allows a user to configure various parameters (e.g. enemy count, enemy scale, gravity) to add greater variability to gameplay. I introduced destructible scenery in this mode, which could be manipulated by a physical robot, either by driving into it, or by shooting at it.
Key Technologies
Unity | C# | ARFoundation | ARKit | ARCore | Vuforia | OpenCV