Why does the editor search for assets relative to itself

Jul 4, 2010 at 7:38 PM

Shouldn't the content path be relative to whatever scene file you're working on? Why does it make sense to configure the scene editor for each project you work on... same goes for custom component tokens. I feel like I'm missing something because this makes no sense to me at all.

Jul 4, 2010 at 7:47 PM

Also doesn't the current set up mean that you have to change the path for different build targets? Either that or change the build output directory in Visual Studio.

Coordinator
Jul 4, 2010 at 10:16 PM
Edited Jul 4, 2010 at 10:17 PM

Hi Olenikm!

From the 'Editor Guide.doc' that installs with the engine to Start->Programs->Ox Game Engine->Documentation -

Using Your Game’s Content in the Editors

By default the editors have access only to content provided by Ox. To make your game’s content available to the editors, you have to edit the editor’s Configuration/Ox.xml file. You must modify the <ContentRootDirectory> path to point to your project’s output content folder. The output content folder is the folder that contains the compiler-generated .xnb files, not the artist-created source files.

Jul 4, 2010 at 10:30 PM

Er, yes, I read the documentation. I am wondering WHY it is that way. The content folder containing the XNBs varies based on build target, and differs from project to project. The result is that you have to set it every time it changes. Wouldn't it be better to make it relative to the scene file being edited?

Coordinator
Jul 5, 2010 at 3:44 AM

Ah, I see :) Well, I don't see how it would work how you suggest. There's no necessary simple relationship between the path of a document and the project's build folder. Given that, do you have any ideas that could make it work as you suggest?

Jul 5, 2010 at 4:11 AM

I guess my problem is that configuration is absolute on a per-install basis. This means each team member has to configure the editor himself. Worse, it means that if you move your solution directory, you have to change the configuration.

I think it makes sense to have a simple project or workspace file for the editors that can point to the relative locations of assets, or possibly contain other configuration data. This would let you use the editor on a per-project basis and not worry about making anything absolute. At first I was thinking along the lines of an Eclipse workspace or Visual Studio solution but those are too involved. All you really need is a simple configuration file in the same folder as your scenes that tells the editor where to look for content.

In a sample project, I have a folder structure like this, following the standard Visual Studio format of [SolutionDir]\[ProjectDir]. I assume that most people keep their scenes in the same place and that they aren't scattered all over their hard drive.

OxGame1\OxGame1\Content\Ox\Scenes\Level1.xml
OxGame1\OxGame1\Content\Ox\Scenes\Level2.xml
OxGame1\OxGame1\Content\Ox\Scenes\Level3.xml

My content is compiled to:

OxGame1\OxGame1\bin\x86\debug\Content

So maybe I could have a file:

OxGame1\OxGame1\Content\Ox\Scenes\sceneConfig.xml

That tells the scene editor that my assets are at "..\..\..\bin\x86\debug\Content"

And actually, I'm not really worried about build targets since content shouldn't change between build targets unless you have some crazy custom build steps.

Make sense now? :)

Coordinator
Jul 8, 2010 at 5:14 AM
I'll try to come up with something simple and correct to implement. So far I've not figured out anything that is both :(
Jul 8, 2010 at 5:18 AM

Is there a way to extend the Visual Studio project file format? Add a custom element? That would make a very convenient solution to the "project" idea, especially considering the rest of the content is in the project anyway.