diff --git a/.opencode/skills/kq4-room-documenter/SKILL.md b/.opencode/skills/kq4-room-documenter/SKILL.md index e7e77ad..c7ed929 100644 --- a/.opencode/skills/kq4-room-documenter/SKILL.md +++ b/.opencode/skills/kq4-room-documenter/SKILL.md @@ -27,7 +27,8 @@ Generate documentation following this exact structure: ### 1. Header Format: `# Room ##: [Room Name]` -**Filename**: `kq4-##-human-readable-name.md` +**Directory**: `rooms/kq4-##-human-readable-name/` +**Filename inside directory**: `kq4-##-human-readable-name.md` ### 2. High-Level Summary A paragraph describing the room's purpose, key features, NPCs, and gameplay significance. @@ -187,21 +188,29 @@ Follow the format exactly: 5. Scripts table 6. Technical notes with state variables -### Step 7: Save File +### Step 7: Generate Visual PNG -Save to: `rooms/kq4-###-human-readable-name.md` +After saving the documentation, generate the room visual: +1. Run: `./sci_pic_render "" rooms/kq4-###-human-readable-name/` +2. This creates three PNG files: + - `pic_###_visual.png` - Background visual + - `pic_###_control.png` - Control (walkable areas) + - `pic_###_priority.png` - Priority (z-ordering) +3. Move the markdown file into the room directory: `mv rooms/kq4-###-human-readable-name.md rooms/kq4-###-human-readable-name/` ### Step 8: Update README.md After saving the room documentation: 1. Read the current README.md to find the Progress section 2. Find the row for this room number -3. Update the Status to `[DONE](./rooms/kq4-###-human-readable-name.md)` +3. Update the Status to include embedded PNG and link: + - With PNG: `![pic_###_visual.png](./rooms/kq4-###-human-readable-name/pic_###_visual.png) [DONE](./rooms/kq4-###-human-readable-name/kq4-###-human-readable-name.md)` + - Without PNG (if render fails): `[DONE](./rooms/kq4-###-human-readable-name/kq4-###-human-readable-name.md)` 4. Fill in the Room Description with a human-readable name (e.g., "Beach", "Fountain Pool", "Cave Entrance") ## Example Reference -See `rooms/055-seven-dwarfs-diamond-mine.md` for a complete example following this format. +See `rooms/kq4-055-seven-dwarfs-diamond-mine/kq4-055-seven-dwarfs-diamond-mine.md` for a complete example following this format. ## Command Reference @@ -322,5 +331,7 @@ Document all applied regions and check each for additional interactions. - Include full message text in quotes - Organize interactions logically by type - Be thorough but concise in descriptions -- Filename must be: `kq4-##-human-readable-name.md` (e.g., `kq4-024-waterfall-and-pool.md`) -- After completing the documentation, update README.md with the room description and link +- Create directory: `rooms/kq4-##-human-readable-name/` +- Save markdown as: `rooms/kq4-##-human-readable-name/kq4-##-human-readable-name.md` +- Generate PNGs using sci_pic_render into the room directory +- After completing the documentation, update README.md with the room description, embedded PNG thumbnail, and link diff --git a/README.md b/README.md index dcf8509..867f9e5 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,15 @@ A comprehensive documentation of all game interactions extracted from the decomp ``` / -├── rooms/ # Room-specific interaction documentation -│ ├── kq4-001.md # Beach (starting room) -│ ├── kq4-002.md # Beach continuation -│ ├── kq4-007.md # Fisherman's shack exterior -│ ├── kq4-042.md # Fisherman's cottage interior -│ └── ... # One file per room +├── rooms/ # Room-specific documentation (one directory per room) +│ ├── kq4-001-beach/ # Beach (starting room) +│ │ ├── 001-beach.md # Room documentation +│ │ ├── pic_001_visual.png # Background visual +│ │ ├── pic_001_control.png # Control (walkable areas) +│ │ └── pic_001_priority.png # Priority (z-ordering) +│ ├── kq4-002-meadow/ # Meadow (with Satyr/Pan) +│ ├── kq4-010-forest-path/ # Forest Path +│ └── ... # One directory per room ├── KQ4_v1.006.004_int0.000.502_SRC_(6)/ │ └── src/ # Decompiled SCI scripts │ ├── Main.sc # Game engine & global handlers @@ -218,6 +221,39 @@ When adapting to a KQ5-style interface (walk, look, hand, talk, inventory): Text messages referenced as `Print scriptNum messageNum` will be extracted from the game's RESOURCE files and added to each room's documentation. +## Generating Room Visuals + +Each room directory contains rendered PNG images of the game's PIC resources: + +### Using sci_pic_render + +```bash +./sci_pic_render "" +``` + +**Example:** +```bash +./sci_pic_render 1 "King's Quest IV - The Perils of Rosella (1988)/KQ4" rooms/kq4-001-beach +``` + +This generates three PNG files in the room directory: +- `pic_###_visual.png` - The background visual +- `pic_###_control.png` - Control (walkable areas) +- `pic_###_priority.png` - Priority (z-ordering) + +### Directory Structure + +``` +rooms/ +├── kq4-001-beach/ +│ ├── 001-beach.md # Room documentation +│ ├── pic_001_visual.png # Background +│ ├── pic_001_control.png # Walkable areas +│ └── pic_001_priority.png # Z-ordering +└── kq4-010-forest-path/ + └── ... +``` + ## Contributing When adding room documentation: @@ -233,105 +269,105 @@ When adding room documentation: | Room Number | Room Description | Status | |-------------|------------------|--------| -| 001 | Beach | [DONE](./rooms/kq4-001-beach.md) | -| 002 | Meadow (with Satyr/Pan) | [DONE](./rooms/kq4-002-meadow.md) | -| 003 | Fountain Pool | [DONE](./rooms/kq4-003-fountain-pool.md) | -| 004 | Ogre's Cottage Exterior | [DONE](./rooms/kq4-004-ogres-cottage.md) | -| 005 | Forest Grove | [DONE](./rooms/kq4-005-forest-grove.md) | -| 006 | Cave Entrance | [DONE](./rooms/kq4-006-cave-entrance.md) | -| 007 | Fisherman's Shack Exterior | [DONE](./rooms/kq4-007-fishermans-shack.md) | -| 008 | Back of Fisherman's Shack | [DONE](./rooms/kq4-008-back-of-fishermans-shack.md) | -| 009 | Shady Wooded Area | [DONE](./rooms/kq4-009-shady-wooded-area.md) | -| 010 | Forest Path | [DONE](./rooms/kq4-010-forest-path.md) | -| 011 | Enchanted Grove | [DONE](./rooms/kq4-011-enchanted-grove.md) | -| 012 | Haunted Forest | [DONE](./rooms/kq4-012-haunted-forest.md) | -| 013 | Beach | [DONE](./rooms/kq4-013-beach.md) | -| 014 | Green Meadow | [DONE](./rooms/kq4-014-green-meadow.md) | -| 015 | The Frog Pond | [DONE](./rooms/kq4-015-frog-pond.md) | -| 016 | Graveyard | [DONE](./rooms/kq4-016-graveyard.md) | -| 017 | Spooky House Exterior | [DONE](./rooms/kq4-017-spooky-house-exterior.md) | -| 018 | Cemetery | [DONE](./rooms/kq4-018-cemetery.md) | -| 019 | Coastal Cliffs | [DONE](./rooms/kq4-019-coastal-cliffs.md) | -| 020 | Meadow | [DONE](./rooms/kq4-020-meadow.md) | -| 021 | Bridge Over Stream | [DONE](./rooms/kq4-021-bridge-over-stream.md) | -| 022 | Gnome's Cottage | [DONE](./rooms/kq4-022-gnomes-cottage.md) | -| 023 | Forest Path with Cottage | [DONE](./rooms/kq4-023-forest-path-with-cottage.md) | -| 024 | Waterfall and Pool | [DONE](./rooms/kq4-024-waterfall-and-pool.md) | -| 025 | Beach at River Delta | [DONE](./rooms/kq4-025-beach-at-river-delta.md) | -| 026 | River Meadow | [DONE](./rooms/kq4-026-river-meadow.md) | -| 027 | Forest Path | [DONE](./rooms/kq4-027-forest-path.md) | -| 028 | Mine Entrance | [DONE](./rooms/kq4-028-mine-entrance.md) | -| 029 | Dense Forest | [DONE](./rooms/kq4-029-dense-forest.md) | -| 030 | Mountain Pass | [DONE](./rooms/kq4-030-mountain-pass.md) | -| 031 | Open Ocean | [DONE](./rooms/kq4-031-open-ocean.md) | -| 032 | Ocean Near Island | [DONE](./rooms/kq4-032-ocean-near-island.md) | -| 033 | Enchanted Island Beach | [DONE](./rooms/kq4-033-enchanted-island-beach.md) | -| 034 | Island Beach | [DONE](./rooms/kq4-034-island-beach.md) | -| 035 | Island Beach | [DONE](./rooms/kq4-035-island-beach.md) | -| 036 | Island Garden Pond | [DONE](./rooms/kq4-036-island-garden-pond.md) | -| 037 | Fairy Island | [DONE](./rooms/kq4-037-fairy-island.md) | -| 038 | Island Garden | [DONE](./rooms/kq4-038-island-garden.md) | -| 039 | Island Beach | [DONE](./rooms/kq4-039-island-beach.md) | -| 040 | Island Beach (East) | [DONE](./rooms/kq4-040-island-beach-east.md) | -| 041 | Island Shore | [DONE](./rooms/kq4-041-island-shore.md) | -| 042 | Fisherman's Cottage Interior | [DONE](./rooms/kq4-042-fishermans-shack-inside.md) | -| 043 | Desert Island | [DONE](./rooms/kq4-043-desert-island.md) | -| 044 | Inside Whale | [DONE](./rooms/kq4-044-inside-whale.md) | -| 045 | Genesta's Bed Chamber | [DONE](./rooms/kq4-045-genestas-bed-chamber.md) | -| 046 | Tower Stairway | [DONE](./rooms/kq4-046-tower-stairway.md) | -| 047 | Genesta's Palace Entry Hall | [DONE](./rooms/kq4-047-genestas-palace-entry-hall.md) | -| 048 | Ogre's Bedroom | [DONE](./rooms/kq4-048-ogres-bedroom.md) | -| 049 | Ogre's Cottage | [DONE](./rooms/kq4-049-ogres-cottage.md) | -| 050 | Ogress's Kitchen | [DONE](./rooms/kq4-050-ogress-kitchen.md) | -| 051 | Ogre's Closet | [DONE](./rooms/kq4-051-ogres-closet.md) | +| 001 | Beach | ![pic_001_visual.png](./rooms/kq4-001-beach/pic_001_visual.png) [DONE](./rooms/kq4-001-beach/001-beach.md) | +| 002 | Meadow (with Satyr/Pan) | ![pic_002_visual.png](./rooms/kq4-002-meadow/pic_002_visual.png) [DONE](./rooms/kq4-002-meadow/kq4-002-meadow.md) | +| 003 | Fountain Pool | ![pic_003_visual.png](./rooms/kq4-003-fountain-pool/pic_003_visual.png) [DONE](./rooms/kq4-003-fountain-pool/kq4-003-fountain-pool.md) | +| 004 | Ogre's Cottage Exterior | ![pic_004_visual.png](./rooms/kq4-004-ogres-cottage/pic_004_visual.png) [DONE](./rooms/kq4-004-ogres-cottage/kq4-004-ogres-cottage.md) | +| 005 | Forest Grove | ![pic_005_visual.png](./rooms/kq4-005-forest-grove/pic_005_visual.png) [DONE](./rooms/kq4-005-forest-grove/kq4-005-forest-grove.md) | +| 006 | Cave Entrance | ![pic_006_visual.png](./rooms/kq4-006-cave-entrance/pic_006_visual.png) [DONE](./rooms/kq4-006-cave-entrance/kq4-006-cave-entrance.md) | +| 007 | Fisherman's Shack Exterior | ![pic_007_visual.png](./rooms/kq4-007-fishermans-shack/pic_007_visual.png) [DONE](./rooms/kq4-007-fishermans-shack/kq4-007-fishermans-shack.md) | +| 008 | Back of Fisherman's Shack | ![pic_008_visual.png](./rooms/kq4-008-back-of-fishermans-shack/pic_008_visual.png) [DONE](./rooms/kq4-008-back-of-fishermans-shack/kq4-008-back-of-fishermans-shack.md) | +| 009 | Shady Wooded Area | ![pic_009_visual.png](./rooms/kq4-009-shady-wooded-area/pic_009_visual.png) [DONE](./rooms/kq4-009-shady-wooded-area/kq4-009-shady-wooded-area.md) | +| 010 | Forest Path | ![pic_010_visual.png](./rooms/kq4-010-forest-path/pic_010_visual.png) [DONE](./rooms/kq4-010-forest-path/kq4-010-forest-path.md) | +| 011 | Enchanted Grove | ![pic_011_visual.png](./rooms/kq4-011-enchanted-grove/pic_011_visual.png) [DONE](./rooms/kq4-011-enchanted-grove/kq4-011-enchanted-grove.md) | +| 012 | Haunted Forest | ![pic_012_visual.png](./rooms/kq4-012-haunted-forest/pic_012_visual.png) [DONE](./rooms/kq4-012-haunted-forest/kq4-012-haunted-forest.md) | +| 013 | Beach | ![pic_013_visual.png](./rooms/kq4-013-beach/pic_013_visual.png) [DONE](./rooms/kq4-013-beach/kq4-013-beach.md) | +| 014 | Green Meadow | ![pic_014_visual.png](./rooms/kq4-014-green-meadow/pic_014_visual.png) [DONE](./rooms/kq4-014-green-meadow/kq4-014-green-meadow.md) | +| 015 | The Frog Pond | ![pic_015_visual.png](./rooms/kq4-015-frog-pond/pic_015_visual.png) [DONE](./rooms/kq4-015-frog-pond/kq4-015-frog-pond.md) | +| 016 | Graveyard | ![pic_016_visual.png](./rooms/kq4-016-graveyard/pic_016_visual.png) [DONE](./rooms/kq4-016-graveyard/kq4-016-graveyard.md) | +| 017 | Spooky House Exterior | ![pic_017_visual.png](./rooms/kq4-017-spooky-house-exterior/pic_017_visual.png) [DONE](./rooms/kq4-017-spooky-house-exterior/kq4-017-spooky-house-exterior.md) | +| 018 | Cemetery | ![pic_018_visual.png](./rooms/kq4-018-cemetery/pic_018_visual.png) [DONE](./rooms/kq4-018-cemetery/kq4-018-cemetery.md) | +| 019 | Coastal Cliffs | ![pic_019_visual.png](./rooms/kq4-019-coastal-cliffs/pic_019_visual.png) [DONE](./rooms/kq4-019-coastal-cliffs/kq4-019-coastal-cliffs.md) | +| 020 | Meadow | ![pic_020_visual.png](./rooms/kq4-020-meadow/pic_020_visual.png) [DONE](./rooms/kq4-020-meadow/kq4-020-meadow.md) | +| 021 | Bridge Over Stream | ![pic_021_visual.png](./rooms/kq4-021-bridge-over-stream/pic_021_visual.png) [DONE](./rooms/kq4-021-bridge-over-stream/kq4-021-bridge-over-stream.md) | +| 022 | Gnome's Cottage | ![pic_022_visual.png](./rooms/kq4-022-gnomes-cottage/pic_022_visual.png) [DONE](./rooms/kq4-022-gnomes-cottage/kq4-022-gnomes-cottage.md) | +| 023 | Forest Path with Cottage | ![pic_023_visual.png](./rooms/kq4-023-forest-path-with-cottage/pic_023_visual.png) [DONE](./rooms/kq4-023-forest-path-with-cottage/kq4-023-forest-path-with-cottage.md) | +| 024 | Waterfall and Pool | ![pic_024_visual.png](./rooms/kq4-024-waterfall-and-pool/pic_024_visual.png) [DONE](./rooms/kq4-024-waterfall-and-pool/024-waterfall-and-pool.md) | +| 025 | Beach at River Delta | ![pic_025_visual.png](./rooms/kq4-025-beach-at-river-delta/pic_025_visual.png) [DONE](./rooms/kq4-025-beach-at-river-delta/kq4-025-beach-at-river-delta.md) | +| 026 | River Meadow | ![pic_026_visual.png](./rooms/kq4-026-river-meadow/pic_026_visual.png) [DONE](./rooms/kq4-026-river-meadow/kq4-026-river-meadow.md) | +| 027 | Forest Path | ![pic_027_visual.png](./rooms/kq4-027-forest-path/pic_027_visual.png) [DONE](./rooms/kq4-027-forest-path/kq4-027-forest-path.md) | +| 028 | Mine Entrance | ![pic_028_visual.png](./rooms/kq4-028-mine-entrance/pic_028_visual.png) [DONE](./rooms/kq4-028-mine-entrance/kq4-028-mine-entrance.md) | +| 029 | Dense Forest | ![pic_029_visual.png](./rooms/kq4-029-dense-forest/pic_029_visual.png) [DONE](./rooms/kq4-029-dense-forest/kq4-029-dense-forest.md) | +| 030 | Mountain Pass | ![pic_030_visual.png](./rooms/kq4-030-mountain-pass/pic_030_visual.png) [DONE](./rooms/kq4-030-mountain-pass/kq4-030-mountain-pass.md) | +| 031 | Open Ocean | ![pic_031_visual.png](./rooms/kq4-031-open-ocean/pic_031_visual.png) [DONE](./rooms/kq4-031-open-ocean/kq4-031-open-ocean.md) | +| 032 | Ocean Near Island | ![pic_032_visual.png](./rooms/kq4-032-ocean-near-island/pic_032_visual.png) [DONE](./rooms/kq4-032-ocean-near-island/kq4-032-ocean-near-island.md) | +| 033 | Enchanted Island Beach | ![pic_033_visual.png](./rooms/kq4-033-enchanted-island-beach/pic_033_visual.png) [DONE](./rooms/kq4-033-enchanted-island-beach/kq4-033-enchanted-island-beach.md) | +| 034 | Island Beach | ![pic_034_visual.png](./rooms/kq4-034-island-beach/pic_034_visual.png) [DONE](./rooms/kq4-034-island-beach/kq4-034-island-beach.md) | +| 035 | Island Beach | ![pic_035_visual.png](./rooms/kq4-035-island-beach/pic_035_visual.png) [DONE](./rooms/kq4-035-island-beach/kq4-035-island-beach.md) | +| 036 | Island Garden Pond | ![pic_036_visual.png](./rooms/kq4-036-island-garden-pond/pic_036_visual.png) [DONE](./rooms/kq4-036-island-garden-pond/kq4-036-island-garden-pond.md) | +| 037 | Fairy Island | ![pic_037_visual.png](./rooms/kq4-037-fairy-island/pic_037_visual.png) [DONE](./rooms/kq4-037-fairy-island/kq4-037-fairy-island.md) | +| 038 | Island Garden | ![pic_038_visual.png](./rooms/kq4-038-island-garden/pic_038_visual.png) [DONE](./rooms/kq4-038-island-garden/kq4-038-island-garden.md) | +| 039 | Island Beach | ![pic_039_visual.png](./rooms/kq4-039-island-beach/pic_039_visual.png) [DONE](./rooms/kq4-039-island-beach/kq4-039-island-beach.md) | +| 040 | Island Beach (East) | ![pic_040_visual.png](./rooms/kq4-040-island-beach-east/pic_040_visual.png) [DONE](./rooms/kq4-040-island-beach-east/kq4-040-island-beach-east.md) | +| 041 | Island Shore | ![pic_041_visual.png](./rooms/kq4-041-island-shore/pic_041_visual.png) [DONE](./rooms/kq4-041-island-shore/kq4-041-island-shore.md) | +| 042 | Fisherman's Cottage Interior | ![pic_042_visual.png](./rooms/kq4-042-fishermans-shack-inside/pic_042_visual.png) [DONE](./rooms/kq4-042-fishermans-shack-inside/kq4-042-fishermans-shack-inside.md) | +| 043 | Desert Island | ![pic_043_visual.png](./rooms/kq4-043-desert-island/pic_043_visual.png) [DONE](./rooms/kq4-043-desert-island/kq4-043-desert-island.md) | +| 044 | Inside Whale | ![pic_044_visual.png](./rooms/kq4-044-inside-whale/pic_044_visual.png) [DONE](./rooms/kq4-044-inside-whale/kq4-044-inside-whale.md) | +| 045 | Genesta's Bed Chamber | ![pic_045_visual.png](./rooms/kq4-045-genestas-bed-chamber/pic_045_visual.png) [DONE](./rooms/kq4-045-genestas-bed-chamber/kq4-045-genestas-bed-chamber.md) | +| 046 | Tower Stairway | ![pic_046_visual.png](./rooms/kq4-046-tower-stairway/pic_046_visual.png) [DONE](./rooms/kq4-046-tower-stairway/kq4-046-tower-stairway.md) | +| 047 | Genesta's Palace Entry Hall | ![pic_047_visual.png](./rooms/kq4-047-genestas-palace-entry-hall/pic_047_visual.png) [DONE](./rooms/kq4-047-genestas-palace-entry-hall/kq4-047-genestas-palace-entry-hall.md) | +| 048 | Ogre's Bedroom | ![pic_048_visual.png](./rooms/kq4-048-ogres-bedroom/pic_048_visual.png) [DONE](./rooms/kq4-048-ogres-bedroom/kq4-048-ogres-bedroom.md) | +| 049 | Ogre's Cottage | ![pic_049_visual.png](./rooms/kq4-049-ogres-cottage/pic_049_visual.png) [DONE](./rooms/kq4-049-ogres-cottage/kq4-049-ogres-cottage.md) | +| 050 | Ogress's Kitchen | ![pic_050_visual.png](./rooms/kq4-050-ogress-kitchen/pic_050_visual.png) [DONE](./rooms/kq4-050-ogress-kitchen/kq4-050-ogress-kitchen.md) | +| 051 | Ogre's Closet | ![pic_051_visual.png](./rooms/kq4-051-ogres-closet/pic_051_visual.png) [DONE](./rooms/kq4-051-ogres-closet/kq4-051-ogres-closet.md) | | 052 | | N/A (doesn't exist) | -| 053 | Seven Dwarfs' Bedroom | [DONE](./rooms/kq4-053-seven-dwarfs-bedroom.md) | -| 054 | Seven Dwarfs' Cottage | [DONE](./rooms/kq4-054-seven-dwarfs-cottage.md) | -| 055 | Seven Dwarfs Diamond Mine | [DONE](./rooms/kq4-055-seven-dwarfs-diamond-mine.md) | -| 056 | Seven Dwarfs' Diamond Mine (West) | [DONE](./rooms/kq4-056-seven-dwarfs-diamond-mine-west.md) | -| 057 | Witches' Cave | [DONE](./rooms/kq4-057-witches-cave.md) | -| 058 | Tower Organ Room | [DONE](./rooms/kq4-058-tower-organ-room.md) | -| 059 | Baby Nursery | [DONE](./rooms/kq4-059-baby-nursery.md) | -| 060 | Bedroom | [DONE](./rooms/kq4-060-bedroom.md) | -| 061 | Tower Stairs | [DONE](./rooms/kq4-061-tower-stairs.md) | -| 062 | Bedroom | [DONE](./rooms/kq4-062-bedroom.md) | -| 063 | Attic | [DONE](./rooms/kq4-063-attic.md) | -| 064 | Old Dining Room | [DONE](./rooms/kq4-064-old-dining-room.md) | -| 065 | Old Kitchen | [DONE](./rooms/kq4-065-old-kitchen.md) | -| 066 | Secret Tower | [DONE](./rooms/kq4-066-secret-tower.md) | -| 067 | The Parlor | [DONE](./rooms/kq4-067-the-parlor.md) | -| 068 | The Foyer | [DONE](./rooms/kq4-068-the-foyer.md) | -| 069 | The Crypt | [DONE](./rooms/kq4-069-the-crypt.md) | -| 070 | Waterfall Cave | [DONE](./rooms/kq4-070-waterfall-cave.md) | -| 071 | Cave Entrance | [DONE](./rooms/kq4-071-cave-entrance.md) | -| 072 | Dark Cave Passage | [DONE](./rooms/kq4-072-dark-cave-passage.md) | -| 073 | Cave Exit | [DONE](./rooms/kq4-073-cave-exit.md) | -| 074 | Troll Cave | [DONE](./rooms/kq4-074-troll-cave.md) | -| 075 | Troll Cave Passage | [DONE](./rooms/kq4-075-troll-cave-passage.md) | -| 076 | Dark Chasm | [DONE](./rooms/kq4-076-dark-chasm.md) | -| 077 | Swamp | [DONE](./rooms/kq4-077-swamp.md) | -| 078 | Swamp Island | [DONE](./rooms/kq4-078-swamp-island.md) | -| 079 | Mountain Path to Dark Castle | [DONE](./rooms/kq4-079-mountain-path-to-dark-castle.md) | -| 080 | Lolotte's Castle Entrance | [DONE](./rooms/kq4-080-lolottes-castle-entrance.md) | -| 081 | Edgar's Tower Bedroom | [DONE](./rooms/kq4-081-edgars-tower-bedroom.md) | -| 082 | Lolotte's Tower Bedroom | [DONE](./rooms/kq4-082-lolottes-tower-bedroom.md) | -| 083 | Castle Dungeon Cell | [DONE](./rooms/kq4-083-castle-dungeon-cell.md) | -| 084 | Cottage Front | [DONE](./rooms/kq4-084-cottage-front.md) | -| 085 | Dark Tower Stairs | [DONE](./rooms/kq4-085-dark-tower-stairs.md) | -| 086 | Dim Hallway (West End) | [DONE](./rooms/kq4-086-dim-hallway-west-end.md) | -| 087 | East End of Hallway | [DONE](./rooms/kq4-087-east-end-of-hallway.md) | -| 088 | Stone Tower Stairs | [DONE](./rooms/kq4-088-stone-tower-stairs.md) | -| 089 | Castle Kitchen | [DONE](./rooms/kq4-089-castle-kitchen.md) | -| 090 | West Tower Bottom | [DONE](./rooms/kq4-090-west-tower-bottom.md) | -| 091 | Castle Dining Room | [DONE](./rooms/kq4-091-castle-dining-room.md) | -| 092 | Lolotte's Throne Room | [DONE](./rooms/kq4-092-lolottes-throne-room.md) | -| 093 | Bottom of East Tower | [DONE](./rooms/kq4-093-bottom-of-east-tower.md) | -| 094 | Unicorn Stable | [DONE](./rooms/kq4-094-unicorn-stable.md) | -| 095 | Fisherman's Pier | [DONE](./rooms/kq4-095-fishermans-pier.md) | +| 053 | Seven Dwarfs' Bedroom | ![pic_053_visual.png](./rooms/kq4-053-seven-dwarfs-bedroom/pic_053_visual.png) [DONE](./rooms/kq4-053-seven-dwarfs-bedroom/kq4-053-seven-dwarfs-bedroom.md) | +| 054 | Seven Dwarfs' Cottage | ![pic_054_visual.png](./rooms/kq4-054-seven-dwarfs-cottage/pic_054_visual.png) [DONE](./rooms/kq4-054-seven-dwarfs-cottage/kq4-054-seven-dwarfs-cottage.md) | +| 055 | Seven Dwarfs Diamond Mine | ![pic_055_visual.png](./rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_visual.png) [DONE](./rooms/kq4-055-seven-dwarfs-diamond-mine/055-seven-dwarfs-diamond-mine.md) | +| 056 | Seven Dwarfs' Diamond Mine (West) | ![pic_056_visual.png](./rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_visual.png) [DONE](./rooms/kq4-056-seven-dwarfs-diamond-mine-west/kq4-056-seven-dwarfs-diamond-mine-west.md) | +| 057 | Witches' Cave | ![pic_057_visual.png](./rooms/kq4-057-witch-cave/pic_057_visual.png) [DONE](./rooms/kq4-057-witch-cave/57-witch-cave.md) | +| 058 | Tower Organ Room | ![pic_058_visual.png](./rooms/kq4-058-tower-organ-room/pic_058_visual.png) [DONE](./rooms/kq4-058-tower-organ-room/kq4-058-tower-organ-room.md) | +| 059 | Baby Nursery | ![pic_059_visual.png](./rooms/kq4-059-baby-nursery/pic_059_visual.png) [DONE](./rooms/kq4-059-baby-nursery/kq4-059-baby-nursery.md) | +| 060 | Bedroom | ![pic_060_visual.png](./rooms/kq4-060-bedroom/pic_060_visual.png) [DONE](./rooms/kq4-060-bedroom/kq4-060-bedroom.md) | +| 061 | Tower Stairs | ![pic_061_visual.png](./rooms/kq4-061-tower-stairs/pic_061_visual.png) [DONE](./rooms/kq4-061-tower-stairs/kq4-061-tower-stairs.md) | +| 062 | Bedroom | ![pic_062_visual.png](./rooms/kq4-062-bedroom/pic_062_visual.png) [DONE](./rooms/kq4-062-bedroom/kq4-062-bedroom.md) | +| 063 | Attic | ![pic_063_visual.png](./rooms/kq4-063-attic/pic_063_visual.png) [DONE](./rooms/kq4-063-attic/kq4-063-attic.md) | +| 064 | Old Dining Room | ![pic_064_visual.png](./rooms/kq4-064-old-dining-room/pic_064_visual.png) [DONE](./rooms/kq4-064-old-dining-room/kq4-064-old-dining-room.md) | +| 065 | Old Kitchen | ![pic_065_visual.png](./rooms/kq4-065-old-kitchen/pic_065_visual.png) [DONE](./rooms/kq4-065-old-kitchen/kq4-065-old-kitchen.md) | +| 066 | Secret Tower | ![pic_066_visual.png](./rooms/kq4-066-secret-tower/pic_066_visual.png) [DONE](./rooms/kq4-066-secret-tower/kq4-066-secret-tower.md) | +| 067 | The Parlor | ![pic_067_visual.png](./rooms/kq4-067-the-parlor/pic_067_visual.png) [DONE](./rooms/kq4-067-the-parlor/kq4-067-the-parlor.md) | +| 068 | The Foyer | ![pic_068_visual.png](./rooms/kq4-068-the-foyer/pic_068_visual.png) [DONE](./rooms/kq4-068-the-foyer/kq4-068-the-foyer.md) | +| 069 | The Crypt | ![pic_069_visual.png](./rooms/kq4-069-the-crypt/pic_069_visual.png) [DONE](./rooms/kq4-069-the-crypt/kq4-069-the-crypt.md) | +| 070 | Waterfall Cave | ![pic_070_visual.png](./rooms/kq4-070-waterfall-cave/pic_070_visual.png) [DONE](./rooms/kq4-070-waterfall-cave/070-waterfall-cave.md) | +| 071 | Cave Entrance | ![pic_071_visual.png](./rooms/kq4-071-cave-entrance/pic_071_visual.png) [DONE](./rooms/kq4-071-cave-entrance/kq4-071-cave-entrance.md) | +| 072 | Dark Cave Passage | ![pic_072_visual.png](./rooms/kq4-072-dark-cave-passage/pic_072_visual.png) [DONE](./rooms/kq4-072-dark-cave-passage/kq4-072-dark-cave-passage.md) | +| 073 | Cave Exit | ![pic_073_visual.png](./rooms/kq4-073-cave-exit/pic_073_visual.png) [DONE](./rooms/kq4-073-cave-exit/kq4-073-cave-exit.md) | +| 074 | Troll Cave | ![pic_074_visual.png](./rooms/kq4-074-troll-cave/pic_074_visual.png) [DONE](./rooms/kq4-074-troll-cave/kq4-074-troll-cave.md) | +| 075 | Troll Cave Passage | ![pic_075_visual.png](./rooms/kq4-075-troll-cave-passage/pic_075_visual.png) [DONE](./rooms/kq4-075-troll-cave-passage/kq4-075-troll-cave-passage.md) | +| 076 | Dark Chasm | ![pic_076_visual.png](./rooms/kq4-076-dark-chasm/pic_076_visual.png) [DONE](./rooms/kq4-076-dark-chasm/kq4-076-dark-chasm.md) | +| 077 | Swamp | ![pic_077_visual.png](./rooms/kq4-077-swamp/pic_077_visual.png) [DONE](./rooms/kq4-077-swamp/kq4-077-swamp.md) | +| 078 | Swamp Island | ![pic_078_visual.png](./rooms/kq4-078-swamp-island/pic_078_visual.png) [DONE](./rooms/kq4-078-swamp-island/kq4-078-swamp-island.md) | +| 079 | Mountain Path to Dark Castle | ![pic_079_visual.png](./rooms/kq4-079-mountain-path-to-dark-castle/pic_079_visual.png) [DONE](./rooms/kq4-079-mountain-path-to-dark-castle/kq4-079-mountain-path-to-dark-castle.md) | +| 080 | Lolotte's Castle Entrance | ![pic_080_visual.png](./rooms/kq4-080-lolottes-castle-entrance/pic_080_visual.png) [DONE](./rooms/kq4-080-lolottes-castle-entrance/kq4-080-lolottes-castle-entrance.md) | +| 081 | Edgar's Tower Bedroom | ![pic_081_visual.png](./rooms/kq4-081-edgars-tower-bedroom/pic_081_visual.png) [DONE](./rooms/kq4-081-edgars-tower-bedroom/kq4-081-edgars-tower-bedroom.md) | +| 082 | Lolotte's Tower Bedroom | ![pic_082_visual.png](./rooms/kq4-082-lolottes-tower-bedroom/pic_082_visual.png) [DONE](./rooms/kq4-082-lolottes-tower-bedroom/kq4-082-lolottes-tower-bedroom.md) | +| 083 | Castle Dungeon Cell | ![pic_083_visual.png](./rooms/kq4-083-castle-dungeon-cell/pic_083_visual.png) [DONE](./rooms/kq4-083-castle-dungeon-cell/kq4-083-castle-dungeon-cell.md) | +| 084 | Cottage Front | ![pic_084_visual.png](./rooms/kq4-084-cottage-front/pic_084_visual.png) [DONE](./rooms/kq4-084-cottage-front/kq4-084-cottage-front.md) | +| 085 | Dark Tower Stairs | ![pic_085_visual.png](./rooms/kq4-085-dark-tower-stairs/pic_085_visual.png) [DONE](./rooms/kq4-085-dark-tower-stairs/kq4-085-dark-tower-stairs.md) | +| 086 | Dim Hallway (West End) | ![pic_086_visual.png](./rooms/kq4-086-dim-hallway-west-end/pic_086_visual.png) [DONE](./rooms/kq4-086-dim-hallway-west-end/kq4-086-dim-hallway-west-end.md) | +| 087 | East End of Hallway | ![pic_087_visual.png](./rooms/kq4-087-east-end-of-hallway/pic_087_visual.png) [DONE](./rooms/kq4-087-east-end-of-hallway/kq4-087-east-end-of-hallway.md) | +| 088 | Stone Tower Stairs | ![pic_088_visual.png](./rooms/kq4-088-stone-tower-stairs/pic_088_visual.png) [DONE](./rooms/kq4-088-stone-tower-stairs/kq4-088-stone-tower-stairs.md) | +| 089 | Castle Kitchen | ![pic_089_visual.png](./rooms/kq4-089-castle-kitchen/pic_089_visual.png) [DONE](./rooms/kq4-089-castle-kitchen/kq4-089-castle-kitchen.md) | +| 090 | West Tower Bottom | ![pic_090_visual.png](./rooms/kq4-090-west-tower-bottom/pic_090_visual.png) [DONE](./rooms/kq4-090-west-tower-bottom/kq4-090-west-tower-bottom.md) | +| 091 | Castle Dining Room | ![pic_091_visual.png](./rooms/kq4-091-castle-dining-room/pic_091_visual.png) [DONE](./rooms/kq4-091-castle-dining-room/kq4-091-castle-dining-room.md) | +| 092 | Lolotte's Throne Room | ![pic_092_visual.png](./rooms/kq4-092-lolottes-throne-room/pic_092_visual.png) [DONE](./rooms/kq4-092-lolottes-throne-room/kq4-092-lolottes-throne-room.md) | +| 093 | Bottom of East Tower | ![pic_093_visual.png](./rooms/kq4-093-bottom-of-east-tower/pic_093_visual.png) [DONE](./rooms/kq4-093-bottom-of-east-tower/kq4-093-bottom-of-east-tower.md) | +| 094 | Unicorn Stable | ![pic_094_visual.png](./rooms/kq4-094-unicorn-stable/pic_094_visual.png) [DONE](./rooms/kq4-094-unicorn-stable/kq4-094-unicorn-stable.md) | +| 095 | Fisherman's Pier | ![pic_095_visual.png](./rooms/kq4-095-fishermans-pier/pic_095_visual.png) [DONE](./rooms/kq4-095-fishermans-pier/kq4-095-fishermans-pier.md) | | 096 | | N/A (doesn't exist) | | 097 | | N/A (doesn't exist) | -| 098 | Transitional Room | [DONE](./rooms/kq4-098-transitional-room.md) | -| 099 | Transitional Room | [DONE](./rooms/kq4-099-transitional-room.md) | +| 098 | Transitional Room | [DONE](./rooms/kq4-098-transitional-room/kq4-098-transitional-room.md) | +| 099 | Transitional Room | [DONE](./rooms/kq4-099-transitional-room/kq4-099-transitional-room.md) | ## Credits diff --git a/__pycache__/extract_sci_pic.cpython-311.pyc b/__pycache__/extract_sci_pic.cpython-311.pyc new file mode 100644 index 0000000..1b9c4d9 Binary files /dev/null and b/__pycache__/extract_sci_pic.cpython-311.pyc differ diff --git a/__pycache__/extract_sci_text.cpython-311.pyc b/__pycache__/extract_sci_text.cpython-311.pyc new file mode 100644 index 0000000..27381cf Binary files /dev/null and b/__pycache__/extract_sci_text.cpython-311.pyc differ diff --git a/docs/rooms/pic_001_control.png b/docs/rooms/pic_001_control.png new file mode 100644 index 0000000..a2673f9 Binary files /dev/null and b/docs/rooms/pic_001_control.png differ diff --git a/docs/rooms/pic_001_priority.png b/docs/rooms/pic_001_priority.png new file mode 100644 index 0000000..877d49c Binary files /dev/null and b/docs/rooms/pic_001_priority.png differ diff --git a/docs/rooms/pic_001_visual.png b/docs/rooms/pic_001_visual.png new file mode 100644 index 0000000..0a6705d Binary files /dev/null and b/docs/rooms/pic_001_visual.png differ diff --git a/docs/rooms/pic_002_control.png b/docs/rooms/pic_002_control.png new file mode 100644 index 0000000..ec0676e Binary files /dev/null and b/docs/rooms/pic_002_control.png differ diff --git a/docs/rooms/pic_002_lines_only.png b/docs/rooms/pic_002_lines_only.png new file mode 100644 index 0000000..1c4232c Binary files /dev/null and b/docs/rooms/pic_002_lines_only.png differ diff --git a/docs/rooms/pic_002_priority.png b/docs/rooms/pic_002_priority.png new file mode 100644 index 0000000..e5e8e0b Binary files /dev/null and b/docs/rooms/pic_002_priority.png differ diff --git a/docs/rooms/pic_002_visual.png b/docs/rooms/pic_002_visual.png new file mode 100644 index 0000000..ade907d Binary files /dev/null and b/docs/rooms/pic_002_visual.png differ diff --git a/docs/rooms/pic_003_control.png b/docs/rooms/pic_003_control.png new file mode 100644 index 0000000..fcfff7f Binary files /dev/null and b/docs/rooms/pic_003_control.png differ diff --git a/docs/rooms/pic_003_priority.png b/docs/rooms/pic_003_priority.png new file mode 100644 index 0000000..cde06ac Binary files /dev/null and b/docs/rooms/pic_003_priority.png differ diff --git a/docs/rooms/pic_003_visual.png b/docs/rooms/pic_003_visual.png new file mode 100644 index 0000000..6285bbe Binary files /dev/null and b/docs/rooms/pic_003_visual.png differ diff --git a/docs/rooms/pic_005_control.png b/docs/rooms/pic_005_control.png new file mode 100644 index 0000000..ec0676e Binary files /dev/null and b/docs/rooms/pic_005_control.png differ diff --git a/docs/rooms/pic_005_priority.png b/docs/rooms/pic_005_priority.png new file mode 100644 index 0000000..0071a8f Binary files /dev/null and b/docs/rooms/pic_005_priority.png differ diff --git a/docs/rooms/pic_005_visual.png b/docs/rooms/pic_005_visual.png new file mode 100644 index 0000000..3e10eb5 Binary files /dev/null and b/docs/rooms/pic_005_visual.png differ diff --git a/docs/rooms/pic_040_control.png b/docs/rooms/pic_040_control.png new file mode 100644 index 0000000..41d086f Binary files /dev/null and b/docs/rooms/pic_040_control.png differ diff --git a/docs/rooms/pic_040_priority.png b/docs/rooms/pic_040_priority.png new file mode 100644 index 0000000..7f18f5f Binary files /dev/null and b/docs/rooms/pic_040_priority.png differ diff --git a/docs/rooms/pic_040_visual.png b/docs/rooms/pic_040_visual.png new file mode 100644 index 0000000..b159827 Binary files /dev/null and b/docs/rooms/pic_040_visual.png differ diff --git a/extract_sci_pic.py b/extract_sci_pic.py new file mode 100644 index 0000000..88a29d7 --- /dev/null +++ b/extract_sci_pic.py @@ -0,0 +1,566 @@ +#!/usr/bin/env python3 +""" +SCI Picture Resource Extractor + +Extracts and renders background images (PIC resources) from Sierra's Creative Interpreter (SCI) games. +Supports SCI0 format (King's Quest IV). +""" + +import os +import sys +from pathlib import Path +from typing import Tuple, Optional +from collections import deque +import numpy as np +from PIL import Image + +PIC_OP_SET_COLOR = 0xf0 +PIC_OP_DISABLE_VISUAL = 0xf1 +PIC_OP_SET_PRIORITY = 0xf2 +PIC_OP_DISABLE_PRIORITY = 0xf3 +PIC_OP_RELATIVE_PATTERNS = 0xf4 +PIC_OP_RELATIVE_MEDIUM_LINES = 0xf5 +PIC_OP_RELATIVE_LONG_LINES = 0xf6 +PIC_OP_RELATIVE_SHORT_LINES = 0xf7 +PIC_OP_FILL = 0xf8 +PIC_OP_SET_PATTERN = 0xf9 +PIC_OP_ABSOLUTE_PATTERNS = 0xfa +PIC_OP_SET_CONTROL = 0xfb +PIC_OP_DISABLE_CONTROL = 0xfc +PIC_OP_RELATIVE_MEDIUM_PATTERNS = 0xfd +PIC_OP_OPX = 0xfe +PIC_OP_END = 0xff + +WIDTH, HEIGHT = 320, 190 + +PATTERN_FLAG_RECTANGLE = 0x10 +PATTERN_FLAG_USE_PATTERN = 0x20 + +CIRCLES = [ + [0x80], + [0x4e, 0x40], + [0x73, 0xef, 0xbe, 0x70], + [0x38, 0x7c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x00], + [0x1c, 0x1f, 0xcf, 0xfb, 0xfe, 0xff, 0xbf, 0xef, 0xf9, 0xfc, 0x1c], + [0x0e, 0x03, 0xf8, 0x7f, 0xc7, 0xfc, 0xff, 0xef, 0xfe, 0xff, 0xe7, 0xfc, 0x7f, 0xc3, 0xf8, 0x1f, 0x00], + [0x0f, 0x80, 0xff, 0x87, 0xff, 0x1f, 0xfc, 0xff, 0xfb, 0xff, 0xef, 0xff, 0xbf, 0xfe, 0xff, 0xf9, 0xff, 0xc7, 0xff, 0x0f, 0xf8, 0x0f, 0x80], + [0x07, 0xc0, 0x1f, 0xf0, 0x3f, 0xf8, 0x7f, 0xfc, 0x7f, 0xfc, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0x7f, 0xfc, 0x7f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf0, 0x07, 0xc0], +] + +JUNQ = [0x20, 0x94, 0x02, 0x24, 0x90, 0x82, 0xa4, 0xa2, 0x82, 0x09, 0x0a, 0x22, 0x12, 0x10, 0x42, 0x14, 0x91, 0x4a, 0x91, 0x11, 0x08, 0x12, 0x25, 0x10, 0x22, 0xa8, 0x14, 0x24, 0x00, 0x50, 0x24, 0x04] + +JUNQINDEX = [0x00, 0x18, 0x30, 0xc4, 0xdc, 0x65, 0xeb, 0x48, 0x60, 0xbd, 0x89, 0x05, 0x0a, 0xf4, 0x7d, 0x7d, 0x85, 0xb0, 0x8e, 0x95, 0x1f, 0x22, 0x0d, 0xdf, 0x2a, 0x78, 0xd5, 0x73, 0x1c, 0xb4, 0x40, 0xa1, 0xb9, 0x3c, 0xca, 0x58, 0x92, 0x34, 0xcc, 0xce, 0xd7, 0x42, 0x90, 0x0f, 0x8b, 0x7f, 0x32, 0xed, 0x5c, 0x9d, 0xc8, 0x99, 0xad, 0x4e, 0x56, 0xa6, 0xf7, 0x68, 0xb7, 0x25, 0x82, 0x37, 0x3a, 0x51, 0x69, 0x26, 0x38, 0x52, 0x9e, 0x9a, 0x4f, 0xa7, 0x43, 0x10, 0x80, 0xee, 0x3d, 0x59, 0x35, 0xcf, 0x79, 0x74, 0xb5, 0xa2, 0xb1, 0x96, 0x23, 0xe0, 0xbe, 0x05, 0xf5, 0x6e, 0x19, 0xc5, 0x66, 0x49, 0xf0, 0xd1, 0x54, 0xa9, 0x70, 0x4b, 0xa4, 0xe2, 0xe6, 0xe5, 0xab, 0xe4, 0xd2, 0xaa, 0x4c, 0xe3, 0x06, 0x6f, 0xc6, 0x4a, 0xa4, 0x75, 0x97, 0xe1] + +EGA_COLORS = [ + (0x00, 0x00, 0x00), (0x00, 0x00, 0xA0), (0x00, 0xA0, 0x00), (0x00, 0xA0, 0xA0), + (0xA0, 0x00, 0x00), (0xA0, 0x00, 0xA0), (0xA0, 0x50, 0x00), (0xA0, 0xA0, 0xA0), + (0x50, 0x50, 0x50), (0x50, 0x50, 0xFF), (0x00, 0xFF, 0x50), (0x50, 0xFF, 0xFF), + (0xFF, 0x50, 0x50), (0xFF, 0x50, 0xFF), (0xFF, 0xFF, 0x50), (0xFF, 0xFF, 0xFF), +] + +DEFAULT_PALETTE = [ + (0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), + (8, 8), (9, 9), (10, 10), (11, 11), (12, 12), (13, 13), (14, 14), (8, 8), + (8, 8), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (8, 8), + (8, 8), (15, 9), (15, 10), (15, 11), (15, 12), (15, 13), (15, 14), (15, 15), + (0, 8), (9, 1), (2, 10), (3, 11), (4, 12), (5, 13), (6, 14), (8, 8), +] + + +class PictureRenderer: + VISUAL = 1 + PRIORITY = 2 + CONTROL = 4 + + def __init__(self): + self.visual = np.full((HEIGHT, WIDTH), 0x0f, dtype=np.uint8) + self.priority = np.zeros((HEIGHT, WIDTH), dtype=np.uint8) + self.control = np.zeros((HEIGHT, WIDTH), dtype=np.uint8) + self.aux = np.zeros((HEIGHT, WIDTH), dtype=np.uint8) + self.palettes = [list(DEFAULT_PALETTE) for _ in range(4)] + self.locked = [0] * 40 + self.reset_state() + + def reset_state(self): + self.palette_number = 0 + self.palette_offset = 0 + self.ega_color = (0, 0) + self.current_priority = 0 + self.current_control = 0 + self.draw_enable = self.VISUAL + self.palette_to_draw = 0 + self.pattern_size = 0 + self.pattern_nr = 0 + self.pattern_use_pattern = False + self.pattern_is_rect = False + + def is_white(self): + return self.ega_color[0] == 15 and self.ega_color[1] == 15 + + def get_aux_set(self): + aux = self.draw_enable + if self.ega_color[0] == 15 and self.ega_color[1] == 15: + aux &= ~self.VISUAL + if self.current_priority == 0: + aux &= ~self.PRIORITY + if self.current_control == 0: + aux &= ~self.CONTROL + return aux + + def plot_pixel(self, x: int, y: int): + if 0 <= x < WIDTH and 0 <= y < HEIGHT: + aux_set = self.get_aux_set() + if self.draw_enable & self.VISUAL: + # EGA dithering: color1 on odd pixels, color2 on even pixels + color_idx = self.ega_color[0] if ((x ^ y) & 1) else self.ega_color[1] + self.visual[y, x] = color_idx + if self.draw_enable & self.PRIORITY: + self.priority[y, x] = self.current_priority + if self.draw_enable & self.CONTROL: + self.control[y, x] = self.current_control + self.aux[y, x] |= aux_set + + def draw_line(self, x1: int, y1: int, x2: int, y2: int): + dx = abs(x2 - x1) + dy = abs(y2 - y1) + sx = 1 if x1 < x2 else -1 + sy = 1 if y1 < y2 else -1 + err = dx - dy + while True: + self.plot_pixel(x1, y1) + if x1 == x2 and y1 == y2: + break + e2 = 2 * err + if e2 > -dy: + err -= dy + x1 += sx + if e2 < dx: + err += dx + y1 += sy + + def draw_pattern(self, x: int, y: int, size: int, pattern_nr: int, use_pattern: bool, is_rect: bool): + wsize = size + x_max, y_max = WIDTH - 1, HEIGHT - 1 + + if x < wsize: + x = wsize + if x + wsize > x_max: + x = x_max - wsize + if y < wsize: + y = wsize + if y + wsize > y_max: + y = y_max - wsize + + if pattern_nr >= len(JUNQINDEX): + return + + junqbit = JUNQINDEX[pattern_nr] + + if is_rect: + for ly in range(y - wsize, y + wsize + 1): + for lx in range(x - wsize, x + wsize + 2): + if use_pattern: + if (JUNQ[junqbit >> 3] >> (7 - (junqbit & 7))) & 1: + self.plot_pixel(lx, ly) + junqbit = (junqbit + 1) & 0xFF + else: + self.plot_pixel(lx, ly) + else: + circlebit = 0 + circle_data = CIRCLES[size] + circle_data_bits = len(circle_data) * 8 + for ly in range(y - wsize, y + wsize + 1): + for lx in range(x - wsize, x + wsize + 2): + circle_on = False + if circlebit < circle_data_bits: + circle_on = bool((circle_data[circlebit >> 3] >> (7 - (circlebit & 7))) & 1) + if circle_on: + if use_pattern: + if (JUNQ[junqbit >> 3] >> (7 - (junqbit & 7))) & 1: + self.plot_pixel(lx, ly) + junqbit = (junqbit + 1) & 0xFF + else: + self.plot_pixel(lx, ly) + circlebit += 1 + + def _fill_bounds(self, x: int, y: int, draw_enable: int) -> bool: + """Check if (x, y) is a fill boundary, using the given draw_enable flags. + + Returns True if the pixel is a boundary (should NOT be filled). + Matches SCICompanion's FILL_BOUNDS macro: + (dwDrawEnable & aux) && !(visual_enabled && pixel_is_white) + """ + aux = self.aux[y, x] + overlap = draw_enable & aux + if overlap: + # There IS something drawn here that overlaps with what we want to draw. + # But if visual is enabled and the pixel is white, treat it as empty (not a boundary). + if (draw_enable & self.VISUAL) and (self.visual[y, x] == 0x0f): + return False + return True + return False + + def _ok_to_fill(self, x: int, y: int, draw_enable: int) -> bool: + if not (0 <= x < WIDTH and 0 <= y < HEIGHT): + return False + return not self._fill_bounds(x, y, draw_enable) + + def flood_fill(self, start_x: int, start_y: int): + if not (0 <= start_x < WIDTH and 0 <= start_y < HEIGHT): + return + + # Compute auxSet from the color/priority/control and draw_enable. + # Then replace draw_enable with auxSet (matching SCICompanion behavior). + aux_set = self.get_aux_set() + draw_enable = aux_set + + # Guard against filling with pure white (would hang/infinite loop). + if self.is_white(): + return + + # If no screen is being drawn to, bail. + if draw_enable == 0: + return + + # Check if starting point is already a boundary. + if self._fill_bounds(start_x, start_y, draw_enable): + return + + # Use a stack (LIFO) to match SCICompanion's qstore/qretrieve behavior. + stack = [(start_x, start_y)] + + while stack: + x, y = stack.pop() + + if not self._ok_to_fill(x, y, draw_enable): + continue + + # Plot the pixel + if draw_enable & self.VISUAL: + self.visual[y, x] = self.ega_color[0] if ((x ^ y) & 1) else self.ega_color[1] + if draw_enable & self.PRIORITY: + self.priority[y, x] = self.current_priority + if draw_enable & self.CONTROL: + self.control[y, x] = self.current_control + self.aux[y, x] |= aux_set + + if y > 0 and self._ok_to_fill(x, y - 1, draw_enable): + stack.append((x, y - 1)) + if x > 0 and self._ok_to_fill(x - 1, y, draw_enable): + stack.append((x - 1, y)) + if x < WIDTH - 1 and self._ok_to_fill(x + 1, y, draw_enable): + stack.append((x + 1, y)) + if y < HEIGHT - 1 and self._ok_to_fill(x, y + 1, draw_enable): + stack.append((x, y + 1)) + + def read_abs_coords(self, data: bytes, i: int) -> Tuple[int, int, int]: + prefix = data[i] + x = data[i + 1] | ((prefix & 0xF0) << 4) + y = data[i + 2] | ((prefix & 0x0F) << 8) + return x, y, i + 3 + + def render(self, data: bytes) -> Tuple[Image.Image, Image.Image, Image.Image]: + self.visual.fill(0x0f) + self.priority.fill(0) + self.control.fill(0) + self.aux.fill(0) + self.palettes = [list(DEFAULT_PALETTE) for _ in range(4)] + self.locked = [0] * 40 + self.reset_state() + + i = 0 + x, y = 0, 0 + + while i < len(data): + opcode = data[i] + + if opcode >= 0xF0: + i += 1 + + if opcode == PIC_OP_END: + break + + elif opcode == PIC_OP_SET_COLOR: + color_code = data[i] + i += 1 + # Palette number and offset within palette + palette_num = color_code // 40 + palette_offset = color_code % 40 + # If palette_num is 0, use the global palette_to_draw instead + palette_to_use = palette_num if palette_num != 0 else self.palette_to_draw + # Store for UI/state tracking + self.palette_number = palette_num + self.palette_offset = palette_offset + # Look up the actual color from the palette + if self.locked[palette_offset]: + self.ega_color = self.palettes[0][palette_offset] + else: + self.ega_color = self.palettes[palette_to_use][palette_offset] + self.draw_enable |= self.VISUAL + + elif opcode == PIC_OP_DISABLE_VISUAL: + self.draw_enable &= ~self.VISUAL + + elif opcode == PIC_OP_SET_PRIORITY: + self.current_priority = data[i] & 0x0F + i += 1 + self.draw_enable |= self.PRIORITY + + elif opcode == PIC_OP_DISABLE_PRIORITY: + self.draw_enable &= ~self.PRIORITY + + elif opcode == PIC_OP_SET_CONTROL: + self.current_control = data[i] + i += 1 + self.draw_enable |= self.CONTROL + + elif opcode == PIC_OP_DISABLE_CONTROL: + self.draw_enable &= ~self.CONTROL + + elif opcode == PIC_OP_RELATIVE_MEDIUM_LINES: + x, y, i = self.read_abs_coords(data, i) + while i < len(data) and data[i] < 0xF0: + by = data[i] + bx = data[i + 1] + i += 2 + dy = (by & 0x7F) if not (by & 0x80) else -(by & 0x7F) + dx = bx if bx < 128 else bx - 256 + self.draw_line(x, y, x + dx, y + dy) + x += dx + y += dy + + elif opcode == PIC_OP_RELATIVE_LONG_LINES: + x, y, i = self.read_abs_coords(data, i) + while i < len(data) and data[i] < 0xF0: + x2, y2, i = self.read_abs_coords(data, i) + self.draw_line(x, y, x2, y2) + x, y = x2, y2 + + elif opcode == PIC_OP_RELATIVE_SHORT_LINES: + x, y, i = self.read_abs_coords(data, i) + while i < len(data) and data[i] < 0xF0: + b = data[i] + i += 1 + dx = ((b >> 4) & 0x7) if not (b & 0x80) else -((b >> 4) & 0x7) + dy = (b & 0x7) if not (b & 0x08) else -(b & 0x7) + self.draw_line(x, y, x + dx, y + dy) + x += dx + y += dy + + elif opcode == PIC_OP_FILL: + while i < len(data) and data[i] < 0xF0: + fx, fy, i = self.read_abs_coords(data, i) + self.flood_fill(fx, fy) + + elif opcode == PIC_OP_RELATIVE_PATTERNS: + pattern_nr_byte = 0 + if self.pattern_use_pattern and i < len(data) and data[i] < 0xF0: + pattern_nr_byte = data[i] + i += 1 + x, y, i = self.read_abs_coords(data, i) + self.draw_pattern(x, y, self.pattern_size, (pattern_nr_byte >> 1) & 0x7f, self.pattern_use_pattern, self.pattern_is_rect) + while i < len(data) and data[i] < 0xF0: + pattern_nr_byte = 0 + if self.pattern_use_pattern and i < len(data) and data[i] < 0xF0: + pattern_nr_byte = data[i] + i += 1 + # Relative short coords for pattern + b = data[i] + i += 1 + dx = ((b >> 4) & 0x7) if not (b & 0x80) else -((b >> 4) & 0x7) + dy = (b & 0x7) if not (b & 0x08) else -(b & 0x7) + x += dx + y += dy + self.draw_pattern(x, y, self.pattern_size, (pattern_nr_byte >> 1) & 0x7f, self.pattern_use_pattern, self.pattern_is_rect) + + elif opcode == PIC_OP_ABSOLUTE_PATTERNS: + while i < len(data) and data[i] < 0xF0: + pattern_nr_byte = 0 + if self.pattern_use_pattern and i < len(data) and data[i] < 0xF0: + pattern_nr_byte = data[i] + i += 1 + x, y, i = self.read_abs_coords(data, i) + self.draw_pattern(x, y, self.pattern_size, (pattern_nr_byte >> 1) & 0x7f, self.pattern_use_pattern, self.pattern_is_rect) + + elif opcode == PIC_OP_RELATIVE_MEDIUM_PATTERNS: + pattern_nr_byte = 0 + if self.pattern_use_pattern and i < len(data) and data[i] < 0xF0: + pattern_nr_byte = data[i] + i += 1 + x, y, i = self.read_abs_coords(data, i) + self.draw_pattern(x, y, self.pattern_size, (pattern_nr_byte >> 1) & 0x7f, self.pattern_use_pattern, self.pattern_is_rect) + while i < len(data) and data[i] < 0xF0: + pattern_nr_byte = 0 + if self.pattern_use_pattern and i < len(data) and data[i] < 0xF0: + pattern_nr_byte = data[i] + i += 1 + by = data[i] + bx = data[i + 1] + i += 2 + dy = (by & 0x7F) if not (by & 0x80) else -(by & 0x7F) + dx = bx if bx < 128 else bx - 256 + x += dx + y += dy + self.draw_pattern(x, y, self.pattern_size, (pattern_nr_byte >> 1) & 0x7f, self.pattern_use_pattern, self.pattern_is_rect) + + elif opcode == PIC_OP_SET_PATTERN: + if i < len(data) and data[i] < 0xF0: + val = data[i] + i += 1 + val &= 0x37 # Mask to valid bits as SCICompanion does + self.pattern_size = val & 0x07 + self.pattern_is_rect = bool(val & PATTERN_FLAG_RECTANGLE) + self.pattern_use_pattern = bool(val & PATTERN_FLAG_USE_PATTERN) + + elif opcode == PIC_OP_OPX: + if i >= len(data): + break + ext = data[i] + i += 1 + if ext == 0x00: + # PIC_OPX_SET_PALETTE_ENTRY: variable length pairs of (index, color) + while i < len(data) and data[i] < 0xF0: + b_index = data[i] + b_color = data[i + 1] + i += 2 + pal_num = b_index // 40 + pal_offset = b_index % 40 + if pal_num < 4: + # color1 is high nibble, color2 is low nibble + color1 = (b_color >> 4) & 0x0f + color2 = b_color & 0x0f + self.palettes[pal_num][pal_offset] = (color1, color2) + if pal_num == 0: + self.locked[pal_offset] = 0xff + elif ext == 0x01: + # PIC_OPX_SET_PALETTE: 1 byte palette number + 40 color bytes + pal_num = data[i] + i += 1 + for j in range(40): + b_color = data[i] + i += 1 + color1 = (b_color >> 4) & 0x0f + color2 = b_color & 0x0f + self.palettes[pal_num][j] = (color1, color2) + # If this palette is the one currently in use, update egaColor + if pal_num == self.palette_number: + self.ega_color = self.palettes[pal_num][self.palette_offset] + elif ext == 0x08: + # PIC_OPX_SET_PRIORITY_TABLE: 14 bytes + i += 14 + else: + # Unknown extended opcode, try to skip gracefully + pass + + else: + break + + visual_img = Image.new('RGB', (WIDTH, HEIGHT)) + for py in range(HEIGHT): + for px in range(WIDTH): + visual_img.putpixel((px, py), EGA_COLORS[self.visual[py, px]]) + + priority_img = Image.fromarray(self.priority * 17, mode='L') + control_img = Image.fromarray(self.control * 17, mode='L') + + return visual_img, priority_img, control_img + + +class SCIPictureExtractor: + def __init__(self, game_dir: str): + self.game_dir = Path(game_dir) + import importlib.util + spec = importlib.util.spec_from_file_location( + "extract_sci_text", + self.game_dir.parent.parent / "extract_sci_text.py" + ) + if spec and spec.loader: + self.extractor_module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(self.extractor_module) + self.extractor = self.extractor_module.SCIResourceExtractor(game_dir) + else: + raise ImportError("Could not load extract_sci_text module") + + def extract_pic(self, pic_number: int, output_dir: str = ".") -> Optional[Tuple[str, str, str]]: + resources = self.extractor.read_resource_map() + pic_resources = [r for r in resources if r['type'] == 1 and r['number'] == pic_number] + + if not pic_resources: + print(f"PIC {pic_number} not found") + return None + + res = pic_resources[0] + print(f"Extracting PIC {pic_number} from package {res['package']}...") + + header = self.extractor.read_resource_header(res['package'], res['offset']) + if not header: + print(f"Failed to read header for PIC {pic_number}") + return None + + print(f" Compression: {header['method_name']}, Size: {header['decompressed_size']} bytes") + + data = self.extractor.extract_resource_data( + res['package'], + res['offset'], + header['compressed_size'], + header['decompressed_size'], + header['method'] + ) + + if not data: + print(f"Failed to extract data for PIC {pic_number}") + return None + + renderer = PictureRenderer() + visual_img, priority_img, control_img = renderer.render(data) + + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + base_name = f"pic_{pic_number:03d}" + visual_path = output_path / f"{base_name}_visual.png" + priority_path = output_path / f"{base_name}_priority.png" + control_path = output_path / f"{base_name}_control.png" + + visual_img.save(visual_path) + priority_img.save(priority_path) + control_img.save(control_path) + + print(f" Saved: {visual_path}") + + return (str(visual_path), str(priority_path), str(control_path)) + + +def main(): + import argparse + + parser = argparse.ArgumentParser(description="Extract SCI picture resources") + parser.add_argument("--pic", type=int, help="Specific PIC number to extract") + parser.add_argument("--output", "-o", default="pics", help="Output directory") + parser.add_argument("--game-dir", "-g", default="King's Quest IV - The Perils of Rosella (1988)/KQ4", + help="Game directory") + + args = parser.parse_args() + + if not os.path.exists(args.game_dir): + print(f"Error: Game directory not found: {args.game_dir}") + sys.exit(1) + + print(f"Extracting pictures from: {args.game_dir}") + + extractor = SCIPictureExtractor(args.game_dir) + + if args.pic is not None: + extractor.extract_pic(args.pic, args.output) + else: + resources = extractor.extractor.read_resource_map() + pic_resources = sorted(set(r['number'] for r in resources if r['type'] == 1)) + print(f"Found {len(pic_resources)} PIC resources") + for pic_num in pic_resources: + extractor.extract_pic(pic_num, args.output) + + print(f"\nExtraction complete! Images saved to {args.output}/") + + +if __name__ == "__main__": + main() diff --git a/rooms/001-beach.md b/rooms/kq4-001-beach/001-beach.md similarity index 100% rename from rooms/001-beach.md rename to rooms/kq4-001-beach/001-beach.md diff --git a/rooms/kq4-001-beach/pic_001_control.png b/rooms/kq4-001-beach/pic_001_control.png new file mode 100644 index 0000000..662f1d9 Binary files /dev/null and b/rooms/kq4-001-beach/pic_001_control.png differ diff --git a/rooms/kq4-001-beach/pic_001_priority.png b/rooms/kq4-001-beach/pic_001_priority.png new file mode 100644 index 0000000..54519c1 Binary files /dev/null and b/rooms/kq4-001-beach/pic_001_priority.png differ diff --git a/rooms/kq4-001-beach/pic_001_visual.png b/rooms/kq4-001-beach/pic_001_visual.png new file mode 100644 index 0000000..9caa0e6 Binary files /dev/null and b/rooms/kq4-001-beach/pic_001_visual.png differ diff --git a/rooms/kq4-002-meadow.md b/rooms/kq4-002-meadow/kq4-002-meadow.md similarity index 100% rename from rooms/kq4-002-meadow.md rename to rooms/kq4-002-meadow/kq4-002-meadow.md diff --git a/rooms/kq4-002-meadow/pic_002_control.png b/rooms/kq4-002-meadow/pic_002_control.png new file mode 100644 index 0000000..8b652dd Binary files /dev/null and b/rooms/kq4-002-meadow/pic_002_control.png differ diff --git a/rooms/kq4-002-meadow/pic_002_priority.png b/rooms/kq4-002-meadow/pic_002_priority.png new file mode 100644 index 0000000..997fb33 Binary files /dev/null and b/rooms/kq4-002-meadow/pic_002_priority.png differ diff --git a/rooms/kq4-002-meadow/pic_002_visual.png b/rooms/kq4-002-meadow/pic_002_visual.png new file mode 100644 index 0000000..b4c09a5 Binary files /dev/null and b/rooms/kq4-002-meadow/pic_002_visual.png differ diff --git a/rooms/kq4-003-fountain-pool.md b/rooms/kq4-003-fountain-pool/kq4-003-fountain-pool.md similarity index 100% rename from rooms/kq4-003-fountain-pool.md rename to rooms/kq4-003-fountain-pool/kq4-003-fountain-pool.md diff --git a/rooms/kq4-003-fountain-pool/pic_003_control.png b/rooms/kq4-003-fountain-pool/pic_003_control.png new file mode 100644 index 0000000..fb8df82 Binary files /dev/null and b/rooms/kq4-003-fountain-pool/pic_003_control.png differ diff --git a/rooms/kq4-003-fountain-pool/pic_003_priority.png b/rooms/kq4-003-fountain-pool/pic_003_priority.png new file mode 100644 index 0000000..8940ab8 Binary files /dev/null and b/rooms/kq4-003-fountain-pool/pic_003_priority.png differ diff --git a/rooms/kq4-003-fountain-pool/pic_003_visual.png b/rooms/kq4-003-fountain-pool/pic_003_visual.png new file mode 100644 index 0000000..457cb6e Binary files /dev/null and b/rooms/kq4-003-fountain-pool/pic_003_visual.png differ diff --git a/rooms/kq4-004-ogres-cottage.md b/rooms/kq4-004-ogres-cottage/kq4-004-ogres-cottage.md similarity index 100% rename from rooms/kq4-004-ogres-cottage.md rename to rooms/kq4-004-ogres-cottage/kq4-004-ogres-cottage.md diff --git a/rooms/kq4-004-ogres-cottage/pic_004_control.png b/rooms/kq4-004-ogres-cottage/pic_004_control.png new file mode 100644 index 0000000..090883d Binary files /dev/null and b/rooms/kq4-004-ogres-cottage/pic_004_control.png differ diff --git a/rooms/kq4-004-ogres-cottage/pic_004_priority.png b/rooms/kq4-004-ogres-cottage/pic_004_priority.png new file mode 100644 index 0000000..a2e6ee7 Binary files /dev/null and b/rooms/kq4-004-ogres-cottage/pic_004_priority.png differ diff --git a/rooms/kq4-004-ogres-cottage/pic_004_visual.png b/rooms/kq4-004-ogres-cottage/pic_004_visual.png new file mode 100644 index 0000000..caa8dab Binary files /dev/null and b/rooms/kq4-004-ogres-cottage/pic_004_visual.png differ diff --git a/rooms/kq4-005-forest-grove.md b/rooms/kq4-005-forest-grove/kq4-005-forest-grove.md similarity index 100% rename from rooms/kq4-005-forest-grove.md rename to rooms/kq4-005-forest-grove/kq4-005-forest-grove.md diff --git a/rooms/kq4-005-forest-grove/pic_005_control.png b/rooms/kq4-005-forest-grove/pic_005_control.png new file mode 100644 index 0000000..932a70e Binary files /dev/null and b/rooms/kq4-005-forest-grove/pic_005_control.png differ diff --git a/rooms/kq4-005-forest-grove/pic_005_priority.png b/rooms/kq4-005-forest-grove/pic_005_priority.png new file mode 100644 index 0000000..593dc6e Binary files /dev/null and b/rooms/kq4-005-forest-grove/pic_005_priority.png differ diff --git a/rooms/kq4-005-forest-grove/pic_005_visual.png b/rooms/kq4-005-forest-grove/pic_005_visual.png new file mode 100644 index 0000000..16cd6b3 Binary files /dev/null and b/rooms/kq4-005-forest-grove/pic_005_visual.png differ diff --git a/rooms/kq4-006-cave-entrance.md b/rooms/kq4-006-cave-entrance/kq4-006-cave-entrance.md similarity index 100% rename from rooms/kq4-006-cave-entrance.md rename to rooms/kq4-006-cave-entrance/kq4-006-cave-entrance.md diff --git a/rooms/kq4-006-cave-entrance/pic_006_control.png b/rooms/kq4-006-cave-entrance/pic_006_control.png new file mode 100644 index 0000000..d48fe39 Binary files /dev/null and b/rooms/kq4-006-cave-entrance/pic_006_control.png differ diff --git a/rooms/kq4-006-cave-entrance/pic_006_priority.png b/rooms/kq4-006-cave-entrance/pic_006_priority.png new file mode 100644 index 0000000..bf6c71b Binary files /dev/null and b/rooms/kq4-006-cave-entrance/pic_006_priority.png differ diff --git a/rooms/kq4-006-cave-entrance/pic_006_visual.png b/rooms/kq4-006-cave-entrance/pic_006_visual.png new file mode 100644 index 0000000..23238f3 Binary files /dev/null and b/rooms/kq4-006-cave-entrance/pic_006_visual.png differ diff --git a/rooms/kq4-007-fishermans-shack.md b/rooms/kq4-007-fishermans-shack/kq4-007-fishermans-shack.md similarity index 100% rename from rooms/kq4-007-fishermans-shack.md rename to rooms/kq4-007-fishermans-shack/kq4-007-fishermans-shack.md diff --git a/rooms/kq4-007-fishermans-shack/pic_007_control.png b/rooms/kq4-007-fishermans-shack/pic_007_control.png new file mode 100644 index 0000000..5104ef1 Binary files /dev/null and b/rooms/kq4-007-fishermans-shack/pic_007_control.png differ diff --git a/rooms/kq4-007-fishermans-shack/pic_007_priority.png b/rooms/kq4-007-fishermans-shack/pic_007_priority.png new file mode 100644 index 0000000..7101f0a Binary files /dev/null and b/rooms/kq4-007-fishermans-shack/pic_007_priority.png differ diff --git a/rooms/kq4-007-fishermans-shack/pic_007_visual.png b/rooms/kq4-007-fishermans-shack/pic_007_visual.png new file mode 100644 index 0000000..8a9db98 Binary files /dev/null and b/rooms/kq4-007-fishermans-shack/pic_007_visual.png differ diff --git a/rooms/kq4-008-back-of-fishermans-shack.md b/rooms/kq4-008-back-of-fishermans-shack/kq4-008-back-of-fishermans-shack.md similarity index 100% rename from rooms/kq4-008-back-of-fishermans-shack.md rename to rooms/kq4-008-back-of-fishermans-shack/kq4-008-back-of-fishermans-shack.md diff --git a/rooms/kq4-008-back-of-fishermans-shack/pic_008_control.png b/rooms/kq4-008-back-of-fishermans-shack/pic_008_control.png new file mode 100644 index 0000000..eb9f577 Binary files /dev/null and b/rooms/kq4-008-back-of-fishermans-shack/pic_008_control.png differ diff --git a/rooms/kq4-008-back-of-fishermans-shack/pic_008_priority.png b/rooms/kq4-008-back-of-fishermans-shack/pic_008_priority.png new file mode 100644 index 0000000..69e0b62 Binary files /dev/null and b/rooms/kq4-008-back-of-fishermans-shack/pic_008_priority.png differ diff --git a/rooms/kq4-008-back-of-fishermans-shack/pic_008_visual.png b/rooms/kq4-008-back-of-fishermans-shack/pic_008_visual.png new file mode 100644 index 0000000..c3643d8 Binary files /dev/null and b/rooms/kq4-008-back-of-fishermans-shack/pic_008_visual.png differ diff --git a/rooms/kq4-009-shady-wooded-area.md b/rooms/kq4-009-shady-wooded-area/kq4-009-shady-wooded-area.md similarity index 100% rename from rooms/kq4-009-shady-wooded-area.md rename to rooms/kq4-009-shady-wooded-area/kq4-009-shady-wooded-area.md diff --git a/rooms/kq4-009-shady-wooded-area/pic_009_control.png b/rooms/kq4-009-shady-wooded-area/pic_009_control.png new file mode 100644 index 0000000..5801371 Binary files /dev/null and b/rooms/kq4-009-shady-wooded-area/pic_009_control.png differ diff --git a/rooms/kq4-009-shady-wooded-area/pic_009_priority.png b/rooms/kq4-009-shady-wooded-area/pic_009_priority.png new file mode 100644 index 0000000..b7ac115 Binary files /dev/null and b/rooms/kq4-009-shady-wooded-area/pic_009_priority.png differ diff --git a/rooms/kq4-009-shady-wooded-area/pic_009_visual.png b/rooms/kq4-009-shady-wooded-area/pic_009_visual.png new file mode 100644 index 0000000..dbb725a Binary files /dev/null and b/rooms/kq4-009-shady-wooded-area/pic_009_visual.png differ diff --git a/rooms/kq4-010-forest-path.md b/rooms/kq4-010-forest-path/kq4-010-forest-path.md similarity index 100% rename from rooms/kq4-010-forest-path.md rename to rooms/kq4-010-forest-path/kq4-010-forest-path.md diff --git a/rooms/kq4-010-forest-path/pic_010_control.png b/rooms/kq4-010-forest-path/pic_010_control.png new file mode 100644 index 0000000..6e013e9 Binary files /dev/null and b/rooms/kq4-010-forest-path/pic_010_control.png differ diff --git a/rooms/kq4-010-forest-path/pic_010_priority.png b/rooms/kq4-010-forest-path/pic_010_priority.png new file mode 100644 index 0000000..ecc873b Binary files /dev/null and b/rooms/kq4-010-forest-path/pic_010_priority.png differ diff --git a/rooms/kq4-010-forest-path/pic_010_visual.png b/rooms/kq4-010-forest-path/pic_010_visual.png new file mode 100644 index 0000000..7dd7c0c Binary files /dev/null and b/rooms/kq4-010-forest-path/pic_010_visual.png differ diff --git a/rooms/kq4-011-enchanted-grove.md b/rooms/kq4-011-enchanted-grove/kq4-011-enchanted-grove.md similarity index 100% rename from rooms/kq4-011-enchanted-grove.md rename to rooms/kq4-011-enchanted-grove/kq4-011-enchanted-grove.md diff --git a/rooms/kq4-011-enchanted-grove/pic_011_control.png b/rooms/kq4-011-enchanted-grove/pic_011_control.png new file mode 100644 index 0000000..0b4682c Binary files /dev/null and b/rooms/kq4-011-enchanted-grove/pic_011_control.png differ diff --git a/rooms/kq4-011-enchanted-grove/pic_011_priority.png b/rooms/kq4-011-enchanted-grove/pic_011_priority.png new file mode 100644 index 0000000..1f5201b Binary files /dev/null and b/rooms/kq4-011-enchanted-grove/pic_011_priority.png differ diff --git a/rooms/kq4-011-enchanted-grove/pic_011_visual.png b/rooms/kq4-011-enchanted-grove/pic_011_visual.png new file mode 100644 index 0000000..9ddb766 Binary files /dev/null and b/rooms/kq4-011-enchanted-grove/pic_011_visual.png differ diff --git a/rooms/kq4-012-haunted-forest.md b/rooms/kq4-012-haunted-forest/kq4-012-haunted-forest.md similarity index 100% rename from rooms/kq4-012-haunted-forest.md rename to rooms/kq4-012-haunted-forest/kq4-012-haunted-forest.md diff --git a/rooms/kq4-012-haunted-forest/pic_012_control.png b/rooms/kq4-012-haunted-forest/pic_012_control.png new file mode 100644 index 0000000..5c41570 Binary files /dev/null and b/rooms/kq4-012-haunted-forest/pic_012_control.png differ diff --git a/rooms/kq4-012-haunted-forest/pic_012_priority.png b/rooms/kq4-012-haunted-forest/pic_012_priority.png new file mode 100644 index 0000000..b14ec8d Binary files /dev/null and b/rooms/kq4-012-haunted-forest/pic_012_priority.png differ diff --git a/rooms/kq4-012-haunted-forest/pic_012_visual.png b/rooms/kq4-012-haunted-forest/pic_012_visual.png new file mode 100644 index 0000000..d915ff4 Binary files /dev/null and b/rooms/kq4-012-haunted-forest/pic_012_visual.png differ diff --git a/rooms/kq4-013-beach.md b/rooms/kq4-013-beach/kq4-013-beach.md similarity index 100% rename from rooms/kq4-013-beach.md rename to rooms/kq4-013-beach/kq4-013-beach.md diff --git a/rooms/kq4-013-beach/pic_013_control.png b/rooms/kq4-013-beach/pic_013_control.png new file mode 100644 index 0000000..070af66 Binary files /dev/null and b/rooms/kq4-013-beach/pic_013_control.png differ diff --git a/rooms/kq4-013-beach/pic_013_priority.png b/rooms/kq4-013-beach/pic_013_priority.png new file mode 100644 index 0000000..beb88b8 Binary files /dev/null and b/rooms/kq4-013-beach/pic_013_priority.png differ diff --git a/rooms/kq4-013-beach/pic_013_visual.png b/rooms/kq4-013-beach/pic_013_visual.png new file mode 100644 index 0000000..d371281 Binary files /dev/null and b/rooms/kq4-013-beach/pic_013_visual.png differ diff --git a/rooms/kq4-014-green-meadow.md b/rooms/kq4-014-green-meadow/kq4-014-green-meadow.md similarity index 100% rename from rooms/kq4-014-green-meadow.md rename to rooms/kq4-014-green-meadow/kq4-014-green-meadow.md diff --git a/rooms/kq4-014-green-meadow/pic_014_control.png b/rooms/kq4-014-green-meadow/pic_014_control.png new file mode 100644 index 0000000..c16a18a Binary files /dev/null and b/rooms/kq4-014-green-meadow/pic_014_control.png differ diff --git a/rooms/kq4-014-green-meadow/pic_014_priority.png b/rooms/kq4-014-green-meadow/pic_014_priority.png new file mode 100644 index 0000000..878055d Binary files /dev/null and b/rooms/kq4-014-green-meadow/pic_014_priority.png differ diff --git a/rooms/kq4-014-green-meadow/pic_014_visual.png b/rooms/kq4-014-green-meadow/pic_014_visual.png new file mode 100644 index 0000000..e9a8caa Binary files /dev/null and b/rooms/kq4-014-green-meadow/pic_014_visual.png differ diff --git a/rooms/kq4-015-frog-pond.md b/rooms/kq4-015-frog-pond/kq4-015-frog-pond.md similarity index 100% rename from rooms/kq4-015-frog-pond.md rename to rooms/kq4-015-frog-pond/kq4-015-frog-pond.md diff --git a/rooms/kq4-015-frog-pond/pic_015_control.png b/rooms/kq4-015-frog-pond/pic_015_control.png new file mode 100644 index 0000000..1667c5d Binary files /dev/null and b/rooms/kq4-015-frog-pond/pic_015_control.png differ diff --git a/rooms/kq4-015-frog-pond/pic_015_priority.png b/rooms/kq4-015-frog-pond/pic_015_priority.png new file mode 100644 index 0000000..654b3e1 Binary files /dev/null and b/rooms/kq4-015-frog-pond/pic_015_priority.png differ diff --git a/rooms/kq4-015-frog-pond/pic_015_visual.png b/rooms/kq4-015-frog-pond/pic_015_visual.png new file mode 100644 index 0000000..f6be18f Binary files /dev/null and b/rooms/kq4-015-frog-pond/pic_015_visual.png differ diff --git a/rooms/kq4-016-graveyard.md b/rooms/kq4-016-graveyard/kq4-016-graveyard.md similarity index 100% rename from rooms/kq4-016-graveyard.md rename to rooms/kq4-016-graveyard/kq4-016-graveyard.md diff --git a/rooms/kq4-016-graveyard/pic_016_control.png b/rooms/kq4-016-graveyard/pic_016_control.png new file mode 100644 index 0000000..14d9dc7 Binary files /dev/null and b/rooms/kq4-016-graveyard/pic_016_control.png differ diff --git a/rooms/kq4-016-graveyard/pic_016_priority.png b/rooms/kq4-016-graveyard/pic_016_priority.png new file mode 100644 index 0000000..89ca1b3 Binary files /dev/null and b/rooms/kq4-016-graveyard/pic_016_priority.png differ diff --git a/rooms/kq4-016-graveyard/pic_016_visual.png b/rooms/kq4-016-graveyard/pic_016_visual.png new file mode 100644 index 0000000..e9fa215 Binary files /dev/null and b/rooms/kq4-016-graveyard/pic_016_visual.png differ diff --git a/rooms/kq4-017-spooky-house-exterior.md b/rooms/kq4-017-spooky-house-exterior/kq4-017-spooky-house-exterior.md similarity index 100% rename from rooms/kq4-017-spooky-house-exterior.md rename to rooms/kq4-017-spooky-house-exterior/kq4-017-spooky-house-exterior.md diff --git a/rooms/kq4-017-spooky-house-exterior/pic_017_control.png b/rooms/kq4-017-spooky-house-exterior/pic_017_control.png new file mode 100644 index 0000000..acab886 Binary files /dev/null and b/rooms/kq4-017-spooky-house-exterior/pic_017_control.png differ diff --git a/rooms/kq4-017-spooky-house-exterior/pic_017_priority.png b/rooms/kq4-017-spooky-house-exterior/pic_017_priority.png new file mode 100644 index 0000000..6f0557c Binary files /dev/null and b/rooms/kq4-017-spooky-house-exterior/pic_017_priority.png differ diff --git a/rooms/kq4-017-spooky-house-exterior/pic_017_visual.png b/rooms/kq4-017-spooky-house-exterior/pic_017_visual.png new file mode 100644 index 0000000..22356f5 Binary files /dev/null and b/rooms/kq4-017-spooky-house-exterior/pic_017_visual.png differ diff --git a/rooms/kq4-018-cemetery.md b/rooms/kq4-018-cemetery/kq4-018-cemetery.md similarity index 100% rename from rooms/kq4-018-cemetery.md rename to rooms/kq4-018-cemetery/kq4-018-cemetery.md diff --git a/rooms/kq4-018-cemetery/pic_018_control.png b/rooms/kq4-018-cemetery/pic_018_control.png new file mode 100644 index 0000000..8a6143d Binary files /dev/null and b/rooms/kq4-018-cemetery/pic_018_control.png differ diff --git a/rooms/kq4-018-cemetery/pic_018_priority.png b/rooms/kq4-018-cemetery/pic_018_priority.png new file mode 100644 index 0000000..50b5e76 Binary files /dev/null and b/rooms/kq4-018-cemetery/pic_018_priority.png differ diff --git a/rooms/kq4-018-cemetery/pic_018_visual.png b/rooms/kq4-018-cemetery/pic_018_visual.png new file mode 100644 index 0000000..65da690 Binary files /dev/null and b/rooms/kq4-018-cemetery/pic_018_visual.png differ diff --git a/rooms/kq4-019-coastal-cliffs.md b/rooms/kq4-019-coastal-cliffs/kq4-019-coastal-cliffs.md similarity index 100% rename from rooms/kq4-019-coastal-cliffs.md rename to rooms/kq4-019-coastal-cliffs/kq4-019-coastal-cliffs.md diff --git a/rooms/kq4-019-coastal-cliffs/pic_019_control.png b/rooms/kq4-019-coastal-cliffs/pic_019_control.png new file mode 100644 index 0000000..d0f68dd Binary files /dev/null and b/rooms/kq4-019-coastal-cliffs/pic_019_control.png differ diff --git a/rooms/kq4-019-coastal-cliffs/pic_019_priority.png b/rooms/kq4-019-coastal-cliffs/pic_019_priority.png new file mode 100644 index 0000000..6048083 Binary files /dev/null and b/rooms/kq4-019-coastal-cliffs/pic_019_priority.png differ diff --git a/rooms/kq4-019-coastal-cliffs/pic_019_visual.png b/rooms/kq4-019-coastal-cliffs/pic_019_visual.png new file mode 100644 index 0000000..468a622 Binary files /dev/null and b/rooms/kq4-019-coastal-cliffs/pic_019_visual.png differ diff --git a/rooms/kq4-020-meadow.md b/rooms/kq4-020-meadow/kq4-020-meadow.md similarity index 100% rename from rooms/kq4-020-meadow.md rename to rooms/kq4-020-meadow/kq4-020-meadow.md diff --git a/rooms/kq4-020-meadow/pic_020_control.png b/rooms/kq4-020-meadow/pic_020_control.png new file mode 100644 index 0000000..9dcb821 Binary files /dev/null and b/rooms/kq4-020-meadow/pic_020_control.png differ diff --git a/rooms/kq4-020-meadow/pic_020_priority.png b/rooms/kq4-020-meadow/pic_020_priority.png new file mode 100644 index 0000000..38d08a1 Binary files /dev/null and b/rooms/kq4-020-meadow/pic_020_priority.png differ diff --git a/rooms/kq4-020-meadow/pic_020_visual.png b/rooms/kq4-020-meadow/pic_020_visual.png new file mode 100644 index 0000000..9baee2f Binary files /dev/null and b/rooms/kq4-020-meadow/pic_020_visual.png differ diff --git a/rooms/kq4-021-bridge-over-stream.md b/rooms/kq4-021-bridge-over-stream/kq4-021-bridge-over-stream.md similarity index 100% rename from rooms/kq4-021-bridge-over-stream.md rename to rooms/kq4-021-bridge-over-stream/kq4-021-bridge-over-stream.md diff --git a/rooms/kq4-021-bridge-over-stream/pic_021_control.png b/rooms/kq4-021-bridge-over-stream/pic_021_control.png new file mode 100644 index 0000000..2bb0f64 Binary files /dev/null and b/rooms/kq4-021-bridge-over-stream/pic_021_control.png differ diff --git a/rooms/kq4-021-bridge-over-stream/pic_021_priority.png b/rooms/kq4-021-bridge-over-stream/pic_021_priority.png new file mode 100644 index 0000000..1194cd1 Binary files /dev/null and b/rooms/kq4-021-bridge-over-stream/pic_021_priority.png differ diff --git a/rooms/kq4-021-bridge-over-stream/pic_021_visual.png b/rooms/kq4-021-bridge-over-stream/pic_021_visual.png new file mode 100644 index 0000000..3eacd1d Binary files /dev/null and b/rooms/kq4-021-bridge-over-stream/pic_021_visual.png differ diff --git a/rooms/kq4-022-gnomes-cottage.md b/rooms/kq4-022-gnomes-cottage/kq4-022-gnomes-cottage.md similarity index 100% rename from rooms/kq4-022-gnomes-cottage.md rename to rooms/kq4-022-gnomes-cottage/kq4-022-gnomes-cottage.md diff --git a/rooms/kq4-022-gnomes-cottage/pic_022_control.png b/rooms/kq4-022-gnomes-cottage/pic_022_control.png new file mode 100644 index 0000000..6610981 Binary files /dev/null and b/rooms/kq4-022-gnomes-cottage/pic_022_control.png differ diff --git a/rooms/kq4-022-gnomes-cottage/pic_022_priority.png b/rooms/kq4-022-gnomes-cottage/pic_022_priority.png new file mode 100644 index 0000000..d48fa0e Binary files /dev/null and b/rooms/kq4-022-gnomes-cottage/pic_022_priority.png differ diff --git a/rooms/kq4-022-gnomes-cottage/pic_022_visual.png b/rooms/kq4-022-gnomes-cottage/pic_022_visual.png new file mode 100644 index 0000000..3bf3401 Binary files /dev/null and b/rooms/kq4-022-gnomes-cottage/pic_022_visual.png differ diff --git a/rooms/kq4-023-forest-path-with-cottage.md b/rooms/kq4-023-forest-path-with-cottage/kq4-023-forest-path-with-cottage.md similarity index 100% rename from rooms/kq4-023-forest-path-with-cottage.md rename to rooms/kq4-023-forest-path-with-cottage/kq4-023-forest-path-with-cottage.md diff --git a/rooms/kq4-023-forest-path-with-cottage/pic_023_control.png b/rooms/kq4-023-forest-path-with-cottage/pic_023_control.png new file mode 100644 index 0000000..65f78b0 Binary files /dev/null and b/rooms/kq4-023-forest-path-with-cottage/pic_023_control.png differ diff --git a/rooms/kq4-023-forest-path-with-cottage/pic_023_priority.png b/rooms/kq4-023-forest-path-with-cottage/pic_023_priority.png new file mode 100644 index 0000000..4c10b09 Binary files /dev/null and b/rooms/kq4-023-forest-path-with-cottage/pic_023_priority.png differ diff --git a/rooms/kq4-023-forest-path-with-cottage/pic_023_visual.png b/rooms/kq4-023-forest-path-with-cottage/pic_023_visual.png new file mode 100644 index 0000000..b3de9df Binary files /dev/null and b/rooms/kq4-023-forest-path-with-cottage/pic_023_visual.png differ diff --git a/rooms/024-waterfall-and-pool.md b/rooms/kq4-024-waterfall-and-pool/024-waterfall-and-pool.md similarity index 100% rename from rooms/024-waterfall-and-pool.md rename to rooms/kq4-024-waterfall-and-pool/024-waterfall-and-pool.md diff --git a/rooms/kq4-024-waterfall-and-pool/pic_024_control.png b/rooms/kq4-024-waterfall-and-pool/pic_024_control.png new file mode 100644 index 0000000..5473796 Binary files /dev/null and b/rooms/kq4-024-waterfall-and-pool/pic_024_control.png differ diff --git a/rooms/kq4-024-waterfall-and-pool/pic_024_priority.png b/rooms/kq4-024-waterfall-and-pool/pic_024_priority.png new file mode 100644 index 0000000..f94c5b2 Binary files /dev/null and b/rooms/kq4-024-waterfall-and-pool/pic_024_priority.png differ diff --git a/rooms/kq4-024-waterfall-and-pool/pic_024_visual.png b/rooms/kq4-024-waterfall-and-pool/pic_024_visual.png new file mode 100644 index 0000000..ec46667 Binary files /dev/null and b/rooms/kq4-024-waterfall-and-pool/pic_024_visual.png differ diff --git a/rooms/kq4-025-beach-at-river-delta.md b/rooms/kq4-025-beach-at-river-delta/kq4-025-beach-at-river-delta.md similarity index 100% rename from rooms/kq4-025-beach-at-river-delta.md rename to rooms/kq4-025-beach-at-river-delta/kq4-025-beach-at-river-delta.md diff --git a/rooms/kq4-025-beach-at-river-delta/pic_025_control.png b/rooms/kq4-025-beach-at-river-delta/pic_025_control.png new file mode 100644 index 0000000..8594147 Binary files /dev/null and b/rooms/kq4-025-beach-at-river-delta/pic_025_control.png differ diff --git a/rooms/kq4-025-beach-at-river-delta/pic_025_priority.png b/rooms/kq4-025-beach-at-river-delta/pic_025_priority.png new file mode 100644 index 0000000..d83c53a Binary files /dev/null and b/rooms/kq4-025-beach-at-river-delta/pic_025_priority.png differ diff --git a/rooms/kq4-025-beach-at-river-delta/pic_025_visual.png b/rooms/kq4-025-beach-at-river-delta/pic_025_visual.png new file mode 100644 index 0000000..ba19846 Binary files /dev/null and b/rooms/kq4-025-beach-at-river-delta/pic_025_visual.png differ diff --git a/rooms/kq4-026-river-meadow.md b/rooms/kq4-026-river-meadow/kq4-026-river-meadow.md similarity index 100% rename from rooms/kq4-026-river-meadow.md rename to rooms/kq4-026-river-meadow/kq4-026-river-meadow.md diff --git a/rooms/kq4-026-river-meadow/pic_026_control.png b/rooms/kq4-026-river-meadow/pic_026_control.png new file mode 100644 index 0000000..e27f66e Binary files /dev/null and b/rooms/kq4-026-river-meadow/pic_026_control.png differ diff --git a/rooms/kq4-026-river-meadow/pic_026_priority.png b/rooms/kq4-026-river-meadow/pic_026_priority.png new file mode 100644 index 0000000..6bc9915 Binary files /dev/null and b/rooms/kq4-026-river-meadow/pic_026_priority.png differ diff --git a/rooms/kq4-026-river-meadow/pic_026_visual.png b/rooms/kq4-026-river-meadow/pic_026_visual.png new file mode 100644 index 0000000..533730f Binary files /dev/null and b/rooms/kq4-026-river-meadow/pic_026_visual.png differ diff --git a/rooms/kq4-027-forest-path.md b/rooms/kq4-027-forest-path/kq4-027-forest-path.md similarity index 100% rename from rooms/kq4-027-forest-path.md rename to rooms/kq4-027-forest-path/kq4-027-forest-path.md diff --git a/rooms/kq4-027-forest-path/pic_027_control.png b/rooms/kq4-027-forest-path/pic_027_control.png new file mode 100644 index 0000000..4e6c839 Binary files /dev/null and b/rooms/kq4-027-forest-path/pic_027_control.png differ diff --git a/rooms/kq4-027-forest-path/pic_027_priority.png b/rooms/kq4-027-forest-path/pic_027_priority.png new file mode 100644 index 0000000..f258ff4 Binary files /dev/null and b/rooms/kq4-027-forest-path/pic_027_priority.png differ diff --git a/rooms/kq4-027-forest-path/pic_027_visual.png b/rooms/kq4-027-forest-path/pic_027_visual.png new file mode 100644 index 0000000..2e996ae Binary files /dev/null and b/rooms/kq4-027-forest-path/pic_027_visual.png differ diff --git a/rooms/kq4-028-mine-entrance.md b/rooms/kq4-028-mine-entrance/kq4-028-mine-entrance.md similarity index 100% rename from rooms/kq4-028-mine-entrance.md rename to rooms/kq4-028-mine-entrance/kq4-028-mine-entrance.md diff --git a/rooms/kq4-028-mine-entrance/pic_028_control.png b/rooms/kq4-028-mine-entrance/pic_028_control.png new file mode 100644 index 0000000..70dc28d Binary files /dev/null and b/rooms/kq4-028-mine-entrance/pic_028_control.png differ diff --git a/rooms/kq4-028-mine-entrance/pic_028_priority.png b/rooms/kq4-028-mine-entrance/pic_028_priority.png new file mode 100644 index 0000000..a5edb51 Binary files /dev/null and b/rooms/kq4-028-mine-entrance/pic_028_priority.png differ diff --git a/rooms/kq4-028-mine-entrance/pic_028_visual.png b/rooms/kq4-028-mine-entrance/pic_028_visual.png new file mode 100644 index 0000000..dd10745 Binary files /dev/null and b/rooms/kq4-028-mine-entrance/pic_028_visual.png differ diff --git a/rooms/kq4-029-dense-forest.md b/rooms/kq4-029-dense-forest/kq4-029-dense-forest.md similarity index 100% rename from rooms/kq4-029-dense-forest.md rename to rooms/kq4-029-dense-forest/kq4-029-dense-forest.md diff --git a/rooms/kq4-029-dense-forest/pic_029_control.png b/rooms/kq4-029-dense-forest/pic_029_control.png new file mode 100644 index 0000000..3943f17 Binary files /dev/null and b/rooms/kq4-029-dense-forest/pic_029_control.png differ diff --git a/rooms/kq4-029-dense-forest/pic_029_priority.png b/rooms/kq4-029-dense-forest/pic_029_priority.png new file mode 100644 index 0000000..7e2aff4 Binary files /dev/null and b/rooms/kq4-029-dense-forest/pic_029_priority.png differ diff --git a/rooms/kq4-029-dense-forest/pic_029_visual.png b/rooms/kq4-029-dense-forest/pic_029_visual.png new file mode 100644 index 0000000..3aee4b5 Binary files /dev/null and b/rooms/kq4-029-dense-forest/pic_029_visual.png differ diff --git a/rooms/kq4-030-mountain-pass.md b/rooms/kq4-030-mountain-pass/kq4-030-mountain-pass.md similarity index 100% rename from rooms/kq4-030-mountain-pass.md rename to rooms/kq4-030-mountain-pass/kq4-030-mountain-pass.md diff --git a/rooms/kq4-030-mountain-pass/pic_030_control.png b/rooms/kq4-030-mountain-pass/pic_030_control.png new file mode 100644 index 0000000..ece86ef Binary files /dev/null and b/rooms/kq4-030-mountain-pass/pic_030_control.png differ diff --git a/rooms/kq4-030-mountain-pass/pic_030_priority.png b/rooms/kq4-030-mountain-pass/pic_030_priority.png new file mode 100644 index 0000000..6e81bd8 Binary files /dev/null and b/rooms/kq4-030-mountain-pass/pic_030_priority.png differ diff --git a/rooms/kq4-030-mountain-pass/pic_030_visual.png b/rooms/kq4-030-mountain-pass/pic_030_visual.png new file mode 100644 index 0000000..eb57e88 Binary files /dev/null and b/rooms/kq4-030-mountain-pass/pic_030_visual.png differ diff --git a/rooms/kq4-031-open-ocean.md b/rooms/kq4-031-open-ocean/kq4-031-open-ocean.md similarity index 100% rename from rooms/kq4-031-open-ocean.md rename to rooms/kq4-031-open-ocean/kq4-031-open-ocean.md diff --git a/rooms/kq4-031-open-ocean/pic_031_control.png b/rooms/kq4-031-open-ocean/pic_031_control.png new file mode 100644 index 0000000..638d7b9 Binary files /dev/null and b/rooms/kq4-031-open-ocean/pic_031_control.png differ diff --git a/rooms/kq4-031-open-ocean/pic_031_priority.png b/rooms/kq4-031-open-ocean/pic_031_priority.png new file mode 100644 index 0000000..ec0676e Binary files /dev/null and b/rooms/kq4-031-open-ocean/pic_031_priority.png differ diff --git a/rooms/kq4-031-open-ocean/pic_031_visual.png b/rooms/kq4-031-open-ocean/pic_031_visual.png new file mode 100644 index 0000000..c19ecfe Binary files /dev/null and b/rooms/kq4-031-open-ocean/pic_031_visual.png differ diff --git a/rooms/kq4-032-ocean-near-island.md b/rooms/kq4-032-ocean-near-island/kq4-032-ocean-near-island.md similarity index 100% rename from rooms/kq4-032-ocean-near-island.md rename to rooms/kq4-032-ocean-near-island/kq4-032-ocean-near-island.md diff --git a/rooms/kq4-032-ocean-near-island/pic_032_control.png b/rooms/kq4-032-ocean-near-island/pic_032_control.png new file mode 100644 index 0000000..c0c05c7 Binary files /dev/null and b/rooms/kq4-032-ocean-near-island/pic_032_control.png differ diff --git a/rooms/kq4-032-ocean-near-island/pic_032_priority.png b/rooms/kq4-032-ocean-near-island/pic_032_priority.png new file mode 100644 index 0000000..fc7e25c Binary files /dev/null and b/rooms/kq4-032-ocean-near-island/pic_032_priority.png differ diff --git a/rooms/kq4-032-ocean-near-island/pic_032_visual.png b/rooms/kq4-032-ocean-near-island/pic_032_visual.png new file mode 100644 index 0000000..fcc0204 Binary files /dev/null and b/rooms/kq4-032-ocean-near-island/pic_032_visual.png differ diff --git a/rooms/kq4-033-enchanted-island-beach.md b/rooms/kq4-033-enchanted-island-beach/kq4-033-enchanted-island-beach.md similarity index 100% rename from rooms/kq4-033-enchanted-island-beach.md rename to rooms/kq4-033-enchanted-island-beach/kq4-033-enchanted-island-beach.md diff --git a/rooms/kq4-033-enchanted-island-beach/pic_033_control.png b/rooms/kq4-033-enchanted-island-beach/pic_033_control.png new file mode 100644 index 0000000..7d8aa17 Binary files /dev/null and b/rooms/kq4-033-enchanted-island-beach/pic_033_control.png differ diff --git a/rooms/kq4-033-enchanted-island-beach/pic_033_priority.png b/rooms/kq4-033-enchanted-island-beach/pic_033_priority.png new file mode 100644 index 0000000..2577e32 Binary files /dev/null and b/rooms/kq4-033-enchanted-island-beach/pic_033_priority.png differ diff --git a/rooms/kq4-033-enchanted-island-beach/pic_033_visual.png b/rooms/kq4-033-enchanted-island-beach/pic_033_visual.png new file mode 100644 index 0000000..ea5b82f Binary files /dev/null and b/rooms/kq4-033-enchanted-island-beach/pic_033_visual.png differ diff --git a/rooms/kq4-034-island-beach.md b/rooms/kq4-034-island-beach/kq4-034-island-beach.md similarity index 100% rename from rooms/kq4-034-island-beach.md rename to rooms/kq4-034-island-beach/kq4-034-island-beach.md diff --git a/rooms/kq4-034-island-beach/pic_034_control.png b/rooms/kq4-034-island-beach/pic_034_control.png new file mode 100644 index 0000000..05eb345 Binary files /dev/null and b/rooms/kq4-034-island-beach/pic_034_control.png differ diff --git a/rooms/kq4-034-island-beach/pic_034_priority.png b/rooms/kq4-034-island-beach/pic_034_priority.png new file mode 100644 index 0000000..2f8ff6a Binary files /dev/null and b/rooms/kq4-034-island-beach/pic_034_priority.png differ diff --git a/rooms/kq4-034-island-beach/pic_034_visual.png b/rooms/kq4-034-island-beach/pic_034_visual.png new file mode 100644 index 0000000..498bec3 Binary files /dev/null and b/rooms/kq4-034-island-beach/pic_034_visual.png differ diff --git a/rooms/kq4-035-island-beach.md b/rooms/kq4-035-island-beach/kq4-035-island-beach.md similarity index 100% rename from rooms/kq4-035-island-beach.md rename to rooms/kq4-035-island-beach/kq4-035-island-beach.md diff --git a/rooms/kq4-035-island-beach/pic_035_control.png b/rooms/kq4-035-island-beach/pic_035_control.png new file mode 100644 index 0000000..2374426 Binary files /dev/null and b/rooms/kq4-035-island-beach/pic_035_control.png differ diff --git a/rooms/kq4-035-island-beach/pic_035_priority.png b/rooms/kq4-035-island-beach/pic_035_priority.png new file mode 100644 index 0000000..a34707e Binary files /dev/null and b/rooms/kq4-035-island-beach/pic_035_priority.png differ diff --git a/rooms/kq4-035-island-beach/pic_035_visual.png b/rooms/kq4-035-island-beach/pic_035_visual.png new file mode 100644 index 0000000..217400f Binary files /dev/null and b/rooms/kq4-035-island-beach/pic_035_visual.png differ diff --git a/rooms/kq4-036-island-garden-pond.md b/rooms/kq4-036-island-garden-pond/kq4-036-island-garden-pond.md similarity index 100% rename from rooms/kq4-036-island-garden-pond.md rename to rooms/kq4-036-island-garden-pond/kq4-036-island-garden-pond.md diff --git a/rooms/kq4-036-island-garden-pond/pic_036_control.png b/rooms/kq4-036-island-garden-pond/pic_036_control.png new file mode 100644 index 0000000..e7bdf64 Binary files /dev/null and b/rooms/kq4-036-island-garden-pond/pic_036_control.png differ diff --git a/rooms/kq4-036-island-garden-pond/pic_036_priority.png b/rooms/kq4-036-island-garden-pond/pic_036_priority.png new file mode 100644 index 0000000..5da577e Binary files /dev/null and b/rooms/kq4-036-island-garden-pond/pic_036_priority.png differ diff --git a/rooms/kq4-036-island-garden-pond/pic_036_visual.png b/rooms/kq4-036-island-garden-pond/pic_036_visual.png new file mode 100644 index 0000000..94811a0 Binary files /dev/null and b/rooms/kq4-036-island-garden-pond/pic_036_visual.png differ diff --git a/rooms/kq4-037-fairy-island.md b/rooms/kq4-037-fairy-island/kq4-037-fairy-island.md similarity index 100% rename from rooms/kq4-037-fairy-island.md rename to rooms/kq4-037-fairy-island/kq4-037-fairy-island.md diff --git a/rooms/kq4-037-fairy-island/pic_037_control.png b/rooms/kq4-037-fairy-island/pic_037_control.png new file mode 100644 index 0000000..d74a375 Binary files /dev/null and b/rooms/kq4-037-fairy-island/pic_037_control.png differ diff --git a/rooms/kq4-037-fairy-island/pic_037_priority.png b/rooms/kq4-037-fairy-island/pic_037_priority.png new file mode 100644 index 0000000..9c2b9ef Binary files /dev/null and b/rooms/kq4-037-fairy-island/pic_037_priority.png differ diff --git a/rooms/kq4-037-fairy-island/pic_037_visual.png b/rooms/kq4-037-fairy-island/pic_037_visual.png new file mode 100644 index 0000000..391121e Binary files /dev/null and b/rooms/kq4-037-fairy-island/pic_037_visual.png differ diff --git a/rooms/kq4-038-island-garden.md b/rooms/kq4-038-island-garden/kq4-038-island-garden.md similarity index 100% rename from rooms/kq4-038-island-garden.md rename to rooms/kq4-038-island-garden/kq4-038-island-garden.md diff --git a/rooms/kq4-038-island-garden/pic_038_control.png b/rooms/kq4-038-island-garden/pic_038_control.png new file mode 100644 index 0000000..b681875 Binary files /dev/null and b/rooms/kq4-038-island-garden/pic_038_control.png differ diff --git a/rooms/kq4-038-island-garden/pic_038_priority.png b/rooms/kq4-038-island-garden/pic_038_priority.png new file mode 100644 index 0000000..8426074 Binary files /dev/null and b/rooms/kq4-038-island-garden/pic_038_priority.png differ diff --git a/rooms/kq4-038-island-garden/pic_038_visual.png b/rooms/kq4-038-island-garden/pic_038_visual.png new file mode 100644 index 0000000..9ba6531 Binary files /dev/null and b/rooms/kq4-038-island-garden/pic_038_visual.png differ diff --git a/rooms/kq4-039-island-beach.md b/rooms/kq4-039-island-beach/kq4-039-island-beach.md similarity index 100% rename from rooms/kq4-039-island-beach.md rename to rooms/kq4-039-island-beach/kq4-039-island-beach.md diff --git a/rooms/kq4-039-island-beach/pic_039_control.png b/rooms/kq4-039-island-beach/pic_039_control.png new file mode 100644 index 0000000..af479be Binary files /dev/null and b/rooms/kq4-039-island-beach/pic_039_control.png differ diff --git a/rooms/kq4-039-island-beach/pic_039_priority.png b/rooms/kq4-039-island-beach/pic_039_priority.png new file mode 100644 index 0000000..4e324df Binary files /dev/null and b/rooms/kq4-039-island-beach/pic_039_priority.png differ diff --git a/rooms/kq4-039-island-beach/pic_039_visual.png b/rooms/kq4-039-island-beach/pic_039_visual.png new file mode 100644 index 0000000..8225564 Binary files /dev/null and b/rooms/kq4-039-island-beach/pic_039_visual.png differ diff --git a/rooms/kq4-040-island-beach-east.md b/rooms/kq4-040-island-beach-east/kq4-040-island-beach-east.md similarity index 100% rename from rooms/kq4-040-island-beach-east.md rename to rooms/kq4-040-island-beach-east/kq4-040-island-beach-east.md diff --git a/rooms/kq4-040-island-beach-east/pic_040_control.png b/rooms/kq4-040-island-beach-east/pic_040_control.png new file mode 100644 index 0000000..1da9bf0 Binary files /dev/null and b/rooms/kq4-040-island-beach-east/pic_040_control.png differ diff --git a/rooms/kq4-040-island-beach-east/pic_040_priority.png b/rooms/kq4-040-island-beach-east/pic_040_priority.png new file mode 100644 index 0000000..6c42895 Binary files /dev/null and b/rooms/kq4-040-island-beach-east/pic_040_priority.png differ diff --git a/rooms/kq4-040-island-beach-east/pic_040_visual.png b/rooms/kq4-040-island-beach-east/pic_040_visual.png new file mode 100644 index 0000000..60be225 Binary files /dev/null and b/rooms/kq4-040-island-beach-east/pic_040_visual.png differ diff --git a/rooms/kq4-041-island-shore.md b/rooms/kq4-041-island-shore/kq4-041-island-shore.md similarity index 100% rename from rooms/kq4-041-island-shore.md rename to rooms/kq4-041-island-shore/kq4-041-island-shore.md diff --git a/rooms/kq4-041-island-shore/pic_041_control.png b/rooms/kq4-041-island-shore/pic_041_control.png new file mode 100644 index 0000000..a0c94e2 Binary files /dev/null and b/rooms/kq4-041-island-shore/pic_041_control.png differ diff --git a/rooms/kq4-041-island-shore/pic_041_priority.png b/rooms/kq4-041-island-shore/pic_041_priority.png new file mode 100644 index 0000000..26a0490 Binary files /dev/null and b/rooms/kq4-041-island-shore/pic_041_priority.png differ diff --git a/rooms/kq4-041-island-shore/pic_041_visual.png b/rooms/kq4-041-island-shore/pic_041_visual.png new file mode 100644 index 0000000..1a83355 Binary files /dev/null and b/rooms/kq4-041-island-shore/pic_041_visual.png differ diff --git a/rooms/kq4-042-fishermans-shack-inside.md b/rooms/kq4-042-fishermans-shack-inside/kq4-042-fishermans-shack-inside.md similarity index 100% rename from rooms/kq4-042-fishermans-shack-inside.md rename to rooms/kq4-042-fishermans-shack-inside/kq4-042-fishermans-shack-inside.md diff --git a/rooms/kq4-042-fishermans-shack-inside/pic_042_control.png b/rooms/kq4-042-fishermans-shack-inside/pic_042_control.png new file mode 100644 index 0000000..b4829e8 Binary files /dev/null and b/rooms/kq4-042-fishermans-shack-inside/pic_042_control.png differ diff --git a/rooms/kq4-042-fishermans-shack-inside/pic_042_priority.png b/rooms/kq4-042-fishermans-shack-inside/pic_042_priority.png new file mode 100644 index 0000000..e20f8ab Binary files /dev/null and b/rooms/kq4-042-fishermans-shack-inside/pic_042_priority.png differ diff --git a/rooms/kq4-042-fishermans-shack-inside/pic_042_visual.png b/rooms/kq4-042-fishermans-shack-inside/pic_042_visual.png new file mode 100644 index 0000000..ad53e94 Binary files /dev/null and b/rooms/kq4-042-fishermans-shack-inside/pic_042_visual.png differ diff --git a/rooms/kq4-043-desert-island.md b/rooms/kq4-043-desert-island/kq4-043-desert-island.md similarity index 100% rename from rooms/kq4-043-desert-island.md rename to rooms/kq4-043-desert-island/kq4-043-desert-island.md diff --git a/rooms/kq4-043-desert-island/pic_043_control.png b/rooms/kq4-043-desert-island/pic_043_control.png new file mode 100644 index 0000000..8fd0eaa Binary files /dev/null and b/rooms/kq4-043-desert-island/pic_043_control.png differ diff --git a/rooms/kq4-043-desert-island/pic_043_priority.png b/rooms/kq4-043-desert-island/pic_043_priority.png new file mode 100644 index 0000000..f42ba00 Binary files /dev/null and b/rooms/kq4-043-desert-island/pic_043_priority.png differ diff --git a/rooms/kq4-043-desert-island/pic_043_visual.png b/rooms/kq4-043-desert-island/pic_043_visual.png new file mode 100644 index 0000000..ce042af Binary files /dev/null and b/rooms/kq4-043-desert-island/pic_043_visual.png differ diff --git a/rooms/kq4-044-inside-whale.md b/rooms/kq4-044-inside-whale/kq4-044-inside-whale.md similarity index 100% rename from rooms/kq4-044-inside-whale.md rename to rooms/kq4-044-inside-whale/kq4-044-inside-whale.md diff --git a/rooms/kq4-044-inside-whale/pic_044_control.png b/rooms/kq4-044-inside-whale/pic_044_control.png new file mode 100644 index 0000000..de82b1e Binary files /dev/null and b/rooms/kq4-044-inside-whale/pic_044_control.png differ diff --git a/rooms/kq4-044-inside-whale/pic_044_priority.png b/rooms/kq4-044-inside-whale/pic_044_priority.png new file mode 100644 index 0000000..0a1dd0a Binary files /dev/null and b/rooms/kq4-044-inside-whale/pic_044_priority.png differ diff --git a/rooms/kq4-044-inside-whale/pic_044_visual.png b/rooms/kq4-044-inside-whale/pic_044_visual.png new file mode 100644 index 0000000..fc2bb0b Binary files /dev/null and b/rooms/kq4-044-inside-whale/pic_044_visual.png differ diff --git a/rooms/kq4-045-genestas-bed-chamber.md b/rooms/kq4-045-genestas-bed-chamber/kq4-045-genestas-bed-chamber.md similarity index 100% rename from rooms/kq4-045-genestas-bed-chamber.md rename to rooms/kq4-045-genestas-bed-chamber/kq4-045-genestas-bed-chamber.md diff --git a/rooms/kq4-045-genestas-bed-chamber/pic_045_control.png b/rooms/kq4-045-genestas-bed-chamber/pic_045_control.png new file mode 100644 index 0000000..636d973 Binary files /dev/null and b/rooms/kq4-045-genestas-bed-chamber/pic_045_control.png differ diff --git a/rooms/kq4-045-genestas-bed-chamber/pic_045_priority.png b/rooms/kq4-045-genestas-bed-chamber/pic_045_priority.png new file mode 100644 index 0000000..4fad180 Binary files /dev/null and b/rooms/kq4-045-genestas-bed-chamber/pic_045_priority.png differ diff --git a/rooms/kq4-045-genestas-bed-chamber/pic_045_visual.png b/rooms/kq4-045-genestas-bed-chamber/pic_045_visual.png new file mode 100644 index 0000000..a0bc7d3 Binary files /dev/null and b/rooms/kq4-045-genestas-bed-chamber/pic_045_visual.png differ diff --git a/rooms/kq4-046-tower-stairway.md b/rooms/kq4-046-tower-stairway/kq4-046-tower-stairway.md similarity index 100% rename from rooms/kq4-046-tower-stairway.md rename to rooms/kq4-046-tower-stairway/kq4-046-tower-stairway.md diff --git a/rooms/kq4-046-tower-stairway/pic_046_control.png b/rooms/kq4-046-tower-stairway/pic_046_control.png new file mode 100644 index 0000000..7d5b2db Binary files /dev/null and b/rooms/kq4-046-tower-stairway/pic_046_control.png differ diff --git a/rooms/kq4-046-tower-stairway/pic_046_priority.png b/rooms/kq4-046-tower-stairway/pic_046_priority.png new file mode 100644 index 0000000..33f8080 Binary files /dev/null and b/rooms/kq4-046-tower-stairway/pic_046_priority.png differ diff --git a/rooms/kq4-046-tower-stairway/pic_046_visual.png b/rooms/kq4-046-tower-stairway/pic_046_visual.png new file mode 100644 index 0000000..4f6dcaf Binary files /dev/null and b/rooms/kq4-046-tower-stairway/pic_046_visual.png differ diff --git a/rooms/kq4-047-genestas-palace-entry-hall.md b/rooms/kq4-047-genestas-palace-entry-hall/kq4-047-genestas-palace-entry-hall.md similarity index 100% rename from rooms/kq4-047-genestas-palace-entry-hall.md rename to rooms/kq4-047-genestas-palace-entry-hall/kq4-047-genestas-palace-entry-hall.md diff --git a/rooms/kq4-047-genestas-palace-entry-hall/pic_047_control.png b/rooms/kq4-047-genestas-palace-entry-hall/pic_047_control.png new file mode 100644 index 0000000..1cc3ff5 Binary files /dev/null and b/rooms/kq4-047-genestas-palace-entry-hall/pic_047_control.png differ diff --git a/rooms/kq4-047-genestas-palace-entry-hall/pic_047_priority.png b/rooms/kq4-047-genestas-palace-entry-hall/pic_047_priority.png new file mode 100644 index 0000000..7fdaa2b Binary files /dev/null and b/rooms/kq4-047-genestas-palace-entry-hall/pic_047_priority.png differ diff --git a/rooms/kq4-047-genestas-palace-entry-hall/pic_047_visual.png b/rooms/kq4-047-genestas-palace-entry-hall/pic_047_visual.png new file mode 100644 index 0000000..36b0188 Binary files /dev/null and b/rooms/kq4-047-genestas-palace-entry-hall/pic_047_visual.png differ diff --git a/rooms/kq4-048-ogres-bedroom.md b/rooms/kq4-048-ogres-bedroom/kq4-048-ogres-bedroom.md similarity index 100% rename from rooms/kq4-048-ogres-bedroom.md rename to rooms/kq4-048-ogres-bedroom/kq4-048-ogres-bedroom.md diff --git a/rooms/kq4-048-ogres-bedroom/pic_048_control.png b/rooms/kq4-048-ogres-bedroom/pic_048_control.png new file mode 100644 index 0000000..7e77f89 Binary files /dev/null and b/rooms/kq4-048-ogres-bedroom/pic_048_control.png differ diff --git a/rooms/kq4-048-ogres-bedroom/pic_048_priority.png b/rooms/kq4-048-ogres-bedroom/pic_048_priority.png new file mode 100644 index 0000000..ff5816d Binary files /dev/null and b/rooms/kq4-048-ogres-bedroom/pic_048_priority.png differ diff --git a/rooms/kq4-048-ogres-bedroom/pic_048_visual.png b/rooms/kq4-048-ogres-bedroom/pic_048_visual.png new file mode 100644 index 0000000..43537d1 Binary files /dev/null and b/rooms/kq4-048-ogres-bedroom/pic_048_visual.png differ diff --git a/rooms/kq4-049-ogres-cottage.md b/rooms/kq4-049-ogres-cottage/kq4-049-ogres-cottage.md similarity index 100% rename from rooms/kq4-049-ogres-cottage.md rename to rooms/kq4-049-ogres-cottage/kq4-049-ogres-cottage.md diff --git a/rooms/kq4-049-ogres-cottage/pic_049_control.png b/rooms/kq4-049-ogres-cottage/pic_049_control.png new file mode 100644 index 0000000..588389b Binary files /dev/null and b/rooms/kq4-049-ogres-cottage/pic_049_control.png differ diff --git a/rooms/kq4-049-ogres-cottage/pic_049_priority.png b/rooms/kq4-049-ogres-cottage/pic_049_priority.png new file mode 100644 index 0000000..6140697 Binary files /dev/null and b/rooms/kq4-049-ogres-cottage/pic_049_priority.png differ diff --git a/rooms/kq4-049-ogres-cottage/pic_049_visual.png b/rooms/kq4-049-ogres-cottage/pic_049_visual.png new file mode 100644 index 0000000..b0f6e07 Binary files /dev/null and b/rooms/kq4-049-ogres-cottage/pic_049_visual.png differ diff --git a/rooms/kq4-050-ogress-kitchen.md b/rooms/kq4-050-ogress-kitchen/kq4-050-ogress-kitchen.md similarity index 100% rename from rooms/kq4-050-ogress-kitchen.md rename to rooms/kq4-050-ogress-kitchen/kq4-050-ogress-kitchen.md diff --git a/rooms/kq4-050-ogress-kitchen/pic_050_control.png b/rooms/kq4-050-ogress-kitchen/pic_050_control.png new file mode 100644 index 0000000..2853a0d Binary files /dev/null and b/rooms/kq4-050-ogress-kitchen/pic_050_control.png differ diff --git a/rooms/kq4-050-ogress-kitchen/pic_050_priority.png b/rooms/kq4-050-ogress-kitchen/pic_050_priority.png new file mode 100644 index 0000000..b46389c Binary files /dev/null and b/rooms/kq4-050-ogress-kitchen/pic_050_priority.png differ diff --git a/rooms/kq4-050-ogress-kitchen/pic_050_visual.png b/rooms/kq4-050-ogress-kitchen/pic_050_visual.png new file mode 100644 index 0000000..2c6f060 Binary files /dev/null and b/rooms/kq4-050-ogress-kitchen/pic_050_visual.png differ diff --git a/rooms/kq4-051-ogres-closet.md b/rooms/kq4-051-ogres-closet/kq4-051-ogres-closet.md similarity index 100% rename from rooms/kq4-051-ogres-closet.md rename to rooms/kq4-051-ogres-closet/kq4-051-ogres-closet.md diff --git a/rooms/kq4-051-ogres-closet/pic_051_control.png b/rooms/kq4-051-ogres-closet/pic_051_control.png new file mode 100644 index 0000000..50d8ee6 Binary files /dev/null and b/rooms/kq4-051-ogres-closet/pic_051_control.png differ diff --git a/rooms/kq4-051-ogres-closet/pic_051_priority.png b/rooms/kq4-051-ogres-closet/pic_051_priority.png new file mode 100644 index 0000000..38402ce Binary files /dev/null and b/rooms/kq4-051-ogres-closet/pic_051_priority.png differ diff --git a/rooms/kq4-051-ogres-closet/pic_051_visual.png b/rooms/kq4-051-ogres-closet/pic_051_visual.png new file mode 100644 index 0000000..9e87490 Binary files /dev/null and b/rooms/kq4-051-ogres-closet/pic_051_visual.png differ diff --git a/rooms/kq4-053-seven-dwarfs-bedroom.md b/rooms/kq4-053-seven-dwarfs-bedroom/kq4-053-seven-dwarfs-bedroom.md similarity index 100% rename from rooms/kq4-053-seven-dwarfs-bedroom.md rename to rooms/kq4-053-seven-dwarfs-bedroom/kq4-053-seven-dwarfs-bedroom.md diff --git a/rooms/kq4-053-seven-dwarfs-bedroom/pic_053_control.png b/rooms/kq4-053-seven-dwarfs-bedroom/pic_053_control.png new file mode 100644 index 0000000..c3e89ac Binary files /dev/null and b/rooms/kq4-053-seven-dwarfs-bedroom/pic_053_control.png differ diff --git a/rooms/kq4-053-seven-dwarfs-bedroom/pic_053_priority.png b/rooms/kq4-053-seven-dwarfs-bedroom/pic_053_priority.png new file mode 100644 index 0000000..5dd179a Binary files /dev/null and b/rooms/kq4-053-seven-dwarfs-bedroom/pic_053_priority.png differ diff --git a/rooms/kq4-053-seven-dwarfs-bedroom/pic_053_visual.png b/rooms/kq4-053-seven-dwarfs-bedroom/pic_053_visual.png new file mode 100644 index 0000000..c33f4bf Binary files /dev/null and b/rooms/kq4-053-seven-dwarfs-bedroom/pic_053_visual.png differ diff --git a/rooms/kq4-054-seven-dwarfs-cottage.md b/rooms/kq4-054-seven-dwarfs-cottage/kq4-054-seven-dwarfs-cottage.md similarity index 100% rename from rooms/kq4-054-seven-dwarfs-cottage.md rename to rooms/kq4-054-seven-dwarfs-cottage/kq4-054-seven-dwarfs-cottage.md diff --git a/rooms/kq4-054-seven-dwarfs-cottage/pic_054_control.png b/rooms/kq4-054-seven-dwarfs-cottage/pic_054_control.png new file mode 100644 index 0000000..c4085e1 Binary files /dev/null and b/rooms/kq4-054-seven-dwarfs-cottage/pic_054_control.png differ diff --git a/rooms/kq4-054-seven-dwarfs-cottage/pic_054_priority.png b/rooms/kq4-054-seven-dwarfs-cottage/pic_054_priority.png new file mode 100644 index 0000000..24e642f Binary files /dev/null and b/rooms/kq4-054-seven-dwarfs-cottage/pic_054_priority.png differ diff --git a/rooms/kq4-054-seven-dwarfs-cottage/pic_054_visual.png b/rooms/kq4-054-seven-dwarfs-cottage/pic_054_visual.png new file mode 100644 index 0000000..660fab9 Binary files /dev/null and b/rooms/kq4-054-seven-dwarfs-cottage/pic_054_visual.png differ diff --git a/rooms/055-seven-dwarfs-diamond-mine.md b/rooms/kq4-055-seven-dwarfs-diamond-mine/055-seven-dwarfs-diamond-mine.md similarity index 100% rename from rooms/055-seven-dwarfs-diamond-mine.md rename to rooms/kq4-055-seven-dwarfs-diamond-mine/055-seven-dwarfs-diamond-mine.md diff --git a/rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_control.png b/rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_control.png new file mode 100644 index 0000000..62903b1 Binary files /dev/null and b/rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_control.png differ diff --git a/rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_priority.png b/rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_priority.png new file mode 100644 index 0000000..1ec12fb Binary files /dev/null and b/rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_priority.png differ diff --git a/rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_visual.png b/rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_visual.png new file mode 100644 index 0000000..48ab5aa Binary files /dev/null and b/rooms/kq4-055-seven-dwarfs-diamond-mine/pic_055_visual.png differ diff --git a/rooms/056-diamond-mine.md b/rooms/kq4-056-diamond-mine/056-diamond-mine.md similarity index 100% rename from rooms/056-diamond-mine.md rename to rooms/kq4-056-diamond-mine/056-diamond-mine.md diff --git a/rooms/kq4-056-diamond-mine/pic_056_control.png b/rooms/kq4-056-diamond-mine/pic_056_control.png new file mode 100644 index 0000000..3ddf251 Binary files /dev/null and b/rooms/kq4-056-diamond-mine/pic_056_control.png differ diff --git a/rooms/kq4-056-diamond-mine/pic_056_priority.png b/rooms/kq4-056-diamond-mine/pic_056_priority.png new file mode 100644 index 0000000..c9760d7 Binary files /dev/null and b/rooms/kq4-056-diamond-mine/pic_056_priority.png differ diff --git a/rooms/kq4-056-diamond-mine/pic_056_visual.png b/rooms/kq4-056-diamond-mine/pic_056_visual.png new file mode 100644 index 0000000..8e24e10 Binary files /dev/null and b/rooms/kq4-056-diamond-mine/pic_056_visual.png differ diff --git a/rooms/kq4-056-seven-dwarfs-diamond-mine-west.md b/rooms/kq4-056-seven-dwarfs-diamond-mine-west/kq4-056-seven-dwarfs-diamond-mine-west.md similarity index 100% rename from rooms/kq4-056-seven-dwarfs-diamond-mine-west.md rename to rooms/kq4-056-seven-dwarfs-diamond-mine-west/kq4-056-seven-dwarfs-diamond-mine-west.md diff --git a/rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_control.png b/rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_control.png new file mode 100644 index 0000000..3ddf251 Binary files /dev/null and b/rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_control.png differ diff --git a/rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_priority.png b/rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_priority.png new file mode 100644 index 0000000..c9760d7 Binary files /dev/null and b/rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_priority.png differ diff --git a/rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_visual.png b/rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_visual.png new file mode 100644 index 0000000..8e24e10 Binary files /dev/null and b/rooms/kq4-056-seven-dwarfs-diamond-mine-west/pic_056_visual.png differ diff --git a/rooms/57-witch-cave.md b/rooms/kq4-057-witch-cave/57-witch-cave.md similarity index 100% rename from rooms/57-witch-cave.md rename to rooms/kq4-057-witch-cave/57-witch-cave.md diff --git a/rooms/kq4-057-witch-cave/pic_057_control.png b/rooms/kq4-057-witch-cave/pic_057_control.png new file mode 100644 index 0000000..371a2c7 Binary files /dev/null and b/rooms/kq4-057-witch-cave/pic_057_control.png differ diff --git a/rooms/kq4-057-witch-cave/pic_057_priority.png b/rooms/kq4-057-witch-cave/pic_057_priority.png new file mode 100644 index 0000000..e503057 Binary files /dev/null and b/rooms/kq4-057-witch-cave/pic_057_priority.png differ diff --git a/rooms/kq4-057-witch-cave/pic_057_visual.png b/rooms/kq4-057-witch-cave/pic_057_visual.png new file mode 100644 index 0000000..5fae919 Binary files /dev/null and b/rooms/kq4-057-witch-cave/pic_057_visual.png differ diff --git a/rooms/kq4-057-witches-cave.md b/rooms/kq4-057-witches-cave/kq4-057-witches-cave.md similarity index 100% rename from rooms/kq4-057-witches-cave.md rename to rooms/kq4-057-witches-cave/kq4-057-witches-cave.md diff --git a/rooms/kq4-057-witches-cave/pic_057_control.png b/rooms/kq4-057-witches-cave/pic_057_control.png new file mode 100644 index 0000000..371a2c7 Binary files /dev/null and b/rooms/kq4-057-witches-cave/pic_057_control.png differ diff --git a/rooms/kq4-057-witches-cave/pic_057_priority.png b/rooms/kq4-057-witches-cave/pic_057_priority.png new file mode 100644 index 0000000..e503057 Binary files /dev/null and b/rooms/kq4-057-witches-cave/pic_057_priority.png differ diff --git a/rooms/kq4-057-witches-cave/pic_057_visual.png b/rooms/kq4-057-witches-cave/pic_057_visual.png new file mode 100644 index 0000000..5fae919 Binary files /dev/null and b/rooms/kq4-057-witches-cave/pic_057_visual.png differ diff --git a/rooms/058-organ-room.md b/rooms/kq4-058-organ-room/058-organ-room.md similarity index 100% rename from rooms/058-organ-room.md rename to rooms/kq4-058-organ-room/058-organ-room.md diff --git a/rooms/kq4-058-organ-room/pic_058_control.png b/rooms/kq4-058-organ-room/pic_058_control.png new file mode 100644 index 0000000..b9ae046 Binary files /dev/null and b/rooms/kq4-058-organ-room/pic_058_control.png differ diff --git a/rooms/kq4-058-organ-room/pic_058_priority.png b/rooms/kq4-058-organ-room/pic_058_priority.png new file mode 100644 index 0000000..ec41e69 Binary files /dev/null and b/rooms/kq4-058-organ-room/pic_058_priority.png differ diff --git a/rooms/kq4-058-organ-room/pic_058_visual.png b/rooms/kq4-058-organ-room/pic_058_visual.png new file mode 100644 index 0000000..45bc55d Binary files /dev/null and b/rooms/kq4-058-organ-room/pic_058_visual.png differ diff --git a/rooms/kq4-058-tower-organ-room.md b/rooms/kq4-058-tower-organ-room/kq4-058-tower-organ-room.md similarity index 100% rename from rooms/kq4-058-tower-organ-room.md rename to rooms/kq4-058-tower-organ-room/kq4-058-tower-organ-room.md diff --git a/rooms/kq4-058-tower-organ-room/pic_058_control.png b/rooms/kq4-058-tower-organ-room/pic_058_control.png new file mode 100644 index 0000000..b9ae046 Binary files /dev/null and b/rooms/kq4-058-tower-organ-room/pic_058_control.png differ diff --git a/rooms/kq4-058-tower-organ-room/pic_058_priority.png b/rooms/kq4-058-tower-organ-room/pic_058_priority.png new file mode 100644 index 0000000..ec41e69 Binary files /dev/null and b/rooms/kq4-058-tower-organ-room/pic_058_priority.png differ diff --git a/rooms/kq4-058-tower-organ-room/pic_058_visual.png b/rooms/kq4-058-tower-organ-room/pic_058_visual.png new file mode 100644 index 0000000..45bc55d Binary files /dev/null and b/rooms/kq4-058-tower-organ-room/pic_058_visual.png differ diff --git a/rooms/kq4-059-baby-nursery.md b/rooms/kq4-059-baby-nursery/kq4-059-baby-nursery.md similarity index 100% rename from rooms/kq4-059-baby-nursery.md rename to rooms/kq4-059-baby-nursery/kq4-059-baby-nursery.md diff --git a/rooms/kq4-059-baby-nursery/pic_059_control.png b/rooms/kq4-059-baby-nursery/pic_059_control.png new file mode 100644 index 0000000..7f61266 Binary files /dev/null and b/rooms/kq4-059-baby-nursery/pic_059_control.png differ diff --git a/rooms/kq4-059-baby-nursery/pic_059_priority.png b/rooms/kq4-059-baby-nursery/pic_059_priority.png new file mode 100644 index 0000000..612f401 Binary files /dev/null and b/rooms/kq4-059-baby-nursery/pic_059_priority.png differ diff --git a/rooms/kq4-059-baby-nursery/pic_059_visual.png b/rooms/kq4-059-baby-nursery/pic_059_visual.png new file mode 100644 index 0000000..cbf1f4e Binary files /dev/null and b/rooms/kq4-059-baby-nursery/pic_059_visual.png differ diff --git a/rooms/kq4-060-bedroom.md b/rooms/kq4-060-bedroom/kq4-060-bedroom.md similarity index 100% rename from rooms/kq4-060-bedroom.md rename to rooms/kq4-060-bedroom/kq4-060-bedroom.md diff --git a/rooms/kq4-060-bedroom/pic_060_control.png b/rooms/kq4-060-bedroom/pic_060_control.png new file mode 100644 index 0000000..585a38d Binary files /dev/null and b/rooms/kq4-060-bedroom/pic_060_control.png differ diff --git a/rooms/kq4-060-bedroom/pic_060_priority.png b/rooms/kq4-060-bedroom/pic_060_priority.png new file mode 100644 index 0000000..e546203 Binary files /dev/null and b/rooms/kq4-060-bedroom/pic_060_priority.png differ diff --git a/rooms/kq4-060-bedroom/pic_060_visual.png b/rooms/kq4-060-bedroom/pic_060_visual.png new file mode 100644 index 0000000..03352df Binary files /dev/null and b/rooms/kq4-060-bedroom/pic_060_visual.png differ diff --git a/rooms/kq4-061-tower-stairs.md b/rooms/kq4-061-tower-stairs/kq4-061-tower-stairs.md similarity index 100% rename from rooms/kq4-061-tower-stairs.md rename to rooms/kq4-061-tower-stairs/kq4-061-tower-stairs.md diff --git a/rooms/kq4-061-tower-stairs/pic_061_control.png b/rooms/kq4-061-tower-stairs/pic_061_control.png new file mode 100644 index 0000000..1461cd4 Binary files /dev/null and b/rooms/kq4-061-tower-stairs/pic_061_control.png differ diff --git a/rooms/kq4-061-tower-stairs/pic_061_priority.png b/rooms/kq4-061-tower-stairs/pic_061_priority.png new file mode 100644 index 0000000..7cd6f5d Binary files /dev/null and b/rooms/kq4-061-tower-stairs/pic_061_priority.png differ diff --git a/rooms/kq4-061-tower-stairs/pic_061_visual.png b/rooms/kq4-061-tower-stairs/pic_061_visual.png new file mode 100644 index 0000000..85a0bc3 Binary files /dev/null and b/rooms/kq4-061-tower-stairs/pic_061_visual.png differ diff --git a/rooms/kq4-062-bedroom.md b/rooms/kq4-062-bedroom/kq4-062-bedroom.md similarity index 100% rename from rooms/kq4-062-bedroom.md rename to rooms/kq4-062-bedroom/kq4-062-bedroom.md diff --git a/rooms/kq4-062-bedroom/pic_062_control.png b/rooms/kq4-062-bedroom/pic_062_control.png new file mode 100644 index 0000000..7b47944 Binary files /dev/null and b/rooms/kq4-062-bedroom/pic_062_control.png differ diff --git a/rooms/kq4-062-bedroom/pic_062_priority.png b/rooms/kq4-062-bedroom/pic_062_priority.png new file mode 100644 index 0000000..55a76d1 Binary files /dev/null and b/rooms/kq4-062-bedroom/pic_062_priority.png differ diff --git a/rooms/kq4-062-bedroom/pic_062_visual.png b/rooms/kq4-062-bedroom/pic_062_visual.png new file mode 100644 index 0000000..ed6ddf6 Binary files /dev/null and b/rooms/kq4-062-bedroom/pic_062_visual.png differ diff --git a/rooms/kq4-063-attic.md b/rooms/kq4-063-attic/kq4-063-attic.md similarity index 100% rename from rooms/kq4-063-attic.md rename to rooms/kq4-063-attic/kq4-063-attic.md diff --git a/rooms/kq4-063-attic/pic_063_control.png b/rooms/kq4-063-attic/pic_063_control.png new file mode 100644 index 0000000..3c1f70f Binary files /dev/null and b/rooms/kq4-063-attic/pic_063_control.png differ diff --git a/rooms/kq4-063-attic/pic_063_priority.png b/rooms/kq4-063-attic/pic_063_priority.png new file mode 100644 index 0000000..91cd0e7 Binary files /dev/null and b/rooms/kq4-063-attic/pic_063_priority.png differ diff --git a/rooms/kq4-063-attic/pic_063_visual.png b/rooms/kq4-063-attic/pic_063_visual.png new file mode 100644 index 0000000..a82b7c8 Binary files /dev/null and b/rooms/kq4-063-attic/pic_063_visual.png differ diff --git a/rooms/kq4-064-old-dining-room.md b/rooms/kq4-064-old-dining-room/kq4-064-old-dining-room.md similarity index 100% rename from rooms/kq4-064-old-dining-room.md rename to rooms/kq4-064-old-dining-room/kq4-064-old-dining-room.md diff --git a/rooms/kq4-064-old-dining-room/pic_064_control.png b/rooms/kq4-064-old-dining-room/pic_064_control.png new file mode 100644 index 0000000..aaafe64 Binary files /dev/null and b/rooms/kq4-064-old-dining-room/pic_064_control.png differ diff --git a/rooms/kq4-064-old-dining-room/pic_064_priority.png b/rooms/kq4-064-old-dining-room/pic_064_priority.png new file mode 100644 index 0000000..f6ec043 Binary files /dev/null and b/rooms/kq4-064-old-dining-room/pic_064_priority.png differ diff --git a/rooms/kq4-064-old-dining-room/pic_064_visual.png b/rooms/kq4-064-old-dining-room/pic_064_visual.png new file mode 100644 index 0000000..57dd85b Binary files /dev/null and b/rooms/kq4-064-old-dining-room/pic_064_visual.png differ diff --git a/rooms/kq4-065-old-kitchen.md b/rooms/kq4-065-old-kitchen/kq4-065-old-kitchen.md similarity index 100% rename from rooms/kq4-065-old-kitchen.md rename to rooms/kq4-065-old-kitchen/kq4-065-old-kitchen.md diff --git a/rooms/kq4-065-old-kitchen/pic_065_control.png b/rooms/kq4-065-old-kitchen/pic_065_control.png new file mode 100644 index 0000000..1bbcf0f Binary files /dev/null and b/rooms/kq4-065-old-kitchen/pic_065_control.png differ diff --git a/rooms/kq4-065-old-kitchen/pic_065_priority.png b/rooms/kq4-065-old-kitchen/pic_065_priority.png new file mode 100644 index 0000000..8ca0bdd Binary files /dev/null and b/rooms/kq4-065-old-kitchen/pic_065_priority.png differ diff --git a/rooms/kq4-065-old-kitchen/pic_065_visual.png b/rooms/kq4-065-old-kitchen/pic_065_visual.png new file mode 100644 index 0000000..e6a101e Binary files /dev/null and b/rooms/kq4-065-old-kitchen/pic_065_visual.png differ diff --git a/rooms/kq4-066-secret-tower.md b/rooms/kq4-066-secret-tower/kq4-066-secret-tower.md similarity index 100% rename from rooms/kq4-066-secret-tower.md rename to rooms/kq4-066-secret-tower/kq4-066-secret-tower.md diff --git a/rooms/kq4-066-secret-tower/pic_066_control.png b/rooms/kq4-066-secret-tower/pic_066_control.png new file mode 100644 index 0000000..c574132 Binary files /dev/null and b/rooms/kq4-066-secret-tower/pic_066_control.png differ diff --git a/rooms/kq4-066-secret-tower/pic_066_priority.png b/rooms/kq4-066-secret-tower/pic_066_priority.png new file mode 100644 index 0000000..170bc56 Binary files /dev/null and b/rooms/kq4-066-secret-tower/pic_066_priority.png differ diff --git a/rooms/kq4-066-secret-tower/pic_066_visual.png b/rooms/kq4-066-secret-tower/pic_066_visual.png new file mode 100644 index 0000000..b2e02e8 Binary files /dev/null and b/rooms/kq4-066-secret-tower/pic_066_visual.png differ diff --git a/rooms/kq4-067-the-parlor.md b/rooms/kq4-067-the-parlor/kq4-067-the-parlor.md similarity index 100% rename from rooms/kq4-067-the-parlor.md rename to rooms/kq4-067-the-parlor/kq4-067-the-parlor.md diff --git a/rooms/kq4-067-the-parlor/pic_067_control.png b/rooms/kq4-067-the-parlor/pic_067_control.png new file mode 100644 index 0000000..f2e4b43 Binary files /dev/null and b/rooms/kq4-067-the-parlor/pic_067_control.png differ diff --git a/rooms/kq4-067-the-parlor/pic_067_priority.png b/rooms/kq4-067-the-parlor/pic_067_priority.png new file mode 100644 index 0000000..a0bb75e Binary files /dev/null and b/rooms/kq4-067-the-parlor/pic_067_priority.png differ diff --git a/rooms/kq4-067-the-parlor/pic_067_visual.png b/rooms/kq4-067-the-parlor/pic_067_visual.png new file mode 100644 index 0000000..337153d Binary files /dev/null and b/rooms/kq4-067-the-parlor/pic_067_visual.png differ diff --git a/rooms/kq4-068-the-foyer.md b/rooms/kq4-068-the-foyer/kq4-068-the-foyer.md similarity index 100% rename from rooms/kq4-068-the-foyer.md rename to rooms/kq4-068-the-foyer/kq4-068-the-foyer.md diff --git a/rooms/kq4-068-the-foyer/pic_068_control.png b/rooms/kq4-068-the-foyer/pic_068_control.png new file mode 100644 index 0000000..bdcf191 Binary files /dev/null and b/rooms/kq4-068-the-foyer/pic_068_control.png differ diff --git a/rooms/kq4-068-the-foyer/pic_068_priority.png b/rooms/kq4-068-the-foyer/pic_068_priority.png new file mode 100644 index 0000000..0b54b94 Binary files /dev/null and b/rooms/kq4-068-the-foyer/pic_068_priority.png differ diff --git a/rooms/kq4-068-the-foyer/pic_068_visual.png b/rooms/kq4-068-the-foyer/pic_068_visual.png new file mode 100644 index 0000000..310778e Binary files /dev/null and b/rooms/kq4-068-the-foyer/pic_068_visual.png differ diff --git a/rooms/kq4-069-the-crypt.md b/rooms/kq4-069-the-crypt/kq4-069-the-crypt.md similarity index 100% rename from rooms/kq4-069-the-crypt.md rename to rooms/kq4-069-the-crypt/kq4-069-the-crypt.md diff --git a/rooms/kq4-069-the-crypt/pic_069_control.png b/rooms/kq4-069-the-crypt/pic_069_control.png new file mode 100644 index 0000000..1e452b3 Binary files /dev/null and b/rooms/kq4-069-the-crypt/pic_069_control.png differ diff --git a/rooms/kq4-069-the-crypt/pic_069_priority.png b/rooms/kq4-069-the-crypt/pic_069_priority.png new file mode 100644 index 0000000..c8142d6 Binary files /dev/null and b/rooms/kq4-069-the-crypt/pic_069_priority.png differ diff --git a/rooms/kq4-069-the-crypt/pic_069_visual.png b/rooms/kq4-069-the-crypt/pic_069_visual.png new file mode 100644 index 0000000..5b7214c Binary files /dev/null and b/rooms/kq4-069-the-crypt/pic_069_visual.png differ diff --git a/rooms/070-waterfall-cave.md b/rooms/kq4-070-waterfall-cave/070-waterfall-cave.md similarity index 100% rename from rooms/070-waterfall-cave.md rename to rooms/kq4-070-waterfall-cave/070-waterfall-cave.md diff --git a/rooms/kq4-070-waterfall-cave/pic_070_control.png b/rooms/kq4-070-waterfall-cave/pic_070_control.png new file mode 100644 index 0000000..f6528f4 Binary files /dev/null and b/rooms/kq4-070-waterfall-cave/pic_070_control.png differ diff --git a/rooms/kq4-070-waterfall-cave/pic_070_priority.png b/rooms/kq4-070-waterfall-cave/pic_070_priority.png new file mode 100644 index 0000000..c4a6549 Binary files /dev/null and b/rooms/kq4-070-waterfall-cave/pic_070_priority.png differ diff --git a/rooms/kq4-070-waterfall-cave/pic_070_visual.png b/rooms/kq4-070-waterfall-cave/pic_070_visual.png new file mode 100644 index 0000000..1cf09af Binary files /dev/null and b/rooms/kq4-070-waterfall-cave/pic_070_visual.png differ diff --git a/rooms/kq4-071-cave-entrance.md b/rooms/kq4-071-cave-entrance/kq4-071-cave-entrance.md similarity index 100% rename from rooms/kq4-071-cave-entrance.md rename to rooms/kq4-071-cave-entrance/kq4-071-cave-entrance.md diff --git a/rooms/kq4-071-cave-entrance/pic_071_control.png b/rooms/kq4-071-cave-entrance/pic_071_control.png new file mode 100644 index 0000000..c2c5629 Binary files /dev/null and b/rooms/kq4-071-cave-entrance/pic_071_control.png differ diff --git a/rooms/kq4-071-cave-entrance/pic_071_priority.png b/rooms/kq4-071-cave-entrance/pic_071_priority.png new file mode 100644 index 0000000..144bcce Binary files /dev/null and b/rooms/kq4-071-cave-entrance/pic_071_priority.png differ diff --git a/rooms/kq4-071-cave-entrance/pic_071_visual.png b/rooms/kq4-071-cave-entrance/pic_071_visual.png new file mode 100644 index 0000000..d3cf1a8 Binary files /dev/null and b/rooms/kq4-071-cave-entrance/pic_071_visual.png differ diff --git a/rooms/kq4-072-dark-cave-passage.md b/rooms/kq4-072-dark-cave-passage/kq4-072-dark-cave-passage.md similarity index 100% rename from rooms/kq4-072-dark-cave-passage.md rename to rooms/kq4-072-dark-cave-passage/kq4-072-dark-cave-passage.md diff --git a/rooms/kq4-072-dark-cave-passage/pic_072_control.png b/rooms/kq4-072-dark-cave-passage/pic_072_control.png new file mode 100644 index 0000000..ff975cf Binary files /dev/null and b/rooms/kq4-072-dark-cave-passage/pic_072_control.png differ diff --git a/rooms/kq4-072-dark-cave-passage/pic_072_priority.png b/rooms/kq4-072-dark-cave-passage/pic_072_priority.png new file mode 100644 index 0000000..157c627 Binary files /dev/null and b/rooms/kq4-072-dark-cave-passage/pic_072_priority.png differ diff --git a/rooms/kq4-072-dark-cave-passage/pic_072_visual.png b/rooms/kq4-072-dark-cave-passage/pic_072_visual.png new file mode 100644 index 0000000..08fe334 Binary files /dev/null and b/rooms/kq4-072-dark-cave-passage/pic_072_visual.png differ diff --git a/rooms/kq4-073-cave-exit.md b/rooms/kq4-073-cave-exit/kq4-073-cave-exit.md similarity index 100% rename from rooms/kq4-073-cave-exit.md rename to rooms/kq4-073-cave-exit/kq4-073-cave-exit.md diff --git a/rooms/kq4-073-cave-exit/pic_073_control.png b/rooms/kq4-073-cave-exit/pic_073_control.png new file mode 100644 index 0000000..41b3ff1 Binary files /dev/null and b/rooms/kq4-073-cave-exit/pic_073_control.png differ diff --git a/rooms/kq4-073-cave-exit/pic_073_priority.png b/rooms/kq4-073-cave-exit/pic_073_priority.png new file mode 100644 index 0000000..e88142a Binary files /dev/null and b/rooms/kq4-073-cave-exit/pic_073_priority.png differ diff --git a/rooms/kq4-073-cave-exit/pic_073_visual.png b/rooms/kq4-073-cave-exit/pic_073_visual.png new file mode 100644 index 0000000..47e5f6c Binary files /dev/null and b/rooms/kq4-073-cave-exit/pic_073_visual.png differ diff --git a/rooms/kq4-074-troll-cave.md b/rooms/kq4-074-troll-cave/kq4-074-troll-cave.md similarity index 100% rename from rooms/kq4-074-troll-cave.md rename to rooms/kq4-074-troll-cave/kq4-074-troll-cave.md diff --git a/rooms/kq4-074-troll-cave/pic_074_control.png b/rooms/kq4-074-troll-cave/pic_074_control.png new file mode 100644 index 0000000..4ddd93c Binary files /dev/null and b/rooms/kq4-074-troll-cave/pic_074_control.png differ diff --git a/rooms/kq4-074-troll-cave/pic_074_priority.png b/rooms/kq4-074-troll-cave/pic_074_priority.png new file mode 100644 index 0000000..8b9f154 Binary files /dev/null and b/rooms/kq4-074-troll-cave/pic_074_priority.png differ diff --git a/rooms/kq4-074-troll-cave/pic_074_visual.png b/rooms/kq4-074-troll-cave/pic_074_visual.png new file mode 100644 index 0000000..08fe334 Binary files /dev/null and b/rooms/kq4-074-troll-cave/pic_074_visual.png differ diff --git a/rooms/kq4-075-troll-cave-passage.md b/rooms/kq4-075-troll-cave-passage/kq4-075-troll-cave-passage.md similarity index 100% rename from rooms/kq4-075-troll-cave-passage.md rename to rooms/kq4-075-troll-cave-passage/kq4-075-troll-cave-passage.md diff --git a/rooms/kq4-075-troll-cave-passage/pic_075_control.png b/rooms/kq4-075-troll-cave-passage/pic_075_control.png new file mode 100644 index 0000000..eb8a2d3 Binary files /dev/null and b/rooms/kq4-075-troll-cave-passage/pic_075_control.png differ diff --git a/rooms/kq4-075-troll-cave-passage/pic_075_priority.png b/rooms/kq4-075-troll-cave-passage/pic_075_priority.png new file mode 100644 index 0000000..a3253bf Binary files /dev/null and b/rooms/kq4-075-troll-cave-passage/pic_075_priority.png differ diff --git a/rooms/kq4-075-troll-cave-passage/pic_075_visual.png b/rooms/kq4-075-troll-cave-passage/pic_075_visual.png new file mode 100644 index 0000000..08fe334 Binary files /dev/null and b/rooms/kq4-075-troll-cave-passage/pic_075_visual.png differ diff --git a/rooms/kq4-076-dark-chasm.md b/rooms/kq4-076-dark-chasm/kq4-076-dark-chasm.md similarity index 100% rename from rooms/kq4-076-dark-chasm.md rename to rooms/kq4-076-dark-chasm/kq4-076-dark-chasm.md diff --git a/rooms/kq4-076-dark-chasm/pic_076_control.png b/rooms/kq4-076-dark-chasm/pic_076_control.png new file mode 100644 index 0000000..776d2b1 Binary files /dev/null and b/rooms/kq4-076-dark-chasm/pic_076_control.png differ diff --git a/rooms/kq4-076-dark-chasm/pic_076_priority.png b/rooms/kq4-076-dark-chasm/pic_076_priority.png new file mode 100644 index 0000000..ce6139f Binary files /dev/null and b/rooms/kq4-076-dark-chasm/pic_076_priority.png differ diff --git a/rooms/kq4-076-dark-chasm/pic_076_visual.png b/rooms/kq4-076-dark-chasm/pic_076_visual.png new file mode 100644 index 0000000..fce873b Binary files /dev/null and b/rooms/kq4-076-dark-chasm/pic_076_visual.png differ diff --git a/rooms/kq4-077-swamp.md b/rooms/kq4-077-swamp/kq4-077-swamp.md similarity index 100% rename from rooms/kq4-077-swamp.md rename to rooms/kq4-077-swamp/kq4-077-swamp.md diff --git a/rooms/kq4-077-swamp/pic_077_control.png b/rooms/kq4-077-swamp/pic_077_control.png new file mode 100644 index 0000000..cf0c551 Binary files /dev/null and b/rooms/kq4-077-swamp/pic_077_control.png differ diff --git a/rooms/kq4-077-swamp/pic_077_priority.png b/rooms/kq4-077-swamp/pic_077_priority.png new file mode 100644 index 0000000..67dffdc Binary files /dev/null and b/rooms/kq4-077-swamp/pic_077_priority.png differ diff --git a/rooms/kq4-077-swamp/pic_077_visual.png b/rooms/kq4-077-swamp/pic_077_visual.png new file mode 100644 index 0000000..c1dd2c6 Binary files /dev/null and b/rooms/kq4-077-swamp/pic_077_visual.png differ diff --git a/rooms/kq4-078-swamp-island.md b/rooms/kq4-078-swamp-island/kq4-078-swamp-island.md similarity index 100% rename from rooms/kq4-078-swamp-island.md rename to rooms/kq4-078-swamp-island/kq4-078-swamp-island.md diff --git a/rooms/kq4-078-swamp-island/pic_078_control.png b/rooms/kq4-078-swamp-island/pic_078_control.png new file mode 100644 index 0000000..ce1b4af Binary files /dev/null and b/rooms/kq4-078-swamp-island/pic_078_control.png differ diff --git a/rooms/kq4-078-swamp-island/pic_078_priority.png b/rooms/kq4-078-swamp-island/pic_078_priority.png new file mode 100644 index 0000000..94552f5 Binary files /dev/null and b/rooms/kq4-078-swamp-island/pic_078_priority.png differ diff --git a/rooms/kq4-078-swamp-island/pic_078_visual.png b/rooms/kq4-078-swamp-island/pic_078_visual.png new file mode 100644 index 0000000..d548683 Binary files /dev/null and b/rooms/kq4-078-swamp-island/pic_078_visual.png differ diff --git a/rooms/kq4-079-mountain-path-to-dark-castle.md b/rooms/kq4-079-mountain-path-to-dark-castle/kq4-079-mountain-path-to-dark-castle.md similarity index 100% rename from rooms/kq4-079-mountain-path-to-dark-castle.md rename to rooms/kq4-079-mountain-path-to-dark-castle/kq4-079-mountain-path-to-dark-castle.md diff --git a/rooms/kq4-079-mountain-path-to-dark-castle/pic_079_control.png b/rooms/kq4-079-mountain-path-to-dark-castle/pic_079_control.png new file mode 100644 index 0000000..51b02be Binary files /dev/null and b/rooms/kq4-079-mountain-path-to-dark-castle/pic_079_control.png differ diff --git a/rooms/kq4-079-mountain-path-to-dark-castle/pic_079_priority.png b/rooms/kq4-079-mountain-path-to-dark-castle/pic_079_priority.png new file mode 100644 index 0000000..4e42a4e Binary files /dev/null and b/rooms/kq4-079-mountain-path-to-dark-castle/pic_079_priority.png differ diff --git a/rooms/kq4-079-mountain-path-to-dark-castle/pic_079_visual.png b/rooms/kq4-079-mountain-path-to-dark-castle/pic_079_visual.png new file mode 100644 index 0000000..bee7790 Binary files /dev/null and b/rooms/kq4-079-mountain-path-to-dark-castle/pic_079_visual.png differ diff --git a/rooms/kq4-080-lolottes-castle-entrance.md b/rooms/kq4-080-lolottes-castle-entrance/kq4-080-lolottes-castle-entrance.md similarity index 100% rename from rooms/kq4-080-lolottes-castle-entrance.md rename to rooms/kq4-080-lolottes-castle-entrance/kq4-080-lolottes-castle-entrance.md diff --git a/rooms/kq4-080-lolottes-castle-entrance/pic_080_control.png b/rooms/kq4-080-lolottes-castle-entrance/pic_080_control.png new file mode 100644 index 0000000..1bba88a Binary files /dev/null and b/rooms/kq4-080-lolottes-castle-entrance/pic_080_control.png differ diff --git a/rooms/kq4-080-lolottes-castle-entrance/pic_080_priority.png b/rooms/kq4-080-lolottes-castle-entrance/pic_080_priority.png new file mode 100644 index 0000000..5e4aabe Binary files /dev/null and b/rooms/kq4-080-lolottes-castle-entrance/pic_080_priority.png differ diff --git a/rooms/kq4-080-lolottes-castle-entrance/pic_080_visual.png b/rooms/kq4-080-lolottes-castle-entrance/pic_080_visual.png new file mode 100644 index 0000000..a3c811e Binary files /dev/null and b/rooms/kq4-080-lolottes-castle-entrance/pic_080_visual.png differ diff --git a/rooms/kq4-081-edgars-tower-bedroom.md b/rooms/kq4-081-edgars-tower-bedroom/kq4-081-edgars-tower-bedroom.md similarity index 100% rename from rooms/kq4-081-edgars-tower-bedroom.md rename to rooms/kq4-081-edgars-tower-bedroom/kq4-081-edgars-tower-bedroom.md diff --git a/rooms/kq4-081-edgars-tower-bedroom/pic_081_control.png b/rooms/kq4-081-edgars-tower-bedroom/pic_081_control.png new file mode 100644 index 0000000..cc3cad3 Binary files /dev/null and b/rooms/kq4-081-edgars-tower-bedroom/pic_081_control.png differ diff --git a/rooms/kq4-081-edgars-tower-bedroom/pic_081_priority.png b/rooms/kq4-081-edgars-tower-bedroom/pic_081_priority.png new file mode 100644 index 0000000..2eb91c9 Binary files /dev/null and b/rooms/kq4-081-edgars-tower-bedroom/pic_081_priority.png differ diff --git a/rooms/kq4-081-edgars-tower-bedroom/pic_081_visual.png b/rooms/kq4-081-edgars-tower-bedroom/pic_081_visual.png new file mode 100644 index 0000000..471634e Binary files /dev/null and b/rooms/kq4-081-edgars-tower-bedroom/pic_081_visual.png differ diff --git a/rooms/kq4-082-lolottes-tower-bedroom.md b/rooms/kq4-082-lolottes-tower-bedroom/kq4-082-lolottes-tower-bedroom.md similarity index 100% rename from rooms/kq4-082-lolottes-tower-bedroom.md rename to rooms/kq4-082-lolottes-tower-bedroom/kq4-082-lolottes-tower-bedroom.md diff --git a/rooms/kq4-082-lolottes-tower-bedroom/pic_082_control.png b/rooms/kq4-082-lolottes-tower-bedroom/pic_082_control.png new file mode 100644 index 0000000..9182afd Binary files /dev/null and b/rooms/kq4-082-lolottes-tower-bedroom/pic_082_control.png differ diff --git a/rooms/kq4-082-lolottes-tower-bedroom/pic_082_priority.png b/rooms/kq4-082-lolottes-tower-bedroom/pic_082_priority.png new file mode 100644 index 0000000..a1a07ed Binary files /dev/null and b/rooms/kq4-082-lolottes-tower-bedroom/pic_082_priority.png differ diff --git a/rooms/kq4-082-lolottes-tower-bedroom/pic_082_visual.png b/rooms/kq4-082-lolottes-tower-bedroom/pic_082_visual.png new file mode 100644 index 0000000..95d733d Binary files /dev/null and b/rooms/kq4-082-lolottes-tower-bedroom/pic_082_visual.png differ diff --git a/rooms/kq4-083-castle-dungeon-cell.md b/rooms/kq4-083-castle-dungeon-cell/kq4-083-castle-dungeon-cell.md similarity index 100% rename from rooms/kq4-083-castle-dungeon-cell.md rename to rooms/kq4-083-castle-dungeon-cell/kq4-083-castle-dungeon-cell.md diff --git a/rooms/kq4-083-castle-dungeon-cell/pic_083_control.png b/rooms/kq4-083-castle-dungeon-cell/pic_083_control.png new file mode 100644 index 0000000..6638602 Binary files /dev/null and b/rooms/kq4-083-castle-dungeon-cell/pic_083_control.png differ diff --git a/rooms/kq4-083-castle-dungeon-cell/pic_083_priority.png b/rooms/kq4-083-castle-dungeon-cell/pic_083_priority.png new file mode 100644 index 0000000..b02e8c2 Binary files /dev/null and b/rooms/kq4-083-castle-dungeon-cell/pic_083_priority.png differ diff --git a/rooms/kq4-083-castle-dungeon-cell/pic_083_visual.png b/rooms/kq4-083-castle-dungeon-cell/pic_083_visual.png new file mode 100644 index 0000000..0b6259e Binary files /dev/null and b/rooms/kq4-083-castle-dungeon-cell/pic_083_visual.png differ diff --git a/rooms/kq4-084-cottage-front.md b/rooms/kq4-084-cottage-front/kq4-084-cottage-front.md similarity index 100% rename from rooms/kq4-084-cottage-front.md rename to rooms/kq4-084-cottage-front/kq4-084-cottage-front.md diff --git a/rooms/kq4-084-cottage-front/pic_084_control.png b/rooms/kq4-084-cottage-front/pic_084_control.png new file mode 100644 index 0000000..a831d15 Binary files /dev/null and b/rooms/kq4-084-cottage-front/pic_084_control.png differ diff --git a/rooms/kq4-084-cottage-front/pic_084_priority.png b/rooms/kq4-084-cottage-front/pic_084_priority.png new file mode 100644 index 0000000..57dfd8b Binary files /dev/null and b/rooms/kq4-084-cottage-front/pic_084_priority.png differ diff --git a/rooms/kq4-084-cottage-front/pic_084_visual.png b/rooms/kq4-084-cottage-front/pic_084_visual.png new file mode 100644 index 0000000..d14c197 Binary files /dev/null and b/rooms/kq4-084-cottage-front/pic_084_visual.png differ diff --git a/rooms/kq4-085-dark-tower-stairs.md b/rooms/kq4-085-dark-tower-stairs/kq4-085-dark-tower-stairs.md similarity index 100% rename from rooms/kq4-085-dark-tower-stairs.md rename to rooms/kq4-085-dark-tower-stairs/kq4-085-dark-tower-stairs.md diff --git a/rooms/kq4-085-dark-tower-stairs/pic_085_control.png b/rooms/kq4-085-dark-tower-stairs/pic_085_control.png new file mode 100644 index 0000000..9cc5634 Binary files /dev/null and b/rooms/kq4-085-dark-tower-stairs/pic_085_control.png differ diff --git a/rooms/kq4-085-dark-tower-stairs/pic_085_priority.png b/rooms/kq4-085-dark-tower-stairs/pic_085_priority.png new file mode 100644 index 0000000..fad0fec Binary files /dev/null and b/rooms/kq4-085-dark-tower-stairs/pic_085_priority.png differ diff --git a/rooms/kq4-085-dark-tower-stairs/pic_085_visual.png b/rooms/kq4-085-dark-tower-stairs/pic_085_visual.png new file mode 100644 index 0000000..5d695e9 Binary files /dev/null and b/rooms/kq4-085-dark-tower-stairs/pic_085_visual.png differ diff --git a/rooms/kq4-086-dim-hallway-west-end.md b/rooms/kq4-086-dim-hallway-west-end/kq4-086-dim-hallway-west-end.md similarity index 100% rename from rooms/kq4-086-dim-hallway-west-end.md rename to rooms/kq4-086-dim-hallway-west-end/kq4-086-dim-hallway-west-end.md diff --git a/rooms/kq4-086-dim-hallway-west-end/pic_086_control.png b/rooms/kq4-086-dim-hallway-west-end/pic_086_control.png new file mode 100644 index 0000000..9004250 Binary files /dev/null and b/rooms/kq4-086-dim-hallway-west-end/pic_086_control.png differ diff --git a/rooms/kq4-086-dim-hallway-west-end/pic_086_priority.png b/rooms/kq4-086-dim-hallway-west-end/pic_086_priority.png new file mode 100644 index 0000000..280ca0e Binary files /dev/null and b/rooms/kq4-086-dim-hallway-west-end/pic_086_priority.png differ diff --git a/rooms/kq4-086-dim-hallway-west-end/pic_086_visual.png b/rooms/kq4-086-dim-hallway-west-end/pic_086_visual.png new file mode 100644 index 0000000..39c08c7 Binary files /dev/null and b/rooms/kq4-086-dim-hallway-west-end/pic_086_visual.png differ diff --git a/rooms/kq4-087-east-end-of-hallway.md b/rooms/kq4-087-east-end-of-hallway/kq4-087-east-end-of-hallway.md similarity index 100% rename from rooms/kq4-087-east-end-of-hallway.md rename to rooms/kq4-087-east-end-of-hallway/kq4-087-east-end-of-hallway.md diff --git a/rooms/kq4-087-east-end-of-hallway/pic_087_control.png b/rooms/kq4-087-east-end-of-hallway/pic_087_control.png new file mode 100644 index 0000000..f329547 Binary files /dev/null and b/rooms/kq4-087-east-end-of-hallway/pic_087_control.png differ diff --git a/rooms/kq4-087-east-end-of-hallway/pic_087_priority.png b/rooms/kq4-087-east-end-of-hallway/pic_087_priority.png new file mode 100644 index 0000000..6b00456 Binary files /dev/null and b/rooms/kq4-087-east-end-of-hallway/pic_087_priority.png differ diff --git a/rooms/kq4-087-east-end-of-hallway/pic_087_visual.png b/rooms/kq4-087-east-end-of-hallway/pic_087_visual.png new file mode 100644 index 0000000..7d37bc6 Binary files /dev/null and b/rooms/kq4-087-east-end-of-hallway/pic_087_visual.png differ diff --git a/rooms/kq4-088-stone-tower-stairs.md b/rooms/kq4-088-stone-tower-stairs/kq4-088-stone-tower-stairs.md similarity index 100% rename from rooms/kq4-088-stone-tower-stairs.md rename to rooms/kq4-088-stone-tower-stairs/kq4-088-stone-tower-stairs.md diff --git a/rooms/kq4-088-stone-tower-stairs/pic_088_control.png b/rooms/kq4-088-stone-tower-stairs/pic_088_control.png new file mode 100644 index 0000000..db6a2b0 Binary files /dev/null and b/rooms/kq4-088-stone-tower-stairs/pic_088_control.png differ diff --git a/rooms/kq4-088-stone-tower-stairs/pic_088_priority.png b/rooms/kq4-088-stone-tower-stairs/pic_088_priority.png new file mode 100644 index 0000000..86c1ad1 Binary files /dev/null and b/rooms/kq4-088-stone-tower-stairs/pic_088_priority.png differ diff --git a/rooms/kq4-088-stone-tower-stairs/pic_088_visual.png b/rooms/kq4-088-stone-tower-stairs/pic_088_visual.png new file mode 100644 index 0000000..424fde2 Binary files /dev/null and b/rooms/kq4-088-stone-tower-stairs/pic_088_visual.png differ diff --git a/rooms/kq4-089-castle-kitchen.md b/rooms/kq4-089-castle-kitchen/kq4-089-castle-kitchen.md similarity index 100% rename from rooms/kq4-089-castle-kitchen.md rename to rooms/kq4-089-castle-kitchen/kq4-089-castle-kitchen.md diff --git a/rooms/kq4-089-castle-kitchen/pic_089_control.png b/rooms/kq4-089-castle-kitchen/pic_089_control.png new file mode 100644 index 0000000..855ebcb Binary files /dev/null and b/rooms/kq4-089-castle-kitchen/pic_089_control.png differ diff --git a/rooms/kq4-089-castle-kitchen/pic_089_priority.png b/rooms/kq4-089-castle-kitchen/pic_089_priority.png new file mode 100644 index 0000000..32ff552 Binary files /dev/null and b/rooms/kq4-089-castle-kitchen/pic_089_priority.png differ diff --git a/rooms/kq4-089-castle-kitchen/pic_089_visual.png b/rooms/kq4-089-castle-kitchen/pic_089_visual.png new file mode 100644 index 0000000..abe4496 Binary files /dev/null and b/rooms/kq4-089-castle-kitchen/pic_089_visual.png differ diff --git a/rooms/kq4-090-west-tower-bottom.md b/rooms/kq4-090-west-tower-bottom/kq4-090-west-tower-bottom.md similarity index 100% rename from rooms/kq4-090-west-tower-bottom.md rename to rooms/kq4-090-west-tower-bottom/kq4-090-west-tower-bottom.md diff --git a/rooms/kq4-090-west-tower-bottom/pic_090_control.png b/rooms/kq4-090-west-tower-bottom/pic_090_control.png new file mode 100644 index 0000000..a932b16 Binary files /dev/null and b/rooms/kq4-090-west-tower-bottom/pic_090_control.png differ diff --git a/rooms/kq4-090-west-tower-bottom/pic_090_priority.png b/rooms/kq4-090-west-tower-bottom/pic_090_priority.png new file mode 100644 index 0000000..ba65dc3 Binary files /dev/null and b/rooms/kq4-090-west-tower-bottom/pic_090_priority.png differ diff --git a/rooms/kq4-090-west-tower-bottom/pic_090_visual.png b/rooms/kq4-090-west-tower-bottom/pic_090_visual.png new file mode 100644 index 0000000..e189fcd Binary files /dev/null and b/rooms/kq4-090-west-tower-bottom/pic_090_visual.png differ diff --git a/rooms/kq4-091-castle-dining-room.md b/rooms/kq4-091-castle-dining-room/kq4-091-castle-dining-room.md similarity index 100% rename from rooms/kq4-091-castle-dining-room.md rename to rooms/kq4-091-castle-dining-room/kq4-091-castle-dining-room.md diff --git a/rooms/kq4-091-castle-dining-room/pic_091_control.png b/rooms/kq4-091-castle-dining-room/pic_091_control.png new file mode 100644 index 0000000..5759d1a Binary files /dev/null and b/rooms/kq4-091-castle-dining-room/pic_091_control.png differ diff --git a/rooms/kq4-091-castle-dining-room/pic_091_priority.png b/rooms/kq4-091-castle-dining-room/pic_091_priority.png new file mode 100644 index 0000000..39a733a Binary files /dev/null and b/rooms/kq4-091-castle-dining-room/pic_091_priority.png differ diff --git a/rooms/kq4-091-castle-dining-room/pic_091_visual.png b/rooms/kq4-091-castle-dining-room/pic_091_visual.png new file mode 100644 index 0000000..029c06e Binary files /dev/null and b/rooms/kq4-091-castle-dining-room/pic_091_visual.png differ diff --git a/rooms/kq4-092-lolottes-throne-room.md b/rooms/kq4-092-lolottes-throne-room/kq4-092-lolottes-throne-room.md similarity index 100% rename from rooms/kq4-092-lolottes-throne-room.md rename to rooms/kq4-092-lolottes-throne-room/kq4-092-lolottes-throne-room.md diff --git a/rooms/kq4-092-lolottes-throne-room/pic_092_control.png b/rooms/kq4-092-lolottes-throne-room/pic_092_control.png new file mode 100644 index 0000000..bc66e58 Binary files /dev/null and b/rooms/kq4-092-lolottes-throne-room/pic_092_control.png differ diff --git a/rooms/kq4-092-lolottes-throne-room/pic_092_priority.png b/rooms/kq4-092-lolottes-throne-room/pic_092_priority.png new file mode 100644 index 0000000..0fa9579 Binary files /dev/null and b/rooms/kq4-092-lolottes-throne-room/pic_092_priority.png differ diff --git a/rooms/kq4-092-lolottes-throne-room/pic_092_visual.png b/rooms/kq4-092-lolottes-throne-room/pic_092_visual.png new file mode 100644 index 0000000..cb8c54c Binary files /dev/null and b/rooms/kq4-092-lolottes-throne-room/pic_092_visual.png differ diff --git a/rooms/kq4-093-bottom-of-east-tower.md b/rooms/kq4-093-bottom-of-east-tower/kq4-093-bottom-of-east-tower.md similarity index 100% rename from rooms/kq4-093-bottom-of-east-tower.md rename to rooms/kq4-093-bottom-of-east-tower/kq4-093-bottom-of-east-tower.md diff --git a/rooms/kq4-093-bottom-of-east-tower/pic_093_control.png b/rooms/kq4-093-bottom-of-east-tower/pic_093_control.png new file mode 100644 index 0000000..e577da5 Binary files /dev/null and b/rooms/kq4-093-bottom-of-east-tower/pic_093_control.png differ diff --git a/rooms/kq4-093-bottom-of-east-tower/pic_093_priority.png b/rooms/kq4-093-bottom-of-east-tower/pic_093_priority.png new file mode 100644 index 0000000..1d2abb7 Binary files /dev/null and b/rooms/kq4-093-bottom-of-east-tower/pic_093_priority.png differ diff --git a/rooms/kq4-093-bottom-of-east-tower/pic_093_visual.png b/rooms/kq4-093-bottom-of-east-tower/pic_093_visual.png new file mode 100644 index 0000000..6b1491e Binary files /dev/null and b/rooms/kq4-093-bottom-of-east-tower/pic_093_visual.png differ diff --git a/rooms/kq4-094-unicorn-stable.md b/rooms/kq4-094-unicorn-stable/kq4-094-unicorn-stable.md similarity index 100% rename from rooms/kq4-094-unicorn-stable.md rename to rooms/kq4-094-unicorn-stable/kq4-094-unicorn-stable.md diff --git a/rooms/kq4-094-unicorn-stable/pic_094_control.png b/rooms/kq4-094-unicorn-stable/pic_094_control.png new file mode 100644 index 0000000..dd6dd0d Binary files /dev/null and b/rooms/kq4-094-unicorn-stable/pic_094_control.png differ diff --git a/rooms/kq4-094-unicorn-stable/pic_094_priority.png b/rooms/kq4-094-unicorn-stable/pic_094_priority.png new file mode 100644 index 0000000..381edf2 Binary files /dev/null and b/rooms/kq4-094-unicorn-stable/pic_094_priority.png differ diff --git a/rooms/kq4-094-unicorn-stable/pic_094_visual.png b/rooms/kq4-094-unicorn-stable/pic_094_visual.png new file mode 100644 index 0000000..9f289a3 Binary files /dev/null and b/rooms/kq4-094-unicorn-stable/pic_094_visual.png differ diff --git a/rooms/kq4-095-fishermans-pier.md b/rooms/kq4-095-fishermans-pier/kq4-095-fishermans-pier.md similarity index 100% rename from rooms/kq4-095-fishermans-pier.md rename to rooms/kq4-095-fishermans-pier/kq4-095-fishermans-pier.md diff --git a/rooms/kq4-095-fishermans-pier/pic_095_control.png b/rooms/kq4-095-fishermans-pier/pic_095_control.png new file mode 100644 index 0000000..6517b51 Binary files /dev/null and b/rooms/kq4-095-fishermans-pier/pic_095_control.png differ diff --git a/rooms/kq4-095-fishermans-pier/pic_095_priority.png b/rooms/kq4-095-fishermans-pier/pic_095_priority.png new file mode 100644 index 0000000..9880898 Binary files /dev/null and b/rooms/kq4-095-fishermans-pier/pic_095_priority.png differ diff --git a/rooms/kq4-095-fishermans-pier/pic_095_visual.png b/rooms/kq4-095-fishermans-pier/pic_095_visual.png new file mode 100644 index 0000000..191314c Binary files /dev/null and b/rooms/kq4-095-fishermans-pier/pic_095_visual.png differ diff --git a/rooms/kq4-098-transitional-room.md b/rooms/kq4-098-transitional-room/kq4-098-transitional-room.md similarity index 100% rename from rooms/kq4-098-transitional-room.md rename to rooms/kq4-098-transitional-room/kq4-098-transitional-room.md diff --git a/rooms/kq4-099-transitional-room.md b/rooms/kq4-099-transitional-room/kq4-099-transitional-room.md similarity index 100% rename from rooms/kq4-099-transitional-room.md rename to rooms/kq4-099-transitional-room/kq4-099-transitional-room.md diff --git a/sci_pic_render b/sci_pic_render new file mode 100755 index 0000000..94f9f87 Binary files /dev/null and b/sci_pic_render differ diff --git a/sci_pic_render.c b/sci_pic_render.c new file mode 100644 index 0000000..b1c5468 --- /dev/null +++ b/sci_pic_render.c @@ -0,0 +1,959 @@ +/* + * SCI Picture Resource Renderer + * + * Renders PIC resources from Sierra SCI games (SCI0 format) to PNG images. + * Based on rendering algorithms from SCICompanion by Philip Fortier. + * + * Usage: sci_pic_render [output_directory] + * + * Compile: gcc -o sci_pic_render sci_pic_render.c -lpng -lz -lm -O2 + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define WIDTH 320 +#define HEIGHT 190 +#define MAX_PATH 4096 + +/* PIC opcodes */ +#define PIC_OP_SET_COLOR 0xf0 +#define PIC_OP_DISABLE_VISUAL 0xf1 +#define PIC_OP_SET_PRIORITY 0xf2 +#define PIC_OP_DISABLE_PRIORITY 0xf3 +#define PIC_OP_RELATIVE_PATTERNS 0xf4 +#define PIC_OP_RELATIVE_MEDIUM_LINES 0xf5 +#define PIC_OP_RELATIVE_LONG_LINES 0xf6 +#define PIC_OP_RELATIVE_SHORT_LINES 0xf7 +#define PIC_OP_FILL 0xf8 +#define PIC_OP_SET_PATTERN 0xf9 +#define PIC_OP_ABSOLUTE_PATTERNS 0xfa +#define PIC_OP_SET_CONTROL 0xfb +#define PIC_OP_DISABLE_CONTROL 0xfc +#define PIC_OP_RELATIVE_MEDIUM_PATTERNS 0xfd +#define PIC_OP_OPX 0xfe +#define PIC_OP_END 0xff + +#define PATTERN_FLAG_RECTANGLE 0x10 +#define PATTERN_FLAG_USE_PATTERN 0x20 + +#define PALETTE_SIZE 40 + +/* Circle patterns for pen tool */ +static const uint8_t circles[][30] = { + {0x80}, + {0x4e, 0x40}, + {0x73, 0xef, 0xbe, 0x70}, + {0x38, 0x7c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x00}, + {0x1c, 0x1f, 0xcf, 0xfb, 0xfe, 0xff, 0xbf, 0xef, 0xf9, 0xfc, 0x1c}, + {0x0e, 0x03, 0xf8, 0x7f, 0xc7, 0xfc, 0xff, 0xef, 0xfe, 0xff, 0xe7, + 0xfc, 0x7f, 0xc3, 0xf8, 0x1f, 0x00}, + {0x0f, 0x80, 0xff, 0x87, 0xff, 0x1f, 0xfc, 0xff, 0xfb, 0xff, 0xef, + 0xff, 0xbf, 0xfe, 0xff, 0xf9, 0xff, 0xc7, 0xff, 0x0f, 0xf8, 0x0f, 0x80}, + {0x07, 0xc0, 0x1f, 0xf0, 0x3f, 0xf8, 0x7f, 0xfc, 0x7f, 0xfc, 0xff, + 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0x7f, + 0xfc, 0x7f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf0, 0x07, 0xc0} +}; + +static const uint8_t junq[32] = { + 0x20, 0x94, 0x02, 0x24, 0x90, 0x82, 0xa4, 0xa2, 0x82, 0x09, 0x0a, 0x22, + 0x12, 0x10, 0x42, 0x14, 0x91, 0x4a, 0x91, 0x11, 0x08, 0x12, 0x25, 0x10, + 0x22, 0xa8, 0x14, 0x24, 0x00, 0x50, 0x24, 0x04 +}; + +static const uint8_t junqindex[128] = { + 0x00, 0x18, 0x30, 0xc4, 0xdc, 0x65, 0xeb, 0x48, + 0x60, 0xbd, 0x89, 0x05, 0x0a, 0xf4, 0x7d, 0x7d, + 0x85, 0xb0, 0x8e, 0x95, 0x1f, 0x22, 0x0d, 0xdf, + 0x2a, 0x78, 0xd5, 0x73, 0x1c, 0xb4, 0x40, 0xa1, + 0xb9, 0x3c, 0xca, 0x58, 0x92, 0x34, 0xcc, 0xce, + 0xd7, 0x42, 0x90, 0x0f, 0x8b, 0x7f, 0x32, 0xed, + 0x5c, 0x9d, 0xc8, 0x99, 0xad, 0x4e, 0x56, 0xa6, + 0xf7, 0x68, 0xb7, 0x25, 0x82, 0x37, 0x3a, 0x51, + 0x69, 0x26, 0x38, 0x52, 0x9e, 0x9a, 0x4f, 0xa7, + 0x43, 0x10, 0x80, 0xee, 0x3d, 0x59, 0x35, 0xcf, + 0x79, 0x74, 0xb5, 0xa2, 0xb1, 0x96, 0x23, 0xe0, + 0xbe, 0x05, 0xf5, 0x6e, 0x19, 0xc5, 0x66, 0x49, + 0xf0, 0xd1, 0x54, 0xa9, 0x70, 0x4b, 0xa4, 0xe2, + 0xe6, 0xe5, 0xab, 0xe4, 0xd2, 0xaa, 0x4c, 0xe3, + 0x06, 0x6f, 0xc6, 0x4a, 0xa4, 0x75, 0x97, 0xe1 +}; + +static const uint8_t default_palette_init[PALETTE_SIZE] = { + 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0x88, + 0x88, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x88, + 0x88, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + 0x08, 0x91, 0x2a, 0x3b, 0x4c, 0x5d, 0x6e, 0x88 +}; + +typedef struct { + uint8_t color1; + uint8_t color2; +} EGACOLOR; + +typedef struct { + uint8_t visual[HEIGHT][WIDTH]; + uint8_t priority[HEIGHT][WIDTH]; + uint8_t control[HEIGHT][WIDTH]; + uint8_t aux[HEIGHT][WIDTH]; + EGACOLOR palettes[4][PALETTE_SIZE]; + uint8_t locked[PALETTE_SIZE]; + + uint8_t palette_number; + uint8_t palette_offset; + EGACOLOR ega_color; + uint8_t current_priority; + uint8_t current_control; + uint8_t draw_enable; + uint8_t palette_to_draw; + uint8_t pattern_size; + uint8_t pattern_nr; + bool pattern_use_pattern; + bool pattern_is_rect; +} PicRenderer; + +#define PIC_SCREEN_VISUAL 0x01 +#define PIC_SCREEN_PRIORITY 0x02 +#define PIC_SCREEN_CONTROL 0x04 + +static void renderer_init(PicRenderer *r) { + memset(r, 0, sizeof(*r)); + memset(r->visual, 0x0f, sizeof(r->visual)); + + for (int p = 0; p < 4; p++) { + for (int i = 0; i < PALETTE_SIZE; i++) { + r->palettes[p][i].color1 = (default_palette_init[i] >> 4) & 0x0f; + r->palettes[p][i].color2 = default_palette_init[i] & 0x0f; + } + } + + r->draw_enable = PIC_SCREEN_VISUAL; +} + +static bool is_white(PicRenderer *r) { + return r->ega_color.color1 == 15 && r->ega_color.color2 == 15; +} + +static uint8_t get_aux_set(PicRenderer *r) { + uint8_t aux = r->draw_enable; + if (r->ega_color.color1 == 15 && r->ega_color.color2 == 15) { + aux &= ~PIC_SCREEN_VISUAL; + } + if (r->current_priority == 0) { + aux &= ~PIC_SCREEN_PRIORITY; + } + if (r->current_control == 0) { + aux &= ~PIC_SCREEN_CONTROL; + } + return aux; +} + +#define BUFFEROFFSET(cx, cy, x, y) (((cy) - 1 - (y)) * (cx) + (x)) + +static void plot_pixel(PicRenderer *r, int x, int y) { + if (x < 0 || y < 0 || x >= WIDTH || y >= HEIGHT) return; + + uint8_t aux_set = get_aux_set(r); + + if (r->draw_enable & PIC_SCREEN_VISUAL) { + uint8_t color_idx = ((x ^ y) & 1) ? r->ega_color.color1 : r->ega_color.color2; + r->visual[y][x] = color_idx; + } + if (r->draw_enable & PIC_SCREEN_PRIORITY) { + r->priority[y][x] = r->current_priority; + } + if (r->draw_enable & PIC_SCREEN_CONTROL) { + r->control[y][x] = r->current_control; + } + r->aux[y][x] |= aux_set; +} + +static void draw_line(PicRenderer *r, int x1, int y1, int x2, int y2) { + int dx = abs(x2 - x1); + int dy = abs(y2 - y1); + int sx = (x1 < x2) ? 1 : -1; + int sy = (y1 < y2) ? 1 : -1; + int err = dx - dy; + + while (1) { + plot_pixel(r, x1, y1); + if (x1 == x2 && y1 == y2) break; + int e2 = 2 * err; + if (e2 > -dy) { err -= dy; x1 += sx; } + if (e2 < dx) { err += dx; y1 += sy; } + } +} + +static void draw_pattern(PicRenderer *r, int x, int y, int size, int pattern_nr, bool use_pattern, bool is_rect) { + int wsize = size; + int x_max = WIDTH - 1; + int y_max = HEIGHT - 1; + + if (x < wsize) x = wsize; + if (x + wsize > x_max) x = x_max - wsize; + if (y < wsize) y = wsize; + if (y + wsize > y_max) y = y_max - wsize; + + if (pattern_nr >= 128) return; + + uint8_t junqbit = junqindex[pattern_nr]; + + if (is_rect) { + for (int ly = y - wsize; ly <= y + wsize; ly++) { + for (int lx = x - wsize; lx <= x + wsize + 1; lx++) { + if (use_pattern) { + if ((junq[junqbit >> 3] >> (7 - (junqbit & 7))) & 1) { + plot_pixel(r, lx, ly); + } + junqbit = (junqbit + 1) & 0xFF; + } else { + plot_pixel(r, lx, ly); + } + } + } + } else { + int circlebit = 0; + const uint8_t *circle_data = circles[size]; + for (int ly = y - wsize; ly <= y + wsize; ly++) { + for (int lx = x - wsize; lx <= x + wsize + 1; lx++) { + bool circle_on = (circle_data[circlebit >> 3] >> (7 - (circlebit & 7))) & 1; + if (circle_on) { + if (use_pattern) { + if ((junq[junqbit >> 3] >> (7 - (junqbit & 7))) & 1) { + plot_pixel(r, lx, ly); + } + junqbit = (junqbit + 1) & 0xFF; + } else { + plot_pixel(r, lx, ly); + } + } + circlebit++; + } + } + } +} + +static bool fill_bounds(PicRenderer *r, int x, int y, uint8_t draw_enable) { + uint8_t aux = r->aux[y][x]; + uint8_t overlap = draw_enable & aux; + if (overlap) { + if ((draw_enable & PIC_SCREEN_VISUAL) && (r->visual[y][x] == 0x0f)) { + return false; + } + return true; + } + return false; +} + +static bool ok_to_fill(PicRenderer *r, int x, int y, uint8_t draw_enable) { + if (x < 0 || y < 0 || x >= WIDTH || y >= HEIGHT) return false; + return !fill_bounds(r, x, y, draw_enable); +} + +typedef struct { int x, y; } Point; +#define MAX_FILL_STACK (WIDTH * HEIGHT) + +static void flood_fill(PicRenderer *r, int start_x, int start_y) { + if (start_x < 0 || start_x >= WIDTH || start_y < 0 || start_y >= HEIGHT) return; + + uint8_t aux_set = get_aux_set(r); + uint8_t draw_enable = aux_set; + + if (is_white(r)) return; + if (draw_enable == 0) return; + if (fill_bounds(r, start_x, start_y, draw_enable)) return; + + Point *stack = malloc(MAX_FILL_STACK * sizeof(Point)); + if (!stack) return; + + int stack_pos = 0; + stack[stack_pos++] = (Point){start_x, start_y}; + + int x_max = WIDTH - 1; + int y_max = HEIGHT - 1; + + while (stack_pos > 0) { + Point p = stack[--stack_pos]; + int x = p.x, y = p.y; + + if (!ok_to_fill(r, x, y, draw_enable)) continue; + + if (draw_enable & PIC_SCREEN_VISUAL) { + r->visual[y][x] = ((x ^ y) & 1) ? r->ega_color.color1 : r->ega_color.color2; + } + if (draw_enable & PIC_SCREEN_PRIORITY) { + r->priority[y][x] = r->current_priority; + } + if (draw_enable & PIC_SCREEN_CONTROL) { + r->control[y][x] = r->current_control; + } + r->aux[y][x] |= aux_set; + + if (y > 0 && ok_to_fill(r, x, y - 1, draw_enable) && stack_pos < MAX_FILL_STACK) + stack[stack_pos++] = (Point){x, y - 1}; + if (x > 0 && ok_to_fill(r, x - 1, y, draw_enable) && stack_pos < MAX_FILL_STACK) + stack[stack_pos++] = (Point){x - 1, y}; + if (x < x_max && ok_to_fill(r, x + 1, y, draw_enable) && stack_pos < MAX_FILL_STACK) + stack[stack_pos++] = (Point){x + 1, y}; + if (y < y_max && ok_to_fill(r, x, y + 1, draw_enable) && stack_pos < MAX_FILL_STACK) + stack[stack_pos++] = (Point){x, y + 1}; + } + + free(stack); +} + +static void read_abs_coords(const uint8_t *data, size_t *i, int *x, int *y) { + uint8_t prefix = data[(*i)++]; + *x = data[(*i)++] | ((prefix & 0xF0) << 4); + *y = data[(*i)++] | ((prefix & 0x0F) << 8); +} + +static void render_pic(PicRenderer *r, const uint8_t *data, size_t len) { + size_t i = 0; + int x = 0, y = 0; + + while (i < len) { + uint8_t opcode = data[i++]; + + if (opcode == PIC_OP_END) break; + + switch (opcode) { + case PIC_OP_SET_COLOR: { + uint8_t color_code = data[i++]; + uint8_t palette_num = color_code / PALETTE_SIZE; + uint8_t palette_offset = color_code % PALETTE_SIZE; + uint8_t palette_to_use = palette_num ? palette_num : r->palette_to_draw; + + r->palette_number = palette_num; + r->palette_offset = palette_offset; + + if (r->locked[palette_offset]) { + r->ega_color = r->palettes[0][palette_offset]; + } else { + r->ega_color = r->palettes[palette_to_use][palette_offset]; + } + r->draw_enable |= PIC_SCREEN_VISUAL; + break; + } + + case PIC_OP_DISABLE_VISUAL: + r->draw_enable &= ~PIC_SCREEN_VISUAL; + break; + + case PIC_OP_SET_PRIORITY: + r->current_priority = data[i++] & 0x0F; + r->draw_enable |= PIC_SCREEN_PRIORITY; + break; + + case PIC_OP_DISABLE_PRIORITY: + r->draw_enable &= ~PIC_SCREEN_PRIORITY; + break; + + case PIC_OP_SET_CONTROL: + r->current_control = data[i++]; + r->draw_enable |= PIC_SCREEN_CONTROL; + break; + + case PIC_OP_DISABLE_CONTROL: + r->draw_enable &= ~PIC_SCREEN_CONTROL; + break; + + case PIC_OP_RELATIVE_MEDIUM_LINES: + read_abs_coords(data, &i, &x, &y); + while (i < len && data[i] < 0xF0) { + uint8_t by = data[i++]; + uint8_t bx = data[i++]; + int dy = (by & 0x80) ? -(by & 0x7F) : (by & 0x7F); + int dx = (int8_t)bx; + draw_line(r, x, y, x + dx, y + dy); + x += dx; + y += dy; + } + break; + + case PIC_OP_RELATIVE_LONG_LINES: + read_abs_coords(data, &i, &x, &y); + while (i < len && data[i] < 0xF0) { + int x2, y2; + read_abs_coords(data, &i, &x2, &y2); + draw_line(r, x, y, x2, y2); + x = x2; + y = y2; + } + break; + + case PIC_OP_RELATIVE_SHORT_LINES: + read_abs_coords(data, &i, &x, &y); + while (i < len && data[i] < 0xF0) { + uint8_t b = data[i++]; + int dx = (b & 0x80) ? -((b >> 4) & 0x7) : ((b >> 4) & 0x7); + int dy = (b & 0x08) ? -(b & 0x7) : (b & 0x7); + draw_line(r, x, y, x + dx, y + dy); + x += dx; + y += dy; + } + break; + + case PIC_OP_FILL: + while (i < len && data[i] < 0xF0) { + int fx, fy; + read_abs_coords(data, &i, &fx, &fy); + flood_fill(r, fx, fy); + } + break; + + case PIC_OP_RELATIVE_PATTERNS: { + uint8_t pattern_nr_byte = 0; + if (r->pattern_use_pattern && i < len && data[i] < 0xF0) { + pattern_nr_byte = data[i++]; + } + read_abs_coords(data, &i, &x, &y); + draw_pattern(r, x, y, r->pattern_size, (pattern_nr_byte >> 1) & 0x7f, + r->pattern_use_pattern, r->pattern_is_rect); + + while (i < len && data[i] < 0xF0) { + pattern_nr_byte = 0; + if (r->pattern_use_pattern && i < len && data[i] < 0xF0) { + pattern_nr_byte = data[i++]; + } + uint8_t b = data[i++]; + int dx = (b & 0x80) ? -((b >> 4) & 0x7) : ((b >> 4) & 0x7); + int dy = (b & 0x08) ? -(b & 0x7) : (b & 0x7); + x += dx; + y += dy; + draw_pattern(r, x, y, r->pattern_size, (pattern_nr_byte >> 1) & 0x7f, + r->pattern_use_pattern, r->pattern_is_rect); + } + break; + } + + case PIC_OP_ABSOLUTE_PATTERNS: + while (i < len && data[i] < 0xF0) { + uint8_t pattern_nr_byte = 0; + if (r->pattern_use_pattern && i < len && data[i] < 0xF0) { + pattern_nr_byte = data[i++]; + } + read_abs_coords(data, &i, &x, &y); + draw_pattern(r, x, y, r->pattern_size, (pattern_nr_byte >> 1) & 0x7f, + r->pattern_use_pattern, r->pattern_is_rect); + } + break; + + case PIC_OP_RELATIVE_MEDIUM_PATTERNS: { + uint8_t pattern_nr_byte = 0; + if (r->pattern_use_pattern && i < len && data[i] < 0xF0) { + pattern_nr_byte = data[i++]; + } + read_abs_coords(data, &i, &x, &y); + draw_pattern(r, x, y, r->pattern_size, (pattern_nr_byte >> 1) & 0x7f, + r->pattern_use_pattern, r->pattern_is_rect); + + while (i < len && data[i] < 0xF0) { + pattern_nr_byte = 0; + if (r->pattern_use_pattern && i < len && data[i] < 0xF0) { + pattern_nr_byte = data[i++]; + } + uint8_t by = data[i++]; + uint8_t bx = data[i++]; + int dy = (by & 0x80) ? -(by & 0x7F) : (by & 0x7F); + int dx = (int8_t)bx; + x += dx; + y += dy; + draw_pattern(r, x, y, r->pattern_size, (pattern_nr_byte >> 1) & 0x7f, + r->pattern_use_pattern, r->pattern_is_rect); + } + break; + } + + case PIC_OP_SET_PATTERN: { + if (i < len && data[i] < 0xF0) { + uint8_t val = data[i++] & 0x37; + r->pattern_size = val & 0x07; + r->pattern_is_rect = (val & PATTERN_FLAG_RECTANGLE) != 0; + r->pattern_use_pattern = (val & PATTERN_FLAG_USE_PATTERN) != 0; + } + break; + } + + case PIC_OP_OPX: { + if (i >= len) break; + uint8_t ext = data[i++]; + + if (ext == 0x00) { + while (i < len && data[i] < 0xF0) { + uint8_t b_index = data[i++]; + uint8_t b_color = data[i++]; + uint8_t pal_num = b_index / PALETTE_SIZE; + uint8_t pal_offset = b_index % PALETTE_SIZE; + if (pal_num < 4) { + r->palettes[pal_num][pal_offset].color1 = (b_color >> 4) & 0x0f; + r->palettes[pal_num][pal_offset].color2 = b_color & 0x0f; + if (pal_num == 0) { + r->locked[pal_offset] = 0xff; + } + } + } + } else if (ext == 0x01) { + uint8_t pal_num = data[i++]; + for (int j = 0; j < PALETTE_SIZE; j++) { + uint8_t b_color = data[i++]; + r->palettes[pal_num][j].color1 = (b_color >> 4) & 0x0f; + r->palettes[pal_num][j].color2 = b_color & 0x0f; + } + if (pal_num == r->palette_number) { + r->ega_color = r->palettes[pal_num][r->palette_offset]; + } + } else if (ext == 0x08) { + i += 14; + } + break; + } + + default: + break; + } + } +} + +static uint8_t *decompress_lzw(const uint8_t *src, size_t src_len, size_t dest_len) { + uint8_t *dest = calloc(dest_len, 1); + if (!dest) return NULL; + + int bitlen = 9; + int bitmask = 0x01ff; + int bitctr = 0; + size_t bytectr = 0; + + uint16_t tokenlist[4096]; + uint16_t tokenlengthlist[4096]; + int tokenctr = 0x102; + int maxtoken = 0x200; + + int tokenlastlength = 0; + size_t destctr = 0; + + while (bytectr < src_len && destctr < dest_len) { + uint32_t tokenmaker = src[bytectr] >> bitctr; + if (bytectr + 1 < src_len) tokenmaker |= (src[bytectr + 1] << (8 - bitctr)); + if (bytectr + 2 < src_len) tokenmaker |= (src[bytectr + 2] << (16 - bitctr)); + + uint16_t token = tokenmaker & bitmask; + + bitctr += bitlen - 8; + while (bitctr >= 8) { bitctr -= 8; bytectr++; } + bytectr++; + + if (token == 0x101) break; + + if (token == 0x100) { + maxtoken = 0x200; + bitlen = 9; + bitmask = 0x01ff; + tokenctr = 0x102; + } else { + if (token > 0xff) { + if (token < tokenctr) { + tokenlastlength = tokenlengthlist[token] + 1; + for (int i = 0; i < tokenlastlength && destctr < dest_len; i++) { + dest[destctr++] = dest[tokenlist[token] + i]; + } + } + } else { + tokenlastlength = 1; + dest[destctr++] = token; + } + + if (tokenctr == maxtoken && bitlen < 12) { + bitlen++; + bitmask = (bitmask << 1) | 1; + maxtoken <<= 1; + } + + if (tokenctr < 4096) { + tokenlist[tokenctr] = destctr - tokenlastlength; + tokenlengthlist[tokenctr] = tokenlastlength; + tokenctr++; + } + } + } + + return dest; +} + +static uint8_t *decompress_huffman(const uint8_t *src, size_t src_len, size_t dest_len) { + uint8_t *dest = calloc(dest_len, 1); + if (!dest || src_len < 2) return dest; + + size_t destctr = 0; + uint8_t numnodes = src[0]; + uint8_t terminator = src[1]; + size_t bytectr = 2 + (numnodes << 1); + int bitctr = 0; + + const uint8_t *nodes = &src[2]; + + while (bytectr < src_len && destctr < dest_len) { + int node_idx = 0; + + while (nodes[node_idx * 2 + 1] != 0) { + if (bytectr >= src_len) break; + + uint8_t value = (src[bytectr] << bitctr) & 0xFF; + bitctr++; + if (bitctr == 8) { bitctr = 0; bytectr++; } + + int next_node; + if (value & 0x80) { + next_node = nodes[node_idx * 2 + 1] & 0x0f; + if (next_node == 0) { + if (bytectr >= src_len) break; + uint16_t result = (src[bytectr] << bitctr) & 0xFF; + bytectr++; + if (bytectr < src_len) result |= src[bytectr] >> (8 - bitctr); + result &= 0xff; + + if (result == terminator) goto done; + if (destctr < dest_len) dest[destctr++] = result; + break; + } + } else { + next_node = nodes[node_idx * 2 + 1] >> 4; + } + node_idx += next_node; + } + + if (nodes[node_idx * 2 + 1] == 0) { + uint16_t value = nodes[node_idx * 2] | (nodes[node_idx * 2 + 1] << 8); + if (value == (0x100 | terminator)) break; + if (destctr < dest_len) dest[destctr++] = value & 0xFF; + } + } + +done: + return dest; +} + +typedef struct { + int type; + int number; + int package; + uint32_t offset; +} ResourceEntry; + +typedef struct { + ResourceEntry *entries; + int count; + int capacity; +} ResourceMap; + +static int resource_map_add(ResourceMap *map, int type, int number, int package, uint32_t offset) { + if (map->count >= map->capacity) { + int new_cap = map->capacity ? map->capacity * 2 : 256; + ResourceEntry *new_entries = realloc(map->entries, new_cap * sizeof(ResourceEntry)); + if (!new_entries) return -1; + map->entries = new_entries; + map->capacity = new_cap; + } + map->entries[map->count].type = type; + map->entries[map->count].number = number; + map->entries[map->count].package = package; + map->entries[map->count].offset = offset; + return map->count++; +} + +static bool read_resource_map(const char *game_dir, ResourceMap *map) { + char path[MAX_PATH]; + snprintf(path, sizeof(path), "%s/RESOURCE.MAP", game_dir); + + FILE *f = fopen(path, "rb"); + if (!f) return false; + + uint8_t buf[6]; + size_t n; + + while ((n = fread(buf, 1, 6, f)) == 6) { + uint16_t word = buf[0] | (buf[1] << 8); + uint32_t dword = buf[2] | (buf[3] << 8) | (buf[4] << 16) | (buf[5] << 24); + + if (word == 0xFFFF && dword == 0xFFFFFFFF) break; + + int number = word & 0x7FF; + int type = (word >> 11) & 0x1F; + uint32_t offset = dword & 0x3FFFFFF; + int package = (dword >> 26) & 0x3F; + + resource_map_add(map, type, number, package, offset); + } + + fclose(f); + return true; +} + +typedef struct { + uint8_t method; + uint16_t compressed_size; + uint16_t decompressed_size; +} ResourceHeader; + +static bool read_resource_header(const char *game_dir, int package, uint32_t offset, ResourceHeader *hdr) { + char path[MAX_PATH]; + snprintf(path, sizeof(path), "%s/RESOURCE.%03d", game_dir, package); + + FILE *f = fopen(path, "rb"); + if (!f) return false; + + if (fseek(f, offset, SEEK_SET) != 0) { + fclose(f); + return false; + } + + uint8_t buf[8]; + if (fread(buf, 1, 8, f) != 8) { + fclose(f); + return false; + } + + uint16_t method_word = buf[6] | (buf[7] << 8); + hdr->method = method_word; + hdr->compressed_size = buf[2] | (buf[3] << 8); + hdr->decompressed_size = buf[4] | (buf[5] << 8); + + fclose(f); + return true; +} + +static uint8_t *read_resource_data(const char *game_dir, int package, uint32_t offset, + uint16_t comp_size, uint16_t decomp_size, uint8_t method) { + char path[MAX_PATH]; + snprintf(path, sizeof(path), "%s/RESOURCE.%03d", game_dir, package); + + FILE *f = fopen(path, "rb"); + if (!f) return NULL; + + if (fseek(f, offset + 8, SEEK_SET) != 0) { + fclose(f); + return NULL; + } + + size_t actual_comp_size = comp_size - 4; + uint8_t *comp_data = malloc(actual_comp_size); + if (!comp_data) { + fclose(f); + return NULL; + } + + if (fread(comp_data, 1, actual_comp_size, f) != actual_comp_size) { + free(comp_data); + fclose(f); + return NULL; + } + fclose(f); + + uint8_t *data; + if (method == 0) { + data = malloc(decomp_size); + if (data) memcpy(data, comp_data, decomp_size); + } else if (method == 1) { + data = decompress_lzw(comp_data, actual_comp_size, decomp_size); + } else if (method == 2) { + data = decompress_huffman(comp_data, actual_comp_size, decomp_size); + } else { + data = NULL; + } + + free(comp_data); + return data; +} + +static const uint8_t ega_colors[16][3] = { + {0x00, 0x00, 0x00}, {0x00, 0x00, 0xA0}, {0x00, 0xA0, 0x00}, {0x00, 0xA0, 0xA0}, + {0xA0, 0x00, 0x00}, {0xA0, 0x00, 0xA0}, {0xA0, 0x50, 0x00}, {0xA0, 0xA0, 0xA0}, + {0x50, 0x50, 0x50}, {0x50, 0x50, 0xFF}, {0x00, 0xFF, 0x50}, {0x50, 0xFF, 0xFF}, + {0xFF, 0x50, 0x50}, {0xFF, 0x50, 0xFF}, {0xFF, 0xFF, 0x50}, {0xFF, 0xFF, 0xFF}, +}; + +static bool save_png(const char *filename, uint8_t pixels[HEIGHT][WIDTH], bool use_palette) { + FILE *f = fopen(filename, "wb"); + if (!f) return false; + + png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (!png) { fclose(f); return false; } + + png_infop info = png_create_info_struct(png); + if (!info) { png_destroy_write_struct(&png, NULL); fclose(f); return false; } + + if (setjmp(png_jmpbuf(png))) { + png_destroy_write_struct(&png, &info); + fclose(f); + return false; + } + + png_init_io(png, f); + + if (use_palette) { + png_set_IHDR(png, info, WIDTH, HEIGHT, 8, PNG_COLOR_TYPE_PALETTE, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + + png_color palette[16]; + for (int i = 0; i < 16; i++) { + palette[i].red = ega_colors[i][0]; + palette[i].green = ega_colors[i][1]; + palette[i].blue = ega_colors[i][2]; + } + png_set_PLTE(png, info, palette, 16); + } else { + png_set_IHDR(png, info, WIDTH, HEIGHT, 8, PNG_COLOR_TYPE_GRAY, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + } + + png_write_info(png, info); + + png_bytep row = malloc(WIDTH); + for (int y = 0; y < HEIGHT; y++) { + if (use_palette) { + memcpy(row, pixels[y], WIDTH); + } else { + for (int x = 0; x < WIDTH; x++) { + row[x] = pixels[y][x] * 17; + } + } + png_write_row(png, row); + } + free(row); + + png_write_end(png, NULL); + png_destroy_write_struct(&png, &info); + fclose(f); + + return true; +} + +static bool save_rgb_png(const char *filename, uint8_t visual[HEIGHT][WIDTH]) { + FILE *f = fopen(filename, "wb"); + if (!f) return false; + + png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (!png) { fclose(f); return false; } + + png_infop info = png_create_info_struct(png); + if (!info) { png_destroy_write_struct(&png, NULL); fclose(f); return false; } + + if (setjmp(png_jmpbuf(png))) { + png_destroy_write_struct(&png, &info); + fclose(f); + return false; + } + + png_init_io(png, f); + png_set_IHDR(png, info, WIDTH, HEIGHT, 8, PNG_COLOR_TYPE_RGB, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + + png_write_info(png, info); + + png_bytep row = malloc(WIDTH * 3); + for (int y = 0; y < HEIGHT; y++) { + for (int x = 0; x < WIDTH; x++) { + uint8_t idx = visual[y][x] & 0x0f; + row[x * 3 + 0] = ega_colors[idx][0]; + row[x * 3 + 1] = ega_colors[idx][1]; + row[x * 3 + 2] = ega_colors[idx][2]; + } + png_write_row(png, row); + } + free(row); + + png_write_end(png, NULL); + png_destroy_write_struct(&png, &info); + fclose(f); + + return true; +} + +static ResourceEntry *find_resource(ResourceMap *map, int type, int number) { + for (int i = 0; i < map->count; i++) { + if (map->entries[i].type == type && map->entries[i].number == number) { + return &map->entries[i]; + } + } + return NULL; +} + +static void print_usage(const char *prog) { + fprintf(stderr, "Usage: %s [output_dir]\n", prog); + fprintf(stderr, "\nRenders SCI PIC resources to PNG images.\n"); + fprintf(stderr, "\nArguments:\n"); + fprintf(stderr, " room_number PIC resource number to render\n"); + fprintf(stderr, " resource_dir Directory containing RESOURCE.MAP and RESOURCE.* files\n"); + fprintf(stderr, " output_dir Output directory (default: rooms/)\n"); +} + +int main(int argc, char *argv[]) { + if (argc < 3) { + print_usage(argv[0]); + return 1; + } + + int room_number = atoi(argv[1]); + const char *game_dir = argv[2]; + const char *output_dir = (argc > 3) ? argv[3] : "rooms"; + + ResourceMap map = {0}; + if (!read_resource_map(game_dir, &map)) { + fprintf(stderr, "Error: Could not read RESOURCE.MAP from %s\n", game_dir); + return 1; + } + + ResourceEntry *entry = find_resource(&map, 1, room_number); + if (!entry) { + fprintf(stderr, "Error: PIC %d not found\n", room_number); + free(map.entries); + return 1; + } + + ResourceHeader hdr; + if (!read_resource_header(game_dir, entry->package, entry->offset, &hdr)) { + fprintf(stderr, "Error: Could not read resource header\n"); + free(map.entries); + return 1; + } + + printf("PIC %d: package=%d, method=%d, compressed=%d, decompressed=%d\n", + room_number, entry->package, hdr.method, hdr.compressed_size, hdr.decompressed_size); + + uint8_t *data = read_resource_data(game_dir, entry->package, entry->offset, + hdr.compressed_size, hdr.decompressed_size, hdr.method); + if (!data) { + fprintf(stderr, "Error: Could not decompress resource\n"); + free(map.entries); + return 1; + } + + PicRenderer renderer; + renderer_init(&renderer); + render_pic(&renderer, data, hdr.decompressed_size); + free(data); + free(map.entries); + + char path[MAX_PATH]; + snprintf(path, sizeof(path), "%s/pic_%03d_visual.png", output_dir, room_number); + if (!save_rgb_png(path, renderer.visual)) { + fprintf(stderr, "Error: Could not save %s\n", path); + return 1; + } + printf("Saved: %s\n", path); + + snprintf(path, sizeof(path), "%s/pic_%03d_priority.png", output_dir, room_number); + save_png(path, renderer.priority, false); + + snprintf(path, sizeof(path), "%s/pic_%03d_control.png", output_dir, room_number); + save_png(path, renderer.control, false); + + return 0; +}