Why the prefix on the data folder?

Monkey Forums/Monkey Programming/Why the prefix on the data folder?

therevills(Posted 2012) [#1]
Could someone please tell me the reason we have to prefix the data folder with the project name?

I can hax trans every time Mark releases a new Monkey version so I don't have to do this, but I really want to know why we are forced to do it in the first place...


Karja(Posted 2012) [#2]
You can have several projects that uses different resources in the same folder when it's structured like this. Not that it's something I ever do myself...

I can't see any other reason for it, personally.


therevills(Posted 2012) [#3]
Yeah, thats the only reason I can think of too... but I don't think its a valid one.


Gerry Quinn(Posted 2012) [#4]
I've actually done it once or twice with a mini-project that tests something. And I can imagine a module being distributed with a couple of examples, all in the same folder.

Or you might have an ad-supported version and a full version, or a desktop and a mobile version, though I would normally use the preprocessor for such things.

That said, if the prefix was removed I wouldn't shed any tears over it. And of course it could be made optional, i.e. if there is no folder called xapp.data, it looks for a folder called data. But the prefix doesn't bother me at all either.

In some ways I like the prefix as it clearly distinguishes the stuff that goes in the program from folders like gfx and sfx which contain stuff I am working on for the project but which doesn't go into the build.


ziggy(Posted 2012) [#5]
The prefix is great. It allows to make a single samples folder for my modules. I wich we could give an target specific folder, something like:
myapp.html5.data to force platform specific data folders.


therevills(Posted 2012) [#6]
@Ziggy, yes it does allow you to make a single sample folder but if you reuse media in your samples it will force you to store multiple copies of them in each data folder.

And with the target specific folders, I would do it with a preprocessor as your way would force you to have a different main monkey file, i.e.: myapp.html5.monkey, myapp.java.monkey, myapp.bmax.monkey etc.

@Gerry, yeah its okay for a couple of examples but with Diddy we have 20 examples and quite a few reuse media, so we have to have duplicate files.

Overall, I can live with the prefix (or I can remove it myself per release) but I remember when I first started Monkey it took awhile to work out why I couldnt load an image, so its not really user friendly.


Qcat(Posted 2012) [#7]
How about a command such has SetDataDir() might help even if it uses the preprocessor #.