[ott3d] Game resources management.
Posted: 20 Sep 2009 21:08
I have two ideas regarding resource management in the ott3d branch.
First, I wouldn't use the ogre's default resources.cfg and media.cfg scripts because they make it uncomfortable for the player to download new graphics. Instead, let's dedicate one folder for resources and make the game recursively parse everything in it. Ogre has built-in filesystem acces functions, so no extra libs are necessary.
Second, we need to assign various game-specific attributes to graphical entities, for example checkpoints to rails or weight to vaggons. I suggest using xml files to describe and reference each resource. The game should first parse all the xml-s and then load resources using the obtained data.
This is a sample xml:
I'm willing to code both features if they are approved.
~An00biS
First, I wouldn't use the ogre's default resources.cfg and media.cfg scripts because they make it uncomfortable for the player to download new graphics. Instead, let's dedicate one folder for resources and make the game recursively parse everything in it. Ogre has built-in filesystem acces functions, so no extra libs are necessary.
Second, we need to assign various game-specific attributes to graphical entities, for example checkpoints to rails or weight to vaggons. I suggest using xml files to describe and reference each resource. The game should first parse all the xml-s and then load resources using the obtained data.
This is a sample xml:
Code: Select all
<xml>
<resources version="1"> <!-- Version of the resources file format -->
<resource type="mesh" name="House" path="house.mesh">
<property name="Population" value="10">
<property name="RemovalCost" value="10,000">
<labels>
<label name="Structure" />
<label name="Residental" />
<label name="House" />
</labels>
</resource>
<resource type="mesh" name="Tree" path="tree.mesh">
<!-- properties -->
</resource>
<!-- and more.... -->
</resources>
</xml>
~An00biS