In general, Entity Component Slices use reference counting to keep track of asset use. That reference count (as you may expect) is adjusted per every usage of the asset with the asset being unloaded at a ref count of 0. There are some legacy systems however where assets aren't freed until the level is unloaded. We hope to address this in a future version so keep your eyes peeled for that. Past that, I think implementing a pooling system would be a great idea depending on the quantity of slices you're spawning.
I would also recommend checking out the Multiplayer Sample included with Lumberyard. It's a good example of spawning a good number of a variety of slices. It does not use pooling so it may help you get an idea of bounds.
Please let us know if you have further questions here!
Thanks for your answer.
Hope to have some free time to test something live.
I will surely take a deep look at multiplayer sample.
I need to inspect the code as every single sentence makes more question arise.
I want to understand if the reference to a slice in spawn component make the slice and referenced resources load or not and if there a way to defer the loading and/or to preload to better control what is loaded at any time.
what about assets from server point of view?what get loaded in the server and how to lighten the server package to remove client only assets or load simplified version of some assets(es model with just collision, more compressed animation with less bones etc.
The idea here is always to maximize how much a single instance can manage to load less things , faster and more efficiently to not waste/trash memory and not degrade performances over time.It can be labeled as an early optimization, but even in the beginning is always better to make well informed choices so need to grasp all the engine fundamentals.
Also allocators are an insteresting subject I would love if you can document further.
On the subject of resource loading timing, we're actively looking at that. Presently you can try playing with AZ::Data::AssetFlags values to manipulate the timing of loads as it pertains to an instance of a slice. OBJECTSTREAM_QUEUE_LOAD should allow a slice to load while a loading asset is still being loaded while OBJECTSTREAM_PRE_LOAD should hold the slice until the loading asset finishes.
On the subject of assets from the server point of view, I will have to do some follow up to get a clearer answer. What I do know is that we have a NULL Renderer exactly so we don't waste resources rendering when there isn't anywhere to display to. You can also control what fields are synchronized over the network so you don't have to synchronize every field of an entity.
Can you let me know what you'd like to see in regards to allocators?
Thanks I will look at that flags.
About allocators I use to have few custom ones i use the most in my other project and I have just seen that there are just various ones in the engine, but there is no documentation and is still not clear to me how to make use of them.
However main priority is still the doxygen like documentation and github to make studing the source way more comfortable that stick to the pc and visual studio.
Adding new answers, comments, and votes is disabled.
Can you guys tell me how to Spawn dynamic Slices from C++?Accepted Answer
[Solved] Spawner, How to distinguish the entities spawned?Accepted Answerasked 2 years ago
Is it safe to spawn many disposable slices of limited lifetime or some kind of management strategy is required?Accepted Answerasked 6 years ago
[Solved] How to get EntityID of a slice spawned?Accepted Answerasked 2 years ago
I need help with Lua scripting in terms of spawning and deleting objects as well as providing an impulse and detecting collision!Accepted Answerasked 6 years ago
How you guys made communication between same entity's components or Slice components?Accepted Answer
Lifetime of tasks created by StartSpeechSynthesisTaskasked 2 years ago
Strategy game designAccepted Answerasked 2 years ago
On dynamic slicesasked 5 years ago
Get AssetId of Dynamic SliceAccepted Answerasked 6 years ago