ai21.net
语言

夜班恐怖游戏的双模型对比

演示视频

夜班恐怖游戏的双模型对比 — 1

提示词

Build a complete, polished browser horror game inspired by the "survive the night shift in a security office" genre (like Five Nights at Freddy's), but with a 100% ORIGINAL setting, characters, and name. Do not use any FNAF names, characters, locations, or assets.

## Concept
Title: "SUNNY HOLLOW: AFTER HOURS"
You are a night watchman at Sunny Hollow Studios, an abandoned 1990s children's TV studio. The show's animatronic puppet hosts were shut down after the show was cancelled (last live broadcast: May 17, 1996), but at night they still try to "finish the broadcast". Survive from 12 AM to 6 AM in a small control booth using cameras, shutters, door lights, a ceiling-vent seal and an audio lure, while managing a draining generator.

## Tech
- Single self-contained index.html (HTML + CSS + JS). Three.js r128 UMD from cdnjs (https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js). No external assets: all models are low-poly primitives, all textures are procedural canvas textures (felt, wood, rust, tiles, wallpaper, posters), all sound is generated with the Web Audio API.
- Desktop Chrome at 60 fps. Mouse controls plus keyboard shortcuts.
- Every room is its own THREE.Scene with its own camera, so only the viewed room is rendered. Pre-compile all shaders at boot (renderer.compile on every scene, with the puppets temporarily added) so the first camera flip doesn't hitch.
- Adaptive resolution: render the 3D into a render target at 0.85x. If the average frame time stays above 25 ms for 2.5 s, drop the internal scale by 0.15 (minimum 0.5).
- Add `[hidden]{display:none!important}` to the CSS so hidden overlay screens never block clicks.
- Save progress in localStorage (current night, beaten nights, stars, unlocks, custom-night sliders), wrapped in try/catch.

## Post-processing (full-screen shader)
VHS/CRT pass over everything: scanlines, film grain, chromatic aberration, a rolling tracking band, line jitter, vignette, a full-static mix, a red flash and a darkness fade. Use three presets: office (subtle), camera (strong scanlines, barrel distortion, green tint, more noise) and menu.

## Core loop
- 1 in-game hour = 60 real seconds (12 AM → 6 AM = 6 minutes).
- Mouse near the left/right 22% of the screen turns the view smoothly. Yaw is clamped to ±60°. Arrow keys work as a backup.
- Generator: 100% at start. Usage = 1 (base) + tablet 1 + each door light 1 + each closed shutter 2 + vent seal 1 + lure 1 (for 3 s). Drain = usage × 0.1% per second × night multiplier (N1 0.9, N2 0.95, N3 1.0, N4 1.03, N5 1.06, N6 1.14, custom 1.1). Show POWER LEFT % and colored usage bars.
- At 0%: shutters open, all lights die, cameras disabled. After 4–9 s Mr. Antler appears in the left doorway with eyes pulsing to a generated music-box melody (5–18 s), then 2 s of total darkness, then a jumpscare. If 6 AM arrives first, the player wins.
- 6 AM: chime, a "5 → 6 AM" rolling-digit screen, then the next night starts automatically.
- AI levels rise +1 at 2, 3 and 4 AM on nights 2+.

## Control booth (3D)
- Left and right doorways open onto dark corridors. Each doorway has a corrugated metal shutter that slides down, plus a wall panel with a red SHUTTER button and a white LIGHT button (hold).
- Without the light, a puppet in the doorway shows only faint glowing eyes. Office lights must have short range so the doorway stays dark.
- Desk: old CRT TV with rabbit ears (clickable), two static monitors, a spinning fan, a red phone (click to mute the call), a mug, papers, a desk lamp, a VENT SEAL lever box with an LED, and a tiny moose bobblehead.
- Front wall: a ceiling vent (real hole in the wall mesh, a duct behind it, angled slats, and a metal plate that slides down to seal it), a wall clock synced to game time, show posters, a "MAY 1996" calendar with the 17th circled, a kid's crayon drawing and a caution poster.
- A flickering fluorescent tube and hanging cables.

## Camera tablet
- Toggle with SPACE or by hovering the bottom bar.
- IMPORTANT, avoid a flicker bug: do NOT use mouseenter/mouseleave on the two bars (CAMERAS / LOWER sit in the same spot and ping-pong the tablet). Detect the bar zone from the pointer position inside a global pointermove handler. Flip once per visit (450 ms cooldown). Re-arm only after the mouse moves well above the bar (y < innerHeight − 110). Start each night disarmed.
- 0.22 s slide-up animation. The camera feed starts rendering once it's fully up.
- 8 cameras on a clickable schematic minimap (keys 1–8). Centered header shows "CAM 04 · WEST HALL" plus "● REC" and a timestamp. Slow camera pan in each room. A static burst on switch and whenever a puppet enters or leaves the viewed room.
- Tablet buttons: "♪ PLAY JINGLE [L]" (15 s cooldown bar) and "VENT: OPEN/SEALED [V]".
- Raising the tablet turns off held lights. Shutters can't be operated while it's up.

## Map
CAM 1 Main Stage (stage, painted sunny backdrop, teal curtains, talk-show desk, audience seats, APPLAUSE sign), CAM 2 Green Room, CAM 3 Prop Storage, CAM 4 West Hall, CAM 5 East Hall, CAM 6 Costume Closet, CAM 7 Vent Shaft (red emergency light), CAM 8 Broadcast Tower Room (equipment racks with LEDs, a wall of static/countdown CRTs, an ON AIR sign that lights up during the TV event).

## Antagonists (original, each with a unique mechanic)
Movement opportunity every ~5 s: move if random(0..20) < AI level.
1. MR. ANTLER: felt moose talk-show host (maroon blazer, yellow bow tie, palmate antlers, droopy eyelids, microphone). Route 1 → 2/3 → 4 → left door. He will NOT move while you watch his current camera. In the West Hall he walks toward the camera only while unwatched. At the door he waits lerp(10, 4.5, AI/20) s: shutter closed → loud bangs, he retreats to CAM 2/3. Open → jumpscare.
2. SPROCKET: tin robot co-host (rusty can head, bulb eyes, blinking antenna, chest dials, cassette slot). Route 1 → 8 → 5 → right door. Playing the jingle on a camera 1–2 steps behind him pulls him back there (15% chance the tape skips). Three successful lures within ~40 s each jam his tape for 25 s: red eyes, jittering, +5 aggression, lures stop working. At the right door he behaves like Antler (shutter blocks).
3. LULU: pink-striped sock marionette with button eyes, yarn hair and a wooden control bar with strings. Lives in CAM 6 with an unrest meter (+AI×0.14 per second unwatched, −9 per second while watched). Four visible poses (deeper in the closet → leaning out → staring at the camera); her pose only updates while unwatched. At 100 she enters the vent shaft, and her progress freezes while CAM 7 is watched. At the booth vent she scratches for 3.5–6 s: sealed → thump and she returns to the closet. Open → jumpscare.
4. THE UNDERSTUDY: faceless grey spare mascot suit, "SPARE #2" tag. Normally standing in CAM 3. When power is below 30% it can appear in a front corner of the booth (opposite the side you're facing), with flickering lights and breathing. Keep it out of view (turn away or raise the tablet) for 3 continuous seconds and it vanishes. Otherwise it gets you after lerp(12, 7, AI/20) s.
5. THE BROADCAST (night 5+): the booth TV turns on by itself with color bars and a countdown with beeps. Press T or click the TV before it ends. If it finishes, every camera shows "NO SIGNAL" for 10 s and Antler and Sprocket get +3 aggression meanwhile.

AI per night [Antler, Sprocket, Lulu, Understudy, Broadcast]:
N1 3,2,0,0,0 · N2 5,4,3,0,0 · N3 7,6,6,4,0 · N4 10,9,9,7,0 · N5 13,12,12,11,10 · N6 18,17,17,16,15.

## Jumpscares
The puppet lunges from 1.6 m to face distance in 0.22 s, head aligned to eye level, lit by a strong light. Camera shake, heavy chroma/jitter, a short red flash, and a loud synthesized screech (detuned sawtooths with LFO + distortion + noise). After ~1.35 s show "TECHNICAL DIFFICULTIES" over color bars and static, with who got you, a one-line tip, RETRY and MENU.

## Audio (all synthesized)
Generator hum, fan noise, camera hiss, light buzz, panned footsteps (Antler left, metallic clanks for Sprocket right), shutter slams, bangs, vent scratching, breathing, a cheerful-but-detuned show jingle (lowpassed and panned to the camera's side), the music box, a 6 AM chime with distant cheering, ambient creaks/drips/whispers/distant kids, and a menu drone. Start audio from the first click.

## Story
Each night a phone call types out 3–4 lines with a muffled formant "voice" synced word by word; it can be muted. The calls gradually reveal the lore: the nine-minute feed cut on May 17, 1996; the hosts found smiling at the camera; recordings of kids counting down; the previous watchman calling from inside the Tower Room on night 5. Night 6 is an automated station message.

## Menus and progression
- Boot screen "▶ PLAY TAPE".
- Main menu: a dark 3D stage with the hosts on the right side, a glitching yellow show logo, NEW GAME (with an erase confirmation), CONTINUE, NIGHT 6 and CUSTOM NIGHT (locked until earned), stars, and N1–N6 progress chips.
- An orientation screen with controls and host tips before night 1.
- Endings: beating night 5 shows a newspaper (studio to be demolished, the old watchman missing) and unlocks Night 6. Night 6 shows a creepy pay stub and unlocks Custom Night. A Custom Night at all-20 shows a sign-off card. One star for each.
- Custom night: sliders 0–20 for all five hosts, plus presets.
- P/Esc pauses the game; it also auto-pauses on blur.

## Style
Retro VHS look. VT323 for the UI, a chunky rounded display font for the show logo. Green/amber phosphor HUD: time and night top-right, power and usage bottom-left, key hints above them. Must also work at phone width without overflow.

## Easter eggs
- 6% chance per night that a West Hall poster reads "IT'S STILL ON AIR" with the hosts' eyes crossed out.
- Clicking the booth show poster honks.
- 1/1000 chance on switching to CAM 1 that a sun mascot appears on stage (saved as a ☀ on the menu).
- Typing "sunny" on the menu unlocks everything.

## Quality bar
- Fully playable start to finish with no console errors.
- Night 1 is beatable on the first try with plenty of power left. Night 5 needs skill. Night 6 is hard.
- Comment the code by section: utils/save, textures, puppet models, office, rooms, menu scene, post-processing, audio, game state & AI, input, UI, render loop.

中文译文

构建一个完整、精致的浏览器恐怖游戏,灵感来自「在安保办公室里熬过夜班」这一类型(如 Five Nights at Freddy's),但设定、角色和名称必须 100% 原创。不得使用任何 FNAF 的名称、角色、地点或素材。

## 概念
标题:"SUNNY HOLLOW: AFTER HOURS"
你是 Sunny Hollow Studios 的夜间看守,这是一家废弃的 1990 年代儿童电视演播室。节目被取消后,这档节目的动画玩偶主持人被关停(最后一次直播:1996 年 5 月 17 日),但到了夜里,它们仍试图「完成播出」。在一间狭小的控制亭里,利用摄像机、卷帘门、门灯、天花板通风口封盖和音频诱饵,从 12 AM 撑到 6 AM,同时管理不断耗电的发电机。

## 技术
- 单个自包含的 index.html(HTML + CSS + JS)。Three.js r128 UMD 来自 cdnjs(https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js)。不使用外部素材:所有模型都是低多边形基础几何体,所有贴图都是程序化 Canvas 贴图(毛毡、木头、锈迹、瓷砖、壁纸、海报),所有声音都用 Web Audio API 生成。
- 桌面端 Chrome,60 fps。鼠标控制加键盘快捷键。
- 每个房间都是独立的 THREE.Scene,并拥有自己的相机,因此只渲染正在观看的房间。在启动时预编译所有着色器(对每个场景调用 renderer.compile,并临时加入玩偶),这样第一次切换镜头时不会卡顿。
- 自适应分辨率:先把 3D 渲染到 0.85 倍的渲染目标。如果平均帧时间持续 2.5 秒高于 25 ms,就把内部缩放降低 0.15(最低 0.5)。
- 在 CSS 中添加 `[hidden]{display:none!important}`,确保隐藏的覆盖层界面永远不会挡住点击。
- 用 localStorage 保存进度(当前夜晚、已通关夜晚、星星、解锁项、自定义夜晚滑块),并包在 try/catch 中。

## 后期处理(全屏着色器)
对全部画面叠加 VHS/CRT 效果:扫描线、胶片颗粒、色差、滚动的跟踪条带、行抖动、暗角、全雪花混合、红色闪光和黑暗淡出。使用三种预设:office(轻微)、camera(强扫描线、桶形畸变、绿色色调、更多噪点)和 menu。

## 核心循环
- 游戏内 1 小时 = 现实 60 秒(12 AM → 6 AM = 6 分钟)。
- 鼠标靠近屏幕左/右侧 22% 的区域时,视角会平滑转动。偏航角限制在 ±60°。方向键可作为备用操作。
- 发电机:初始 100%。耗电 = 1(基础)+ 平板 1 + 每盏门灯 1 + 每扇关闭的卷帘门 2 + 通风口封盖 1 + 诱饵 1(持续 3 秒)。耗电速度 = 耗电值 × 每秒 0.1% × 夜晚倍率(N1 0.9、N2 0.95、N3 1.0、N4 1.03、N5 1.06、N6 1.14、自定义 1.1)。显示 POWER LEFT % 和带颜色的耗电条。
- 电量降至 0% 时:卷帘门打开,所有灯光熄灭,摄像机禁用。4–9 秒后,Mr. Antler 出现在左侧门口,双眼随着生成的八音盒旋律脉动(5–18 秒),随后是 2 秒完全黑暗,然后一次惊吓。如果 6 AM 先到,玩家获胜。
- 6 AM:钟声、一个 "5 → 6 AM" 的滚动数字画面,然后自动开始下一夜。
- 第 2 夜起,AI 等级会在 2 AM、3 AM 和 4 AM 各 +1。

## 控制亭(3D)
- 左右两侧的门口通向黑暗的走廊。每个门口都有一扇向下滑动的瓦楞金属卷帘门,另有一块墙面板,上面有红色 SHUTTER 按钮和白色 LIGHT 按钮(按住)。
- 不开灯时,门口的玩偶只露出微弱的发光眼睛。办公室灯光的照射范围必须很短,使门口保持黑暗。
- 桌子:带兔耳天线的旧 CRT 电视(可点击)、两台雪花屏显示器、一台旋转的风扇、一部红色电话(点击可静音通话)、一个马克杯、文件、一盏台灯、一个带 LED 的 VENT SEAL 拉杆盒,以及一个小小的驼鹿摇头摆件。
- 前墙:一个天花板通风口(墙体网格上的真实孔洞,其后有管道、倾斜的百叶,以及一块向下滑动将其封住的金属板)、一个与游戏时间同步的挂钟、节目海报、一本 17 日被圈出的 "MAY 1996" 日历、一张儿童蜡笔画和一张警示海报。
- 一根闪烁的荧光灯管和悬垂的电缆。

## 摄像平板
- 用 SPACE 切换,或悬停底部栏。
- 重要:为避免闪烁 bug,不要在两条栏上使用 mouseenter/mouseleave(CAMERAS / LOWER 处在同一位置,会让平板来回弹跳)。在全局 pointermove 处理器中根据指针位置检测栏区域。每次进入只翻转一次(450 ms 冷却)。只有当鼠标移动到栏上方足够高处(y < innerHeight − 110)后才重新武装。每晚开始时处于未武装状态。
- 0.22 秒的上滑动画。摄像机画面在完全升起后才开始渲染。
- 可点击的示意图小地图上有 8 台摄像机(按键 1–8)。居中标题显示 "CAM 04 · WEST HALL",外加 "● REC" 和时间戳。每个房间的摄像机缓慢平移。切换时以及每当有玩偶进入或离开当前观看的房间时,都会出现一阵雪花。
- 平板按钮:"♪ PLAY JINGLE [L]"(15 秒冷却条)和 "VENT: OPEN/SEALED [V]"。
- 举起平板会关闭正被按住的灯。平板升起时无法操作卷帘门。

## 地图
CAM 1 Main Stage(舞台、绘制的阳光背景板、青绿色窗帘、脱口秀桌子、观众席、APPLAUSE 标牌),CAM 2 Green Room,CAM 3 Prop Storage,CAM 4 West Hall,CAM 5 East Hall,CAM 6 Costume Closet,CAM 7 Vent Shaft(红色应急灯),CAM 8 Broadcast Tower Room(带 LED 的设备机架、一整面雪花/倒计时 CRT 墙、在电视事件期间亮起的 ON AIR 标牌)。

## 敌对角色(原创,每个都有独特机制)
每约 5 秒获得一次移动机会:若 random(0..20) < AI 等级,则移动。
1. MR. ANTLER:毛毡驼鹿脱口秀主持人(栗色西装外套、黄色领结、掌状鹿角、下垂的眼睑、麦克风)。路线 1 → 2/3 → 4 → 左门。当你正在观看他当前所在的摄像机时,他绝不会移动。在 West Hall 中,他只在无人观看时才朝摄像机走来。到达门口后,他会等待 lerp(10, 4.5, AI/20) 秒:卷帘门关闭 → 巨大的撞击声,他退回到 CAM 2/3。门敞开 → 惊吓。
2. SPROCKET:铁皮机器人搭档主持(生锈的罐头脑袋、灯泡眼睛、闪烁的天线、胸前旋钮、卡带插槽)。路线 1 → 8 → 5 → 右门。在他身后 1–2 步远的摄像机播放这段广告曲,会把他拉回那里(15% 概率磁带跳带)。约 40 秒内三次成功的引诱,每次都会卡住他的磁带 25 秒:眼睛变红、抖动、+5 攻击性,引诱失效。在右门他的行为与 Antler 相同(卷帘门可挡住)。
3. LULU:粉色条纹袜子提线木偶,纽扣眼睛、毛线头发,以及带细线的木质控制杆。住在 CAM 6,带有躁动值(无人观看时每秒 +AI×0.14,被观看时每秒 −9)。四种可见姿势(更深入衣柜 → 探出身子 → 盯着摄像机);她的姿势只在无人观看时更新。达到 100 时,她进入通风竖井;观看 CAM 7 时,她的进度会冻结。到达控制亭通风口时,她会抓挠 3.5–6 秒:封住 → 砰的一声,她回到衣柜。敞开 → 惊吓。
4. THE UNDERSTUDY:没有面孔的灰色备用吉祥物套装,挂着 "SPARE #2" 标签。通常站在 CAM 3。当电量低于 30% 时,它可能出现在控制亭前方的一个角落(位于你所朝方向的对侧),伴随闪烁的灯光和呼吸声。让它保持在视野之外(转身或举起平板)连续 3 秒,它就会消失。否则它会在 lerp(12, 7, AI/20) 秒后抓住你。
5. THE BROADCAST(第 5 夜起):控制亭的电视会自行打开,显示彩条和伴随哔声的倒计时。在倒计时结束前按 T 或点击电视。如果它播放完毕,所有摄像机都会显示 "NO SIGNAL" 持续 10 秒,与此同时 Antler 和 Sprocket 获得 +3 攻击性。

每夜 AI [Antler, Sprocket, Lulu, Understudy, Broadcast]:
N1 3,2,0,0,0 · N2 5,4,3,0,0 · N3 7,6,6,4,0 · N4 10,9,9,7,0 · N5 13,12,12,11,10 · N6 18,17,17,16,15.

## 惊吓
玩偶会在 0.22 秒内从 1.6 米处扑到面前距离,头部与视线齐平,被强光照亮。镜头震动、强烈的色差/抖动、短暂的红色闪光,以及响亮的合成尖啸(失谐锯齿波,带 LFO + 失真 + 噪声)。约 1.35 秒后,在彩条和雪花之上显示 "TECHNICAL DIFFICULTIES",并附上是谁抓住了你、一行提示、RETRY 和 MENU。

## 音频(全部合成)
发电机嗡鸣、风扇噪声、摄像机嘶声、灯光嗡响、带声像的脚步声(Antler 的脚步声在左,Sprocket 的金属碰撞声在右)、卷帘门砸落声、撞击声、通风口抓挠声、呼吸声、欢快但失谐的节目广告曲(低通滤波,并声像偏向摄像机所在的一侧)、八音盒、6 AM 的钟声与远处的欢呼、环境中的吱嘎/滴水/低语/远处孩童声,以及菜单的低鸣。音频从第一次点击开始播放。

## 剧情
每晚,一通电话会逐字打出 3–4 行内容,配有闷响的共振峰「嗓音」,逐词同步;通话可以静音。这些通话会逐步揭示背景故事:1996 年 5 月 17 日那次长达九分钟的信号中断;主持人们被发现对着镜头微笑;孩子们倒计时的录音;第 5 夜前任看守从 Tower Room 内部打来的电话。第 6 夜则是一段自动化的电视台播报消息。

## 菜单与进度
- 启动画面 "▶ PLAY TAPE"。
- 主菜单:昏暗的 3D 舞台,主持人们位于右侧,一个故障闪烁的黄色节目标志,NEW GAME(带清除确认)、CONTINUE、NIGHT 6 和 CUSTOM NIGHT(在赢得前处于锁定状态)、星星,以及 N1–N6 进度标签。
- 第 1 夜之前有一块说明屏幕,包含操作方式和主持人提示。
- 结局:通关第 5 夜会显示一张报纸(演播室将被拆除,老看守失踪),并解锁 Night 6。Night 6 会显示一张诡异的工资单,并解锁 Custom Night。全部为 20 的 Custom Night 会显示一张签退卡。每个结局各得一颗星。
- 自定义夜晚:全部五位主持人各有 0–20 的滑块,另有预设。
- P/Esc 暂停游戏;窗口失焦时也会自动暂停。

## 风格
复古 VHS 外观。UI 使用 VT323,节目标志使用一种粗壮圆润的展示字体。绿色/琥珀色磷光 HUD:时间和夜晚位于右上角,电量和耗电位于左下角,按键提示位于它们上方。在手机宽度下也必须正常工作且不溢出。

## 彩蛋
- 每晚有 6% 的概率,West Hall 的一张海报上写着 "IT'S STILL ON AIR",主持人的眼睛被划掉。
- 点击控制亭里的节目海报会发出喇叭声。
- 切换到 CAM 1 时有 1/1000 的概率会让一个太阳吉祥物出现在舞台上(在菜单中保存为 ☀)。
- 在菜单中输入 "sunny" 即可解锁全部内容。

## 质量标准
- 从头到尾完全可玩,控制台没有报错。
- 第 1 夜在首次尝试时即可通关,且剩余充足电量。第 5 夜需要技巧。第 6 夜很难。
- 按板块为代码添加注释:utils/save、textures、puppet models、office、rooms、menu scene、post-processing、audio、game state & AI、input、UI、render loop。

溯源

原作者
kepochnik
发布日期
2026-10-17(由推文 ID 反解)
原始出处
查看原帖 ↗
收录来源
zhuyansen/awesome-opus-5.5-video · 2111421758691827905 · 未声明许可