Linux/Unix users: Where should savefiles be stored?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TJA
    Adept
    • Aug 2007
    • 113

    #16
    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?
    Last edited by TJA; August 17, 2007, 21:14.

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 4916

      #17
      Originally posted by TJA
      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
      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

      Comment

      • TJA
        Adept
        • Aug 2007
        • 113

        #18
        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

        Comment

        • pav
          Administrator
          • Apr 2007
          • 484

          #19
          Originally posted by TJA
          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
          See the elves and everything! http://angband.oook.cz

          Comment

          • TJA
            Adept
            • Aug 2007
            • 113

            #20


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

            Comment

            • Velvet Elvis
              Rookie
              • Aug 2007
              • 4

              #21
              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/




              /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.

              Comment

              • Magnate
                Angband Devteam member
                • May 2007
                • 4916

                #22
                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
                "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                Comment

                • takkaria
                  Veteran
                  • Apr 2007
                  • 1895

                  #23
                  Originally posted by Magnate
                  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.
                  takkaria whispers something about options. -more-

                  Comment

                  • ekolis
                    Knight
                    • Apr 2007
                    • 825

                    #24
                    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
                    You read the scroll labeled NOBIMUS UPSCOTI...
                    You are surrounded by a stasis field!
                    The tengu tries to teleport, but fails!

                    Comment

                    • Daven_26d1
                      Adept
                      • Jun 2007
                      • 180

                      #25
                      Originally posted by takkaria
                      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...
                      You sold a Broken Sword (1d2) (-2,-4) {average} (j) for 1 gold.
                      The shopkeeper howls in agony!
                      You say "Dude, the clue is in the name...".

                      Comment

                      • pav
                        Administrator
                        • Apr 2007
                        • 484

                        #26
                        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.
                        See the elves and everything! http://angband.oook.cz

                        Comment

                        • Magnate
                          Angband Devteam member
                          • May 2007
                          • 4916

                          #27
                          Originally posted by takkaria
                          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
                          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                          Comment

                          • Fuma
                            Adept
                            • May 2007
                            • 103

                            #28
                            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.
                            www.snowleopard.org - International Snow Leopard Trust

                            Comment

                            • Daven_26d1
                              Adept
                              • Jun 2007
                              • 180

                              #29
                              Originally posted by Fuma
                              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...
                              You sold a Broken Sword (1d2) (-2,-4) {average} (j) for 1 gold.
                              The shopkeeper howls in agony!
                              You say "Dude, the clue is in the name...".

                              Comment

                              • Peregrine
                                Rookie
                                • Nov 2007
                                • 2

                                #30
                                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.

                                Comment

                                Working...
                                😀
                                😂
                                🥰
                                😘
                                🤢
                                😎
                                😞
                                😡
                                👍
                                👎