Skip to content
Lubyanoy Ivan edited this page Apr 2, 2025 · 6 revisions

Mod is an element of the file system that contains all of the mod files.

Types

The mod loader supports several types of mods:

  • Folder (more suitable for convenient development)
  • ZIP archive with polymod extension (more suitable for distribution)

Note

You can leave the zip extension, but this is not recommended so that the end user does not confuse the mod with a regular archive.

Manifest

A manifest is a json file in a mod that describes the mod's metadata, or properties. Mod manifest is declared in manifest.json file.

Format

  • id unique mod identifier validated with regex ^(?!polytopia$)[a-z_]+$
  • name user-friendly name
  • version semantic version in format from x.y to x.y.z.w
  • authors list of authors
  • dependencies (optional)
    • id unique mod identifier of the dependency
    • min (optional) minimal dependency version
    • max (optional) maximal dependency version
    • required (optional, default true) will mod not load if this dependecy will be not found?

Tip

There is a special pseudo-mod with id polytopia and its version is equal to the current version of the game

Example

{
    "id": "docs_mod",
    "name": "DocsMod",
    "version": "1.2.3.4",
    "authors": [
        "DocMan",
        "bro0x7"
    ],
    "dependencies": [
        {
            "id": "polytopia",
            "min": "2.0.0",
        },
        {
            "id": "another_cool_mod",
            "required": false
        }
    ]
}

Localization

Localization is a json file in a mod that declares mod's localization strings. Mod localization is declared in localization.json file.

If you've ever used the custom language system before it was removed, you'll notice that the keys follow the same format as custom langs, but with all the periods replaced with underscores. If you want to translate your strings to other languages, you can simply use a comma and enter another language's name with its corresponding string.

Languages

  • English
  • Portuguese (Brazil)
  • Russian
  • Italian (Italy)
  • French (France)
  • Spanish (Mexico)
  • German (Germany)
  • Japanese
  • Korean
  • Hindi
  • Indonesian
  • Malay
  • Polish
  • Thai
  • Turkish
  • Vietnamese
  • Elyrion

Example

{
  "polymod": {
    "English": "PolyMod",
    "Elyrion": "πȱ∫ỹmȱΔ"
  },
  "our_discord": {
    "English": "OUR DISCORD",
    "Elyrion": "Δi^#ȱrΔ"
  }
}

Texture

A texture is an image file in png format, which is being loaded by PolyMod in order to be used ingame.

PolyMod decides how to load the texture based on filename. Texture's file name consists of name, style and level.

  • name id of the texture
  • style tribe or skin id, for which this texture should be set
  • level level of the texture

Format

Here is all possible combinations of how you can name the texture file:

  • name__.png will replace the texture of chosen target for all tribes, skins and possible levels
  • name_style_.png will replace the texture of chosen target for chosen tribe or skin and for all possible levels
  • name__level.png will replace the texture of chosen target for all tribes and skins, but for chosen level
  • name_style_level.png will replace the texture of chosen target for chosen tribe or skin and for chosen level

Example

You want to replace all lumberhut textures for all tribes.

  • We want to replace it for all tribes and skins, so we dont specify the style.
  • Lumber hut has only one level, which means we dont want to specify it. In such case, you should name it as lumberhut__.png

Sprites

Sprites file is a json file which declares advanced settings for how each texture should be transformed into the sprite. Mod sprites is declared in sprites.json file.

Format

  • pixelsPerUnit (optional, default 2112) in Unity, a sprite PPU is a property that determines how many pixels from a sprite texture correspond to one unit in the Unity game world.

  • pivot (optional, default [0.5, 0.5]) in Unity, a sprite pivot is the reference point that determines how a sprite is positioned within the Unity game world. It acts as the point relative to which happen all movements, rotation and scaling of the sprite.

Tip

You can find more info in Unity Documentation.

Example

{
  "lumberhut__": {
    "pixelsPerUnit": 256,
    "pivot": [0.1, 0.5]
  }
}

GLD patch

GLD patch is a json file in a mod that declares mod's modifications to the game's main logic file, GameLogicData. GLD patch is declared in patch.json file.

See for more information information

PolyScript

PolyScript is a dll file, a compiled dotnet classlib. It gives modder direct intervention in the game's code to modify it.

See for more information information

Clone this wiki locally