Get SpatialOS

Sites

Menu

Schema introduction

The schema is where you define all the components that entities in your SpatialOS world can have.

For information about how to design what goes into components, see Designing components.

We also recommend reading Component best practices.

Writing .schema files

Define components in .schema files, written in schemalang. Schema files are stored in the schema/ directory.

For information how to write schema files, see the schemalang reference page.

Generating code from the schema

SpatialOS uses the schema to generate code in various languages (including C#, C++, and Java). You use this generated code in your worker code to interact with the entities in the world

To generate code, use the command spatial worker codegen.

For details on how to use the generated code to send and receive updates to components, see the docs for your SDK:

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums