Planetary Annihilation Mod Structure

From Planetary Annihilation Titans & Classic PA Wiki
(Redirected from Mod Structure)
Jump to: navigation, search

Titans-icon.png Planetary Annihilation Mod Structure

Platinum-rank-icon.png Mod Identifiers

Every mod must have a unique identifier.

The required format is lowercase reverse domain name notation.

eg com.palobby.some-mod-name

If you don't have your own domain or prefer to use your forum / game handle then prefix with com.pa.handle.some-mod-name

eg com.pa.mikeyh.some-mod-name

My personal preference is dashes (-) over underscores (_) for readability.

Platinum-rank-icon.png modinfo.json

Every mod must have a modinfo.json file at the top level.

Community Mods adds additional info to modinfo.json when repackaging mod zips.

author mandatory string space delimited uber forum name(s) (also add authors to clearly specify multiple)
build mandatory string last build number tested against eg 94684
category mandatory array of strings keywords for searching (see below)
context mandatory string client or server
date mandatory string YYYY-MM-DD format of UTC date updated (you'll be penalised for in the future dates)
description mandatory string short description
display_name mandatory string easily identifiable name
forum mandatory string URL to Uber forums post in mods section
identifier mandatory string see mod identifier requirements
signature mandatory string must contain a non empty string eg " "
version mandatory string major.minor.revision (major.minor.revision-suffix will also be accepted)
authorised optional array of strings array of uberIds who can see this mod in community mods
authors optional array of strings array of uber forum names (overrides author if provided)
companions optional for server mods array of strings array of zero or more mod identifiers
dependencies optional array of strings array of zero or more mod identifiers
framework optional boolean true for frameworks that are only used by other mods
icon optional string URL for 300x300px icon (PNG8/alpha, GIF or JPG) displayed at 40x40px in listings and 150x150px in details
priority optional number defaults to 100 and should only be specified in special cases
scenes optional map of arrays user interface scenes map containing an array of local URLs for CSS, HTML or JS files to load
titansOnly optional boolean
classicOnly optional boolean

The following are read by the engine when mounting mods and are available via api.mods:

  • author
  • context
  • dependencies
  • description
  • display_name
  • identifier
  • signature
  • version

The default categories are now:

  • classic
  • titans
  • ai (for AI mods)
  • biomes (for biome mods)
  • browser (for game server browser mods)
  • effects (for effects mods)
  • editor (for system editor mods)
  • fix (for mods that fix defects)
  • gameplay (for mods that impact live gameplay)
  • gw (for galatic war mods)
  • icons (for icon mods)
  • lobby (for new game lobby mods)
  • maps (for map pack client mods)
  • replays (for replay mods)
  • shaders (for shader mods)
  • textures (for texture mods)
  • tournaments (for tournament related mods)
  • ui (for user interface mods)
  • units (for server mods that change the unit roster)
  • settings (for user interface mods)

Please do not add any of the following:

  • mod
  • client
  • client-mod
  • server
  • server-mod
  • map (use maps)
  • planet or planets (use maps)
  • system or systems (use maps)

Additional categories should be concise single lowercase keywords.

Example

  • server mod
  • companion client mod (required for joining or spectating games)
  • client mod (optional)
{
    "context": "server",
    "identifier": "com.palobby.some-mod-name-server",
    "display_name": "Some Mod Name",
    "description": "Description of what some mod name does",
    "author": "mikeyh",
    "version": "1.0.0",
    "build": "94243-pte",
    "date": "2016-05-15",
    "signature": " ",
    "forum": "https://forums.uberent.com/threads/palobby-com-games-browser-global-chat-stats-using-chrome-chromium.69168/",
    "category":
    [
        "units",
        "classic",
        "titans"
    ],
    "icon": "https://palobby.com/icon.png",
    "companions":
    [
        "com.palobby.some-other-mod-name-companion"
    ],
    "dependencies":
    [
        "com.palobby.some-other-mod-name-client"
    ]
}
{
    "context": "client",
    "identifier": "com.palobby.some-mod-name-companion",
    "display_name": "Some Mod Name Companion",
    "description": "Description of what some mod name does",
    "author": "mikeyh",
    "version": "1.0.0",
    "build": "94243-pte",
    "date": "2016-05-15",
    "signature": " ",
    "forum": "https://forums.uberent.com/threads/palobby-com-games-browser-global-chat-stats-using-chrome-chromium.69168/",
    "category":
    [
        "units",
        "ui",
        "lobby",
        "gameplay",
        "settings",
        "classic",
        "titans"
    ],
    "icon": "https://palobby.com/icon.png",
    "hidden": true,
    "scenes":
    {
        "new_game":
        [
            "coui://ui/mods/com.palobby.some-mod-name/new_game.js"
        ],
        "live_game":
        [
            "coui://ui/mods/com.palobby.some-mod-name/live_game.js"
        ],
        "settings":
        [
            "coui://ui/mods/com.palobby.some-mod-name/settings.js"
        ]
    }
}
{
    "context": "client",
    "identifier": "com.palobby.some-mod-name-client",
    "display_name": "Some Mod Name Client",
    "description": "Description of what some mod name does",
    "author": "mikeyh",
    "version": "1.0.0",
    "build": "94243-pte",
    "date": "2016-05-15",
    "signature": " ",
    "forum": "https://forums.uberent.com/threads/palobby-com-games-browser-global-chat-stats-using-chrome-chromium.69168/",
    "category":
    [
        "ui",
        "browser",
        "settings",
        "classic",
        "titans"
    ],
    "icon": "https://palobby.com/icon.png",
    "hidden": true,
    "scenes":
    {
        "server_browser":
        [
            "coui://ui/mods/com.palobby.some-mod-name/server_browser.js"
        ],
        "settings":
        [
            "coui://ui/mods/com.palobby.some-mod-name/settings.js"
        ]
    }
}

Platinum-rank-icon.png Mod Packaging

Mods are packaged as zip archives.

Every mod must have a modinfo.json at the top level.

Mod specific files must be saved under a unique path using lowercase names.

eg ui/mods/com.palobby.some-mod-name/

With user interface modding the convention for filenames is based on the scene name.

eg ui/mods/com.palobby.some-mod-name/server_browser.js

Please make sure you only include mod files in your zip and exclude any files not required. eg src, artwork, etc