Skip to content

Spirit Sling is a social mixed reality (MR) app created to show developers how to build exciting tabletop games that give users a reason to be together in MR.With our new and improved Avatars, and the power of mixed reality, users can now place a fun tabletop experience on a surface and invite a friend into their space to play with them.

License

Notifications You must be signed in to change notification settings

oculus-samples/Unity-SpiritSling

Repository files navigation

Banner

Spirit Sling Tabletop

Spirit Sling is a social mixed reality (MR) app created to show developers how to build exciting tabletop games that give users a reason to be together in MR. With Meta's new and improved Avatars, and the power of mixed reality, users can now place a fun tabletop experience on a surface and invite a friend into their space to play with them.

This codebase is available as both a reference and template for mixed reality projects. You can also test the game on the Meta Horizon Store.

Mechanics and Features

Discover some of the mechanics, features, and techniques used to deliver this unique and engaging multiplayer experience. For more information, visit the documentation.

  • Contextual game board placement: Using Scene API and MRUK, Spirit Sling accesses real-world object data to ensure that the game board is immediately accessible to users’ hands and maintains visibility above real-world objects.
  • Creating and joining a multiplayer session: Spirit Sling supports players joining public or private multiplayer sessions. After the Platform SDK is initialized, the app creates a public or private multiplayer room by calling Fusion.NetworkRunner.StartGame(...) or GroupPresence.Set(...), respectively. A public session is joined by first subscribing to the NetworkEvents.OnSessionListUpdate event, then NetworkRunner.JoinSessionLobby(...)and finally finding and joining the first non-full public room calling NetworkRunner.StartGame(...). For a private lobby, the app reads ApplicationLifecycle.GetLaunchDetails() to accept the invite. The app also subscribes to the ApplicationLifecycle.SetLaunchIntentChangedNotificationCallback() callback to listen for the launch intent changes.
  • Hand tracking integration: Spirit Sling supports hand tracking as a primary form of input when users interact with the gameboard. Hand tracking and Grab interactions can be integrated using Interaction SDK through the Building Blocks tool.
  • Using Interaction SDK to control gameplay: Users can control and manipulate gameplay elements through the app’s ability to detect grab gestures using the Grabbable,HandGrabInteractable, and GrabInteractable components.
  • Game board adjustment with hand tracking: To support an adaptable and comfortable user experience, the game enables users to re-adjust the board after initial placement using the Grabbable component from ISDK and custom One/TwoGrabGameVolumeTransformer components.
  • Adding hand interactions to interface buttons: Users can leverage the poke interaction to navigate the game’s user interface. Poke interaction support can be enabled by adding the Poke Interaction building block, creating a SpiritSlingButton script and attaching it to a game object that includes the PokeInteractable component.

How to run the project in Unity

  1. Configure the project with Meta Quest and Photon
  2. Make sure you're using Unity 2022.3.30.
  3. Make sure you're using one of these devices: Meta Quest 3S, Meta Quest 3, Meta Quest Pro.
  4. Locate the 'Assets/GameSettings.asset' file and populate all the empty fields with your own data.
    4.1. Application Identifier is the unique string that identifies your app on Meta Quest Store.
    4.2. Meta Quest App ID is the ID of your app on Meta Quest Store.
    4.3. Optional: populate Android Keystore name and password. Make sure not to store the 'Assets/GameSettings.asset' file in VCS in this case.
    4.4. Photon App Id Fusion / Voice: unique ids obtained in step 1 in the 'Photon Configuration' section. Game Settings

Project Structure

The project is organically structured to distinguish the main components of the MR experience's logic. Main Spirit Sling components:

  • ConnectionManager handles the Photon Fusion connection workflows for single and multiplayer sessions. The PhotonConnector logic showcases how a shared multiplayer session is handled via Photon Fusion, how the creation of shared rooms and lobbies work, and how the connection states can be handled accordingly.
  • GameVolumeSpawner handles logic for placing the game board into physical environment. It also ensures that the game board is accessible by hands so the user can readjust the initial placement for a more comfortable experience.
  • TabletopGameStateMachine controls the flow of the game between different gameplay states.
  • Please visit the Meta Horizon Documentation page for more details on how the game uses Mixed Reality Utility Kit (MRUK), Platform SDK and Meta Interaction SDK (ISDK).

Dependencies

This project makes use of the following plugins and software:

License

The majority of Spirit Sling is licensed under MIT LICENSE, however files from Text Mesh Pro, and Photon SDK, are licensed under their respective licensing terms.

Contribution

See the CONTRIBUTING file for how to help out.

About

Spirit Sling is a social mixed reality (MR) app created to show developers how to build exciting tabletop games that give users a reason to be together in MR.With our new and improved Avatars, and the power of mixed reality, users can now place a fun tabletop experience on a surface and invite a friend into their space to play with them.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages