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.3.4

Compare
Choose a tag to compare
@gdk-for-unity-bot gdk-for-unity-bot released this 25 Mar 16:19
4b725e8

In this release, we've moved from using chunk-based interest to using query-based interest by default.

To help you with this, we've added an EntityReservationSystem which automatically keeps a pool of reserved entity IDs. The Player Lifecycle module has been integrated with this system, providing the CreatePlayerEntityTemplate callback with the entity ID that the player will have after it is successfully spawned.

This is particularly useful for defining interest queries that are self-referential.

As QBI lets you filter for components a worker should be interested in, the GameObject Creation module has been changed to run for entities that match the minimum component set required by a IEntityGameObjectCreator, instead of any entity that is newly added.

This means that the module no longer cares if an entity is checked out in one frame or across multiple.

In addition, the GDK now lets you pin a runtime version that you wish to use. Initially this has been set to 14.5.0, but you can override this in the GDK Tools Configuration.

We've also included our usual assortment of bug fixes.

Note that this release includes several breaking changes. Please read the upgrade guide here.

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

See the full release notes below! 👇


Breaking Changes

  • The DeploymentLauncher project has an additional required argument runtime_version. If you invoke this manually through dotnet, you'll need to provide this argument. #1299
  • Schema components in ECS no longer have a ComponentId property. #1308
    • You should use ComponentDatabase.GetComponentId<T>() instead.
  • CustomSpatialOSSendSystem is no longer available. #1308
  • The Player Lifecycle feature module now provides an EntityId in its CreatePlayerEntityTemplate callback. #1315
    • You will have to change your callback from (string clientWorkerId, byte[] serializedArguments) to (EntityId entityId, string clientWorkerId, byte[] serializedArguments).
  • Added the PopulateEntityTypeExpectations method to IEntityGameObjectCreator. #1333
    • Use this method to define the set of components expected on an entity to be able create GameObjects for a given entity type.
  • Added string entityType as an argument to IEntityGameObjectCreator.OnEntityCreated. #1333
    • This means that your entities must have the Metadata component to use the GameObject Creation Feature Module.

Added

  • Added ability to construct a CodeWriter using just the raw string content. #1275
    • This will override anything defined through the ergonomic CodeWriter API.
  • Introduced a new CodegenJob model. #1275
  • The SpatialOS Runtime version is now pinned by the GDK. This has been initially set to 14.5.0.
    • You can override this version in the GDK Tools Configuration. #1289
    • This version (or your override) will be used in both local deployments started through the editor and cloud deployments started through the Deployment Launcher.
    • The currently selected version will be displayed in the Deployment Launcher. #1302
  • Added a Dump() method to CommandLineArgs to format all the parsed command line arguments into a string. This can aid you in debugging issues relating to command line args. #1312
  • Added the EntityReservationSystem which automatically keeps a pool of reserved entity IDs. #1314
    • The system's TakeAsync(count) and GetAsync() API can be used to obtain entity IDs for spawning, without needing callbacks.
    • There is also a non-async TryTake(count, out EntityId[]) and TryGet(out EntityId) version which allows for reservations to fail.

Changed

  • Downgraded the level of several code generator logs from Info to Trace. #1277
  • Upgraded the Worker SDK to 14.5.0. #1317
  • Upgraded the Platform SDK used by the Deployment Launcher to 14.5.0 #1317
  • Changed the GameObject Creation module to run for entities that match the minimum component set required by the creator, instead of any entity that is newly added.
    • This means that the module no longer cares if an entity is checked out in one frame or across multiple.

Fixed

  • Fixed a bug where code generation would happen on every Unity compilation, despite the code generator returning successfully. #1294
  • Fixed a bug where dotnet output from the code generator would cause exceptions to be thrown. #1294
  • Fixed a bug where the Mobile Launcher window wouldn't find Android devices that contained hyphens in their product name. #1288 #1296
  • Fixed a bug where component events were not dropped properly when the entity-component pair was removed from the View. [#1298])(#1298)
  • Fixed a bug where Reader/Writer/CommandSender/CommandReceiver fields would not have their state set to invalid when the underlying constraints were not met. #1297
    • This bug would manifest itself in situations like a Reader reference attempting to read data that does not exist in your worker's view anymore.
  • Fixed the Mobile Launcher being unable to find the Android SDK when using the embedded installation. #1319
  • Fixed a bug where losing a Reader due to QBI would break the monobehaviour that required it. #1326

Removed

  • Removed the old CodegenJob model. #1277

Internal

  • Ported all modules to the new CodegenJob model. #1276
  • Running forced code generation now deletes the ImprobableCodegen.marker file. #1294
  • Added tests coverage for the interaction between unlinking a GameObject and Reader/Writer/CommandSender/CommandReceiver state. #1295
  • Reduce complexity in ViewDiff and MessagesToSend classes. #1290
  • De-duplicated code for generated ComponentDiffStorage instances. #1290
  • Improbable.Gdk.Core.EntityId is now a readonly struct. #1290
  • The Playground project now uses QBI instead of CBI. #1370
  • Added MockWorld and MockBase classes to the Improbable.Gdk.TestUtils package. These are designed as a framework for testing Core code. #1305
  • Switched internal profiling to use new ProfilerMarker API. #1311
  • Changed MockWorld.Options.AdditionalSystems from Type[] to Action<World>. #1330