Get SpatialOS

Sites

Menu

How to use schema

When to generate schema

You must generate schema when you add or change any replicated properties (Unreal documentation) that you want to deploy to SpatialOS.

How to generate schema

There are two ways to generate schema for your project:

  • Generate schema (Full Scan)

    To generate schema for all classes* in your project:

    In the Unreal Editor, on the GDK Toolbar, open the Schema drop-down menu and select Schema (Full Scan).
    You must select Schema (Full Scan) the first time you generate schema for a project.
    Toolbar
    Image: In the GDK toolbar in the Unreal Editor, select Schema (Full Scan)

    When you select Schema (Full Scan), the GDK automatically iterates through all classes* in your project to generate the schema files, and then updates the SchemaDatabase.

    Run a full scan the first time you generate schema for your project, and whenever you need to generate schema for classes* that are not currently loaded by the Editor.
    For example: You need to select Schema (Full Scan) if you didn’t generate schema after adding a new Blueprint to your game, and that Blueprint is no longer open in the Editor.

  • Generate Schema (Iterative)

    To generate schema for classes* that are currently loaded by the Editor:

    Select Schema in the GDK Toolbar. The GDK automatically iterates through classes* that are currently loaded by the Editor, generates the schema files and updates the SchemaDatabase.
    Toolbar
    Image: In the GDK toolbar in the Unreal Editor, select Schema

As the GDK automatically generates all the schema you need, you do not have to write or edit schema manually when using the GDK.

*Whenever you generate schema, the GDK automatically creates schema for classes with replicated properties (Unreal documentation) or RPCs (Unreal documentation). If a class does not have replicated properties or RPCs, then the GDK does not generate schema for it.

When to generate schema

Select Schema (Full Scan) if you have:

  • Not generated any schema for your project.
  • Added a class with replicated properties that is not currently loaded by the Editor.
  • Edited a class with replicated properties that is not currently loaded by the Editor.

Select Schema if you have:

  • Added a class with replicated properties that is currently loaded by the Editor.
  • Edited a class with replicated properties that is currently loaded by the Editor.

How to delete schema

When you generate schema, the GDK verifies that any classes referenced in the SchemaDatabase still exist. If you delete a class, the GDK removes it from the SchemaDatabase the next time you generate schema.

Schema and source control

If you are using the built-in Unreal source control system Unreal locks this file on checkout, meaning other users are unable to write to it. To prevent this, mark the SchemaDatabase file as writable locally on each machine, and only check out the file when you are ready to commit any changes made to it.

Schema for unique local classes

Whenever you generate schema, the GDK checks the SchemaDatabase and all the in-memory classes in your project and removes any classes referenced in the SchemaDatabase that no longer exist.

This means that if you have a class that only exists on one user’s machine (for example, a newly created class, or a class used for local testing) then these classes are automatically removed from the SchemaDatabase file whenever another user generates schema.

To prevent this, commit newly created or modified classes to source control alongside the SchemaDatabase.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums