I’ve already got a custom system for handling this, I’m just about to improve it because its not very scalable.
I do think it is doable on your side because the batch I’m talking about basically just needs to be “any object created during this network update”.
When client syncs, obviously there is already some way of knowing if an object was created in this update (this is already exposed)
All I’m saying is, once all the objects have been created that are going to be created for this network update, trigger an event that basically says “Objects were created in this network update, and they are now ALL ready to be used”.
This could be something done at the very end of a network update. It could check whether objects were created in this update, and if there was at least 1 object created, the event would fire.
I think the real question is… is that going to be a general use case and worth implementing on your side?
I’d say anyone that uses synced GameObject properties is going to want this to ensure that those references are valid before they try to perform some logic on those references.
I’d also say that any game that has complex network objects is going to inherently use synced GameObject references because of the way Coherence is designed.
One basic example of this is a unit with abilities. If both unit and ability are network objects themselves, there will need to be a reference made one way or another to keep track of the relationship.
If a unit is created with multiple abilities, the sim will create them all in the same frame, and it will be able to easily make those relational references at instantiation.
However, on client, the unit and abilities will instantiate in basically random order, and will not all be available at once. If the unit object is created on client first, and abilities have yet to be created, I can’t run an initialization that involves references to the abilities, or it will fail.
I have to wait until I know both units and abilities are created and can properly reference each other before I can attempt to rely on those references at all.
This is what I do custom currently, but I just wanted to at least ask before I reworked what I had.