Godot
Last updated
Last updated
Follow these steps to quickly set up and start using Planetary Processing with your Godot game. For more detailed information on both the Godot SDK and the server-side API, please visit our .
We recommend using Godot's most recent release version. If you are using an older version, we recommend a minimum of v4.2.1 for a successful integration.
You will also need the most recent compatible version of the .NET SDK.
Godot Engine v4.2.1+ .net version required
.NET SDK 6.0+ (Desktop target)
.NET SDK 7.0+ (Android target)
.NET SDK 8.0+ (iOS target)
Navigate to the
Click Create Game in the top right
Provide the details of your game. Upon its creation, you will be taken to your Game Dashboard.
For this quick start, we will be using Anonymous Auth, which allows players to connect without a username and password. To enable this, navigate to the settings section of your Game Dashboard and enable Anonymous Auth as the Player Authentication Type within Game Settings.
Create a new Godot project, from the Project Manager.
In the FileSystem panel, create a new folder within the res://
folder. Name it addons
.
Right click the addons
folder and select "Open in Terminal".
In the terminal, clone the Planetary Processing Godot SDK.
Select the ‘Project Settings’ from the ‘Project’ tab in the topbar.
Navigate to the 'Plugins' tab and enable the Planetary Processing plugin.
Create a Node3D root node in the Scene panel, and save it as 'main'.
Add a PPRootNode as child node to your scene's root.
Select 'Tools > C# > Create C# Solution' from the ‘Project’ tab in the topbar.
This creates a .csproj and a .sln file in the root folder of your project. (Tabbing in and out of the Godot Editor will refresh the FileSystem Panel to show the new .csproj file).
In the Inspector panel of the PPRootNode, press the "Add Csproj Reference" button.
We will come back to the PPRootNode after we have made some scenes to represent our player and our entities.
Select the ‘Project Settings’ from the ‘Project’ tab in the topbar.
In the 'General' tab, find the 'Application > Run' section.
Set the Main Scene to be 'main.tscn'.
Create a new scene to represent your player, and save it as 'player'.
Add the PPEntityNode as a direct child of the root node of your scene.
In the Inspector for the PPEntityNode, input player
as the Type.
Add a MeshInstance to the root node of your scene.
In the Inspector assign the Mesh parameter a 'New BoxMesh' to make it visible.
Add a Camera3D to the root node of your scene and position it to look at the player.
Every Entity has a ‘Type’. These Entity Types are defined in the backend code downloaded from your game repository.
Locate the ‘entity’ folder.
Make note of the names of the .lua files inside the ‘entity’ folder. These are your Entity Types.
For the demo game repository, the Entity Types: cat, tree, and player are used. Entities in Godot are formed from scenes containing the PPEntityNode and a valid Type parameter.
Create a scene to represent one of your entities, such as a cat, and save it as 'cat'.
Add the PPEntityNode as a direct child of the root node of your scene.
In the Inspector for the PPEntityNode, input a Type. Entering ‘cat’ will sync this prefab with the ‘cat.lua’ entity in the server-side code.
Add a MeshInstance to the root node of your scene.
In the Inspector assign the Mesh parameter a 'New SphereMesh', to make it visible.
Repeat the process for trees and give them a CylinderMesh.
Other players are created in the same way as most entities, however they share their type 'player' with the player character.
Create a scene to represent other players, and save it as 'other_player'.
Add the PPEntityNode as a direct child of the root node of your scene.
In the Inspector for the PPEntityNode, input the Type 'player'.
Add a MeshInstance to the root node of your scene.
In the Inspector assign the Mesh parameter a 'New CapsuleMesh', to make it visible.
The PPRootNode emits a signal when entities change position or state on the server. These signals can be used to update an entity's position with new x, y, and z values.
Attach a new script called 'entity_movement.gd' to the root node parameter (not PPEnityNode) of each of your entity scenes (except the player character scene), with the following code.
Return to the PPRootNode in the main scene, and start filling in its parameters.
Drag and drop your player.tscn into the ‘Player Scene’ input.
Connect cat.tscn, tree.tscn and other_player.tscn to separate elements in the ‘Scenes’ input list.
You can leave Chunk Scene empty for now. Chunk scenes are optional, but for help implementing them go to Creating Chunk Scenes below.
If you wish to store data in game world chunks, you can add chunk objects to your game as scenes. These chunks will be spawned into the world as invisible nodes in their proper location, and will load and unload as the player moves around the world.
Chunk scenes are optional and you can create a game without them if you wish.
Create a scene and save it as 'chunk'.
Add the PPChunkNode as a direct child of the root node of your scene.
Attach a new script called 'chunk_update.gd' to the root node parameter (not PPChunkNode) with the following code:
Attach a new script called 'root.gd' to the root node parameter (not PPRootNode) of your main scene, with the following code. This will allow the player to join and interact with the game world.
Player inputs need to be passed to the server.
Select the ‘Project Settings’ from the ‘Project’ tab in the topbar.
Navigate to the 'Input Map' tab and add four new actions: 'move_forward', 'move_left', 'move_backward', and 'move_right'.
Use the plus symbol to add an input event to each of them.
Attach a new script called 'player.gd' to the root node parameter (not PPEntityNode) of your player scene, with the following code.
You now have everything you need to establish a basic connection between Godot and the server-side demo code.
Click 'Actions>Start Game' to start the server-side simulation.
Launch your game from Godot.
As your project runs, you should now be able to see the game world and all its entities. Your Planetary Processing game dashboard map should also show that a player has joined!
You can also change how many and what entities are spawned in the init.lua file.
Go back to your game dashboard in our web panel
From the actions menu in the top right, stop the game if it's running.
Select "Deploy Latest Version" - this will roll out your updated server-side code.
Start up your game again in Godot and in the web panel, to see the changes you have made!
Clone the repository as listed in your game dashboard - this is your Planetary Processing backend code.
In the Inspector panel of the PPRootNode, enter the Game ID of your game. This is a number which can be found on your , next to your game’s name and repo link.
Navigate back to your .
On the Planetary Processing , select your game to enter its dashboard.
you can edit the behaviour of entities by changing their Lua file within the ‘entity’ directory.
We recommend here to get a sense of what you can do with Planetary Processing. When you add or change entities, make sure your server-side changes match up with your game engine client.
After configuring your game entities and logic, to the game repository:
If you have encountered any issues, we have a premade demo of this guide: If you have further questions, please get in touch on our .