A comprehensive toolkit for minifying, linting, and converting Pico-8 and Picotron game carts to reduce code size.
Shrinko8 is a Python-based toolkit for Pico-8 and Picotron developers that minifies, lints, and converts game cart files. It solves the problem of strict code size limits in these fantasy consoles by aggressively reducing token counts, character counts, and compressed byte sizes while maintaining correctness through configurable safety options.
Pico-8 and Picotron developers who need to optimize their game carts to fit within token and character limits, especially those creating tweet-carts or pushing the boundaries of cartridge capacity.
Developers choose Shrinko8 for its superior compression algorithms compared to native Pico-8 tools, fine-grained control over minification safety and metrics, and comprehensive feature set including linting, constants optimization, and multi-format conversion in a single tool.
Shrink (minify) Pico-8 (& Picotron) carts, as well as other tools (e.g. linting, format conversion, exports)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Shrinko8 achieves better code compression than native Pico-8 tools when creating PNGs, allowing carts to fit into formats that Pico-8 cannot, as noted in the format conversion section.
Offers configurable safety levels (e.g., --minify-safe-only) and focus metrics (tokens, chars, compressed) to tailor optimization, giving developers fine-grained control over output size.
Detects common errors like undeclared locals, unused variables, and duplicate identifiers, helping catch bugs early, with options to customize linting rules via --lint hints.
Automatically replaces constant expressions with values and removes dead code branches marked with --[[const]], enabling efficient management of debug code without runtime overhead.
Supports conversion between p8, png, rom, lua, and other formats, often with better compression than default tools, and includes merging capabilities for cart sections.
Aggressive minification requires manual hints (e.g., --[[member]] or --preserve) to avoid breaking code, adding significant setup overhead and potential for user error.
Picotron support is labeled as experimental and may have incomplete compatibility or breaking changes, making it risky for production use.
Understanding the various hints, sub-languages (like split), and command-line options demands substantial time investment, which can deter newcomers.
Without safe minification, assumptions about table indexing and _ENV usage can lead to minified carts that error or misbehave, requiring debugging and manual fixes.