feat(retro-office): make local-office floor footprint configurable - #143
Open
lucapinello wants to merge 1 commit into
Open
feat(retro-office): make local-office floor footprint configurable#143lucapinello wants to merge 1 commit into
lucapinello wants to merge 1 commit into
Conversation
The local-office floor plate is hardcoded to 1800x720 in core/district.ts. Make LOCAL_OFFICE_CANVAS_WIDTH/HEIGHT read from NEXT_PUBLIC_LOCAL_OFFICE_WIDTH/ HEIGHT (positive ints), falling back to the current 1800/720 defaults so nothing changes for existing users. Floor, walls, floor lines, camera framing and the walkability zone all already derive from these two constants, so overriding them reshapes the plate coherently. Add FOOTPRINT_FITS_DEFAULT_OFFICE and gate the east-wing gym/QA-lab decorative floor tiles (authored at fixed x in [1092,1534]) on it, so they render exactly as before on the default footprint and are cleanly omitted on a smaller custom plate instead of spilling past the wall. Motivating use case: a household/home floor (compact, roughly-square plate with a central common room ringed by a few rooms) instead of the default call-center corridor.
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.
Make the local-office floor footprint configurable
What
The local-office floor plate is currently hardcoded to 1800×720 in
src/features/retro-office/core/district.ts:This PR makes those two values read from environment variables, falling back to
the current constants when unset:
LOCAL_OFFICE_CANVAS_WIDTH←NEXT_PUBLIC_LOCAL_OFFICE_WIDTH(default1800)LOCAL_OFFICE_CANVAS_HEIGHT←NEXT_PUBLIC_LOCAL_OFFICE_HEIGHT(default720)Parsing is defensive (positive integers only; anything else falls back to the
default), so a missing or malformed value can never break an existing install.
Why
The default footprint is a long, corridor-shaped call center. Some deployments
want a different shape — our use case is a household / "home" floor: a
compact, roughly-square plate with a central common room ringed by a few rooms,
which reads as a home rather than an office. Today that requires editing core
geometry; this makes it a config knob instead.
Everything downstream already derives from these two constants — the floor plane,
the four perimeter walls, the interior floor lines and the isometric camera
framing (
SCALE/toWorld/LOCAL_CAMERA_TARGET), plus the walkability zoneLOCAL_OFFICE_ZONEused by pathfinding — so overriding them reshapes the wholeplate coherently with no other changes.
The one guard added
The built-in east-wing gym / QA-lab decorative floor tiles in
scene/environment.tsxare authored at fixed canvas coordinates(
x ∈ [1092, 1534]). On a plate smaller than the default they would render pastthe wall. A new exported flag,
FOOTPRINT_FITS_DEFAULT_OFFICE(true only when theplate is at least the default size), now gates those two tile blocks so they
render exactly as before on the default footprint and are cleanly omitted on a
smaller custom one.
Backwards compatibility
Fully backwards compatible. With no env vars set, the footprint is exactly
1800×720andFOOTPRINT_FITS_DEFAULT_OFFICEistrue, so rendering isbyte-identical to before.
npx tsc --noEmitpasses.Files
src/features/retro-office/core/district.ts— env-driven footprint + theFOOTPRINT_FITS_DEFAULT_OFFICEflag.src/features/retro-office/scene/environment.tsx— gate the east-wingdecorative tiles on the new flag.