Get SpatialOS

Sites

Menu

Release notes for SpatialOS version 12

Note: SpatialOS 12 is fine for local development and deployments using the small deployment template, but deployments using larger templates may be unstable.

12.0.1

Released on 2017-10-05

Fixes

C# SDK

  • Calling DeepCopy on a generated type containing a collection of EntityId or Bytes values will now function correctly rather than throwing an exception.

12.0.0

Released on 2017-10-03

New features

General

  • A new load balancer strategy is now available. The new “Points of Interest” strategy is a static load balancing strategy which allows you to specify points of interest in your world and a targeted number of workers. The strategy will then determine the best way to simulate those points of interest so that each point is only simulated by a single worker. For more information read our load balancer configuration page.

  • The authority handover between two workers has been reworked. It is now possible for workers to be warned of imminent authority loss before they actually lose authority over a component. More information can be found in Handing over authority between workers.

Schema

  • Maps now support non-primitive types as keys.
  • Transient fields in Schemalang.

    In Schemalang, you can now mark option, list and map fields as transient. Data in transient fields won’t be saved in snapshots taken from a deployment, or loaded from a snapshot at the start of deployment.

    This makes clearing per-deployment state in snapshots easier. See the Schemalang Reference for more information.

Unreal SDK

  • SpatialOS component properties are now publicly exposed, and will automatically replicate when modified. This is more efficient than manually sending component updates. See the upgrade guide to get started, and Interacting with entity components for more information.

C# SDK

  • Added Improbable.Worker.SnapshotInputStream and Improbable.Worker.SnapshotOutputStream to read and write snapshot files one entity at a time. Improbable.Worker.Snapshot.Load and Improbable.Worker.Snapshot.Save have been deprecated.

  • Added a ToString() method to the Option class which returns the string "Option[Value]", or "Option.EMPTY" if Option has no value.

  • Added the IDeepCopyable interface in the Improbable.Collections namespace. This enables deep copying of classes which implement the IDeepCopyable interface.

  • C# Classes in the Improbable.Collections namespace now implement the IDeepCopyable interface.

  • The HasAuthority boolean on the AuthorityChangeOp has been removed and replaced with Authority enum with values NotAuthoritative, Authoritative, AuthorityLossImminent.

  • The HasAuthority method on the View has been removed and replaced with GetAuthority which returns an enum.

  • Connection.SendLogMessage() now accepts an optional entity ID to associate with the log message.

  • Connection.SendReserveEntityIdsRequest and Dispatcher.OnReserveEntityIdsResponse methods have been added, enabling single requests to reserve contiguous ranges of entity IDs to be used for entity creation.

  • query::NotConstraint has been added to allow queries to match entities that do not match the given subconstraint.

C++ SDK

  • Added worker::SnapshotInputStream and worker::SnapshotOutputStream to read and write snapshot files one entity at a time. worker::LoadSnapshot and worker::SaveSnapshot have been deprecated.

  • Schema-generated types are now default-constructible. This is equivalent to calling the existing static Create() method.

  • The C++ SDK now has the equivalent of the Worker.Dynamic functionality from the C# and Java SDKs, in the form of two new functions worker::ForEachComponent and worker::ForComponent. These are template functions which take a worker::Components template class parameter to define the list of components that should be considered.

  • The HasAuthority boolean on the AuthorityChangeOp has been removed and replaced with Authority enum with values kNotAuthoritative, kAuthoritative, kAuthorityLossImminent.

  • The HasAuthority method on the View has been removed and replaced with GetAuthority which returns an enum.

  • Connection.SendLogMessage() now accepts an optional entity ID to associate with the log message.

  • Connection::SendReserveEntityIdsRequest and Dispatcher::OnReserveEntityIdsResponse methods have been added, enabling single requests to reserve contiguous ranges of entity IDs to be used for entity creation.

  • query::NotConstraint has been added to allow queries to match entities that do not match the given subconstraint.

Java SDK

  • Added improbable.worker.SnapshotInputStream and improbable.worker.SnapshotOutputStream to read and write snapshot files one entity at a time. improbable.worker.Snapshot.load and improbable.worker.Snapshot.save have been deprecated.

  • The HasAuthority boolean on the AuthorityChangeOp has been removed and replaced with Authority enum with values NotAuthoritative, Authoritative, AuthorityLossImminent.

  • The HasAuthority method on the View has been removed and replaced with GetAuthority which returns an enum.

  • Connection.SendReserveEntityIdsRequest and Dispatcher.OnReserveEntityIdsResponse methods have been added, enabling single requests to reserve contiguous ranges of entity IDs to be used for entity creation.

  • Connection.sendLogMessage() now accepts an optional entity ID to associate with the log message.

  • query::NotConstraint has been added to allow queries to match entities that do not match the given subconstraint.

Fixes

Spatial CLI tools

  • Improved user experience when using spatial setup install-dependencies. The Unity SDK won’t be installed by default any more. See the SpatialOS Windows setup guide for more details.

Unity SDK

  • Fixed MacOS workers throwing exceptions like Failed to deserialize snapshot for component ID 50 when built with Unity 2017.1.
  • Prefab pools are now cleaned and removed from scenes after disconnecting from SpatialOS.

  • The Unity SDK and all generated code is now placed under the <unity worker>/Assets/Plugins/Improbable folder to help decrease project compile times. It was previously installed to <unity worker>/Assets/Improbable.

  • When you’re using EntityBuilder, you can now set write access on the EntityACL component itself using .SetEntityAclComponentWriteAccess(). For details, see, Creating and deleting entities

Unreal SDK

  • Cleaned up auto-generated component code. Unused functions are removed and formatting is improved.
  • Fixed a C++ compile error that could occur when custom types were declared and referenced in different orders.

  • Fixed an issue where a component’s OnPropertyUpdate delegates were invoked before the entire component update was applied.

  • The errors useradd: user 'unrealworker' already exists and ln: failed to create symbolic link '/improbable/logs/UnrealWorker/Logs/Epic': File exists will not appear anymore when running a cloud deployment with more than one Unreal worker.

  • When you’re using EntityBuilder, you can now set write access on the EntityACL component itself using .SetEntityAclComponentWriteAccess(). For details, see Creating and deleting entities

  • spatial worker clean now properly cleans up intermediate code-generated files.

C# SDK

  • A Dispatcher callback that itself registers multiple other callbacks on the same Dispatcher no longer possibly results in those callbacks being registered in the wrong order.
  • Fixed an issue where invoking Dispatcher callbacks could allocate memory on old versions of .NET (including Unity).

C++ SDK

  • A Dispatcher callback that itself registers multiple other callbacks on the same Dispatcher no longer possibly results in those callbacks being registered in the wrong order.

Java SDK

  • A Dispatcher callback that itself registers multiple other callbacks on the same Dispatcher no longer possibly results in those callbacks being registered in the wrong order.

  • Java objects which implement Closeable now throw a RuntimeException if they are used after the close() method is called.

Breaking changes

General

  • All usages of the darwin and mac strings for target-platform specifications have been deprecated in favour of macos. For information about how to get your project up-to-date please see the upgrade-guide.

Unity SDK

  • Command-line arguments +ip and +port used by Unity workers have been renamed to respectively +receptionistHost and +receptionistPort.

  • CoreSdkDll worker SDK libraries have been moved from Assets/Plugins/x86 <or> x86_64 <or> core-bundle-x86_64-macos to Assets/Plugins/CoreSdk. Please make sure you remove the folders previously containing CoreSdkDll when upgrading your project.

Unreal SDK

  • All component update delegates have been changed to a global FSpatialComponentUpdated delegate with zero parameters. With the seamless update implementation, you can now read the property value directly from the component.
  • Command-line arguments +ip and +port used by Unreal workers have been renamed to respectively +receptionistHost and +receptionistPort.

  • Component command delegate types are now declared in the global namespace in order to work around a UE4 limitation. Command delegates use their return and input types as naming for the delegate, for example command DamageResponse damage(DamageRequest); will create a delegate named FDamageResponseDamageRequestCommand and will be declared in the command responder .h file, in this case DamageCommandResponder.h.

  • Component event delegate types are now declared in the global namespace in order to work around a UE4 limitation. Event delegates use their return type as naming for the delegate, for example event TestEvent toggled; will create a delegate named FTestEventDelegate and will be declared in the user type .h file, in this case TestEvent.h.

  • Component updates on Coordinates properties are now automatically transformed into Unreal coordinate space. Calling SpatialOsCoordinatesToUnrealCoordinates() is no longer necessary when applying a position update to an Unreal actor.

  • Delegates declared in SpatialOSComponent.h have been moved to global scope and renamed. FAuthorityChangeDelegate is now named FSpatialAuthorityChangeDelegate and FComponentReadyDelegate is now FSpatialComponentReadyDelegate.

  • Unreal SDK now requires an explicit list of components to be passed into certain methods in the underlying C++ SDK. The complete list of methods which now require this parameter is:

    • Connection::ConnectAsync
    • Locator::ConnectAsync
    • Dispatcher::Dispatcher
    • LoadSnapshot
    • SaveSnapshot
  • “SpatialOSCommon.h” provides an autogenerated helper type called improbable::unreal::Components to pass as a template parameter into these functions. Note that it is uncommon to be using these low level functions in Unreal code.

C# SDK

  • Finding out which components the worker is authoritative over has moved from Improbable.Worker.Entity (entity.HasAuthority, which has been removed) into the Improbable.Worker.View itself (view.GetAuthority).
  • The GetComponents method on the Improbable.Worker.Entity class has been renamed to GetComponentIds, and now returns a HashSet<uint>.
  • The Contains method on the Improbable.Worker.Entity class has been removed. Use Get<T>().HasValue instead.

  • The old --language=csharp_deprecated codegen backend for spatial process_schema has been removed.

  • The C# SDK no longer depends on protobuf-net, and protobuf-net is no longer distributed with the SDK. If you have customised project files for your C# workers, you will need to update them to remove this dependency.

C++ SDK

  • Finding out which components the worker is authoritative over has moved from worker::Entity (entity.HasAuthority, which has been removed) into the worker::View itself (view.GetAuthority).

  • The way the C++ SDK finds out about components in generated code has changed. The old mechanism attempted to discover components automatically using static initialization tricks, but this did not work correctly in many situations. SDK methods now require an explicit list of components to be passed in using the worker::ComponentRegistry interface, which is implemented by the worker::Components template class. The complete list of methods which now require this parameter is:

    • Connection::ConnectAsync
    • Locator::ConnectAsync
    • Dispatcher::Dispatcher
    • LoadSnapshot
    • SaveSnapshot
  • The worker::View class has moved to a separate header file, <improbable/view.h>. This class can now be implemented entirely in user code using the new ForEachComponent functionality, and is intended to serve mostly as an example. The View::View constructor now takes a worker::Components template class argument.

Java SDK

  • A number of class fields have been changed to make the Java SDK more consistent with other language SDKs:
    • networkParameters in ConnectionParameters is now network
    • type in NetworkParameters is now connectionType

Deprecations

Unity SDK

  • Field PlayerBuildConfiguation.Global, class GlobalConfig and class PluginConfig (in Improbable.Unity.EditorTools.Build) are deprecated.
  • The HasAuthority boolean on SpatialOS Components have been deprecated, and replaced with Authority enum with values NotAuthoritative, Authoritative, AuthorityLossImminent.
  • The HasAuthority method on the View has been deprecated, and replaced with GetAuthority which returns an enum.

Unreal SDK

  • The HasAuthority boolean on SpatialOS Components have been deprecated, and replaced with EAuthority enum with values NotAuthoritative, Authoritative, AuthorityLossImminent.

JavaScript SDK

  • The Experimental JavaScript SDK is now deprecated. As part of its “experimental” status we have done a thorough evaluation of the Javascript SDK through its usage, features and maintenance cost. As a result the decision was taken to halt its development. Please contact us if you have any queries.

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums