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
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
andCreateResponse
. Instead, they are constructors that take the same arguments. - The
Require
attribute has moved from theImprobable.Gdk.GameObjectRepresentation
namespace to theImprobable.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 nowOn{EVENT_NAME}Event
.{FIELD_NAME}Updated
is nowOn{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 nowSend{EVENT_NAME}Event
.Send
is nowSendUpdate
.
- 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 fromGameObject OnEntityCreated(SpatialOSEntity entity)
tovoid OnEntityCreated(SpatialOSEntity entity, EntityGameObjectLinker linker)
. - The signature of
IEntityGameObjectCreator.OnEntityCreated
has changed fromvoid OnEntityRemoved(EntityId entityId, GameObject linkedGameObject)
tovoid OnEntityRemoved(EntityId entityId)
.- All linked
GameObject
instances are still unlinked before this is called, however it is now your responsibility to track if aGameObject
was created when the entity was added. - You should now call
linker.LinkGameObjectToSpatialOSEntity()
to link theGameObject
to the SpatialOS entity. - You should also pass-in a list of
ComponentType
toLinkGameObjectToSpatialOSEntity
which you wish to be copied from theGameObject
to the ECS entity associated with theGameObject
.- 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.
- All linked
SpatialOSComponent
has been renamed toLinkedEntityComponent
.- The field
SpatialEntityId
on theLinkedEntityComponent
has been renamed toEntityId
. - The field
Entity
has been removed.
- The field
- The
Improbable.Gdk.Core.Dispatcher
class has been removed.
Added
- All generated schema types, enums, and types which implement
ISpatialComponentSnapshot
are now marked asSerializable
.- Note that generated types that implement
ISpatialComponentData
are not marked asSerializable
.
- Note that generated types that implement
- Added the
DynamicConverter
class for converting aISpatialComponentSnapshot
to anISpatialComponentUpdate
. - 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]
anEntityId
,Entity
,World
,ILogDispatcher
, andWorldCommandSender
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 inCreatePlayerRequestType
with abytes
field for sending arbitrary serialized data.
- Replaced
- Added
RequestPlayerCreation
to manually request for player creation inSendCreatePlayerRequestSystem
. - 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
inOnEnable
.
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
andAggregateSubscription
. - 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.
- This now backs the
- Low-level APIs have been changed significantly.
- Added a View separate from the Unity ECS.
- Removed unnecessary
KcpNetworkParameters
overrides inMobileWorkerConnector
where it matched the default values.