I'm having a very hard time trying to figure out a good way to add new resources to my game project in a way that's convenient for designers.
To try and better understand the problem, I'm trying to create a very simple game. It's in the style of an old text adventure. The user begins in a room, and at the start of each turn an image of the room is displayed and some text describing the room is printed. Then several options are shown (in a multiple choice format). The user picks one and option and the result of the action is printed to the screen. Then the turn ends and the next turn begins (the new image and description are shown, more options are printed, etc).
This game will require several resources: - String tables (to hold the text) - Images (Shown in each room) - Places (links to the image and description, as well as the list of options) - New Game Scenerio (used to initialize game. Just tells the user where the starting room is)
I would like to create an editor where designers can just start it up and then start adding and editing rooms.
The straight forward approach would be to create a simple, stand alone editor that can load and save independent Place files. It would use relative file paths to locate the linked images and string tables. These Place file format would be XML which would later be compiled to a binary form when the final resource archive containing all resources is compiled.
The trouble with using paths, though, is that if you rename and move files (as you likely will as the project get larger), the paths that point to it will break (at well as any relative paths it points to itself).
Relative paths can also be a problem if you need to refer to resources that are in a completely different branch off the root. For example, let's say I have the following resources in my project:
/item/MagicWand.xml /place/grassyPlain/castle/DarkTower.xml
If I want to place a MagicWand in my DarkTower, I'd have to use a relative path that looks something like "../../../item/MagicWand.xml". That's pretty cumbersome. It would be nicer to use something like "item.MagicWand".
Also, since these resources are going to be compiled, if I need to refer to them from my scripts I will need something to call them. If my user is in the DarkTower and selects the option "go to the griffon pen", I'm like to be able to do this with code similar to
getUser().setLocation("place.grassyPlain.castle.GriffonPen");
All this suggests importing my resources into some sort of super editor project that knows how to handle all resources and provides names for them (and even provide interactive editors for some of them). While this would simplify the naming problem, but would be a lot of work - especially if more than one person need to design resources at the same time. (for multiple users, I'd need a database-like locking mechanism to make sure multiple people weren't renaming things or working on the same file at the same time). The whole thing would have a look and feel that calls to mind the Flash editor.
My thinking keeps leaning toward this super-duper editor solution, since I've been exposed to tools like this before. However, this seems like a lot of work, especially for so simple a project. I can't help but think that I'm over thinking this. I would like to have a system for managing my game's resource that is simple yet, flexible and which integrates well with my code/scripts.
Does anyone have any thought on what makes a good resource managment/naming system?