Tune survival horror
Goal
Make a dark first-person escape game with battery management, stamina and a stalker. Use the horror starter, derived from FPS with combat removed.
Files you will edit
src/game.tssrc/level.json
Steps
- Change
walkSpeed,sprintSpeedandbatteryDrainin the game rules. - Move the three Supply keys, battery supplies, patrol TargetPoints and exit in the level. Keep NavigationModifier footprints aligned with interior wall blocks.
- Keep the premade SpotLight's
cameraAttached: trueto follow view yaw and pitch. Toggle itsenabledprop for the beam. The SDK sends pooledset-spot-lightcommands; the host owns the light and removes it on despawn. Light forward is local -Z. - The survivor actor owns
stamina({ maximum: 5, drain: 1, regen: 0.5, recoveryDelay: 1 }). SetstaminaOf(actor).requestedwhile moving. Exhaustion locks use until fully recovered. Component state is serializable. No DOM or rendering code belongs in the guest. - Use AIController navigation and senses to retain only last-known positions. Sprint noise uses
reportNoise; sight and hearing refresh a six-second memory. Keys unlock the premade HingedDoor; opening and crossing the threshold wins, contact loses.
Verify
Run npx vitest run templates/horror in the repository. In the browser start the game, look up/down with LIGHT on, exhaust sprint, collect supplies, evade the stalker and exit. Test keyboard, gamepad and the touch buttons shown in the HUD help.