Get SpatialOS

Sites

Menu

Introduction to entities

An entity consists of a set of components. All meaningful things in a SpatialOS world are entities, with their components defining what they are.

All components are defined in a global schema. To define an entity, you create an entity template which lists the components that the entity has.

When your simulated world is running, workers will make changes to components: either in response to changes in the simulated world, or according to their own internal logic. Other workers will visualize these components, with all data synchronization handled by SpatialOS.

Designing and defining entities

You need to:

  • work out what entities your simulated world have
  • work out what components those entities will have
  • define the components in the schema

For full details, see Designing and defining entities.

Creating and deleting entities

You can create and delete entities from code in any worker. You create entities using an entity template that lists all the components an entity has.

See Creating and deleting an entity for details.

Updating components

Any change that happens to an entity should happen through component updates. Any changes made to a component are automatically synchronized to all relevant workers.

See sending and receiving component updates for more details.

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums