Welcome to SpacetimeMultiplayerGameDemo, a basic game project developed in Unity that showcases the power and efficiency of SpacetimeDB in creating a multiplayer game. While this project is still under development, all the code and assets are open-source and free for anyone to use in their own projects.
- Login: The user's private key is stored in Unity PlayerPrefs system the first time they play and is used to authenticate in future sessions.
- Chat: Open Chat window with ENTER key. Basic chat message system.
- Overhead Names: Player names are displayed over their head.
- Movement: Basic player movement system.
- Resource Node Spawning: Server spawns resource nodes on the map.
- Harvesting: Players can harvest resource nodes.
- Inventory: Open Inventory with TAB. Harvested resources go to inventory.
- Jumping: Players can jump with SPACE.
- Install SpacetimDB and start SpacetimeDB local instance. View the SpacetimeDB getting started guide for detailed instructions.
- Navigate to the Server folder. Publish the Spacetime demo module to your local instance.
spacetime publish spacetimedemo
- Open the project in Unity.
- Open the Scene named
Main
in the Scenes folder. - Click on the
GameManager
object in the Scene and double check the connection settings in the Inspector. They should be:
Module Address: spacetimedemo
Host Name: localhost:3000
SSL Enabled: false
- Hit the Play button to play in the editor.