Skip to content

Region flag patches for all countries/regions for the GROUND BRANCH video game

Notifications You must be signed in to change notification settings

Bob-AT/region-patches

Repository files navigation

Region Flag Patches

This collection adds flag patches for all countries/regions to GROUND BRANCH.

The patches are automatically generated by a script using ImageMagick.

Contents:

  • All countries (except for the Holy See).
  • States/regions of Australia, Canada, Germany, Spain, and the USA.
  • Multi-national organizations (in alphabetical order): CSTO, EU, NATO, UN.
  • Redacted patches (black patch, white patch).

GitHub link: https://github.com/Bob-AT/region-patches

Installation

Via Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=3249167694

Q&A

Q: The flag of country X appears to be deformed? A: Patches for GROUND BRANCH need to be exactly 512x256. The aspect ratio is 2:1. For some flags, this does not work well. Please provide an aspect-ratio correction transformation via a GitHub ticket. (See README on GitHub for how such transformations work).

Q: The flag of country X offends me, what should I do? A: You can simply delete the flag from your local files. Alternatively, you can replace the flag with a copy of "(Bob-AT)Redacted_A.png".

Q: Can I use the scripts to generate other patches? A: Yes, but be aware that asset sources need attribution.

Q: I have another issue. A: Please create a https://github.com/Bob-AT/region-patches/issues on GitHub.

Asset Sources

  • The black frame of the image is derived from (BlackfootStudios)UnitedStates_B.png and (BlackfootStudios)UnitedStates_B_N.png.
  • The fabric texture (fabric.png) is based on black-fabric-textile-textured-background_16014764, Image by rawpixel.com on Freepik.
  • Flags are from https://github.com/fonttools/region-flags. These flags are usually derived from public domain Wikipedia flags. Exceptions are noted in the .txt files and embedded as comments in the .png files.
  • The frame of the normal map is derived from (BlackfootStudios)UnitedStates_B.png and (BlackfootStudios)UnitedStates_B_N.png.
  • The fabric_N.png normal map is generated via https://cpetry.github.io/NormalMap-Online/ using the following parameters: Sobel; Strength 0.5; Level 7.5; Blur 0; invert the green channel.

Building from Source

Preparation:

  • On Windows, you will need "Git for Windows" from https://git-scm.com/download/win to run the bash scripts.
  • Copy (BlackfootStudios)UnitedStates*.png from the game into assets/.

In general, you will need:

To build a single flag:

./process-patch.sh ./region-flags/png/US.png OUTPUT_PREFIX
# or shorter:
./process-patch.sh US OUTPUT_PREFIX

To build all flags:

time ./make.sh LIST.txt
# or shorter:
time ./make.sh

To build all "US" flags:

time ./make.sh <(grep US LIST.txt)

To build all flags and run optipng/advdef lossless size optimization:

time RELEASE=1 ./make.sh

Aspect Ratio

Patches for GROUND BRANCH need to be exactly 512x256. The aspect ratio is 2:1.

If we subtract the frame, we have a canvas size of 476x228. Since this is a weird aspect ratio, we use 472x236 (2:1) instead. We resize the flags to 472x236 and then put them into the frame. Four pixels at the top and bottom will be removed.

For most flags, resizing to 472x236 will look okay. For some flags, we will need to perform a transformation with ImageMagick so that they look okay.

Example: Switzerland (region-flags/png/CH.png) is a square flag. The flag has a red background and a white cross.

We can resize the flag to 236x236, thus maintaining its 1:1 aspect ratio. Afterward, we can put the flag in the horizontal center of a 472x236 transparent canvas:

magick composite -gravity center \( CH.png -resize 236x236 \) \( -size 472x236 xc:none \) output.png

If we replace xc:none with xc:red, then the flag would be centered on a red background.

In practice, these transformations are specified in extra-flags/transform.sh:

transform_CH_A () { # center square CH flag on transparent background
  project_onto_color ./region-flags/png/CH.png xc:none "$1"
}

transform_CH_B () { # center square CH flag on red background
  project_onto_color ./region-flags/png/CH.png xc:red "$1"
}

Creating Sample.jpg

This call generates Sample.jpg.

cd build/png ; rm *_N.png
magick montage *.png -tile 16x -geometry +6+6 -background '#090909' miff:- | magick convert miff:- -resize '1920x1080' ~/Downloads/Sample.jpg

About

Region flag patches for all countries/regions for the GROUND BRANCH video game

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages