All Projects → spatialos → sdk-for-unity-vr-starter-project

spatialos / sdk-for-unity-vr-starter-project

Licence: other
[Deprecated] SpatialOS SDK for Unity Virtual Reality Starter Project

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to sdk-for-unity-vr-starter-project

sdk-for-unity
SpatialOS SDK for Unity
Stars: ✭ 49 (+13.95%)
Mutual labels:  games, online, multiplayer, unity-editor, mmo, improbable, spatialos, unity3d-games, massive, monobehaviour
gdk-for-unity-blank-project
SpatialOS GDK for Unity Blank Project
Stars: ✭ 33 (-23.26%)
Mutual labels:  games, online, multiplayer, mmo, improbable, spatialos, massive, monobehaviour
Gdk For Unity
SpatialOS GDK for Unity
Stars: ✭ 296 (+588.37%)
Mutual labels:  games, online, multiplayer, unity-editor, mmo
Gdk For Unity Fps Starter Project
SpatialOS GDK for Unity FPS Starter Project
Stars: ✭ 119 (+176.74%)
Mutual labels:  games, online, multiplayer, mmo
Crystalshire
Legacy VB6 open-source ORPG
Stars: ✭ 24 (-44.19%)
Mutual labels:  games, multiplayer, mmo
reshade-vrtoolkit
Modular shader to enhance you HMD clarity & sharpness with minimal performance impact.
Stars: ✭ 40 (-6.98%)
Mutual labels:  games, vr, steamvr
Game-Assets-And-Resources
Free and paid game assets and game resources for 2D games, 3D games, mobile games, Steam games, Unity games, and other games.
Stars: ✭ 164 (+281.4%)
Mutual labels:  games, unity3d-games
phaser multiplayer demo
HTML5 Multiplayer with Phaser and Go
Stars: ✭ 35 (-18.6%)
Mutual labels:  games, multiplayer
piw5 bot warfare
The Bot Warfare mod for PlutoniumIW5
Stars: ✭ 57 (+32.56%)
Mutual labels:  games, multiplayer
Swords And Ravens
A reimplementation of the board game "A Game of Thrones: The Board Game 2nd Edition"
Stars: ✭ 29 (-32.56%)
Mutual labels:  online, multiplayer
lightsout
🎲 Lights Out Game
Stars: ✭ 23 (-46.51%)
Mutual labels:  games, online
mnimi
🎲 Mnimi (A Game of Memory Skill)
Stars: ✭ 15 (-65.12%)
Mutual labels:  games, online
RiptideSampleFPS
Sample FPS project using RiptideNetworking, and source code for the Riptide tutorials.
Stars: ✭ 80 (+86.05%)
Mutual labels:  games, multiplayer
BeatSaberSongBrowser
BeatSaber plugin, adds much needed functionality to the song selection interface.
Stars: ✭ 166 (+286.05%)
Mutual labels:  games, vr
Medguireborn
MedGui Reborn is a frontend/launcher (GUI) for Mednafen multi emulator, written in VB .Net with Microsoft Visual Studio Community
Stars: ✭ 40 (-6.98%)
Mutual labels:  games, multiplayer
Gameproject3
游戏服务器框架,网络层分别用SocketAPI、Boost Asio、Libuv三种方式实现, 框架内使用共享内存,无锁队列,对象池,内存池来提高服务器性能。还包含一个不断完善的Unity 3D客户端,客户端含大量完整资源,坐骑,宠物,伙伴,装备, 这些均己实现上阵和穿戴, 并可进入副本战斗,多人玩法也己实现, 持续开发中。
Stars: ✭ 655 (+1423.26%)
Mutual labels:  games, multiplayer
Project Dollhouse
A project aiming to rebuild TSO (The Sims Online) from the ground up. Inspired by CorsixTH.
Stars: ✭ 83 (+93.02%)
Mutual labels:  games, online
Openspades
Compatible client of Ace of Spades 0.75
Stars: ✭ 769 (+1688.37%)
Mutual labels:  online, multiplayer
Khan
khan will drive all your enemies to the sea (and also take care of your game's clans)!
Stars: ✭ 22 (-48.84%)
Mutual labels:  online, multiplayer
Warzone2100
Command the forces of The Project in a battle to rebuild the world after mankind has been nearly destroyed by nuclear missiles. A 100% free and open source real-time strategy game for Windows, macOS, Linux, BSD+
Stars: ✭ 2,094 (+4769.77%)
Mutual labels:  games, multiplayer

SpatialOS SDK for Unity Virtual Reality Starter Project

New from October 2018: The SpatialOS GDK for Unity
Check out the alpha release of our SpatialOS Game Development Kit (GDK) for Unity. Using the Unity Entity Component System (ECS), the GDK is the next evolution in developing SpatialOS games in Unity. The SpatialOS GDK for Unity is designed to replace the SpatialOS SDK for Unity and we recommend using it over using the SDK for new game projects. See our blog post anouncement for more information.


Virtual Reality starter project

Copyright (C) 2017 Improbable Worlds Limited. All rights reserved.


Introduction

This is a SpatialOS project that implements basic functionality for a VR game or application, intended as a starting point for developing your own. It requires SteamVR hardware (the HTC Vive headset, controllers, and base stations).

The main features of this project are:

  • Players controlled by VR peripherals.
  • Spectators controlled by mouse and keyboard.
  • Multiplayer by default. Many players and spectators can share the same world.
  • Position and orientation tracking of headset and controllers.
  • Move by teleporting. Press the trackpad on either controller, move the target, and release the trackpad to teleport to the target location.
  • Grab objects, pass them between hands, throw them, and catch them.

If you run into problems, or want to give us feedback, please visit the SpatialOS forums.

Running the project

To run the project locally, first build it by running spatial worker build, then start the server with spatial local start. You can connect a client by opening the Unity project and pressing the play button, or by running spatial local worker launch UnityClient default. See the documentation for more details.

To deploy the project to the cloud, first build it by running spatial worker build -t=deployment, then upload the assembly with spatial cloud upload <assembly name>, and finally deploy it with spatial cloud launch <assembly name> <launch configuration file> <deployment name> --snapshot=<snapshot file>. You can obtain and share links to connect to the deployment from the console. See the documentation for more details.

Project structure and design overview

Player entity and peripheral tracking

The player is represented by an entity. Its position corresponds to the centre of the Vive's play area, an abstraction that represents the physical space that is tracked by the base stations.

The position of the player's head tracks that of the Vive headset, and the player's hands track that of controllers. Those positions are stored as offsets from the player's position. Input from the headset and the controllers is handled by VrPeripheralHandler.cs, and players are visualised by VrPeripheralVisualiser.cs.

This approach to the player's position is specific to the HTC Vive with its play area. A more usual approach for SpatialOS would have the position of the player entity match the position of the player's head; however, the approach used in this project has several advantages, including a more straightforward implementation, lower bandwidth requirements (since offsets can be transmitted using smaller data types than absolute world positions), and a familiar model for experienced SteamVR developers.

The main downside is that physically moving within the play area will not cause the player entity to move when seen on the Inspector. This may not matter much, since the the SpatialOS world will normally be orders of magnitude bigger than the average living room, so most of the player movement will be done by teleporting. We may revisit this design tradeoff in future iterations of this project.

Should the framerate not update fast enough for your hardware, you can change the default framerate in workers/unity/Assets/Gamelogic/Global/SimulationSettings.cs

Teleportation

Teleportation is implemented client-side. When the player presses the trackpad on either controller, a teleport targeter is displayed. The player can move it around to choose their desired destination, and release the trackpad to perform the teleport. All of this is implemented in TeleportationHandler.cs.

Spectator camera

Spectators are players who connect without a VR headset. They are limited to moving around and viewing the game world, but can't interact with it. The camera orientation is controlled with the mouse, and its position is controlled with the WASD keys. Spectators are visible in-game to other spectators and to players. This is done in SpectatorFlycam.cs.

Grabbing and throwing objects

Entities can be easily marked as grabbable, which lets them be picked up, dropped and thrown. When the client detects a collision between a controller and a grabbable object, it adds it to a set of reachable objects; when the collision ends, the object is removed (by keeping this set, we avoid having to search for nearby objects constantly). The closest reachable object is highlighted by being made blue. This is done in HandCollisionHandler.cs, and happens entirely on the client.

When the trackpad is pressed, a GrabRequestEvent with the entity ID of the closest reachable object is emitted by GrabbingSender.cs on the client side. This event is handled by GrabbingReceiver.cs on the server side. It validates the grab attempt (that is, verifies that the hand and the object are actually colliding). If it is valid, it updates the CurrentGrabberInfo property of the Grabbable component to record which player and controller is grabbing it. When the trackpad is released, a very similar process handles dropping an object that is being held.

While an object is being held, its position and orientation track those of the controller than is holding it. This is done in every client, to ensure there's no jitter between the position and orientation of the object and the controller. When an object is released, its velocity is set to match that of the controller; this way, objects can be thrown. All of this is implemented in GrabbableTransformHandler.cs.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].