PDA

View Full Version : Linux/Unix users: Where should savefiles be stored?


takkaria
June 22, 2007, 14:26
Where should savefiles be stored? Are they better kept in lib/save/ (or wherever your distro puts them), or in your home directory in ~/.angband/, along with your pref files, screendumps, and the like?

(Since we have a poll function here, I might as well use it. :))

Nick
June 22, 2007, 14:30
Where should savefiles be stored? Are they better kept in lib/save/ (or wherever your distro puts them), or in your home directory in ~/.angband/, along with your pref files, screendumps, and the like?

(Since we have a poll function here, I might as well use it. :))

Can you have more than two choices in a poll? I wanted the Don't Care option :)

pav
June 22, 2007, 14:32
I believe they should be in /var/games on multiuser install, in ~/.angband otherwise. The lib/ should be installed read-only.

takkaria
June 22, 2007, 14:40
Can you have more than two choices in a poll? I wanted the Don't Care option :)

I thought that just after I'd created it, but I couldn't see any way to edit it afterward.

pav
June 22, 2007, 14:42
I can edit it :)

takkaria
June 22, 2007, 14:46
I believe they should be in /var/games on multiuser install, in ~/.angband otherwise. The lib/ should be installed read-only.

Is that just tradition speaking, or do you make use of the multiuser aspect?

pav
June 22, 2007, 14:49
If people want to install Angband from their distro's package system, it got to be proper multiuser install.

The preference of /var over making /usr/share/angband subdir writable is an aspect of my traditionalist worldview as a FreeBSD user.

Personally, I do play all my bands from a ~/bin install...

petebull
June 22, 2007, 19:12
I chose home directory because that's what is always in my backups on upgrades or reinstallations.

I'd consider /var/games/ as reasonable second option.

Bandobras
June 22, 2007, 20:11
When I was a student, friendly research-teaching assistants installed Angband on their faculty Linux machine. I've become addicted to Angband by playing it through telnet from lab text terminals. From time to time assistant's character's ghost would kill me in town (V was nasty at that time), which was both scary and dignifying. ;)

I think, for variants with ghosts, /var/games is a must. For variants with score (all?) it is nice, too. Not many admins install Angband by default and not many can be compelled, but then, not so many people play Angband, anyway...

Nolendil
July 9, 2007, 01:51
As I have several versions of Angband installed (mostly one only used for the borg, one with the current version I play and some older versions scattered around), I'd prefer to keep them in lib/save/ so that I know which save goes with which version.
None of these versions is installed system wide (I share the computer with my parents and none of them play Angband, shame on them :) ).

Anyway, I usually prefer to have all files related to an app in the same directory so that you just have to delete the directory to uninstall everything, or copy the whole directory to move the app to another computer.
But it might be just me.

If you plan to put the files in the home directory, note that, on Mac OS X, the standard place for user save files (and some other stuff) is "~/Library/Application Support/<app_name>/", not "~/.<app_name>".
By the way, the Mac version of Angband 3.0.6 (and probably some previous ones, I don't know when the change occurred) already stores bone, data, character dumps, saves and scores in the home directory but under "~/Library/Preferences/Angband/" which doesn't perfectly fit with Mac OS X standards.
Some Mac applications (especially ports from other Unix platforms) store their prefs and saves in "~/.<appname>" but it's a pain as it means you have to check several places to remove prefs and save files when you remove an app. Moreover, it means you have to use the terminal to get access to the files (as far as I know, it's not possible to show hidden files with Mac OS X GUI) which is less user-friendly.
So you might consider making a special case for the Mac version but I can live with whatever you choose.

TJA
August 17, 2007, 12:26
Its personal data and, on a Unix/Linux system, belongs to a personal directory - that is somewhere in $HOME
This is true without any arguments against it - the rest of server OS installation may by far not under control of the user(s) and may be overwritten, newly installed or upgraded without notice!
Only in your $HOME you have control over your files and can be sure they will exist!

Other ideas about this do not originate from a Unix/Linux system with potentially many users and even many administrator but from the PC-view of things: "This is my computer" ... wrong in Unix/Linux. At least as the default for a game´s configuration!

IMHO, of course :)

Magnate
August 17, 2007, 12:39
Its personal data and, on a Unix/Linux system, belongs to a personal directory - that is somewhere in $HOME
This is true without any arguments against it - the rest of server OS installation may by far not under control of the user(s) and may be overwritten, newly installed or upgraded without notice!
Only in your $HOME you have control over your files and can be sure they will exist!

I agree. All your saves, dumps and pref files belong in ~/.angband/Variantname/ - I can't for the life of me see why people would want their save files under /usr or /var ...

As a second choice I would go for /usr/local/games/Variantname/lib/save/

CC

Fuma
August 17, 2007, 13:59
Other ideas about this do not originate from a Unix/Linux system with potentially many users and even many administrator but from the PC-view of things: "This is my computer" ... wrong in Unix/Linux. At least as the default for a game´s configuration!

You're missing the whole point. Angband was supposed to be installed by the *system admin* on the linux box, so that everyone could play and compete with each other. Thus having access to your save file enables you to cheat.
Of course this is a really far-fetched example, as roguelikes aren't a very popular game and most people playing them aren't going to cheat, but the possibility exists.

We should separate "installing the game for yourself" and "installing the game for everyone".
Nonetheless, as long as there is a simple way to manually change the savefiles location, it's not a big problem.

TJA
August 17, 2007, 15:44
Its not the job of anybody to control such "cheating", esp. not of the administrator of a box.

takkaria
August 17, 2007, 19:11
Its not the job of anybody to control such "cheating", esp. not of the administrator of a box.

It is if the scorefile is shared by all users.

TJA
August 17, 2007, 22:03
The scorefile is a place for common data and should be somewhere under /var or maybe under /opt as all variable common data, IMHO.
For a personal installation ("make install" not as root), it should still default to the private area of $HOME

takkaria, please tell - what is that with the forum?
From time to time, it is incredible slow - to the point where is think the site is down!
Where do you run this from?
Do you need support of any kind?

Magnate
August 20, 2007, 10:10
The scorefile is a place for common data and should be somewhere under /var or maybe under /opt as all variable common data, IMHO.
For a personal installation ("make install" not as root), it should still default to the private area of $HOME
Wait a sec. Now we're talking about where the whole package goes, not just the save files. I've assumed that until now we were talking about a root-installed system-wide package (the binary installed to /usr/games or /usr/local games, the rest in /usr/local/lib or whatever). In this case I still think that people should have their save files in their home directories, but if you're really worried about scummers messing up the score table then yes, they have to go in /installpath/lib/save instead.

But a personal installation to $HOME is a different matter. The savefiles then just behave like on a Windoze PC: $HOME/Angband/lib/save.
takkaria, please tell - what is that with the forum?
From time to time, it is incredible slow - to the point where is think the site is down!
Where do you run this from?
Do you need support of any kind?
Andrew (takkaria) is the Angband maintainer, not the forum maintainer. Pav runs Oook - and I've never noticed it being slow.

CC

TJA
August 20, 2007, 11:01
Thanx for information - so my question and potential offer goes to pav :)

Right now, the forum is fine - when i made my OP, it needed about a 30 secs up to a minute to reload a topic ...

:-O

pav
August 21, 2007, 00:04
Right now, the forum is fine - when i made my OP, it needed about a 30 secs up to a minute to reload a topic ...
Friday August 17, evening? I think our transit carrier flapped its routing again, I was getting all the international internet very slowly that evening. Might as well be reciprocal.

The server should have enough horsepower to handle a punny 30 people a day forums :cool:

TJA
August 21, 2007, 00:24
:)

We need to get more active people here ....

Velvet Elvis
August 22, 2007, 04:04
Do many people other than distributions use the install rule? I generally just play from the source directory in my /home so I don't have to worry about packaging it.

Distros will place files according to the FHS standard. (Does POSIX deal with this kind of thing at all?) Keep in mind you're dealing with a number of UNIX versions here and not just Linux. There is a fair bit of variation between them. It's important to use the standards if you want to avoid writing different install rules for each one.

Nothing should go under /usr by default. It should go to /usr/local unless specified with a ./configure option or by editing the makefile if autotools aren't used. /usr is for official packages only. If you have 'make install' going to /usr you run the risk of overwriting files installed by the distribution. It also makes it a lot harder to upgrade and/or remove. Some multiuser systems are set up so that sudo gives write access to /usr/local and not to user so only root can write to /usr/. I'm not sure if this is really that much of a security bonus, but I've seen it. The point being, default file locations often effect who is allowed to install the software.

What's done in multiuser setups to prevent user A from loading user B's savefile? Ie, could I do angband -u yoursavefile?


From skimming the current V /lib/readme.txt

The following should all go in /var/games

/lib/apex/*
/lib/bone/* (if used)
/lib/data/*.raw
/lib/save/

The following should be under /usr/local/etc/angband/
/lib/file/time.txt
/lib/perf/

All documentation should be under /usr/local/doc, including the current per directory readme files.

Everything else should go to /usr/local/games/

http://www.pathname.com/fhs/pub/fhs-2.3.html#VARGAMESVARIABLEGAMEDATA



/var/games : Variable game data (optional)
Purpose
Any variable data relating to games in /usr should be placed here. /var/games should hold the variable data previously found in /usr; static data, such as help text, level descriptions, and so on, must remain elsewhere, such as /usr/share/games.

Rationale

/var/games has been given a hierarchy of its own, rather than leaving it merged in with the old /var/lib as in release 1.2. The separation allows local control of backup strategies, permissions, and disk usage, as well as allowing inter-host sharing and reducing clutter in /var/lib. Additionally, /var/games is the path traditionally used by BSD.

Magnate
August 22, 2007, 11:36
Erm, this varies by distribution. Debian, for example, has strict rules about what sort of files are placed where by packages. That's why there's a maintainer for each package, as distinct from each application. It's that person's job to ensure that all the files go in the right place upon installing the package.

So the point I'm making is that we don't need to have a debate about where *bands should install themselves on unices. Whoever packages them up for Debian/ SuSE/ RedHat/ whatever will make sure that the installation conforms to their package system's requirements.

I don't think it's a good idea for us to try and second-guess these requirements, since they differ for each system. Anyone who does not use package management at all will probably be playing from the source tree under $HOME, as someone has already exemplified.

CC

takkaria
August 22, 2007, 13:33
Erm, this varies by distribution. Debian, for example, has strict rules about what sort of files are placed where by packages. That's why there's a maintainer for each package, as distinct from each application. It's that person's job to ensure that all the files go in the right place upon installing the package.

So the point I'm making is that we don't need to have a debate about where *bands should install themselves on unices. Whoever packages them up for Debian/ SuSE/ RedHat/ whatever will make sure that the installation conforms to their package system's requirements.

Quite. But it was more of a "should the game ever keep scorefiles and savefiles centrally?" question, on the basis that if it shouldn't, I could go nuke the code that allows that to happen.

ekolis
August 22, 2007, 19:02
Just a clarification, is there any reason that scorefiles and savefiles need to be kept either both centrally or both per-user? In my ideal world, there would be a configure option, call it --with-central-scores, which would determine whether scorefiles are central or per-user. This would allow an admin of a multi-user system to make the decision on whether or not each player gets his own scorelist or all players on the system share a scorelist. (If player ghosts are ever implemented, then there could also be another option, --with-central-bones, which would determine whether or not players can encounter each others' ghosts or only ghosts of previous characters played by that particular user... ;))
On the other hand, savefiles ought to be per-user, if only because they have minimal effect on the game itself. The only thing I can think of that a savefile could affect is the score rankings - everything else like the bones, rawfiles and such is technically not affected by the savefiles because for instance the rawfiles, while they are triggered by a single user running the game, are created by the game itself, not by any specific user action, and the bones are created by the game killing the player - the player (typically) does not make the active decision to die!

Then again - does it REALLY matter? I mean, it's just a filesystem - the game has access to all of those files, so theoretically if you had stuff separated, you could programmatically pull it all together, while if you had stuff combined, you could programmatically filter out anything that's irrelevant to a particular user! :P

Daven_26d1
August 22, 2007, 21:36
Quite. But it was more of a "should the game ever keep scorefiles and savefiles centrally?" question, on the basis that if it shouldn't, I could go nuke the code that allows that to happen.

Although centralised servers running ASCII games are becoming a thing of the past (in the days of Moria, students would often compete - to the detriment of coursework - on university mainframes) you know for a fact that the first thing that will happen if you nuke that code is that someone will come on here saying:

"I set up Angband on my server, but I'm unsure how to stop the players getting access to their savefiles, and thus cheating. Perhaps you could expand the makefiles..."

Weirdly, I see lots of Nethack servers around, often running competitions, but not *band ones... The competition site in the links section is pretty cool, but I think more people would join in if it ran a single variant and enforced a no-cheating policy. If I had a spare server lying around...

pav
August 23, 2007, 00:35
There is an online variant called MAngband. There's also TomeNET. The people playing there are pretty competitive, last time I checked. They even cheated the ladder here few times.

Magnate
August 23, 2007, 11:34
Quite. But it was more of a "should the game ever keep scorefiles and savefiles centrally?" question, on the basis that if it shouldn't, I could go nuke the code that allows that to happen.
Well, IMO you should preserve the options and avoid nuking the code. I can see why some would want central score and/or save files, and why others wouldn't.

CC

Fuma
August 23, 2007, 11:36
The online variants are too quick for my taste. It's bad enough that you can get easily killed in two turns in normal, turn based variants.
In MAngband you can get killed in a blink of an eye, literally.

Daven_26d1
August 23, 2007, 15:03
The online variants are too quick for my taste. It's bad enough that you can get easily killed in two turns in normal, turn based variants.
In MAngband you can get killed in a blink of an eye, literally.

Yeah, the RT thing has totally put me of playing Mangband. If I wanted that sort of experience, I'd probably dig out my copy of Neverwinter nights or something, call some peeps over and cover the spare bedroom in a LAN...

I was more thinking of shell providers that offer a global V install as part of their service. I guess our particular gaming hobby is a bit obscure for modern tastes...

Peregrine
November 1, 2007, 04:47
Hi all,

Sorry if posting to two-month old threads is frowned upon; this popped up in Google when I was reading up on the Filesystem Hierarchy Standard, and as a once-and-future Angband player I wanted to throw in my 2c.

As I see it, there can never be a definitive answer to this question, because it comes down to personal preference. Are savefiles personal data, or are they merely per-user data? Personal data should be kept under ~, and is completely at the control of the user (including the freedom to cheat). Per-user data can be about the user rather than actually belonging to the user, and so can be freely kept under /var.

And the game itself: is it a personal hobby (~), or a system-wide option (/usr)? Even more so than the savefile question, this is down to the individual user and administrator. Where variants and patched copies are involved, there's no reason why both can't be true on the same system.

So why do we* need to make this decision for them? This follows ekolis's line of thought, but goes further: make the whole thing configurable at install time. I imagine a workflow something like this (giving the installing user the option to change any of the default paths):

Is this install the main one or an extra?
1) This is the Angband install (there may be others but this is the main or current one)
...<angdir> defaults to angband
2) This is not the main Angband install, just one of many
...<angdir> defaults to angband-3.x (or some other qualifier)

Where is the game installed?
1) Install for this user only
...<maindir> defaults to something like ~/bin/<angdir>
...<datadir> defaults to <maindir>/lib
...<savedir> defaults to <maindir>/lib/save
2) Install system-wide (requires root privileges)
...<maindir> defaults to /usr/local/games/<angdir>
...<datadir> defaults to /usr/local/share/<angdir>
...Where are saves stored?
...A) Save to user's home
......<savedir> defaults to something like ~/.<angdir>
...B) Save centrally (e.g. to prevent cheating)
......<savedir> defaults to /var/games/<angdir>

Then write the game to <maindir>, the general game data to <datadir>, and the saves to <savedir>. If the locations of saves and scorefiles are independent (as ekolis suggested), then the scorefile location can be selected the same as the savefile location.

Choices could be made on the command line or interactively or whatever. Looking at the way the vote has gone here, installing for the user only would be the sensible default. Each distro-specific package could then reverse that default if the package maintainer chose.

Too much?

* "We" meaning "you"; I'm just an interloper. :)

takkaria
November 1, 2007, 06:13
Hi all,

Sorry if posting to two-month old threads is frowned upon;

No worries; but I've already done much the same as you wrote. I fell victim to one of the classic blunders, which in this case was starting a new thread about it, which I wish I hadn't have done, since that was a fairly thought-out reply you had there. :) [Unlike this one, which is badly constructed and has too many subclauses, including a mis-thought-out film reference.]

Peregrine
November 1, 2007, 06:53
No worries; but I've already done much the same as you wrote.

Oh! Well, that's a good thing, I guess. :) I haven't actually played since 3.0.6 (on Windows, at that), but I'm currently putting my old, dead PC back in order, planning out the filesystem for a dual-boot XP/Debian system -- and Angband will be promptly going onto both sides of the dual boot.

I fell victim to one of the classic blunders, which in this case was starting a new thread about it, which I wish I hadn't have done, since that was a fairly thought-out reply you had there. :) [Unlike this one, which is badly constructed and has too many subclauses, including a mis-thought-out film reference.]

Well, my own classic blunder was not searching for other threads on the subject first. But... I hate to impose, but having done so now, I still can't find the new thread...?

takkaria
November 1, 2007, 10:23
Well, my own classic blunder was not searching for other threads on the subject first. But... I hate to impose, but having done so now, I still can't find the new thread...?

Having said that I started a new thread, I check now, and it's actually part of someone else's thread. http://angband.oook.cz/forum/showpost.php?p=2495&postcount=6 is the post I meant.

tuppe666
November 3, 2007, 00:20
online!? seems the best way to me

Kiyoshi Aman
November 3, 2007, 12:36
As far as savegames go...I'd really prefer it if Angband were able to be used on a proper multiuser system; I've been meaning to set up an Angband/ToME/etc server using dgamelaunch [the same service the Nethack servers use]., but I still haven't gotten around to it.