Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

GDK for Unity Alpha Release 0.2.0

Compare
Choose a tag to compare
@zeroZshadow zeroZshadow released this 19 Mar 21:11
· 384 commits to master since this release
bf7978a

This release contains major breaking changes to the Core ECS and MonoBehaviour APIs, based on feedback and learnings from 0.1.x releases. There are some performance improvements out-of-the-box, with the ability to isolate and disable reactive components for further gains.

Keep giving us your feedback and/or suggestions! Check out our Discord, our forums, or here in the Github issues!

For more information, have a browse through our detailed release notes below! 🎉


Breaking Changes

  • Changed the format of the BuildConfiguration asset. Please recreate, or copy it from workers/unity/Playground/Assets/Config/BuildConfiguration.asset.
  • Command request and responses are no longer constructed from static methods CreateRequest and CreateResponse. Instead, they are constructors that take the same arguments.
  • The Require attribute has moved from the Improbable.Gdk.GameObjectRepresentation namespace to the Improbable.Gdk.Subscriptions namespace.
  • The generated Readers have been renamed from {COMPONENT_NAME}.Requirable.Reader to {COMPONENT_NAME}Reader.
  • The Reader callback events' names have changed.
    • On{EVENT_NAME} is now On{EVENT_NAME}Event.
    • {FIELD_NAME}Updated is now On{FIELD_NAME}Update.
  • The generated Writers have been renamed from {COMPONENT_NAME}.Requirable.Writer to {COMPONENT_NAME}Writer.
  • The Writer send method names have changed.
    • Send{EVENT_NAME} is now Send{EVENT_NAME}Event.
    • Send is now SendUpdate.
  • The generated command senders in MonoBehaviours have also changed.
    • {COMPONENT_NAME}.Requirable.CommandRequestSender and {COMPONENT_NAME}.Requirable.CommandResponseHandler have been combined and are now called {COMPONENT_NAME}CommandSender.
    • {COMPONENT_NAME}.Requirable.CommandRequestHandler is now called {COMPONENT_NAME}CommandReceiver.
  • When creating GameObjects, the IEntityGameObjectCreator.OnEntityCreated signature has changed from GameObject OnEntityCreated(SpatialOSEntity entity) to void OnEntityCreated(SpatialOSEntity entity, EntityGameObjectLinker linker).
  • The signature of IEntityGameObjectCreator.OnEntityCreated has changed from void OnEntityRemoved(EntityId entityId, GameObject linkedGameObject) to void OnEntityRemoved(EntityId entityId).
    • All linked GameObject instances are still unlinked before this is called, however it is now your responsibility to track if a GameObject was created when the entity was added.
    • You should now call linker.LinkGameObjectToSpatialOSEntity() to link the GameObject to the SpatialOS entity.
    • You should also pass-in a list of ComponentType to LinkGameObjectToSpatialOSEntity which you wish to be copied from the GameObject to the ECS entity associated with the GameObject.
      • Note that for the Transform Synchronization feature module to work correctly, you need to set up a linked Transform Component on your GameObject. You also need to link any Rigidbody Component on your GameObject.
    • There is no limit on the number of GameObject instances that you can link to a SpatialOS entity. However, you cannot add a component type to a linked GameObject instance more than once.
    • Deleting a linked GameObject unlinks it from the SpatialOS entity automatically.
  • SpatialOSComponent has been renamed to LinkedEntityComponent.
    • The field SpatialEntityId on the LinkedEntityComponent has been renamed to EntityId.
    • The field Entity has been removed.
  • The Improbable.Gdk.Core.Dispatcher class has been removed.

Added

  • All generated schema types, enums, and types which implement ISpatialComponentSnapshot are now marked as Serializable.
    • Note that generated types that implement ISpatialComponentData are not marked as Serializable.
  • Added the DynamicConverter class for converting a ISpatialComponentSnapshot to an ISpatialComponentUpdate.
  • Added a generated ECS shared component called {COMPONENT_NAME}.ComponentAuthority for each SpatialOS component.
    • This component contains a single boolean which denotes whether a worker instance has write access authority over that component.
    • The component does not tell you about soft-handover (AuthorityLossImminent).
  • You may now [Require] an EntityId, Entity, World, ILogDispatcher, and WorldCommandSender in MonoBehaviours.
  • Added constructors for all generated component snapshot types.
  • Added the ability to send arbitrary serialized data in a player creation request.
    • Replaced Vector3f position in CreatePlayerRequestType with a bytes field for sending arbitrary serialized data.
  • Added RequestPlayerCreation to manually request for player creation in SendCreatePlayerRequestSystem.
  • Added a menu item, navigate to SpatialOS > Generate Dev Authentication Token, to generate a TextAsset containing the Development Authentication Token.
  • Added the ability to mark a build target as Required which will cause builds to fail in the Editor if the prerequisite build support is not installed.

Changed

  • Upgraded the Worker SDK version to 13.6.2.
  • Improved the UX of the BuildConfiguration inspector.
  • Improved the UX of the GDK’s Tools Configuration window.
  • Deleting a GameObject now automatically unlinks it from its ECS entity. Note that the ECS entity and the SpatialOS entity are not also deleted.
  • Changed the format of the BuildConfiguration asset. Please recreate, or copy it from workers/unity/Playground/Assets/Config/BuildConfiguration.asset.
  • Building workers will not change the active build target anymore. The build target will be set back to whatever was set before starting the build process.

Fixed

  • Fixed a bug where, from the SpatialOS menu in the Unity Editor, running SpatialOS > Generate code would always regenerate code, even if no files had changed.
  • Fixed a bug where building all workers in our sample projects would fail if you have Android build support installed but didn't set the path to the Android SDK.
  • Fixed a bug where some prefabs would not be processed correctly, causing a NullReferenceException in OnEnable.

Internal

  • Changed the code generator to use the schema bundle JSON rather than AST JSON.
    • If you have forked the code generator, this may be a breaking change.
  • Exposed annotations in the code generator model.
  • Added a MockConnectionHandler implementation for testing code which requires the world to be populated with SpatialOS entities.
  • Added tests for StandardSubscriptionManagers and AggregateSubscription.
  • Re-added tests for Reader/Writer injection criteria and MonoBehaviour enabling.
  • Reactive components have been isolated and can be disabled.
  • Subscriptions API has been added, this allows you to subscribe anything for which a manager has been defined.
    • This now backs the Require API in MonoBehaviours.
  • Low-level APIs have been changed significantly.
  • Added a View separate from the Unity ECS.
  • Removed unnecessary KcpNetworkParameters overrides in MobileWorkerConnector where it matched the default values.