TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    Storing Maps as Folders only rather than as either Zip or Folder

    Scheduled Pinned Locked Moved Development
    10 Posts 7 Posters 2.1k Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LaFayetteL Offline
      LaFayette Admin
      last edited by

      As a thought, what if we unzipped map zips after downloading?

      This seemingly would simplify a whole lot of code that handles either folders or zipped files. We would not need to do as much zip file work within the game engine and would be able to use the file system API to more easily traverse map contents. Furthermore, when unzipping, we could rename the map folder and remove the '-master' suffix (which would further simplify the map content search path).

      For backward compatibility and conversion, the engine would likely first scan on start up for any map zips and then extract them. Then after any downloads, a last step would be to unzip.

      Any thoughts to this?

      PantherP 1 Reply Last reply Reply Quote 4
      • TheDogT Offline
        TheDog
        last edited by

        Maps I like, I always unzip to see what is new and how they were constructed and perhaps tinker with the xml code, so it works for me.

        https://forums.triplea-game.org/tags/thedog
        https://forums.triplea-game.org/topic/3741/curated-best-top-maps-triplea-guides

        1 Reply Last reply Reply Quote 0
        • djabwanaD Offline
          djabwana
          last edited by

          In general, I'm 100% a fan of simplifying map storage, organization, and loading/parsing.

          Is there any downside as far as bogging down a file system with a) longer paths (probably not - the map folders are relatively shallow, though perhaps some unit names are long) b) a much vaster number of individual files (unit and tile images)?

          I'm almost certain that is premature optimization, but that's the only downside I could think of

          1 Reply Last reply Reply Quote 0
          • PantherP Offline
            Panther Admin Moderators @LaFayette
            last edited by Panther

            @LaFayette What was the reason to zip the files? It cannot be saving storage as the difference unzipped versus zipped is neglectable.

            But there must have been something behind zipping them? Is it only because of how Github provides the files?

            Don't always trust TripleA when it comes to rules questions. Know the rules before you start … and better check what TripleA has done.

            1 Reply Last reply Reply Quote 0
            • LaFayetteL Offline
              LaFayette Admin
              last edited by

              Zips Provide Faster Downloads

              Downloading a single file is far faster than multiple files. For download, that makes a lot of sense.

              Zips are not saving very much disk space

              Some XMLs are relatively large, they will compress to perhaps around 10% of their original size. Images and sound, essentially no savings. Map disk space usage is dominated by images and sound files, so a zip is not saving much.

              Faster file system access unzipped, less CPU usage

              Reading compressed files has gotten pretty fast, but the system does need to spend extra CPU cycles to uncompress a zip and maybe need additional hard disk access to access the zip.

              Code Complexity

              Perhaps the biggest difference is here. There is quite a bit of code to handle map files being in either a folder or a zip and this will be the major difference as far as I can see. Meanwhile on the downside we'd need to have some new code to unzip and ensure that any new zips are also unzipped.

              ubernautU 1 Reply Last reply Reply Quote 0
              • ubernautU Offline
                ubernaut Moderators @LaFayette
                last edited by

                @LaFayette i agree folder file structure is generally better. 🙂

                "You should never have told me horses sleep standing up, it gave me a mental block." - Mister Ed

                RogerCooperR 1 Reply Last reply Reply Quote 0
                • RogerCooperR Offline
                  RogerCooper @ubernaut
                  last edited by

                  Another advantage of unzipping is that unzipped files don't have case sensitivity problems with file names while zipped files do.

                  djabwanaD C 2 Replies Last reply Reply Quote 0
                  • djabwanaD Offline
                    djabwana @RogerCooper
                    last edited by

                    @RogerCooper That's just windows FYI- file names are case sensitive on non-Windows OSes

                    1 Reply Last reply Reply Quote 2
                    • C Offline
                      Cernel Moderators @RogerCooper
                      last edited by Cernel

                      @RogerCooper said in Storing Maps as Folders only rather than as either Zip or Folder:

                      Another advantage of unzipping is that unzipped files don't have case sensitivity problems with file names while zipped files do.

                      You have just pointed out what I rather believe is a huge disadvantage of dealing only with non-zipped files: it would most likely cause a lot of wrong casing for map-makers using case-insensitive systems, by removing the ability of at least partially checking for case inconsistencies by playing the game using the zipped map's folder.

                      Unless a way for checking for case consistency while using case-insensitive systems is provided (The only, and only partial, way I know is by zipping the map's folder.), removing the primacy or, even more so, the support of zipped maps' folders would be disastrous (You would most likely end up with the majority of maps made by map-makers on case-insensitive systems being riddled by wrong casing and, therefore, unplayable for normal users on case-sensitive systems.).

                      djabwanaD 1 Reply Last reply Reply Quote 0
                      • djabwanaD Offline
                        djabwana @Cernel
                        last edited by

                        @Cernel As we unzip a file, we will be doing a lot of checks (are all the required folders there? is there a centers.txt, etc.?) and as part of that process, we could enforce a casing convention.

                        I have a tool that fixes capitalization. When I got image assets from @GenerationKILL sometimes the casing was a bit off, so I would just run this tool and it would conform every unit to a convention like this: Unit-Name.png regardless of the OS and regardless of the original naming.

                        We could implement a similar normalization process at the map parsing level (though it might be hard to get map makers on the same page about which casing convention should be used).

                        https://github.com/jdimeo/triplea-map-tools/blob/master/src/main/java/jdimeo/triplea/util/FixFileNames.java

                        1 Reply Last reply Reply Quote 2

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • 1 / 1
                        • First post
                          Last post
                        Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums