Unreal
Last updated
Last updated
Follow these steps to quickly set up and start using Planetary Processing with your Unreal Engine 5 game. For more detailed information on both the SDK and the server-side API, please visit our documentation.
We recommend using the latest Unreal Engine 5 version. If you are using an older version, you must use at least Unreal Engine 5.4+
The PP Unreal plugin supports macOS or Windows. It does not currently support Linux.
Navigate to the games section of our web panel.
Click Create Game in the top right.
Provide the details of your game. Upon its creation, you will be taken to your Game Dashboard.
Note: UE5's coordinate system is measured in centimetres. Therefore we should select a large chunk size of 6400 (equivalent to 64 meters).
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.
Clone the git repository as listed in your game dashboard - this is your Planetary Processing backend code.
Open UE5 and start a new project. For this quickstart we will use the Third Person template and make a blueprint project. You may use any tempate of your choice.
Install the Planetary Processing plugin by cloning the repository into the root level of your UE5 project. You should see a new plugins folder containing a Planetary Processing folder if successful.
In the UE5 editor, go to Edit and select Plugins. Search for and enable Planetary Processing. If it does not appear at first, try restarting the UE5 editor.
With the plugin enabled, you should be able to see the Planetary Processing plugin content in the Content Browser. Make sure you have 'Show plugin Content' ticked in the Content Browser Settings.
First navigate to the Planetary Processing Content folder in Plugins and open the PP_ExamplePlayerController blueprint. Find the Event BeginPlay chain at the top of the blueprint and edit the Init function to have the same Game ID as your Planetary Processing panel game. Remember to always compile and save before closing.
Navigate to your game controller. In the third person template this is BP_ThirdPersonGameMode and can be found in All/Game/ThirdPerson/Blueprints. Open it and set the Player Controller Class to PP_ExamplePlayerController.
Your player should now be connected to the Planetary Processing back end. Test this by selecting 'Start Game' game from the actions menu in the top right of your game's web panel. Then press play in the UE5 editor.
You should be greeted with the Planetary Processing template login screen. If you are using username and password authentication (available in the Game Settings section of your panel game), enter the login details for a player. If you are using anonymous authentication, just press login. You can remove the login widget from the PP_ExamplePlayerController blueprint if you so wish.
Once logged in, you should now be able to move your player and see its position updated on the panel map.
Since the panel map is 2D and top down, while Unreal is 3D, the coordinate axes need to be changed to update the position correctly.
Open the PP_ExamplePlayerController blueprint and navigate to the Send Player Position Message section. Create Break Vector and Make Vector nodes. Connect them, swapping only the X and Z position values.
The default demo code in the backend server will do an additional swap, whenever the message values are received from a 3D client, exchanging the Y and Z positions. Later you might choose to combine these two swaps into a single function, handled exclusively on the client or server side (xyz -> yzx).
Insert the new Break/Make Vector pair between the Get Actor Location and Convert Vector To Server Coords Message Data nodes.
You may also see cubes appearing across the scene representing our cat and tree entities using the PP_ExampleEntityActor by default. We will look at these next.
Every Entity has a ‘Type’. These Entity Types are defined in the backend code downloaded from your game repository.
Navigate back to your cloned 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. But remember, the ‘player’ type is for representing other players in the game, not for the main player character.
Lets make a blueprint for our tree entity. Go to /All/Game/ThirdPerson/Blueprints and create a new blueprint class. Search for and select PP_ExampleEntityActor. Name this blueprint 'Tree'.
Open this blueprint and make some edits of your choice. In this example we only have the starter content, so we will switch the static mesh to a Shape_Cone and the material to M_Bush. We will also increase the scale to 3 in all directions.
Register this new entity by going to PP_ExamplePlayerController in the Plugins folder and selecting EntityMap in the Variables section. Add an element called tree and set the blueprint to our new tree blueprint. Note that the element name must be the same as a lua Entity Type in the backend ('tree' to match 'tree.lua').
Test this blueprint is working by pressing play and logging in. You should now see our wonderfully realistic trees scattered across the world.
We can follow the same process to make a blueprint for the cat entity if we so wished. Likewise, we can also make new entities in the backend and set them up in Unreal Engine in the same manner.
From this point on you can develop your game as you normally would in Unreal Engine 5. Remember, any props, actors, terrain and other similar entities that you want to be shared between players must be setup as an entity, like we did with the tree.
Using the repo we cloned earlier you can edit the behaviour of entities by changing their Lua file within the ‘entity’ directory.
You can also change how many and what entities are spawned in the init.lua file.
We recommend experimenting 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, push your changes to the game repository:
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 Unreal Engine 5 and in the web panel, to see the changes you have made!