[Guide] How to make and distribute a map pack

Discussion in 'Mapping and stuff' started by grandhomie, August 3, 2018.

  1. grandhomie

    grandhomie Active Member

    Messages:
    173
    Likes Received:
    188
    An easy way to see how to create a map pack is to look at an existing one, here's mine: https://github.com/grandhomie/com.pa.grandhomie.maps/archive/release.zip

    modinfo.json

    You'll need to have a valid modinfo.json file (you can edit it with any text editor but you need to make sure that the data is in the right JSON format, modern editors have a JSON validator but if yours doesn't, copy paste the content of your file to https://jsonformatter.curiousconcept.com/ to make sure it is valid).
    You can copy paste my modinfo.json but you'll have to change the following values:
    - identifier: maybe com.pa.username.maps
    - display_name
    - description
    - author
    - version
    - date
    - forum to point to a thread where you list infos about your maps
    - icon: points to a logo for your mod, I point it to my avatar
    - load_planet : points to the file that lists all your maps (note that the path coui://ui/mods/grandhomie/maps.js has to match the directory structure of your mod)
    - searchable : list of keywords to search for your map pack

    maps.js

    The maps.js is self explanatory:
    cShareSystems.load_pas("Grand Homie's 2v2 NS", [
    "coui://ui/mods/grandhomie/systems/la_somme_2v2.pas",
    "coui://ui/mods/grandhomie/systems/theia_4v4_ns.pas"
    ]);

    "Grand Homie's 2v2 NS" is the name of the tab in which the maps listed will appear. And "coui://ui/mods/grandhomie/systems/la_somme_2v2.pas" is the path of one of the map (again, make sure it matches your directory structure).

    Add metadata to your maps (.pas)

    When you export your maps you'll have almost everything in it but you can edit them with a text editor to add a description, version, creator and number of players supported (open any of my maps to see an example).

    Release / update process

    I have my mods on my github https://github.com/grandhomie/com.pa.grandhomie.maps because it makes it easy to track the changes and I just sent mikey the link to the "Download ZIP" (archive) of my "release" branch:

    [​IMG]

    You need to look into Github if you're not familiar with it (https://guides.github.com/activities/hello-world/), I use this workflow:
    - edit my maps locally
    - push them to my master branch
    Once I'm happy with the modifications and I want to release the new version to the community
    - I update the version of the mod, push it to master
    - then switch to the release branch (you'll have to create it the 1st time) and merge master into it (more or less means copy what's on master to the release branch)

    Note that some people don't use github and just send a link to a dropbox archive, that works too, it's just not as easy to keep track of the files. Also if you don't want to deal with the 2 branches and merging, you can send the link to the master branch (the default branch) to mikeyh but you'll have to make sure that you just push your files to github once you're ready.

    The directory structure of a map pack:

    [​IMG]

    Useful wiki links:
    - https://wiki.palobby.com/wiki/Planetary_Annihilation_Mod_Structure
    - https://wiki.palobby.com/wiki/Planetary_Annihilation_Maps
    - https://wiki.palobby.com/wiki/Planetary_Annihilation_Modding#New_Mod_Submission_Offline
    Last edited: August 3, 2018
  2. emarkus

    emarkus Active Member

    Messages:
    312
    Likes Received:
    141
    Your release.zip, as generated by github, does not look like a valid mod-zip. because it adds a top level directy named by repository name. I expected the generated zip file to *directly* contain modinfo.json and so on...

    I mean, your zip package seems to work? But i wonder why?
  3. grandhomie

    grandhomie Active Member

    Messages:
    173
    Likes Received:
    188
    It doesn't add a top level directory, might be your zip software that does that.
  4. emarkus

    emarkus Active Member

    Messages:
    312
    Likes Received:
    141
    No, github is adding a top level directory to your mod. It functions nevertheless because the PA servers retrieving the mods are traversing the directory structure.
    grandhomie likes this.

Share This Page