Skip to main content

Last Exit: First Person Example

Last Exit is the bundled first-person horror project. A short playable route demonstrates interaction, dialogue, storage, inventory and animated scene changes. Its game rules are Lua; models, UI, audio and animation tracks are ordinary assets.

Create an editable copy from Project Hub. The installed template is read-only. Open Scenes/main_menu.json and select PLAY in Play Mode.

Project flow​

SceneExperience
main_menu.jsonTitle artwork, Play, Controls
shelter.json3 x 3 m room and first door
corridor.json2 m wide passage and warehouse door
warehouse.jsonTruck occupant, blocked entry, office, item box and key
ending.jsonEscape screen, replay and menu

Aim at nearby objects to see their action prompt. The man in the truck refuses to leave. The entrance is jammed; find the key beside the office door and use the yard exit. Cloth and battery in the chest are optional inventory examples.

Controls​

InputAction
Left stick / D-PadWalk / navigate UI
Right stickLook
L1 / R1Turn with a digital pad
L2 / R2Look down / up
CrossInteract, confirm, advance dialogue, transfer item
CircleCancel / close
SquareRun
TriangleInventory
StartPause / resume

Use the same actions throughout the UI. Movement and looking stop while a panel or transition owns input. The bitmap font includes controller glyphs at ASCII positions {, |, }, ~; it does not require Unicode support.

Lua and native services​

The six behaviours under Assets/Scripts/LastExit are player.lua, interactable.lua, flow.lua, inventory.lua, menu.lua and dialogue.lua. The project README and LEARNING_PATH.md document their properties, callbacks, slots and asset pivots.

Physics.Raycast includes walls and triggers; the nearest hit must carry the Interactable tag. This prevents using a key or door through a wall. Modal canvases restrict native button focus, while Lua separately gates world actions.

Session stores up to 32 entries, with 31-byte keys and 63-byte values. Inventory survives scene changes but is not written to a Memory Card. New Game resets the demo's namespace. A six-slot item box and six-slot pack demonstrate capacity, bidirectional transfer, rollback and unique pickup.

SceneManager.LoadScene accepts EntryPoint and Presentation options. Black presentation hides the loading UI; destination Start finds the requested marker and fades in. ScreenFade runs on unscaled time across scene replacement. The door/handle animation and camera movement happen before loading the next scene. The office door and chest animate physically inside the warehouse. Rooms/Portals remain visibility tools, not scene loaders.

See Lua API Reference for signatures and Session and transitions for reusable contracts.

Replace assets​

Authoring/LastExit.blend contains the assembled rooms and editable Blender models. Assets/Models/LastExit holds their normal OBJ exports: shells, truck, crates, door parts, key, furniture, hollow chest and lights. Four indexed atlases separate architecture, inspection surfaces, props and secondary industrial details. UV layout and texel density are authored in Blender; use the ordinary model and texture import settings when replacing them. See Model Import and Texture Import.

Read Authoring/README.md for export settings, pivots and reproduction scripts. Preserve collider sizes, animation targets, hinges and script names when replacing art. Keep GUID metadata or update every corresponding reference. Static doors combine decoration on their interaction target; animated parts stay separate.

The demo includes original cover art, UI images and texture sources. The bitmap alphabet is procedural. Action sounds, UI cues, truck knocks and music are user-selected library assets with provenance recorded in Authoring/audio_sources.json. Their original collection licenses still apply. No Resident Evil assets are distributed. The old development blockout generator must not overwrite this art.

The template contains five Last Exit scenes and their dependencies, plus editable Blender sources. Models use metres: doors are 1.10 x 2.20 m, the truck is 5.22 m long and the key is 11.74 cm high. Use Advanced Feature Lab for Timeline, skeletal animation and portals.

Audio​

Four concrete footstep variations follow actual movement, so turning or pushing against a wall does not produce steps. Walking and running cadence is controlled in player.lua independently of sample pitch. Doors and the chest have separate opening and closing sounds; creaks play only during opening motion. Truck interaction plays three spaced knocks.

Inventory navigation, item selection, other menu navigation and opening a dialogue window use separate cues. A new dialogue page does not replay the window-opening sound. These are Lua event rules, not automatic sounds attached to every engine Button or Canvas.

The warehouse uses 15 resident effects, approximately 80 KiB of SPU sample data, with Audio Sources attached to existing objects. Gameplay and menu/ending use distinct stereo loops through CD-XA. Long tracks use Music, never resident AudioSources. AUDIO_GUIDE.md and UI_ASSET_GUIDE.md explain the source names, import settings and event bindings. See AudioSource for stoppable playback versus independent one-shots.

UI and dialogue​

The item box shows six storage rows beside six pack slots. The personal pack uses the left side for the selected item's inspection image. That preview starts disabled and stays hidden in the item-box view; keep that rule when adding items. Descriptions and controls have their own contrasting backgrounds. The aiming reticle is a small transparent image.

Dialogue has entry, typing, page-change and exit phases. Cross first reveals the complete line; a later press advances or confirms. In Controls, Square switches between typewriter and instant text. The dialogue uses unscaled time so its presentation can continue while gameplay is paused. See UI and Canvas and Standalone Animations to reuse these tools.

Normal loading screens reuse the menu art and show progress for the current disc read. Door transitions intentionally use black loading after the door animation. Configure your own presentation using Scene Management.

Editable sources use descriptive English snake_case, such as ui_inventory_navigate.wav and warehouse_key_icon.png. Names describe use; GUID-named files in Library are generated caches and should not be renamed.

Keep an editable copy current​

Updating the engine updates its bundled template, not an existing editable demo. Open the example-copy dialog and select the same parent folder. For an older versioned Last Exit copy, Update Copy and Open replaces it with the current template and keeps the complete previous folder beside it as a backup. This is a replacement, not a merge of local edits. Use a different parent folder to compare a fresh copy with your customized project. Save and close the old copy before updating, then rebuild its disc image.

Validation​

Build and inspect post-bake reports in Build/ps1/logs after every art replacement. The project reserves 104 KiB of Lua heap and targets 320 x 240. Static PS1 budget acceptance does not prove emulator frame rate or physical-console compatibility. Test the complete route, UI cancellation, transfers, both truck dialogues, key use, pause and replay with a digital pad and DualShock.