example-lantern-quay
Lantern Quay
A small 2.5D RPG island. Start in Lantern Quay and follow the winding road behind the lighthouse through Brackenwood to Alderwick Farms. Take the east fork to Gullstrand beach and look for Tideglass Cave among the rocks. The towns, forest, beach, and quay pier are connected on foot.
Within Lantern Quay, speak to Mara, pick up lantern oil from Ivo at the carpenter's stall, and return to Mara. Nessa is near the mill. Rowan and Elin have their own conversations in Alderwick. Look for the interaction prompt when you approach the front of a building or the cave entrance.
Play
Build the desktop OpenGL version from the workspace root. The build uses Cargo to build Garnet's pinned Rapier physics library.
scripts/check-composition example-quay
"${TMPDIR:-/tmp}/garnet-lantern-quay"
- WASD or arrows to walk relative to the camera.
- E to talk, enter, or leave when the interaction prompt appears.
- Q / R to orbit, or right-drag to rotate and tilt the view.
- Home to reset the camera.
- 1 or 2 to choose a dialogue response. The buttons also accept pointer input.
- L or the upper-right button to switch between daylight and dusk.
- Escape to close the conversation or exit the game.
The scene uses layered timber-frame geometry, roof tiles, shutters, awnings, a windmill, and a harbor with a dock and boat. The depth-tested characters use painted sprite atlases with six walk frames and two idle poses. The forest mixes 3D firs with foliage sprites. Each building has a walkable, furnished room based on its use, and the cave has emissive crystal clusters and an animated underground pool.
The player uses a swept capsule in a fixed-step 3D physics world. Building walls, trunks, planters, rocks, fences, furniture, and the shoreline constrain movement. Interiors use their own collision world.
The meadow albedo was made with the built-in image generation tool and saved as meadow.jpg.
Meadow texture prompt
Single square seamless repeating albedo tile for an original handcrafted 2.5D fantasy coastal island RPG. Straight orthographic overhead flat material sample of lightly trodden low green meadow and coastal woodland ground. Interleaved soft moss green blades, tiny brown earth gaps, dry ochre grass and sparse tiny white clover. Muted warm moss and olive colors. Painterly realistic hand-painted game texture rendered with fine brushwork, medium-low contrast, tiny natural details, consistent density across image. Absolutely flat diffuse lighting, no highlights or shadows, zero objects or rocks bigger than a pinch of grass, no directional marks, no seam, no border, no labels, no perspective, no vignette. Tile must read well at isometric foreshortening. All four edges designed to wrap.
The daylight and dusk presets change directional shadows, point lights, the ambient diffuse probe, fog, and the emissive windows and lanterns. The built-in PBR shader lights textured surfaces with tangent-space normals. The animated water computes waves, a Fresnel term, shore foam and stylized lantern streaks with a custom fragment shader.
The harbour water and the cave pool are Slang programs in shaders/ (water.slang, pool.slang) sharing water_shading.slang. Shore foam uses shore.slang, which Island.shore_slang generates from the island shoreline; a spec checks that it matches. After changing the shore or a shader, regenerate shore.slang from Island.shore_slang and rebuild the generated Crystal modules and backend sources from the workspace root:
scripts/garnet shaders build example-lantern-quay/shaders
How it uses the engine
desktop.cr is the whole entry point: World.new, App::Desktop, the Game plugin and world.run. Game installs three plugins:
Town(town.cr): quest and location state in theQuest,WhereaboutsandCollisionsresources; the traveler (Traveler+Transform3D), villagers (Villager) and camera (Orbit) are entities. Fixed-step systems read actions (:move,:look,:interact,:accept,:decline,:light,:recenter,:leave) and the dialogue buttons emitChoiceandToggleLightevents.Presentation(scenery.cr): builds the island and rooms and animates them inPostUpdate; the camera entity'sScreenCamera3DhasScene::Plugindraw itsCamera3Dview of the currentScene3DRoot(the island or a room) on screen.Console(console.cr): the HUD and dialog, run byUI::Plugin.
Controls also work on a gamepad: left stick walks, right stick orbits and tilts, A interacts, B declines, Y changes the light.
Render verification
capture/route.json is an input tape of the verification route: it completes the errand, talks to all five villagers, follows both road branches, and enters and leaves the lighthouse, cave and barn. The capture run replays it through App::Capture, the same input path as live play, and writes PNG screenshots of all four outdoor districts, the three interiors, the conversation, dusk and a rotated, tilted camera. It fails unless the replay reaches every goal and ends where the recording did.
GARNET_QUAY_CAPTURE=/tmp/quay-gl "${TMPDIR:-/tmp}/garnet-lantern-quay"
scripts/check-composition example-quay-metal
GARNET_QUAY_CAPTURE=/tmp/quay-metal "${TMPDIR:-/tmp}/garnet-lantern-quay-metal"
After changing gameplay or collision, re-record the route headless with GARNET_QUAY_RECORD_ROUTE=1 "${TMPDIR:-/tmp}/garnet-lantern-quay". The recorder walks the route closed-loop with a virtual gamepad and key taps and checks each step. engine/spec/lantern_quay_spec.cr replays the tape headless and drives the town through input.
The Metal build uses App::Desktop's AppKit window (-Dgarnet_metal). Both load the assets from this example directory.
example-lantern-quay
- 0
- 0
- 0
- 0
- 0
- about 13 hours ago
- November 30, 2026
Wed, 02 Dec 2026 02:09:52 GMT