Where should OpenTTD place files? (OSX only)

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Where should OpenTTD place the files? (please read post before voting)

Poll ended at 03 Jan 2008 17:23

~/Documents/OpenTTD
2
10%
~/Library/OpenTTD
5
25%
~/Library/Application Support/OpenTTD
8
40%
other (please specify)
5
25%
 
Total votes: 20

Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Where should OpenTTD place files? (OSX only)

Post by Bjarni »

Only for mac users

Based on feedback we might change the default location for where OpenTTD places files. The files in question are data, savegames, screenshots and so on so depending on the user that location will be accessed either only when installing or often.

Now the question is: where do you think it's best to store this? In theory it's best in "Application Support" but since it will place stuff like screenshots in there I'm not sure it's the best solution in our case so now you have to tell what you think.

Note: this poll is a guideline, not a final solution. We might not end up with the "winner". A feedback with very good arguments could declare the winner, so replies are welcome :wink:
pvz
Engineer
Engineer
Posts: 3
Joined: 27 Dec 2007 19:23

Re: Where should OpenTTD place files? (OSX only)

Post by pvz »

I voted Other because I believe there is not one single answer to this question that matches the expectations of a Macintosh user. I don't think you can't dump all the files in the same place and be happy with it.

If you really want to dump everything in one place, I suggest ~/Library/Application Support/OpenTTD as an acceptable compromise, since that's where most games I have installed on my machine put their user-specific stuff.

But instead I suggest a system like this:

For resource files: (executables, scenarios, sounds, bitmaps, NewGRF, original TTD data files, etc)

OpenTTD is distributed as a single application bundle (maybe accompanied with some Readme files etc on the same DMG.) That application bundle contains all the stuff that is distributed with OpenTTD. (This appears to be how it already works, with the exception of the media folder and the (almost empty -- just a directory tree) scenario/ folder.

If a data resource file is required by OpenTTD it should look in these three locations, in the given order: ~/Library/Application Support/OpenTTD/<resource path>, /Library/Application Support/OpenTTD/<resource path>, then inside the application bundle. That way you can, for example install the TT data files system-wide but still keep your scenarios etc in your home directory, but can still override anything through your local home directory. This is relatively consistent with how most stuff on the Mac works.

Configuration files:

The configuration files are for native mac apps usually PLIST files in ~/Library/Preferences. Sure, you can put them there, but I don't think that's strictly neccessary, although it's pretty nice. The standard Mac troubleshooting technique is to trash the preference file, and people expect that to be in ~/Library/Preferences -- although ~/Library/Application Support/OpenTTD isn't so far behind. For me, either of the options is equal here. Edit: On second thought, in the interest of consistency between different platforms, putting it in ~/Library/Application Support/OpenTTD is probably the best.

For user files: (savegames, screenshots, maybe something else I'm not thinking of now...)

Savegames should be in ~/Documents/OpenTTD -- since this is what you'd expect. A savegame is definitely user-generated content. Sure, right now maybe double clicking savegames in the Finder doesn't work, but it shouldn't be that hard to fix. Even if you don't I think putting savegames in ~/Documents makes a lot of sense.

Screenshots should be dumped on the Desktop. That's where Mac users expect screenshots to go, and for most people, making screenshots is a rare occurrence, and putting it somewhere easy to find is a good idea, especially since no real user feedback is given to where the screenshot is put.

Other operating systems

I think this same logic can be applied to other operating systems, too.

On Linux-like system for example, you could store your OpenTTD resource files somewhere like in /usr/local/share and /usr/share and allow local users to override that by putting stuff in ~/.openttd/ -- savegames should default to be put somewhere like ~/openttd/ (no dot). Screenshots should probably go into ~/ since there is no real unified standard for where a Linux user has his desktop, or even if his current Desktop Environment has a destop. I haven't run OpenTTD on a Linux machine, so maybe this is close to what it does already. I don't know...

Windows like systems don't really have the same tradition of seperating data between users, but some lessons could still be applied. Also, I don't use Windows that much, so my apologies if the path names are a bit incorrect. I'm working from memory. Anyway, keep the system-wide data in somewhere like C:\Program Files\OpenTTD and allow overriding these by looking somewhere like C:\Documents and Settings\All Users\Application Data\OpenTTD and C:\Documents and Settings\<current user>\Application Data\OpenTTD. Store savegames somewhere like C:\Documents and Settings\<current user>\My Documents\OpenTTD, and dump screenshots in C:\Documents and Settings\<current user>\Desktop. (Of course, use standard Windows coding practice of using proper variable names when actually coding, so it still works if the users change around their desktop location etc in the registry.)
Per von Zweigbergk
pv2b on IRC and OpenTTD.
User avatar
netraam
Engineer
Engineer
Posts: 10
Joined: 27 Nov 2007 17:52
Location: The flat country

Re: Where should OpenTTD place files? (OSX only)

Post by netraam »

I voted for '~/Library/Application Support/OpenTTD', which seems the most logical place to me.

However, the question that remains is what is wrong with the current way. I have OpenTTD installed in a folder 'Applications / OpenTTD', with all the files that come with it. That needs a little attention when upgrading to a new version, to make sure that I don't overwrite the existing scenarios folder, but that's not that much work.
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Where should OpenTTD place files? (OSX only)

Post by dihedral »

~/Documents/OpenTTD is kinda the wrong place for the mix of files located in there

i find ~/Library/Application Support/OpenTTD too tucked away for 'users'

therefore my vote went to ~/Library/OpenTTD

i find this a nice compromise, it's in the Library folder of the user, but not 'hidden in a deep corner' of that directory, and is not mixed with the users other documents. who knows what kind of 'structure' the various users have in ~/Documents?
~/Library/OpenTTD will blend in a little more with a more or less standard/expected behavior on os x without hiding it in another level deeper from 'users' (i.e. they will not have to dig too deep to get there and have more of a chance of getting comfortable with that location than with ~/Library/Application Support/OpenTTD) and gives the users 'freedom' back to ~/Documents to have that structured the way they feel most comfortable, used to and happy with

if a user still wants to access the OpenTTD directory from ~/Documents a symlink will do the trick here (symlinking this way round makes more sense than symlinking to ~/Library from ~/Documents!)
User avatar
metalangel
Tycoon
Tycoon
Posts: 1092
Joined: 20 Mar 2004 14:41
Location: Brooklin, ON

Re: Where should OpenTTD place files? (OSX only)

Post by metalangel »

Perhaps it's because I started computing with DOS, but I think it should be ~/Applications/OpenTTD... yes, the folder the game itself is in.

I don't know about you guys, but I tend to have several independent 'versions' going - one which is grfed up for the UK, one for the US, etc etc. This keeps each version's saves separate.
Image
"(Locomotion is) one of the best-playing games of its type." -Chris Sawyer

Northeast Corridor - South Wales & the Southwest
different
Engineer
Engineer
Posts: 79
Joined: 18 Jul 2007 21:14

Re: Where should OpenTTD place files? (OSX only)

Post by different »

On OS X, the whole point of an application 'bundle' is that you don't see anything but the program in the Applications folder. This makes it easier to navigate the folder, because you have all your programs, ready to launch. The resources are tucked away, which is great because 99% of the time, you won't need to look at them.

OTTD is very different, because it is still under development, and so there are many modifications and such that people here are creating. So it is not straightforward to have just an application bundle!

I voted 'Library/OpenTTD' but I don't believe it is that simple. Savegames/scenarios should be in 'Documents/OpenTTD', and now I'm thinking about it, it'd be great if screenshots were exported into iPhoto, tagged as an OpenTTD screenshot. Not sure how easy that is!! Failing that, the logical place is either the Desktop or the Pictures folder.

Everything else, music, newgrf, config should be in the library.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Where should OpenTTD place files? (OSX only)

Post by Bjarni »

metalangel wrote:I don't know about you guys, but I tend to have several independent 'versions' going - one which is grfed up for the UK, one for the US, etc etc. This keeps each version's saves separate.
You have the option to add a config file (openttd.cfg) next to the bundle and then it will save files locally and nobody wants to remove that feature.

This issue is about where OpenTTD should place files by default. This is specially the files it writes itself like savegames and screenshots as we still have the ability to make it look for grf files in several locations but surely it will only write files in one specific location by default.
User avatar
lobster
Tycoon
Tycoon
Posts: 5671
Joined: 21 Dec 2003 23:30
Location: Atlantic Ocean
Contact:

Re: Where should OpenTTD place files? (OSX only)

Post by lobster »

hmm, i have everything in a games folder in Applications, but my personal feeling says that it's best stored in Library/Application Support, really.
"Your mother was a lobster, and your father... was also a lobster" -- The rascal formerly known as astath -- Last.fm -- Official TT-Dave Worley Fan Club

Image

<orudge> make love to me while I surf, dear lobster
User avatar
orudge
Administrator
Administrator
Posts: 25223
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: Where should OpenTTD place files? (OSX only)

Post by orudge »

pvz wrote:I voted Other because I believe there is not one single answer to this question that matches the expectations of a Macintosh user. I don't think you can't dump all the files in the same place and be happy with it.
I would agree for the most part with this post. Using ~/Library/Application Support/OpenTTD *and* ~/Documents/OpenTTD (perhaps put screenshots here instead of the desktop, in my opinion) would seem to be consistent with the way most Mac applications work.
Boah
Engineer
Engineer
Posts: 15
Joined: 29 Jul 2004 23:47
Location: London
Contact:

Re: Where should OpenTTD place files? (OSX only)

Post by Boah »

It depends on what files, really. The current files in ~/Documents/OpenTTD is where I'd logically look for most of those files. They are generally user data files such as saved games and screenshots (although I'd suggest a sub-folder for screenshots, like there's for saved games, but that's an aside).

More important than that though (at least to some extent), is what Apple has to say on the matter. The guidelines generally says that "~/Library/Application Support" (or in fact anywhere in ~/Library) should not contain any user data of any sort, "~/Library/Preferences" should be used for preferences/configuration files, "~/Library/Caches/" for any cache files, use the temporary folder for temporary files, and so on.

Therefore, to me, ~/Documents/OpenTTD is a perfectly valid location for most files currently there. Storing configuration files in the same location might not be ideal or recommended, but it might be acceptable (for the time being?).

Some resources that might be helpful:
When it is not necessary to make a decision, it is necessary not to make a decision - Lord Falkland (1610 - 1643)
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Where should OpenTTD place files? (OSX only)

Post by Bjarni »

Apple wrote:Don’t Pollute User Space

It is important to remember that the user domain (/Users) is intended for files created by the user. With the exception of the ~/Library directory, your application should never install files into the user’s home directory. In particular, you should never install files into a user’s Documents directory or into the /Users/Shared directory. These directories should only be modified by the user.

Even if your application provides clip art or sample files that the user would normally manipulate, you should place those files in either the local or user’s Library/Application Support directory by default. The user can move or copy files from this directory as desired. If you are concerned about the user finding these files, you should include a way for the user to browse or access them directly from your application’s user interface.
So Apple wants to make this complicated. However it's Apple's guidelines and we already break the guidelines by using statically linked binaries. Apple don't like statically linked binaries (they argue that when you update a library then all apps using that library should use the new one... makes sense) but it would mean that all users would have to install libpng and freetype manually.

I think the bottomline is that we should figure out what works for us in our specific case. Apple wrote this as a general guideline, not specific to our case where we want to share as much code as possible with linux. Sure we could move openttd.cfg to the pref directory but what would we gain apart from a harder to maintain code?
pvz
Engineer
Engineer
Posts: 3
Joined: 27 Dec 2007 19:23

Re: Where should OpenTTD place files? (OSX only)

Post by pvz »

One thing that I seem to be getting from this entire thread is that placing stuff in ~/Library is somehow "complicated". Not at all. Library isn't "hidden" in any way. It's in fact where a seasoned Mac user would *expect* to find stuff.

You won't be doing newbies any favour by unilaterally putting stuff in ~/Documents befause it's "easier". It's not easier. Users have to be told to look in ~/Documents same as being told to look in ~/Library somewhere.
Per von Zweigbergk
pv2b on IRC and OpenTTD.
Boah
Engineer
Engineer
Posts: 15
Joined: 29 Jul 2004 23:47
Location: London
Contact:

Re: Where should OpenTTD place files? (OSX only)

Post by Boah »

It's in fact where a seasoned Mac user would *expect* to find stuff.
A 'seasoned' Mac user will most likely not know what ~/Library is there for, nor will he care, because in most cases you never have to fumble around in there for anything. 'Documents', on the other hand, is not only pretty much self-explanatory, it is also where user data is usually found. Therefore the user is more likely to figure it out and not have to be told.
Users have to be told to look in ~/Documents same as being told to look in ~/Library somewhere.
User data (saved games, screenshots, etc) should not be in ~/Library simply because no one else puts user data there, hence the user wouldn't expect it to be there.

It's not just about the physical location - it's about expectations and consistency.

Drawing parallels to Windows, it's probably worth mentioning that Microsoft do have similar guidelines and similar folders where files should go - you wouldn't put user data in "~/Application Data", you would put it in "~/My Documents" ("~/Documents" on Vista). Alternatively you'd put it in the user's home folder, but it most definitely would not go in "~/Application Data".
You won't be doing newbies any favour by unilaterally putting stuff in ~/Documents befause it's "easier".
I think the "unilaterally putting stuff" is the crux of the 'issue'. The current location for saved games and screenshots is where the user would expect them to be. The real argument is whether 'other' files also belong there - and while OpenTTD doesn't follow Apple's guidelines by having them there it is probably acceptable as a compromise (if they all have to be in the same place). Having it the way it is now is much better than moving everything into ~/Library.

My opinions obviously :)
Last edited by Boah on 30 Dec 2007 23:24, edited 2 times in total.
When it is not necessary to make a decision, it is necessary not to make a decision - Lord Falkland (1610 - 1643)
Boah
Engineer
Engineer
Posts: 15
Joined: 29 Jul 2004 23:47
Location: London
Contact:

Re: Where should OpenTTD place files? (OSX only)

Post by Boah »

However it's Apple's guidelines and we already break the guidelines by using statically linked binaries.
There are valid arguments both ways on that one (although both Apple and Microsoft generally recommends the dynamic route). However, I wouldn't use breaking one guideline as reason to break another ;)
Apple wrote this as a general guideline, not specific to our case where we want to share as much code as possible with linux.
I don't really see code sharing as an argument for not following the guidelines. It should be possible to code it in a way so it can support platform specific stuff while keeping the internal API the same across platforms.

Note that these are just a general comments, and not comments on the codebase of OpenTTD as I don't know it. Reality is always a place of compromise - the current location of the files is the best such compromise if there has to be one.

My opinion, as always.
When it is not necessary to make a decision, it is necessary not to make a decision - Lord Falkland (1610 - 1643)
different
Engineer
Engineer
Posts: 79
Joined: 18 Jul 2007 21:14

Re: Where should OpenTTD place files? (OSX only)

Post by different »

Apple wrote:Don’t Pollute User Space

It is important to remember that the user domain (/Users) is intended for files created by the user. With the exception of the ~/Library directory, your application should never install files into the user’s home directory. In particular, you should never install files into a user’s Documents directory or into the /Users/Shared directory. These directories should only be modified by the user.

Even if your application provides clip art or sample files that the user would normally manipulate, you should place those files in either the local or user’s Library/Application Support directory by default. The user can move or copy files from this directory as desired. If you are concerned about the user finding these files, you should include a way for the user to browse or access them directly from your application’s user interface.
[/quote]

I read this as:

Any file installed by OTTD should not be installed in the user's domain. But files created after the installation - i.e. by the user (screenshots and the like) could reside in the user's Documents directory, as the user has intended for them to be created.
Bjarni wrote: I think the bottomline is that we should figure out what works for us in our specific case. Apple wrote this as a general guideline, not specific to our case where we want to share as much code as possible with linux. Sure we could move openttd.cfg to the pref directory but what would we gain apart from a harder to maintain code?
There are obviously trade-offs, and it is difficult when you are maintaining multiple versions of an application all at the same time, perhaps for compatibility issues or different configuarations.

Personally, I would treat a Mac 'port' as just that - a separate codebase. To not make use of OS X's preferences handling or other features (which aren't supported in Win/Linux) would be daft. However I can appreciate that it makes a lot more work which I doubt you'd want to take on (as extra to the great work you've already done :) )
octernion
Engineer
Engineer
Posts: 5
Joined: 05 Jan 2008 17:27

Re: Where should OpenTTD place files? (OSX only)

Post by octernion »

I am I Mac user, and I recently needed to change the config file (to see how the 32bpp blitter looked- it was pretty weird on my PPC laptop, actually) for 0.6.0-b2. I first looked in the data directory, didn't find anything, then looked in Application Support (since that's where everything else puts data/config files), wasn't there, so I checked preferences, wasn't there... I had to open up Spotlight, which informed me the config files were in my Documents directory! Utterly, completely counter-intuitive-I certainly hadn't told OpenTTD to clutter up my well-organized Documents! :)

Anyways, a strong vote for putting at least the data and config files into Application Support where they belong!
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Where should OpenTTD place files? (OSX only)

Post by DaleStan »

IMO, savegames go in a subdirectory of Documents (Documents/OpenTTD, Documents/Saved Games/OpenTTD, &c.) and anything else goes somewhere else.

For Windows, that "somewhere else" is <user>/Application Data/OpenTTD if its user-specific, and one of All Users/Application Data/OpenTTD or Program Files/OpenTTD if it's global.
I'm not sure which of ~/Library and Application Support most closely resemble those locations, though.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Draakon
Director
Director
Posts: 542
Joined: 11 Mar 2007 16:50

Re: Where should OpenTTD place files? (OSX only)

Post by Draakon »

Erm, windows puts savegames, screenshots and config files inside My Documents with a subfolder called OpenTTD. Rest goes where user installs/puts them currently.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Where should OpenTTD place files? (OSX only)

Post by DaleStan »

OK, Screenshots go in Documents too.

But configs and data files have no business in Documents. They go (as in "belong, should be put") somewhere else.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Draakon
Director
Director
Posts: 542
Joined: 11 Mar 2007 16:50

Re: Where should OpenTTD place files? (OSX only)

Post by Draakon »

Data files don't go in documents, unless user does put them there.

But we aren't here to talk about Windows here.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests