-
Notifications
You must be signed in to change notification settings - Fork 0
renderer: day-state plate selection (#1291) #1298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,25 @@ | |
| } catch {} | ||
| if(!string.IsNullOrEmpty(_locPlate)) PLATE=_locPlate; | ||
| else { var _abs="/home/unity/worldos-unity/Assets/painterly/backdrops/_active_combat.txt"; if(System.IO.File.Exists(_abs)){ var _n=System.IO.File.ReadAllText(_abs).Trim(); if(_n.Length>0) PLATE=_n; } } | ||
| // #1291: day-state plate selection. A sentinel (_time_of_day.txt, written by the deploy/driver step — | ||
| // NOT the engine directly; today's engine time_of_day is not yet surfaced on /combat-surface) says | ||
| // "day"/"night". When it says day AND a naming-convention sibling "<room>_day_v1.png" exists (room = | ||
| // the resolved PLATE's prefix up to its first underscore, e.g. tavern_layered_v1.png -> tavern), prefer | ||
| // it. ADDITIVE + default-off: no sentinel file, sentinel != "day", or missing day plate all fall through | ||
| // to today's PLATE unchanged (night/current behavior stays the default). | ||
| try { | ||
| var _todF="/home/unity/worldos-unity/Assets/painterly/backdrops/_time_of_day.txt"; | ||
| if(System.IO.File.Exists(_todF)){ | ||
| var _tod=System.IO.File.ReadAllText(_todF).Trim().ToLowerInvariant(); | ||
| if(_tod=="day"){ | ||
| var _us=PLATE.IndexOf('_'); | ||
| var _room=_us>0?PLATE.Substring(0,_us):PLATE.Replace(".png",""); | ||
| var _dayName=_room+"_day_v1.png"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: Day-plate name hardcodes _v1, diverges from curated _v2 default plate The day variant is derived as Category: Unity scene/prefab Why this matters: A room whose curated plate is v2 but whose only available day art is v2 would get no day plate at all (silent fallback to night), or a v1 day plate of inconsistent quality — both are silent operator surprises rather than errors. Low blast radius since it's additive and default-off. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Day-plate filename convention is hardcoded and unverified vs the generator/deploy step The renderer hardcodes the day sibling as Category: Unity scene/prefab Why this matters: A day/night render feature that silently never activates because of an unverified filename coupling is a classic release-regression/proof-gap: it looks wired but produces no visible day evidence, and the absence of evidence is indistinguishable from 'sentinel not set'. |
||
| var _dayPath="Assets/painterly/backdrops/"+_dayName; | ||
| if(System.IO.File.Exists("/home/unity/worldos-unity/"+_dayPath)) PLATE=_dayName; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: No editor/fixture smoke evidence for day-state render behavior in this diff This PR adds runtime render behavior (conditional day-plate selection that changes the painted backdrop) but the diff carries no focused Unity editor smoke, fixture, or a captured day-vs-night plate pair proving the sentinel path resolves and renders the day sibling. Repo proof expectations call for editor/play-mode/fixture evidence when runtime behavior changes. No tracked test exercises this branch (qa/* time_of_day references are engine state, not this renderer sentinel). Add at minimum a one-off editor capture log showing sentinel=day + present Category: Unity scene/prefab |
||
| } | ||
| } | ||
| } catch {} | ||
| string PLATE_PATH="Assets/painterly/backdrops/"+PLATE; | ||
| // New backdrop plates default to NPOT=ToNearest, which square-distorts a 1344x768 plate and breaks the | ||
| // camera-pin aspect. Force NPOT=None so the plate keeps native dims (idempotent — only reimports if needed). | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: Room-prefix extraction drops plate version; day lookup is pinned to v1 regardless of night version
_roomisPLATE.Substring(0,_us)— forcrypt_firelit_v2.pngthis yieldscrypt(correct), but the version segment (firelit_v2) is discarded and the day name is rebuilt ascrypt_day_v1.pngwith a hardcoded_v1. As night plates advance to v2/v3, their day counterparts stay pinned to v1 by this code, so a freshly regenerated day plate at a higher version would be ignored. At minimum, if the_day_v1.pngconvention is intentional, add a comment stating the version is intentionally fixed; otherwise derive the day name from the full non-extension stem or a registry field.Category: Runtime correctness