FBC: NIGHT SHIFT — 2x OoP case, full-size hotline desks, no phone labels

This commit is contained in:
dandovlatov 2026-11-25 01:24:57 +04:00
parent ca0fae5847
commit b9eb02fc68
9 changed files with 48 additions and 35 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -83,20 +83,27 @@ Edge cases:
waves; post FX and the containment clock stay visible throughout. waves; post FX and the containment clock stay visible throughout.
- No blackout HUD. Only the normal objective panel and containment clock remain, - No blackout HUD. Only the normal objective panel and containment clock remain,
so the clock's pressure stays legible; the puzzle is read from the world. so the clock's pressure stays legible; the puzzle is read from the world.
`draw_blackout_labels()` projects small FBC placards above the screen, the `draw_blackout_labels()` projects a small FBC placard above the screen and,
nearest unanswered phone (within 6 m) and the case (within 9 m). once revealed, above the OoP case (within 9 m). The phone tables carry no
helper labels — the red glow is the whole prompt.
## 5. Blender assets (`tools/blender/build_blackout_props.py`) ## 5. Blender assets (`tools/blender/build_blackout_props.py`)
| GLB | Contents | Tris | Rendering in game | | GLB | Contents | Tris | Rendering in game |
|---|---|---|---| |---|---|---|---|
| `phone_table.glb` | Desk, drawer, red handset, rotary dial, hot indicator, cord | 746 | opaque actor shader, pulsing flash + red glow | | `phone_table.glb` | Desk, drawer, red handset, rotary dial, hot indicator, cord (authored 1.5× size) | 746 | opaque actor shader, pulsing flash + red glow |
| `case_frame.glb` | Plinth, brass trim, four posts, **yellow Board roof**, roof seal | 176 | opaque actor shader, 1.5× scale | | `case_frame.glb` | Plinth, brass trim, four posts, **yellow Board roof**, roof seal (authored 2× size) | 176 | opaque actor shader, 1.5× scale |
| `case_glass.glb` | Four translucent panes | 64 | actor shader with new `uAlpha` uniform (0.30) and depth-mask-free alpha blending | | `case_glass.glb` | Four translucent panes (authored 2× size) | 64 | actor shader with new `uAlpha` uniform (0.30) and depth-mask-free alpha blending |
Conventions: one merged mesh per GLB, painted `Color` vertex attribute, origin Conventions: one merged mesh per GLB, painted `Color` vertex attribute, origin
at feet, facing +Z in engine (-Y in Blender), exports via `actor_kit.export_actor`. at feet, facing +Z in engine (-Y in Blender), exports via `actor_kit.export_actor`.
The existing `switch.glb` is drawn inside the case (2.2× scale). `CASE_SCALE = 2.0` in the generator doubles the case frame/glass geometry; the
game keeps its 1.5× draw scale, so the OoP container ships at twice the original
footprint and height. The existing `switch.glb` is drawn inside it (4.4× scale,
also doubled so the switch still fills the case). `PHONE_TABLE_SCALE = 1.5`
likewise scales the hotline desks at source so they read as full-size furniture
beside the ~1.9 m agent; their draw scale stays 0.78× and the red ground ring
is tightened to match the wider footprint.
Concept: `docs/concept/blackout_props_lineup.png`. Concept: `docs/concept/blackout_props_lineup.png`.
Source scene: `assets/blender/fbc_blackout_props.blend`. Source scene: `assets/blender/fbc_blackout_props.blend`.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 KiB

After

Width:  |  Height:  |  Size: 689 KiB

View file

@ -16,7 +16,7 @@ class BlackoutSequence {
public: public:
static constexpr int kPhoneCount = 20; // 5 columns x 4 rows static constexpr int kPhoneCount = 20; // 5 columns x 4 rows
static constexpr float kPhoneRadius = 2.2f; static constexpr float kPhoneRadius = 2.2f;
static constexpr float kCaseRadius = 2.6f; static constexpr float kCaseRadius = 2.6f; // step-inside radius, independent of the art size
static constexpr float kLightsOutDelay = 2.0f; // grace period in the screen static constexpr float kLightsOutDelay = 2.0f; // grace period in the screen
void init(const Floor& floor); // derive layout from the authored Screen prop void init(const Floor& floor); // derive layout from the authored Screen prop

View file

@ -1136,26 +1136,13 @@ void Presenter::draw_blackout_labels(const Game& game) {
const BlackoutSequence& b = game.blackout; const BlackoutSequence& b = game.blackout;
const Vec2 p = game.player.pos; const Vec2 p = game.player.pos;
int nearest = -1; // No placards over the phone tables — the ringing desks read the puzzle on
float best = 6.0f; // inspection range // their own. The one world label left is the OoP case, lifted to clear its
for (int i = 0; i < BlackoutSequence::kPhoneCount; ++i) { // doubled-height roof.
if (b.phone_answered(i)) continue;
const float d = distance(p, b.phone(i));
if (d < best) {
best = d;
nearest = i;
}
}
if (nearest >= 0) {
const Vec2 q = b.phone(nearest);
const Vector2 s = GetWorldToScreen({q.x, 1.4f, q.y}, camera_);
draw_inspection_placard(s, "FBC HOTLINE", "LINE STILL OPEN",
Color{245, 197, 24, 255});
}
if (b.phase() == BlackoutPhase::CaseRevealed && if (b.phase() == BlackoutPhase::CaseRevealed &&
distance(p, b.case_pos()) < 9.0f) { distance(p, b.case_pos()) < 9.0f) {
const Vec2 c = b.case_pos(); const Vec2 c = b.case_pos();
const Vector2 s = GetWorldToScreen({c.x, 2.8f, c.y}, camera_); const Vector2 s = GetWorldToScreen({c.x, 5.6f, c.y}, camera_);
draw_inspection_placard(s, "OBJECT OF POWER", "LIGHT SWITCH / CLASS IV", draw_inspection_placard(s, "OBJECT OF POWER", "LIGHT SWITCH / CLASS IV",
Color{245, 197, 24, 255}); Color{245, 197, 24, 255});
} }
@ -1190,12 +1177,14 @@ void Presenter::draw_blackout(Game& game) {
answered ? Color{80, 80, 86, 255} : WHITE, ring_flash, answered ? Color{80, 80, 86, 255} : WHITE, ring_flash,
false, 0.0f, 0.0f, anim_time_ * (answered ? 0.2f : 1.2f)); false, 0.0f, 0.0f, anim_time_ * (answered ? 0.2f : 1.2f));
if (!answered) { if (!answered) {
DrawCylinder({q.x, 0.04f, q.y}, 0.9f, 0.9f, 0.012f, 12, // The GLB is authored 1.5x; the ring hugs the desk instead of
// dwarfing it, and the glows ride the taller handset.
DrawCylinder({q.x, 0.04f, q.y}, 1.1f, 1.1f, 0.012f, 12,
Color{255, 45, 55, static_cast<unsigned char>(70 + 40 * pulse)}); Color{255, 45, 55, static_cast<unsigned char>(70 + 40 * pulse)});
glow_batch.add_billboard({q.x, 1.15f, q.y}, 3.2f, 3.2f, glow_batch.add_billboard({q.x, 1.4f, q.y}, 3.6f, 3.6f,
cam_right, cam_up, cam_right, cam_up,
Color{255, 80, 90, 200}); Color{255, 80, 90, 200});
glow_batch.add_ground({q.x, 0.02f, q.y}, 1.4f, glow_batch.add_ground({q.x, 0.02f, q.y}, 1.7f,
Color{220, 30, 40, 85}); Color{220, 30, 40, 85});
} }
} }
@ -1203,15 +1192,16 @@ void Presenter::draw_blackout(Game& game) {
if (b.phase() == BlackoutPhase::CaseRevealed) { if (b.phase() == BlackoutPhase::CaseRevealed) {
const Vec2 c = b.case_pos(); const Vec2 c = b.case_pos();
models_.draw(ActorModel::CaseFrame, {c.x, 0.0f, c.y}, 0.0f, 1.5f, WHITE); models_.draw(ActorModel::CaseFrame, {c.x, 0.0f, c.y}, 0.0f, 1.5f, WHITE);
models_.draw(ActorModel::Switch, {c.x, 0.0f, c.y}, 0.0f, 2.2f, models_.draw(ActorModel::Switch, {c.x, 0.0f, c.y}, 0.0f, 4.4f,
WHITE, 0.0f, false, 0.0f, 0.0f, 0.0f, 0.55f); WHITE, 0.0f, false, 0.0f, 0.0f, 0.0f, 0.55f);
// Glass last, blended, with the switch visible through the panes. // Glass last, blended, with the switch visible through the panes.
// Frame/glass GLBs are authored 2x larger; only this draw scale is used.
models_.draw(ActorModel::CaseGlass, {c.x, 0.0f, c.y}, 0.0f, 1.5f, models_.draw(ActorModel::CaseGlass, {c.x, 0.0f, c.y}, 0.0f, 1.5f,
Color{190, 225, 235, 255}, 0.0f, false, 0.0f, 0.0f, 0.0f, Color{190, 225, 235, 255}, 0.0f, false, 0.0f, 0.0f, 0.0f,
0.0f, {0.0f, 0.0f, 0.0f}, 0.30f); 0.0f, {0.0f, 0.0f, 0.0f}, 0.30f);
DrawCylinder({c.x, 0.06f, c.y}, 3.0f, 3.0f, 0.02f, 24, DrawCylinder({c.x, 0.06f, c.y}, 6.0f, 6.0f, 0.02f, 24,
Color{245, 197, 24, 120}); Color{245, 197, 24, 120});
glow_batch.add_billboard({c.x, 1.3f, c.y}, 4.5f, 4.5f, glow_batch.add_billboard({c.x, 2.6f, c.y}, 9.0f, 9.0f,
cam_right, cam_up, Color{245, 197, 24, 70}); cam_right, cam_up, Color{245, 197, 24, 70});
} }

View file

@ -34,6 +34,14 @@ P = K.PALETTE
P.update({"plastic": "#2a2d33", "glass": "#9fc4cf", P.update({"plastic": "#2a2d33", "glass": "#9fc4cf",
"concrete_lt": "#9d9c96", "brass": "#b89348"}) "concrete_lt": "#9d9c96", "brass": "#b89348"})
# The OoP container is authored at half its shipped size: the frame and glass
# GLBs are uniformly doubled here, so both the game and the concept scene get
# one single, reproducible size change (no second scale in the presenter).
CASE_SCALE = 2.0
# Hotline desks ship 1.5x their authored size so a ringing table reads as real
# office furniture next to the ~1.9 m agent instead of doll-house dressing.
PHONE_TABLE_SCALE = 1.5
def rect(rx, ry): def rect(rx, ry):
return [(-rx, -ry), (rx, -ry), (rx, ry), (-rx, ry)] return [(-rx, -ry), (rx, -ry), (rx, ry), (-rx, ry)]
@ -120,6 +128,14 @@ roots = {}
for name, builder, cap in BUILDERS: for name, builder, cap in BUILDERS:
root = builder() root = builder()
K.merge_actor(root, name) K.merge_actor(root, name)
# export_actor uses export_apply=True, so this object scale is baked into
# the GLB; the .blend keeps it editable on the merged mesh.
art_scale = CASE_SCALE if name.startswith("case_") else (
PHONE_TABLE_SCALE if name == "phone_table" else 1.0)
if art_scale != 1.0:
for child in root.children_recursive:
if child.type == "MESH":
child.scale = (art_scale, art_scale, art_scale)
tris = K.triangle_count(root) tris = K.triangle_count(root)
print("[budget] %-12s %5d tris (cap %d) %s" print("[budget] %-12s %5d tris (cap %d) %s"
% (name, tris, cap, "OK" if tris <= cap else "OVER")) % (name, tris, cap, "OK" if tris <= cap else "OVER"))
@ -146,11 +162,11 @@ for pane in roots["case_glass"].children_recursive:
bpy.ops.object.select_all(action="DESELECT") bpy.ops.object.select_all(action="DESELECT")
bpy.ops.import_scene.gltf(filepath=os.path.join(MODEL_DIR, "switch.glb")) bpy.ops.import_scene.gltf(filepath=os.path.join(MODEL_DIR, "switch.glb"))
switch_root = bpy.context.object switch_root = bpy.context.object
for name, x in (("phone_table", -2.4), ("case_frame", 0.6), for name, x in (("phone_table", -3.0), ("case_frame", 0.6),
("case_glass", 0.6)): ("case_glass", 0.6)):
roots[name].location.x = x roots[name].location.x = x
switch_root.location = (0.6, 0, -0.16) switch_root.location = (0.6, 0, -0.16 * CASE_SCALE)
switch_root.scale = (1.7, 1.7, 1.7) switch_root.scale = (1.7 * CASE_SCALE, 1.7 * CASE_SCALE, 1.7 * CASE_SCALE)
world = bpy.data.worlds.new("BlackoutWorld") world = bpy.data.worlds.new("BlackoutWorld")
bpy.context.scene.world = world bpy.context.scene.world = world
@ -177,8 +193,8 @@ for name, loc, power, col in (
cam_data = bpy.data.cameras.new("BlackoutCam") cam_data = bpy.data.cameras.new("BlackoutCam")
cam = bpy.data.objects.new("BlackoutCam", cam_data) cam = bpy.data.objects.new("BlackoutCam", cam_data)
bpy.context.scene.collection.objects.link(cam) bpy.context.scene.collection.objects.link(cam)
cam.location = (0.4, -9.5, 4.2) cam.location = (0.4, -14.0, 5.8)
cam.rotation_euler = (Vector((0.6, 0, 1.1)) - cam.location).to_track_quat("-Z", "Y").to_euler() cam.rotation_euler = (Vector((0.6, 0, 2.2)) - cam.location).to_track_quat("-Z", "Y").to_euler()
cam_data.lens = 42 cam_data.lens = 42
scene = bpy.context.scene scene = bpy.context.scene
scene.camera = cam scene.camera = cam