Shade sprite module: faction generation, asset scanning, TextureCache
Extends the shade_sprite module (for merchant-shade.itch.io character sprite sheets) with procedural faction generation and asset management: - FactionGenerator: seed-based faction recipes with Biome, Element, Aesthetic, and RoleType enums for thematic variety - AssetLibrary: filesystem scanner that discovers and categorizes layer PNGs by type (skins, clothes, hair, etc.) - TextureCache: avoids redundant disk I/O when building many variants - CharacterAssembler: HSL shift documentation, method improvements - Demo expanded to 6 interactive scenes (animation viewer, HSL recolor, character gallery, faction generator, layer compositing, equipment) - EVALUATION.md: 7DRL readiness assessment of the full module - 329-line faction generation test suite Assets themselves are not included -- sprite sheets are external dependencies, some under commercial license. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9718153709
commit
80e14163f9
7 changed files with 2471 additions and 314 deletions
|
|
@ -29,6 +29,14 @@ For layered characters:
|
|||
assembler.add_layer("clothes/BasicBlue-Body.png", hue_shift=120.0)
|
||||
assembler.add_layer("hair/M-Hairstyle1-Black.png")
|
||||
texture = assembler.build("my_character")
|
||||
|
||||
For procedural factions:
|
||||
from shade_sprite import FactionGenerator, AssetLibrary
|
||||
|
||||
lib = AssetLibrary()
|
||||
gen = FactionGenerator(seed=42, library=lib)
|
||||
recipe = gen.generate()
|
||||
textures = recipe.build_role_textures(assembler)
|
||||
"""
|
||||
|
||||
from .formats import (
|
||||
|
|
@ -44,12 +52,23 @@ from .formats import (
|
|||
detect_format,
|
||||
)
|
||||
from .animation import AnimatedSprite
|
||||
from .assembler import CharacterAssembler
|
||||
from .assembler import CharacterAssembler, TextureCache
|
||||
from .assets import AssetLibrary, LayerFile
|
||||
from .factions import (
|
||||
FactionRecipe,
|
||||
FactionGenerator,
|
||||
RoleDefinition,
|
||||
Biome,
|
||||
Element,
|
||||
Aesthetic,
|
||||
RoleType,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# Core classes
|
||||
"AnimatedSprite",
|
||||
"CharacterAssembler",
|
||||
"TextureCache",
|
||||
# Format definitions
|
||||
"Direction",
|
||||
"AnimFrame",
|
||||
|
|
@ -63,4 +82,15 @@ __all__ = [
|
|||
"ALL_FORMATS",
|
||||
# Utilities
|
||||
"detect_format",
|
||||
# Asset scanning
|
||||
"AssetLibrary",
|
||||
"LayerFile",
|
||||
# Faction generation
|
||||
"FactionRecipe",
|
||||
"FactionGenerator",
|
||||
"RoleDefinition",
|
||||
"Biome",
|
||||
"Element",
|
||||
"Aesthetic",
|
||||
"RoleType",
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue