I’ve set up my Actor for replication according to Unreal Engine’s documentation, but my Actor does not replicate.
There could be a few different reasons for this. The list below provides some of the most common ones, ordered by likelihood:
It’s easy to forget to generate the schema for your replicated Actor. Make sure you run the Schema Generator before launching your project.
As per Unreal Engine’s replication documentation, your Actor needs to be created on the server-worker before it can replicate to the client-workers.
Ensure that your call to
SpawnActoris happening on your server-worker.
Validate that the SpatialOS entity that represents your Actor appears in the Inspector. If it doesn’t, then it’s likely that it’s not marked up for replication correctly.
Mark your Actor for replication as per Unreal Engine’s Actor replication documentation. You can validate that your Actor is replicated in
Validate that you receive an
WORKER_OP_TYPE_ADD_ENTITYfor the entity representing your Actor in the
USpatialView::ProcessOpsand that your entity is spawned in
I’ve moved my game over to the SpatialOS GDK for Unreal and am getting a crash in
UEngine::TickWorldTravel when launching a PIE instance of my game.
Ensure that you have set up your Game Instance Class in your project settings (from the Unreal Editor, naviagte to: Edit > Project Settings > Project > Maps & Modes > Game Instance Class) to point to either
SpatialGameInstance or a game instance that inherits from
Can I change between Unreal Engine’s networking stack and the SpatialOS GDK for Unreal networking stack?
Yes you can! In the
Unreal Editor, select the
Play dropdown from the toolbar, and toggle the
Spatial Networking checkbox to switch between the two networking stacks.
I’m getting the following compilation error when building the GDK:
Error C2248: FRepLayout::Cmds': cannot access private member declared in class 'FRepLayout.
You’re building against an unsupported version of Unreal Engine. Make sure you’re targeting the fork of Unreal Engine that the GDK requires. See the setup guide for more details.
My game uses reliable multicast RPCs - why does the SpatialOS GDK for Unreal not support these?
The underlying implementation of multicast RPCs uses SpatialOS events (SpatialOS documentation). SpatialOS events can only be sent unreliably. Additionally, the cost of a multicast RPC scales with the number of client-workers present in a deployment, which means they can get very expensive. A better approach would be to send RPCs to only the workers that are close to the broadcasting worker.
When I build my project, I get the following error:
Unknown class specifier 'SpatialType'.
SpatialType is a new class specifier for tagging of classes to replicate to SpatialOS. This message likely means that you have not built our UE4 fork, or pointed your project to use it. Follow the steps here to ensure the GDK is set up correctly.
When I launch my SpatialOS deployment, I receive error messages similar to:
uses component ID 100005 which conflicts with components defined elsewhere.
This means you were using the GDK since pre-alpha. To fix the issue, delete the contents of your
spatial/schema folder, run
Setup.bat again in the GDK folder, and generate the schemas again. You may also need to update your streaming queries in
spatialos.json. Refer to our StarterProject repo to see an example.