218 lines
9.2 KiB
Markdown
218 lines
9.2 KiB
Markdown
# Ratdoku
|
||
|
||
A cozy rat-hotel logic puzzle. Every guest gets a room, a floor, a corridor, and a little space from the neighbours.
|
||
|
||
## Run it
|
||
|
||
1. Install **Godot 4.7 or newer** (standard edition, not .NET).
|
||
2. Open this folder in Godot (`project.godot`).
|
||
3. Press **F5**.
|
||
|
||
The project uses a portrait **360×640 dp canvas**, scaled to a 540×960 desktop window. On a tall phone it expands vertically instead of stretching the UI.
|
||
|
||
## How to play
|
||
|
||
- **Tap / left-click** a cell to mark it with an X. Tap an X or a guest to clear it.
|
||
- **Press and hold** (mobile) or **right-click** (PC) to check a guest in. Hold or right-click a guest to check them out.
|
||
- A gold ring fills while you hold; at the hold threshold (default 0.35 s) the guest is placed.
|
||
- **Undo** and **Hint** are at the bottom. **Restart room** and **Back to lobby** live in the in-level settings sheet.
|
||
- A **gold ring** around a guest means they are already checked in and cannot be moved.
|
||
- Win when every room, floor, and corridor has exactly one rat and no two rats touch — even diagonally.
|
||
- **No guessing is required.** Every room has exactly one solution.
|
||
|
||
## Each room has its own guest
|
||
|
||
Every level assigns **eight distinct guests** to its eight coloured rooms. The guest is the same across the whole room, so a blue room is always one specific rat, the yellow room another, and so on. The assignment is deterministic per level, and a level never repeats a guest across two rooms.
|
||
|
||
The board uses circular **head tokens** from `art/guests/heads/`. Crumb remains the host and appears on Home and in the win overlay.
|
||
|
||
### Pattern mode and the room legend
|
||
|
||
- **Pattern mode is on by default.** Each room carries a distinct motif — paw, cheese, key, bed, bell, leaf, fish, star — drawn over the colour. Turn it off in Settings for flat colours.
|
||
- A **room legend** above the board shows the eight guests for the level, one per region colour. Solved rooms get a gold ring.
|
||
- The **gear in the top-right opens settings over the puzzle**, so patterns, timer, motion, and hold time can change without leaving the room. **Resume** is the primary action; restarting is deliberately secondary.
|
||
|
||
## Screens
|
||
|
||
- **Home** — top hub with Crumb avatar, guest progress, and settings; Continue/Check in; Guest Book; House Rules.
|
||
- **Game** — top bar, rule strip for the first three rooms, room legend, board, timer, undo/hint, in-level settings, win overlay.
|
||
- **The Guest Book** — 25 guests: five residents unlocked from the start, the other 20 unlocked one per room. Locked cards show a very faint portrait under `???` and their room number.
|
||
- **Settings** — a bottom sheet over Home or the board: room patterns, timer, reduce motion, hold time, how to play, restart/back, reset progress.
|
||
- **House Rules** — four illustrated rules, controls, tips, FAQ, and an interactive 5×5 practice board.
|
||
|
||
## Unlocks
|
||
|
||
- **Residents** (available from the start): Miso, Hilde, Pip, Nana Fig, Biscuit.
|
||
- **Room guests**: Pepper (Room 1) through Marmalade (Room 20).
|
||
- **Rooms 21–30** are bonus rooms. They use the same guest cast on the board but do not unlock a new Guest Book entry.
|
||
- Completing a room unlocks its guest and adds a “New guest” card to the win overlay.
|
||
- Crumb is the host and has a pinned card; she is not one of the 25.
|
||
|
||
## Levels
|
||
|
||
`data/levels.json` contains **30 verified 8×8 puzzles**: 20 guest rooms plus 10 bonus rooms. Every board is generated from a legal solution, split into eight connected rooms, and checked for a single solution. Each starts with three gold-ringed guests.
|
||
|
||
## Project layout
|
||
|
||
```
|
||
scenes/
|
||
Main.tscn entry point + screen navigation
|
||
Home.tscn title screen
|
||
Game.tscn board screen + HUD + win overlay
|
||
Board.tscn custom-drawn board
|
||
GuestBook.tscn gallery
|
||
SettingsSheet.tscn bottom-sheet settings
|
||
Rulebook.tscn house rules + interactive tutorial
|
||
scripts/
|
||
Main.gd navigation/back stack + sheet routing
|
||
Home.gd top hub + home screen
|
||
Game.gd level flow, legend, rule strip, timer, win overlay
|
||
Board.gd rounded tiles, motifs, input, undo, hints, per-room guests
|
||
Rules.gd pure win/conflict rules
|
||
Levels.gd JSON level loader
|
||
Guests.gd guest manifest loader
|
||
SaveGame.gd autoload: settings + progress
|
||
GuestBook.gd gallery, locked cards, detail sheet
|
||
SettingsSheet.gd shared settings sheet
|
||
Rulebook.gd handbook content + 5×5 tutorial
|
||
MiniDiagram.gd rule illustrations
|
||
Palette.gd colours
|
||
UI.gd 360dp tokens, fonts, buttons, icons
|
||
Version.gd version/build label
|
||
RatPortrait.gd fallback vector mascot
|
||
assets/
|
||
fonts/ Fredoka + Nunito (OFL)
|
||
icons/ Lucide SVG icon set
|
||
art/
|
||
crumb.png full mascot
|
||
crumb_head.png circular head token used on Home/win
|
||
guests/
|
||
cards/<id>.png 512 detail portraits
|
||
thumbs/<id>.png 256 gallery thumbnails
|
||
heads/<id>.png 256 circular board tokens
|
||
source/ 1024 originals, raw renders, contact sheets (ignored by Godot/export)
|
||
data/
|
||
levels.json 30 verified 8×8 puzzles
|
||
guests.json 25 guest entries
|
||
tutorial.json 5×5 practice puzzle
|
||
tools/
|
||
generate_levels.gd headless 8×8 generator (appends new rooms)
|
||
smoke_test.gd rules/board smoke test
|
||
ui_test.gd settings/gallery/unlock/tutorial test
|
||
screenshot.gd dev screenshots
|
||
build_android.ps1 Android export helper
|
||
workflows/ Krea2 guest-generation variants
|
||
export_presets.cfg Android debug preset
|
||
build/Ratdoku.apk installable debug APK
|
||
```
|
||
|
||
## Save data
|
||
|
||
`user://ratdoku_save.json` stores completed rooms, unlocked guests, `last_room`, and settings. “Reset progress” clears rooms and unlocks but keeps settings.
|
||
|
||
## Regenerate levels
|
||
|
||
```powershell
|
||
& "C:\Program Files (x86)\Steam\steamapps\common\Godot Engine\godot.windows.opt.tools.64.exe" `
|
||
--headless --path . --script res://tools/generate_levels.gd
|
||
```
|
||
|
||
The generator appends until `data/levels.json` contains 30 rooms. It keeps the existing pack and only creates the missing rooms.
|
||
|
||
## Guest art
|
||
|
||
The 25 guest portraits were generated from the `Krea2_Turbo_Uncensored` ComfyUI workflow with a shared chibi/gouache prompt and per-character props. The final prompt variants are in `tools/workflows/final_guests/`.
|
||
|
||
Runtime assets:
|
||
|
||
- `art/guests/heads/<id>.png` — board tokens
|
||
- `art/guests/cards/<id>.png` — detail portraits
|
||
- `art/guests/thumbs/<id>.png` — gallery thumbnails
|
||
|
||
Source 1024 renders and contact sheets live in `art/guests/source/` and are excluded from the Android export.
|
||
|
||
## Android APK
|
||
|
||
The current APK is:
|
||
|
||
```
|
||
build/Ratdoku.apk
|
||
```
|
||
|
||
It is a **debug-signed, arm64-v8a** APK:
|
||
|
||
- Package: `com.ratdoku.game`
|
||
- Version: `0.4.0` (version code 4)
|
||
- Min SDK: 24 (Android 7.0)
|
||
- Target SDK: 36
|
||
- Size: about 41 MB
|
||
- Portrait orientation
|
||
- Build label: `v0.4.0-alpha · build 2026-12-02`
|
||
|
||
To install, copy the APK to the phone, open it, and allow “Install unknown apps” for the file manager/browser. Or with a USB-connected phone and USB debugging:
|
||
|
||
```powershell
|
||
& "E:\AndroidTools\sdk\platform-tools\adb.exe" install -r "E:\Ahri\Documents\Ratdoku\Development\build\Ratdoku.apk"
|
||
```
|
||
|
||
### Toolchain
|
||
|
||
The local Android build uses:
|
||
|
||
- JDK: `E:\AndroidTools\jdk-17.0.21.1+2`
|
||
- Android SDK: `E:\AndroidTools\sdk`
|
||
- Build tools: `35.0.0`
|
||
- Godot editor settings: `export/android/android_sdk_path`, `java_sdk_path`, debug keystore.
|
||
|
||
Rebuild with:
|
||
|
||
```powershell
|
||
.\tools\build_android.ps1
|
||
```
|
||
|
||
If you want a Play Store build, switch `gradle_build/export_format` to AAB, use a release keystore, and set `package/signed` appropriately. The current APK is for direct testing, not store upload.
|
||
|
||
## Tests
|
||
|
||
```powershell
|
||
& "C:\Program Files (x86)\Steam\steamapps\common\Godot Engine\godot.windows.opt.tools.64.exe" `
|
||
--headless --path . --script res://tools/smoke_test.gd
|
||
```
|
||
|
||
```powershell
|
||
& "C:\Program Files (x86)\Steam\steamapps\common\Godot Engine\godot.windows.opt.tools.64.exe" `
|
||
--headless --path . --script res://tools/ui_test.gd
|
||
```
|
||
|
||
`ui_test.gd` checks settings propagation, room-1 → Pepper unlock, gallery progress, and the interactive 5×5 tutorial. Both tests reset the save when they finish.
|
||
|
||
## Versioning and releases
|
||
|
||
The current development build is **v0.4.0-alpha** (“Lobby Redesign”) with the build label on Home and in Settings.
|
||
|
||
Gitea repository:
|
||
|
||
`https://gitea.nyxara.cc/Ahri-the-Vastaya/Ratdoku`
|
||
|
||
Alpha releases (all marked prerelease, each with a debug APK and source archive):
|
||
|
||
- **v0.1.0-alpha** — first playable 20-room prototype
|
||
- **v0.2.0-alpha** — Guest Book, Settings, House Rules, 25 guests
|
||
- **v0.3.0-alpha** — 30 rooms, unique guest per room, Android APK
|
||
- `redesign-360` — branch with the 360dp redesign work
|
||
|
||
The version is set in three places: `project.godot` (`config/version`), `scripts/Version.gd` (display label), and `export_presets.cfg` (`version/name`, `version/code`).
|
||
|
||
## Current scope
|
||
|
||
- 30 verified 8×8 rooms (20 guest rooms + 10 bonus)
|
||
- Unique guest per room per level
|
||
- 360dp layout, Fredoka/Nunito typography, Lucide icons
|
||
- Playful rounded tiles, 8 pattern motifs, room legend
|
||
- In-level settings sheet with patterns/timer/motion/hold/restart/lobby
|
||
- Interactive 5×5 tutorial
|
||
- 25 guest portraits + Crumb
|
||
- Settings, gallery, rulebook, unlock flow
|
||
- Installable Android debug APK
|
||
- No audio yet, no profile/daily streak yet, no release keystore/AAB yet
|