[Minor Feature] Packaging variants: light vs batteries-included #163
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#162 [Major Feature] Cross-compilation for Windows from Linux
john/McRogueFace
Reference
john/McRogueFace#163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Current builds have dramatically different sizes:
Games that are "pure McRogueFace" may only need
import mcrfpyand optionallysys.exit()- no stdlib at all.Proposed Variants
Light Build (~15-20 MB)
mcrfpymodule,sys,builtinsFull Build (~80+ MB)
json,pathlib,random,collections, etc.Implementation
mcrfpyto functionQuestions
random? (Very commonly needed for games)json? (Useful for save files)Related
Preliminary Research Findings
Current Build Size Breakdown
libpython3.14.soLib/(pure Python stdlib)lib.linux-x86_64-3.14/(C extensions)Definitely Removable (Development/Testing Only)
These are never needed for game distribution:
Lib/test/Lib/idlelib/Lib/ensurepip/Lib/tkinter/Lib/turtledemo/*test*.so)Just removing these brings Linux from ~82 MB → ~40 MB.
Engine Requirements from Stdlib
The C++ engine imports
enumfor Easing, Transition, and FOV enum types:src/PyEasing.cpp-PyImport_ImportModule("enum")src/PyTransition.cpp-PyImport_ImportModule("enum")src/PyFOV.cpp-PyImport_ImportModule("enum")The
enummodule has minimal dependencies (only builtins).Game Script Module Usage Analysis
Analyzed all scripts in
src/scripts/,tests/, andtests/demo/:Highly Used (essential for most games):
random- 8+ files (enemy AI, loot tables, level generation)sys- 20+ files (exit codes, test infrastructure)math- 5+ files (geometry, pathfinding, visibility)Moderately Used (useful for complex games):
dataclasses- 5 files (item system, data structures)pathlib- 3 files (path handling)json- 2+ files (save files, benchmarking)os- 5+ files (environment, cross-platform)Light Usage (optional/demo-only):
code- 1 file (interactive console for debugging)typing,enum,re,datetime,base64- AI/vLLM demos onlyDependency Chains
randommodule imports:jsonmodule imports:Proposed Build Variants
1. Ultra-Light Build (~20 MB target)
Removes everything except:
libpython3.14.so(required)enum(required by engine)encodings/subset (utf_8, ascii, latin_1)importlib/(required for imports)Use case: Demos, tutorials, games that only use
mcrfpyAPI2. Game-Ready Build (~25-30 MB target)
Adds to Ultra-Light:
random+ dependencies (math, bisect, operator, itertools)json+ codecsUse case: Most typical roguelike games
3. Full Build (~40 MB)
Current build minus development cruft:
test/,idlelib/,ensurepip/,tkinter/,turtledemo/Use case: Complex games, games using networking, async, etc.
Questions for Implementation
Encodings: The
encodings/directory has 124 files (1.8 MB). Games likely only need UTF-8. Should we strip to essentials?__pycache__: Currently 3.9 MB in Lib/. Pre-compiled.pycfiles speed startup but could be regenerated on first run.Build script approach:
__lib_light/and__lib_full/directoriesRandom included by default? The issue asks this - based on usage analysis, yes - it's used in 8+ game files and is essential for roguelike mechanics.
Next Steps
a7ada7d65b- closing this feature, the actual difference between "light" and "full" is ~1MB, so I probably will only distribute the "full" stdlib. The real key to keeping distribution size down will be compressing assets.