Hmm...
The staggered loading part makes sense in the case of actual resources. I didn't think that was what you meant, though, since you were talking about plugging things into the world. Do you mean like loading configuration data for the object from files?
I don't get why this pattern is associated with improved performance, though. A constructor is just a function. It would have to do the same work as the other functions are doing. Do you mean that performance is improved by the staggered loading?
In my mind I'm thinking that an entity would be created, then plugged in. Any resources (graphics, audio, etc) that it needs should be owned remotely (by a cache or something) so that they can be shared between instances. The entity may trigger loads from the cache, but the cache could be designed to provide a placeholder 'blank' resource until the loading is complete. I get that the loading could be moved to the plug-in/activate stage rather than the construction, which would spread the work out.
I guess what I don't get is why you can't do something like:
class Thing {
Thing() {
//set default values here
commonCtor();
}
Thing(SerialThing*) {
//deserialize here? (or deserialize externally and pass in a pimpl?)
commonCtor();
}
void commonCtor() {
//construction (maybe notify the cache of impending resource requests so that it can get a head start if it's not busy?)
}
void OnPlacedInWorld() {
//activate the object
}
};
I'm thinking that it would make more sense if I saw it in action. I just don't get why the actual ctor would be left blank and then have a number of initialization functions. Possibly this relates to that fact that I've not yet worked with the Entity-Component pattern.
I don't fully understand what you mean by point 7. Does GameObject() have a meaningful constructor or is it left blank? From your earlier post I had the impression that the ctor was doing nothing, and either the OnCreate() function or some kind of external(?) deserialization was being used instead. So what you're saying is that the base ctor is doing some kind of common work, and then OnCreate() or alternative is doing the local construction?
It isn't a case of non-construction. The game object is fully constructed after the constructor.
?
Yeah, I'd need to see what kind of overall framework this is in before I'd understand the reasoning behind it.