1
\$\begingroup\$

I have one way - xml and code like this:

<Texture file="file_name.jpg">
  <Sprite id="ID_SPRITE_1" coordinates="0 0 64 64"/>
  <Sprite id="ID_SPRITE_2" coordinates="64 0 64 64"/>
  <Sprite id="ID_SPRITE_4" coordinates="128 0 64 64"/>
</Texture>

then parse and load it, when application starts, then use resources by id.

What another ways to describe paths and propeties of resources used by developers and why?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ What kind of alternative are you looking for? Is there any particular thing you don't like about loading xml config files? \$\endgroup\$ Commented Dec 24, 2013 at 13:29
  • \$\begingroup\$ i just want to know different developer's solutions for common knowledge \$\endgroup\$
    – hoody
    Commented Dec 24, 2013 at 22:39

2 Answers 2

1
\$\begingroup\$

Commonly game resources, menus (GUI), levels, etc will all be handle offline using a set of tools, usually developed in-house for an exact purpose. These tools will then often export to a bespoke format designed to allow the game to quickly load in these files with little overhead. To do this the files will typically be in a binary format and so every tweak must be performed in the tool and then re-exported for the game.

Tools are an important part of game development. They reduce the responsibilities of the programmers and allow all members of the team to edit resources without the knowing how to read through a code file. Most importantly though, the more that can be pre-prepared offline to reduce overhead in game, the better.

\$\endgroup\$
1
  • \$\begingroup\$ thanx for answer \$\endgroup\$
    – hoody
    Commented Dec 24, 2013 at 22:34
1
\$\begingroup\$

This is going to depend entirely on each kind of resource. There are many ways to manage your resources, too.

An example of how I do this with one of my projects, is I separate resources into packages. so a package may consist of 5-10 files that define a map, or a couple of hundred of precompiled shaders. Then when I want to a resource I call Cache->Load<Map>("Map1.pak", "Map.xml");

Of course, every project that I've worked with has used a different system. For example, you may want to check Ogre3d to see how resource management is done there.

\$\endgroup\$
1
  • \$\begingroup\$ thanx for answer \$\endgroup\$
    – hoody
    Commented Dec 24, 2013 at 22:36

Not the answer you're looking for? Browse other questions tagged .