Get SpatialOS

Sites

Menu

The SpatialOS Unreal integration is currently experimental. It's usable, butdefinitely has some sharp edges! We're very open to feedback - don't hesitate to get in touch on the forums if youhave any thoughts.

Changing the starting state of the world

When you deploy a SpatialOS project, the initial state of the SpatialOS world is defined by a snapshot. The example projects come with a default snapshot - snapshots/default.snapshot - but you can modify it or create new ones.

In the RPG demo project, there’s an Unreal commandlet to generate a snapshot, located in workers\unreal\Source\RpgDemo\ExportSnapshotCommandlet.cpp. The commandlet uses the C++ worker API to add a few NPCs to the world.

The commandlet creates several Entity instances: these define the entities that will be spawned when the game starts. You can add your own by using the SpatialOS components and Unreal blueprints you defined. When you’re happy with your changes, build your new snapshot:

  1. Compile your C++ changes.
  2. On the root of your project run ./generatesnapshot.sh (this will run the Unreal commandlet and overwrite snapshots/default.snapshot).

Note: You can change the snapshot save name or location by modifying it in the Commandlet code.

Once your new snapshot is built, you can launch your new world with spatial local launch --snapshot=<your_snapshot_name>.snapshot.

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums