Page 1 of 1

Rewrite asset loading / resource groups to be simpler

Posted: Mon Nov 28, 2011 8:50 pm
by fuzzybinary
I'm putting out a request to rewrite the loader.

IMO, The loader as it stands is overly complicated, and adds an extra layers of complexity where a simple layer will do. Although the Archive, ResourceGroup, Resource loader system *can* make it simple to override normal cases, working with edge cases, or situations in which things like file-indexing, pre-loading and preparsing are not available or not the best solution, the Ogre asset loader is nigh impossible to overload without significant headache.

I think the Ogre asset loader should be able to support a simple load request on all asset / resource types. E.g. the following should work out of the box with no other calls to the ResourceManager

Code: Select all

dino = pSceneManager->createEntity("Dino", "assets/Dino/dino.mesh");
This means this loader should:
[*] Search archived groups if they're being used for the mesh, then touch the file system from the CWD to load the mesh.
[*] Grab skeletons starting from the directory containing the mesh, allowing the use or relative path names
[*] On demand load mentioned materials, whether or not they are indexed in the initial material search, starting at the directory of the mesh, and moving to search other directories after.

Doing this in the current system requires you override 3 (maybe more) listeners and hack around the way Ogre wants to manage assets. Why can't this just be simpler?

Re: Rewrite asset loading / resource groups to be simpler

Posted: Sat Jan 07, 2012 12:21 pm
by madmarx
From my point of view, the main reason I haven't rewrote it and proposed a replacement (though I share globally your feeling/thought), is mainly because :
- it would take me ton of time (it is so strange in the first place).
- it would break tons of code, and I don't know how much it would be accepted by the community.
- sometimes I don't know if I wouldn't prefer to also rewrite the scenemanager system.
- <=> this is not the only thing I would rewrite, this one has a lower priority.

In the end, in my currents projects, I prefer to write my own importer/exporter to avoid this difficulties.

Pierre

Re: Rewrite asset loading / resource groups to be simpler

Posted: Fri Jan 13, 2012 2:36 pm
by Klaim
A first step would be to setup a resource manager base interface (base class), then move the current implementation as a specialization (child class) and make it default. Then you could implement whatever other way that could be or not accepted later by the community, maybe as an option. Something like "SimpleResourceManager" implementation that would be "dumb".

I don't know how much useful it would be that said. My current plans is to setup a resource manager specific to my game because it uses far more other resource types than just the graphic ones (and in an async way...) so I'll just not use the Ogre one and load graphics manually through the ogre stream classes. This way I don't need the Ogre resource manager at all (if my understanding is correct - I wish I could even ditch it from the Ogre code...maybe when it will be more modular).

Anyway that don't make having a resource manager interface unnecessary.