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

    Storing Map Index in Database - Deprecating triplea_maps.yaml

    Scheduled Pinned Locked Moved Development
    20 Posts 5 Posters 2.3k Views 5 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.
    • RogerCooperR Offline
      RogerCooper @Cernel
      last edited by

      @cernel So theoretically I could set up my own repository right now and just have it approved as an authorized repository and added to the scanning process.

      Of course, there is nothing to prevent multiple scenarios with the same name.

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

        @Cernel using folder names for the name of the map is not ideal for a number of reasons:

        • spaces get weird
        • repository names cannot have spaces in them
        • it's not expected that the map name to be the folder
        • a number of characters are restricted from appearing in a folder name
        • it's not even clear which folder is the 'map folder'. When some maps are extracted you get one folder with files in it, other cases you get a folder containing another folder that then actually contains the map files.
        • when developing a map, there is no repository, if the name is derived from the folder name then that would have to be kept in sync with repository names; and that can get really complicated and requires map makers to know unnecessary detail about how a repository is packaged into a zip file.

        If they are always the same, why to duplicate them, if they are not necessarily the same, what's the point of having one different from the other?

        They are not necessarily always the same. Before it was something of a requirement with a few complex caveats and hacks to make the name more human readable, no there is no such dependency nor restriction and a map name can now be much more arbitrary.

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

          @rogercooper Are you referring to the triplea-games organization or a repository under your username?

          Of course, there is nothing to prevent multiple scenarios with the same name.

          Yes, this was an existing problem and will potentially continue to be. The engines behavior (was not and) is not deterministic if multiple scenarios are installed with the same name.

          1 Reply Last reply Reply Quote 0
          • C Offline
            Cernel Moderators @LaFayette
            last edited by

            @lafayette So now anyone is free to name the repository/folder however it wants? For example, I can decide my current "270bc_wars" has the map name (in the yaml inside the map folder) "270BC Wars" and the repository/folder name "space-wars"? If not everything is acceptable, are there or will there be guidelines?

            Anyways, I'm understanding that now we have the "map name" and the "folder name". The "map name" is inside the "yaml" in the map folder, and nowhere else, whereas the "folder name" is always only the name of the repository (differently from before, when the main folder name was generated from the map name in the "triplea_maps.yaml"). Did I get everything right?

            For example, if I currently download "WW2 Oil and Snow 2nd Edition" via TripleA 2.5, what I get is this series of folders:
            triplea/downloadedMaps/ww2_oil_and_snow_2nd_edition-master.zip/ww2_oil_and_snow_1st_edition-master/map/games/...
            That is, the main folder name (ww2_oil_and_snow_2nd_edition-master.zip) is given by the map name in the "triplea_maps.yaml" (namely, "WW2 Oil and Snow 2nd Edition"), automatically converting all spaces to underscores and all uppercase characters to lowercase, whereas the first sub-folder name is simply the name of the repository (namely, https://github.com/triplea-maps/ww2_oil_and_snow_1st_edition).

            I understand, instead, that 2.6 will have one single, non-zipped, folder immediately followed by the "map" folder (Correct?). If so, is the (now single) folder name determined by the repository name, the map name (now given by the "mapName" in the "map.yaml" of the map) or by what else?

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

              @cernel

              @lafayette So now anyone is free to name the repository/folder however it wants?

              Sure, but we can also all be adults about it and try to keep things easy to manage.

              the main folder name was generated from the map name in the "triplea_maps.yaml"

              It is was actually more complex. There are just two places where the map name is ever displayed:

              • the download maps window
              • https://triplea-game.org/maps-list/maps/

              The 'map_name' field in triplea_maps.yaml had just those two uses and nothing further. After download map name came from either XML file or save game file and there is a search algorithm to find folders with a likely matching name.

              Now the search algorithm is more precise to look at 'map.yaml' files and to look for a matching map name. The map name in that file also carriers over to replace 'triplea_maps.yaml'

              That is, the main folder name (ww2_oil_and_snow_2nd_edition-master.zip) is given by the map name in the "triplea_maps.yaml"

              In this example the zip file URL is given by 'triplea_maps.yaml'. The name of the zip file is determined by the repository. 'triplea_map.yaml' mapName plays no part in this or how the download is installed on disk.

              I understand, instead, that 2.6 will have one single, non-zipped, folder immediately followed by the "map" folder (Correct?).

              The maps will be unzipped, yes. The folder containing the map.yml file is the map folder. I don't know if the game engine is 100% consistent about that though, it wasn't before and may still not be.

              If so, is the (now single) folder name determined by the repository name,

              The name of the zip file downloaded is determined by the repository. The unzip of that does nothing special and unzips the contents into a similarly named folder.

              the map name (now given by the "mapName" in the "map.yaml" of the map) or by what else?

              The 'mapName' and 'mapFolder' concept are now much more automatic and a map maker need not
              be so aware of it anymore. You no longer need to include 'map name' in XML files.

              The engine when it launches a map knows where it came from, it opens the map based on you selecting a scenario
              that is listed in the map.yml file. That same file has map name, that value is then injected into save
              games as was before. When loading a save game, the map is found by searching for 'map.yaml' files with a matching
              map name instead of fuzzy matching folders.

              C 1 Reply Last reply Reply Quote 0
              • C Offline
                Cernel Moderators @LaFayette
                last edited by

                @lafayette I suggest obliging (by documenting this requirement) all mapmakers to have a repository name which is exactly equal to the map name (in the map.yaml of the repository) with mandatory changes for problematic characters (like stripping all spaces (I think it is better stripping spaces than turning them into underscores.)).

                RogerCooperR LaFayetteL 2 Replies Last reply Reply Quote 0
                • RogerCooperR Offline
                  RogerCooper @Cernel
                  last edited by

                  @cernel Do the files in the repository need to be kept unzipped or can they be zipped? It is certainly easier to manage a repository with a limited number of zipped files.

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

                    @cernel it's a very correctable problem if it were to arise. I don't think it's that big of a worry just yet.

                    @RogerCooper indeed zipped is easier to manage if the map files do not change.

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      beelee @LaFayette
                      last edited by

                      @lafayette said in Storing Map Index in Database - Deprecating triplea_maps.yaml:

                      and have the server scan repositories to read the 'map.yam' file and then store that information in database.

                      so as long as you have a git repo of said map all is good ?

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

                        @beelee Basically. The server will scan for repos in the 'triplea-maps' organization, so the repo needs to be in that org. But yeah, if you fork a repo into the 'triplea-maps' org, it'll be picked up shortly after.

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

                          @lafayette So it won't be anymore possible to keep (broken or elsewise unworthwhile) maps in the official repository yet not in download list? In particular, I've noticed that "Conquest of the World" is now offered for download (which is fine because I believe the game is at least playable).

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

                            @cernel I was tempted to create a 'pull' list of maps that should be pulled. It is easier to instead to remove those maps. We do have categories after all though to mark which maps are still works in progress.

                            1 Reply Last reply Reply Quote 0

                            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