Directory paths for resources and assets

Posted by The Communist Duck on Game Development See other posts from Game Development or by The Communist Duck
Published on 2010-08-06T13:51:27Z Indexed on 2011/11/17 2:06 UTC
Read the original article Hit count: 270

Filed under:
|
|

If I have a file stucture for my final, released game something like:

  • Main folder
    • Media
      • Images
      • Other assets
      • Sounds
    • Executable
    • List item

And a different one for my 'in development' project, with the same Media folder but:

  • Main
    • Source and .obj, etc.
    • Media with everything
    • Bin folder with executable

I obviously cannot hardcode file pathnames into this, like: "../Media/Image/evilguy.png" or "Media/Image/foo.jpg" because they wouldn't work with one of the builds and would require a lot of switching names.

Instead, does it make sense for my resource manager, that loads everything, to have some kind of prefix path? Then, I can just do Get("foo.jpg") or Get("Sounds/boom.ogg")
And simply switch out, for the final release, the ctr argument from the relative path for the development build to the release layout?

If not, how have other people sorted these sorts of things out?

© Game Development or respective owner

Related posts about loading

Related posts about file