How about ... replacing /edit/*.txt and /data/*.raw with SQLite ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PaulBlay
    Knight
    • Jan 2009
    • 657

    #16
    Originally posted by Atarlost
    You're trying to get us to put a hemi v8 in a model A. It's a waste of effort.
    SQLite can be compared to a lot of things, but a hemiv v8 isn't one of them.
    Currently turning (Angband) Japanese.

    Comment

    • Delver
      Rookie
      • May 2009
      • 18

      #17
      What about XML? It has at least one C library I know of, and is text based.

      Actually, I don't think the edit files need to go, at least not yet. If it's not broken, don't fix it, I guess. And giving Angband a full-blown database would probably be overkill.

      I remember when Angband had Lua in it (for no well-defined reason, I gathered). I suppose, if Angband kept Lua it could have used Lua files for edit file replacement in addition to scripting, since Lua was originally defined for data definition and is pretty good at that through its table syntax. I'd leave that to Lua-using variants like T.o.M.E. though.

      Comment

      • Atarlost
        Swordsman
        • Apr 2007
        • 441

        #18
        XML can actually be harder to read because all the tags can and linefeeds can prevent something complex like a spellcasting monster from fitting on a single screen.
        One Ring to rule them all. One Ring to bind them.
        One Ring to bring them all and in the darkness interrupt the movie.

        Comment

        • RogerN
          Swordsman
          • Jul 2008
          • 308

          #19
          I think this is an terrible idea.

          1. If your only motivation for switching to a database is to improve the readability of the info loading routines, isn't it better to just rewrite or improve the current loading routines rather than start from scratch with a database?

          2. Modifying the *_info text files is quick and easy. If you want to make this even easier, it would be just as simple to write an editor for the *_info files as it would be to write an editor for a database.

          3. The format of the *_info files is already very easy (and quick) to parse. Tinkerers can write their own utilities to examine these files and extract information. If you switch to a database, however, then any other utility which wants to retrieve this information will also have to link to a bunch of database stuff.

          4. For the most part, Angband is free of dependencies on external libraries. Let's keep it that way.

          I do agree that removing the .raw files might be nice. I'd be interested in seeing some benchmarks on slower machines loading .raw vs. .txt, as I suspect the speed difference is not big enough to justify keeping separate .raw files. You only load the game once, and IMO simplicity is better than saving 2 seconds of startup time.

          Comment

          • Magnate
            Angband Devteam member
            • May 2007
            • 5110

            #20
            Originally posted by RogerN
            You only load the game once, and IMO simplicity is better than saving 2 seconds of startup time.
            You load the game every time you die and start a new character - which for some of us is many times in an evening.

            Besides, where did people get the impression that keeping the .raw files is all about speed? As I explained earlier in the thread, the .raw files enable the game to be shipped without text files and compiled without (most of) init1.c - it seems to be more about size than speed. I could be wrong - I wasn't around when the design decision was made - but the comments in the code hint that size was the first consideration, not speed. Plus, Angband was developed on university machines where tampering was rife, so it's quite possible that neither size nor speed was the primary reason for the .raw files, but tamper-proofing.
            "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

            Comment

            • andrewdoull
              Unangband maintainer
              • Apr 2007
              • 872

              #21
              Originally posted by Magnate
              Besides, where did people get the impression that keeping the .raw files is all about speed?
              The raw files are about speed. I compiled them out the other day to see the savings in size and it was about 40k of code size saved. And this was on Unangband, which has a lot more edit files than Angband.

              Andrew
              The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
              In UnAngband, the level dives you.
              ASCII Dreams: http://roguelikedeveloper.blogspot.com
              Unangband: http://unangband.blogspot.com

              Comment

              • Magnate
                Angband Devteam member
                • May 2007
                • 5110

                #22
                Originally posted by andrewdoull
                The raw files are about speed. I compiled them out the other day to see the savings in size and it was about 40k of code size saved. And this was on Unangband, which has a lot more edit files than Angband.
                Right. Now, back in 1991, how significant was 40k? IIRC it was about 1/6 of all available RAM. I reckon that would have mattered quite a lot to the original devs.

                I'm *not* saying that speed isn't an issue - it is. But I don't think it was the only reason, or even the primary reason, that the raw files were invented.
                "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                Comment

                • david3x3x3
                  Scout
                  • Jun 2009
                  • 28

                  #23
                  Originally posted by RogerN
                  I do agree that removing the .raw files might be nice. I'd be interested in seeing some benchmarks on slower machines loading .raw vs. .txt, as I suspect the speed difference is not big enough to justify keeping separate .raw files. You only load the game once, and IMO simplicity is better than saving 2 seconds of startup time.
                  I've been working on getting Angband running on Android. This is a slow machine. It's running as machine code translated to Java bytecode running in a virtual machine on a mobile phone processor. That it runs at all is impressive to me. I estimate that the raw files cut 30 seconds off the startup time on this software/hardware combo. Also, due to how multitasking is handled on the phone, I'd say that I'm more prone to restarting the program than I would be running the program under Windows.

                  Comment

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