Walkabout: Gameboard

Demonstrates the experimental Gameboard ARDK feature, which leverages AR meshing for smart virtual character placement and navigation.

Overview

After some instructions, the app turns on the device’s camera and the player is prompted to scan their surroundings, enabling the app to discover and create a navigable Gameboard on the ground. In this demo, the Gameboard is covered with tiles of snow. If the device has LIDAR, the resulting Gameboard may be more refined and stable.

Once enough Gameboard snow tiles are created, a camera-controlled reticle appears on / next to the Gameboard, allowing the player to move around a translucent Captain Doty yeti. The reticle is green when on a safe/valid place to put Doty; otherwise the reticle is orange and Doty’s position is constrained to the nearest valid location. A button appears near the bottom of the screen; pressing it solidifies Doty and places the them at their current location, with a small snowball.

The player is prompted to aim the reticle to choose a destination for Doty to walk to, and press the placement button. An X is placed at the nearest safe/valid destination point to the chosen location. (Some margin from the edge of the Gameboard is required, to give Doty enough clearance to turn.)

As Doty walks to the destination, they roll and grows the snowball. Once the snowball is large enough, the bottom half of a snowman appears somewhere nearby. The player completes the demo by navigating Doty to the snowman to complete it.

ARDK Features in use

  • ARSceneManager

  • ARMeshManager - Manages detection of the AR environment mesh, including instantiation and destruction of MeshCollliderChunk geometry objects that align with the detected mesh

  • Gameboard - Provides functionality to scan the AR environment mesh and maintain a set of tiles indicating the walkable portions of the mesh. The Gameboard also provides path planning logic that calculates a path for the character to use when moving from point to point across the tiles. The Gameboard is dynamically updated during the demo. New tiles may appear if new environment geometry is discovered, and existing tiles may disappear if parts of the room become newly occluded by people, pets, etc., or if lighting conditions change that affect the meshing process. If a piece of Gameboard disappears underneath Doty’s feet, Doty may be teleported to the closest valid point on the remaining Gameboard. The ARDK Gameboard is an experimental feature included in the ARDKExamples package. More Gameboard documentation is available here.

Note

Voyage currently uses an older version of Gameboard than what’s available in the ARDK. The version of Gameboard in the ARDK provides the same functionality, but uses updated APIs. For your own projects, use the version of Gameboard available in the ARDK.

  • ARDepthManager - for occlusion via depth

  • ARSemanticSegmentationManager - for attempting to mask out occlusion of items on the “ground” category/segmentation

Additional Custom Helpers

  • GameboardHelper - helper functionality for working with the ARDK Gameboard

  • WalkaboutDebugManager - manages the debug functionality for the demo

States

StateInstructions

A UI displaying instructions.

StateWarning

A UI displaying a warning about using AR; this is only displayed once per execution of the app, before the user enters an ARSession for the first time.

StateScanning

The device’s camera is turned on, and the player is prompted to scan their surroundings, enabling the app to fill the ground with a navigable Gameboard surface composed of tiles of snow. If the device has LIDAR, the resulting Gameboard may be more refined and stable.

StatePlacement

A camera-controlled reticle appears on / next to the Gameboard, allowing the player to move around a translucent Captain Doty yeti. The reticle is green when on a safe/valid place to put Doty; otherwise the reticle is orange and Doty’s position is constrained to the nearest valid location.

StateGrowSnowball

The player chooses destinations for Doty to walk to, to roll and grow the snowball.

StateBuildSnowman

Once the snowball is large enough, the bottom half of a snowman appears somewhere nearby. The player completes the demo by navigating Doty to the snowman to complete it.

StateGameOver

UI displaying the player’s final step count, and an option to Restart, or Return to Map.

Editor-Only Mock Support

When developing ARDK applications in editor, to avoid always requiring building to a device, it is convenient to employ mock versions of AR assets that function in Unity Editor. Each scene’s mock objects are attached to the scene’s MockScene GameObject. This object has a MockSceneConfiguration component that will destroy the object if outside of Unity Editor.

This scene’s MockScene object includes:

  • A mock environment mesh that is activated by the MockScene object in Unity Editor only.

  • A mock obstacle mesh that carves into the Gameboard, inactive by default, activated manually in the inspector