Commit Graph

13 Commits (4ad0560d06bd849f8ccdaaa473fbafffc97fc641)

Author SHA1 Message Date
AMZN-koppersr 4ad0560d06 Removed AddOn(De)SpawnedHandler from Spawnable Entities Interface
The calls AddOnSpawnedHandler and AddOnDespawnedHandler were removed from the SpawnableEntitiesInterface. These functions will eventually be called from multiple threads and AZ::Event currently doesn't have a thread-safe version to support this. There's also a performance concern as these callbacks are called for each individual (de)spawn requests which can lead to multiple handlers being called without information that's relevant to the callback. It would be better to batch up all (de)spawn requests per ProcessQueue call and only have a single event do a single signal. Since both events are currently not being used they have been removed for now, but can be introduced -with the previously mentioned concerns in mind- when needed.
5 years ago
AMZN-koppersr febf53671e Addressed PR feedback. 5 years ago
AMZN-koppersr 1e7ac60949 Reintroduced spawning multiple instances of the same entity
The following was changed:
- The remapper in AZ::IdUtils now has an additional argument to tell it what to do when it encounters the same source entity id. The original behavior of ignoring the new entity id and returning the first occurrence is the default. The alternative behavior is to store the last known entity id and return that instead.
- Split the optional arguments for SpawnAllEntities and SpawnEntities.
- SpawnEntities now has an option to continue with the entity mapping from a previous spawn call or to start with a fresh mapping. The latter is the default as the former will come at a performance cost since the mapping table has to be reconstructed.
- Entities spawned using SpawnEntities and ReloadEntities now also get the correct entity mapping applied.
- Added several new unit tests to cover most of the new functionality.
- Fixed some places where the older API version was still called.
5 years ago
AMZN-koppersr 8c541b5205 Moved default values to object in the Spawnable Entities Interface 5 years ago
AMZN-koppersr 1bf8c599e3 External Serialize Context for spawning
This change makes it possible to provide a Serialize Context for spawning entities from spawnables. This also removes the need for the Serialize Context to be retrieved multiple times per frame.
5 years ago
AMZN-koppersr c946d57928 Addressed PR feedback. 5 years ago
AMZN-koppersr e0948a26bc Fixed early ticket delete crash
This commit fixes a crash that could happen when a spawnable ticket was deleted before all requests in the queue had completed. Because of this crash the requests now only hold on to the payload of the ticket but not the ticket itself. As a side effect, callbacks can no longer provide the ticket itself so instead a unique id for the ticket is returned.
5 years ago
AMZN-koppersr 76827ff95e Added support for a priority lane for entity spawning
It's now possible to have high and normal priority calls on the spawnable entities manager. This allows for events like (de)spawning and retrieving information to be executed before already queued requests, though requests cannot be reordered on the same ticket. High priority calls are executed twice per frame, while normal priority calls are called only once.
5 years ago
AMZN-koppersr e4efc467f2 Updated comment for ListEntities in SpawnableEntitiesInterface.
Updated the comment for ListEntities to be more descriptive. This hopefully clears up the confusion about what the index in a spawnable ticket exactly refers to.
5 years ago
AMZN-koppersr a807c0b4d8 Additional list function added to Spawnables.
A new list function was added to the SpawnableEntitiesInterface that list entities together with the id of the entity in the spawnable that was used to create it.
This change also include the setup for testing the SpawnableEntitiesManager plus a few tests to cover the newly added functionality.
5 years ago
pereslav 970c87b487 Refactored spawning network entities to use SpawnableEntityManager instead of duplicating the code in NetworkEntityManager 5 years ago
pereslav e414cc151d SPEC-6590 Implemented network entities instantiation by network spawnable asset ID 5 years ago
alexpete c2cbd430fe Integrating up through commit 90f050496 5 years ago