Overworld tileset compiler for Pokémon Generation III decompilation projects
Find a file
grunt-lucas ca5476950d
More core compilation pipeline work with generated config system and DI framework (#186)
## Major Components

  ### Configuration System
- Auto-generated configuration classes from YAML schema using Jinja2
templates
  - Layered configuration with DefaultProvider and YamlFileProvider
- Comprehensive config validation with detailed multi-line error
messages
  - Support for domain, app, and infrastructure configuration layers

  ### Domain Architecture
  - Refactored models to use template classes (PixelTile<T>, Palette<T>)
  - New models: ColorIndex, ColorIndexMap for improved type safety
  - Removed RGBA-specific subclasses in favor of generic implementations
  - Algorithm modules for palette matching and tile conversions

  ### Dependency Injection
  - Integrated Google Fruit DI framework
  - Component-based architecture for service composition

  ### Core Services
  - PrimaryTilesetCompiler: Read and process palette data
  - LayerModeConverter: Handle triple-layer and dual-layer conversions
  - MetatileDecompiler: Decompose metatiles into constituent parts
  - ImageTileizer and LayerImageMetatileizer: Template-based tileization
  - TilePrinter and PalettePrinter: Diagnostic output utilities

  ### Error Handling & Diagnostics
  - Multi-line error messages with source details
  - YAML source line highlighting with formatting
  - Enhanced BufferedUserDiagnostics with tag support

  ### Testing & Documentation
  - Comprehensive test coverage for new algorithms and services
  - Updated architectural notes and planning documents
  - Enhanced code style guidelines and documentation
2025-11-08 09:41:36 -07:00
.github More core compilation pipeline work with generated config system and DI framework (#186) 2025-11-08 09:41:36 -07:00
.vscode More core compilation pipeline work with generated config system and DI framework (#186) 2025-11-08 09:41:36 -07:00
Documentation Porytiles2 MVP: Core compilation pipeline and domain architecture (#185) 2025-10-20 13:47:30 -07:00
Porytiles1 Implement JASC palette save/load and core tileset I/O infrastructure (#178) 2025-08-30 08:46:46 -07:00
Porytiles2 More core compilation pipeline work with generated config system and DI framework (#186) 2025-11-08 09:41:36 -07:00
Resources Porytiles2 MVP: Core compilation pipeline and domain architecture (#185) 2025-10-20 13:47:30 -07:00
Scripts More core compilation pipeline work with generated config system and DI framework (#186) 2025-11-08 09:41:36 -07:00
.gitignore More core compilation pipeline work with generated config system and DI framework (#186) 2025-11-08 09:41:36 -07:00
.porytiles-marker-file Moved rest of warnings onto new diag system 2025-04-27 09:07:40 -07:00
.rgignore Big filename refactor, more to come 2024-10-14 07:16:29 -07:00
CLAUDE.md More core compilation pipeline work with generated config system and DI framework (#186) 2025-11-08 09:41:36 -07:00
CMakeLists.txt Porytiles2 MVP: Core compilation pipeline and domain architecture (#185) 2025-10-20 13:47:30 -07:00
CONTRIBUTING.md Break out Porytiles major versions (#163) 2025-06-08 06:14:50 -07:00
GEMINI.md Huge initial Porytiles2 effort (#166) 2025-07-08 09:38:51 -07:00
LICENSE Move files around 2025-01-05 07:55:50 -07:00
README.md Huge initial Porytiles2 effort (#166) 2025-07-08 09:38:51 -07:00
STYLE.md More core compilation pipeline work with generated config system and DI framework (#186) 2025-11-08 09:41:36 -07:00

Porytiles

Porytiles Develop Branch Build Porytiles Nightly Release

Overworld tileset compiler for use with the pokeruby, pokefirered, and pokeemerald Pokémon Generation III decompilation projects from pret. Also compatible with pokeemerald-expansion from rh-hideout. Builds Porymap-ready assets from RGBA (or indexed) input assets.

PokemonHearth Pokémon Hearth by PurrfectDoodle. Tile art inserted via Porytiles. Used with permission.

Why Should I Use This Tool?

Porytiles makes importing from-scratch tilesets (or editing existing tilesets) easier than ever. Think of it this way: Poryscript, another popular community tool, takes a .script file and generates a corresponding .inc file. Comparably, Porytiles takes a source folder containing RGBA (or indexed) tile assets and generates a corresponding metatiles.bin, metatile_attributes.bin, indexed tiles.png, indexed anim folder, and a populated palettes folder -- all as part of your build!

For more info, please see this wiki page which explains what Porytiles can do in more detail.

Getting Started

First, go ahead and follow the release installation instructions in the wiki. You can use Homebrew, or you can download a release binary and install it yourself. Alternatively, intrepid users may choose to build Porytiles from source. Once you've got Porytiles working, try the demo steps located at this wiki page. Everything else you need to know about Porytiles can be found in the wiki. I highly recommend reading the wiki articles in order. If you have further questions, I can be found on the pret and RH Hideout discord servers under the name grunt-lucas.

Release Cadence

Porytiles follows a Continuous Delivery model for release cadence. Every commit on the develop branch gets packaged and published as a nightly release. Due to my development style as well as time constraints, I don't plan on creating versioned releases for Porytiles. I try to keep the commit history clean, so you can quickly see what has changed in each nightly release. Users are encouraged to install via the brew tap (brew works great on WSL, it's straightforward to set up). With Homebrew, you can run two quick commands and always be up to date.

Building From Source

You can use either GCC or Clang, provided your installation is reasonably recent and supports most C++20 (and some C++23) features. Please see this wiki page for more detailed instructions, should you need them.

Dependencies

You'll need zlib and libpng installed on your system, specifically the static (.a) libraries. Consult your system's package manager for details. Porytiles's build system will search the system library paths for libpng.a and libz.a. If you'd like to link those libraries dynamically, or if the CMake configuration is having trouble finding them, then you'll need to modify Porytiles1/lib/CMakeLists.txt appropriately.

You'll also need cmake version 3.20 or greater.

Build And Run

Set up the CMake build folder:

cmake -B build -DCMAKE_BUILD_TYPE=Release

Then build with:

cd build
cmake --build .

You can check that everything is working like this:

cd ..
./build/Porytiles1/tests/Porytiles1Tests

To run the actual tool:

./build/Porytiles1/tools/driver/porytiles

Notes For macOS

On macOS, the CMake configuration command typically finds your system clang compiler. If you've installed GCC via Homebrew and would like to use that instead, try this alternative configuration command (assuming you have GCC 15):

CXX=g++-15 cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT="" -DCMAKE_CXX_FLAGS="-stdlib=libstdc++ -I/opt/homebrew/opt/gcc/include/c++/15 -L/opt/homebrew/opt/gcc/lib/gcc/15"

If you have a different major version of GCC or you are using an Intel Mac, you may need to tweak this command to match your system.

Note For Aseprite Users

GitHub user PKGaspi has created a collection of useful scripts here. Of particular interest is this export_layers script, which allows you to save each sprite layer to a different file. This may be useful, since Porytiles requires each tile layer in a separate PNG file.