Files
OpenFrontIO/map-generator
FloPinguin e554ffb1b0 Cleanup nations (Part 3) 🧹 Remove nation strength (#2649)
## Description:

This PR removes the nation strength. Reasoning:

- It is currently unused. The backstory can be found in #2498
- It forces map-makers to do balancing work, which is probably not a
good idea
- It increases map-making work
- It increases nation balancing complexity by a lot (we need to have all
the json files in mind)
- It makes humans avoid map areas completely because there is always
that one, same, strong nation
- The map lead Nikola123 wants to "not deal with the stupid nations and
their balancing"

If the goal of nation strength was to make them feel different I would
suggest a nation personality system. Nations that love to boat, love to
ally, love to nuke, love to fullsend, etc.

Link to a discord discussion about nation strength:


https://discord.com/channels/1359946986937258015/1360078040222142564/1450973197251117218

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

FloPinguin
2025-12-19 19:10:01 -08:00
..

MapGenerator

This is a tool to generate map files for OpenFront.

Installation

  1. Install go https://go.dev/doc/install
  2. Install dependencies: go mod download
  3. Run the generator: go run .

Creating a new map

  1. Create a new folder in assets/maps/<map_name>
  2. Create image.png
  3. Create info.json with name and countries
  4. Add the map name in main.go
  5. Run the generator: go run .
  6. Find the output folder at ../resources/maps/<map_name>

By default, this will process all defined maps.

Use --maps to process a single map:

go run . --maps=fourislands

To process a subset of maps, pass a comma-separated list:

go run . --maps=northamerica,world

Create image.png

  1. Download world map (warning very large file)
  2. Crop the file (recommend Gimp)
  • We recommend roughly 2 million pixels for performance reasons
  • Do not go over 4 million pixels.

Create info.json

Example:

{
  "name": "MySampleMap",
  "nations": [
    {
      "coordinates": [396, 364],
      "name": "United States",
      "flag": "us"
    }
  ]
}

To Enable In-Game

  • Add a translation for the map name to resources/lang/en.json
  • Add the MapDescription src/client/components/Maps.ts
  • Add the numPlayersConfig src/core/configuration/DefaultConfig.ts
  • Add the GameMapType src/core/game/Game.ts
  • To add to the map playlist, modify src/server/MapPlaylist.ts

Notes

  • Islands smaller than 30 tiles (pixels) are automatically removed by the script.
  • Bodies of water smaller than 200 tiles (pixels) are also removed.

🛠️ Development Tools

  • Format map-generator code:

    go fmt .