freenode/#shirakumo - IRC Chatlog
Search
13:52:54
Shinmera
As discussed on Sunday, we need a system that somehow notifies entities when their dependent resources have been loaded, so that it can do some loading operations of its own.
13:53:24
Shinmera
1. Mark the entity as a resource itself. This would make it be picked up automatically, but is of course ugly because entities aren't really resources.
13:54:53
Shinmera
2. Call a "finish" or "load" or "ready" function for each entity after the loading of all resources. This could mean calling that function on lots of entities that don't need it and would require re-traversing the scene.
13:55:30
Shinmera
3. Have a superclass for "finishable" or whatever and gather those into a separate vector when the scene is traversed to look for resources. This would mean only calling relevant entities, but at the cost of keeping another data vector.
13:56:10
Shinmera
4. Have some kind of dependency system that keeps track of dependencies of entities and notifies the entity when all of its dependencies have been allocated.
13:56:40
Shinmera
This would be the neatest solution as it would be separated from the loader system, but it would also incur the most implementation complexity and execution overhead.
14:21:39
gingerale
Having another data vector for #3 is cheap and simple enough to implement. I like #4 the most but it seems like something with a lot of moving parts.
14:27:26
Shinmera
"finish" is bad because it implies the instance should be destroyed / is done executing
14:27:46
Shinmera
"load" is bad because there's nothing to load, that's all in resources. this function would only be to perform extra computations based on resources.
14:28:18
Shinmera
"ready" is bad because it seems too general and doesn't really say what the entity is ready for.
21:27:40
mood
Shinmera: So I wasn't here at that time, but I completely agree with gingerale. #4 is neat but also complex, #3 is somewhat ugly but cheap and simple :)
21:31:01
Shinmera
Good, then I just need to figure out why the hell it's not always readying everything like it should.