Repository navigation
3D view: default tile shapes, walls out of the way; roomcap tour mode - #210
Merged
Merged
Conversation
port_repro_roomcap.c, new modes (all opt-in, env-driven):
- TMC_ROOMCAP_TOUR=<plan>: one game session warps through every view in
a plan ("area room x y [layer]" a line, room-local pixels) and captures
each to TMC_ROOMCAP_TOUR_OUT/<line>.png, as the voxel tour
(port_repro_npc_talk.c) walks every room: ~3 s a view instead of ~7 s
for a game started per capture. Each capture is logged with the room,
the camera (scroll - origin, room pixels) and where Link stood. A view
is taken only in the room, in GAMEMAIN_UPDATE, with the camera on Link,
Link in control and no message up, after TMC_ROOMCAP_SETTLE frames (160
outlasts the area-name box); a scene on arrival (a warp onto a fairy
fountain's Piece of Heart) is waited out with A. A view that never
arrives is skipped; a scene that never ends exits (3) naming the view,
and TMC_ROOMCAP_TOUR_START resumes after it. TMC_ROOMCAP_TOUR_DEBUG=1
logs each second's wait and the ROM address of every NPC's script, to
name a scene that holds the camera.
- TMC_ROOMCAP_CLEAN: the room alone -- the game's own HUD hide flags
(HUD_HIDE_ALL), Link not drawn, dialogue advanced with A.
- TMC_ROOMCAP_PROGRESS=<n> (tour): the new game starts past the prologue
with n dungeons cleared: TABIDACHI and LV1..n_CLEAR, and what the game
hands out by then -- each dungeon's element, since an area change takes
a clear back without it (gameUtils.c), which dropped Hyrule Town back to
the prologue's, whose intro scene (script_Npc4EIntroTown) then held the
camera; and the kinstone bag, without which the town plays Ezlo's
kinstone scene.
- The single capture logs its camera too ("[roomcap] view ...").
build.py: GIT_TERMINAL_PROMPT=0 for the per-submodule fetch, so a
private submodule fails instead of stopping the build at a
"Username for github.com" prompt.
The 3D room view guesses each tile's shape from collision alone and takes per-area fixes from voxel_shapes.json, edited by hand from F8 a tile at a time. assets/voxel_shapes.json fixes 475 tile types in 57 areas up front: - prop: bushes, saplings, rocks, pots, stumps, mushrooms, stones, boulders, planters, fences and signposts -- standing cards, where a run of them would otherwise stand up as a block; - block: partly solid tiles the collision test leaves flat -- tree-canopy edges, cliff corners, stone walls, building corners and roofs. Only where the view's own guess differs, and only tile types whose cells agree (80%). Water and holes are left to the view. No wall heights. build.py stages it into dist/ next to the binary, merged under an existing voxel_shapes.json: the player's own entries win, tile by tile. Generated from room dumps by tools/voxel_shapes.py in HelaFaye/tmc (vr branch), from its tile identification; the file holds tile type numbers and shape names only.
Room geometry standing between the camera and an actor (Link, or any ENEMY in the entity lists) thins to a 20% dither around the sight line, so the actor stays in sight: a house front, a cliff, a roof. With more camera angles it is also the back of a wall seen from outside. A pixel thins when it lies within 20 px (feathered over 14) of the line from the camera to the actor, aimed 12 px above its feet, in front of the actor, and above the ground it stands on -- the floor under Link never thins. The dither is a 4x4 Bayer screen door: each pixel is drawn or dropped, so what is drawn stays opaque and writes depth -- no sorting. Only room geometry (kind 0) thins; sprites, the backdrop and the HUD never do. - voxel.vert passes the world position; voxel.frag fadeKeep(), with the camera and up to 16 actors in a fragment uniform (set 3) pushed each frame from Port_Voxel_Present. SPIR-V rebuilt (voxel only). - F8 > Display > 3D walls out of the way (voxel_wall_fade, on by default). Built with --gpu_renderer=y. Not yet seen running: the machine it was written on has no Vulkan display.
A solid tile with no solid tile beside it already stands as a prop card: 5 such prop entries drop out, and 17 lone solid tiles that belong to a wall or tree get block, so the view does not stand them as cards. 510 tile types in 59 areas.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes from the HelaFaye/tmc
vrfork that apply to Picori itself. They're in four commits, so any one can be dropped.1. Room-capture harness: tour mode, clean captures, story progress (
port/port_repro_roomcap.c)All of these are opt-in and driven by environment variables.
TMC_ROOMCAP_TOUR=<plan>: one game session warps through every view in a plan (area room x y [layer]per line, room-local pixels). Each view is captured toTMC_ROOMCAP_TOUR_OUT/<line>.png, like the voxel tour inport_repro_npc_talk.c. That's about 3 s per view, against about 7 s when a new game is started for each capture.scroll - origin) and where Link stood.GAMEMAIN_UPDATE;TMC_ROOMCAP_SETTLEframes have passed. 160 outlasts the area-name box.TMC_ROOMCAP_TOUR_STARTresumes after it.TMC_ROOMCAP_TOUR_DEBUG=1logs the wait each second, plus every NPC's script ROM address. That's how the scene holding the camera below was found.TMC_ROOMCAP_CLEAN: the room alone. It sets the game's ownHUD_HIDE_ALL, doesn't draw Link, and advances dialogue with A.TMC_ROOMCAP_PROGRESS=<n>(tour): the new game starts past the prologue with n dungeons cleared, by settingTABIDACHIandLV1..n_CLEAR. It also gives what the game hands out by that point:gameUtils.c). That drops Hyrule Town back to the prologue version, whose intro scene (script_Npc4EIntroTown) then holds the camera.build.py:GIT_TERMINAL_PROMPT=0for the per-submodule fetch. A private submodule now fails instead of stopping the build at aUsername for github.comprompt.Tested: built, and a three-view Hyrule Town tour lands on each view with the camera on Link. A full run captured 2,492 views of 539 rooms.
2. Default tile shapes for the 3D view (
assets/voxel_shapes.json,build.py)voxel_shapes.jsoncurrently starts empty; players fix misread tiles by hand from F8, one at a time. This ships fixes for 510 tile types in 59 areas, generated from HelaFaye/tmc's tile identification (tools/voxel_shapes.pyon thevrbranch):What gets written:
wallis left out; the loader's default is used.Same format as
SaveShapes(). The file holds tile type numbers and shape names only.build.pystages it next to the binary. An existingvoxel_shapes.jsonis merged, not replaced: the player's own entries win, tile by tile. Checked with a freshdist/and with one holding a hand edit.3. Walls out of the way (
port_voxel.cpp,voxel.vert/.frag)Room geometry between the camera and an actor thins to a 20% dither around the sight line, so the actor stays in sight. Actors are Link and every
ENEMYin the entity lists. Examples are a house front, a cliff, a roof, and, once there are more camera angles, the back of a wall seen from outside.A pixel thins when all of these hold:
How it works:
voxel.vertpasses the world position.voxel.frag'sfadeKeep()reads the camera and up to 16 actors from a fragment uniform (set 3), pushed each frame.voxel_wall_fade, on by default).Tested: it builds with
--gpu_renderer=y, but I haven't seen it running; the machine it was written on has no Vulkan display. The same rule runs in the fork's WebGL mesh viewer, where it's covered by tests and was checked from several angles.