Why does the editor search for assets relative to itself

Jul 4, 2010 at 8: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 8: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.

Jul 4, 2010 at 11:16 PM
Edited Jul 4, 2010 at 11: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 11: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?

Jul 5, 2010 at 4: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 5: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.


My content is compiled to:


So maybe I could have a file:


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? :)

Jul 8, 2010 at 6: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 6: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.