π₯οΈ Computers
A system for creating in-game virtual computers that can run independently with their own operating systems and applications.
The Computers system is designed to support both:
- Standalone in-world computers β interactive, self-contained devices that simulate real hardware + OS.
- Game UI desktops β slick and flexible UI shells (DesktopEnvironment, UIWindowSystem, AppSystem, etc.) that provide a modern in-game interface for menus, HUDs, and apps.
β¨ Features
Modular architecture where each Computer can have its own configuration, display, input, and operating system.
Support for multiple computers in one scene, each isolated but following the same base rules.
Extensible OperatingSystem layer with pluggable subsystems:
- UIWindowSystem for windows, panels, and docking logic.
- AppSystem for apps, processes, and task management.
- ConsoleSystem for debugging or diegetic terminals.
Works both as diegetic devices (in-world monitors) and non-diegetic UI environments (main menus, HUD desktops).
π Module + Folder Structure
The system is split into modular namespaces under CosterGraphics.Computers.
Each namespace corresponds to a subfolder, keeping runtime and editor code cleanly separated.
Computers/
βββ Runtime/
β βββ Computer.cs # Core computer class (bootstrap + OS host)
β βββ ComputerDisplay.cs # Display / screen binding
β βββ ComputerSpeaker.cs # Audio output binding
β βββ OperatingSystem/
β β βββ OperatingSystem.cs # Base OS class
β β βββ DesktopEnvironment.cs # Handles UIWindowSystem
β β βββ AppSystemHost.cs # AppSystem integration
β β βββ ConsoleSystemHost.cs # ConsoleSystem integration
β β βββ ...
β βββ Input/
β βββ KeyboardInput.cs
β βββ VirtualMouseInput.cs
β βββ ...
β
βββ Editor/
βββ ComputerEditor.cs # Inspector tooling
βββ Gizmos/ # Debug visualization tools
This modular split ensures:
- Each Computer instance is just a shell β you βplug inβ display, input, and OS.
- OperatingSystem can evolve independently (desktop-like, console-only, or experimental).
- Easy to add new subsystems (e.g., networking, file systems, or narrative layers).
β‘ Boot Process Walkthrough
When a Computer is powered on in-game, it goes through a deterministic boot cycle similar to real-world hardware/OS startup:
Initialization (Hardware Layer)
The
Computercomponent initializes its connected devices:ComputerDisplay(video output)ComputerSpeaker(audio output)- Input bindings (
KeyboardInput,VirtualMouseInput, XR input, etc.)
Debug messages or a βPOST-likeβ (Power-On Self Test) log may be shown.
Operating System Load
- The
OperatingSystemcomponent is instantiated and attached. - Core subsystems are initialized (ConsoleSystemHost, AppSystemHost, etc.).
- The system can show a boot sequence (text logs, loading visuals).
- The
Desktop Environment / Console Start
Depending on configuration:
- DesktopEnvironment starts, spawning the UIWindowSystem and AppSystem.
- ConsoleSystem is launched instead for text-only computers.
Subsystems register themselves with the OS for process and resource management.
App Startup
- Startup apps or services are launched (e.g., Task Manager, Start Menu, Network App).
- System transitions to a ready state where the player can interact.
This lifecycle allows each Computer to behave like a self-contained machine, and makes it possible to support different βflavorsβ of computers (lightweight console-only, full desktop OS, kiosk mode, etc.).
π Boot Process Diagram
flowchart TD
A[π» Computer Power On] --> B[π§ Hardware Init]
B --> C[π₯οΈ Display + π§ Speaker + β¨οΈ Input Ready]
C --> D[πͺ Operating System Load]
D --> E[βοΈ Subsystems Init<br/>(ConsoleSystemHost, AppSystemHost...)]
E --> F{Desktop or Console?}
F -->|Desktop| G[πΌοΈ DesktopEnvironment<br/>UIWindowSystem + AppSystem]
F -->|Console| H[π₯οΈ ConsoleSystem]
G --> I[π Startup Apps Launched]
H --> I
I --> J[β
Ready for Player Interaction]
π§© Namespace
CosterGraphics.Computers
π Related Articles
- OperatingSystem β OS abstraction, boot process, subsystems.
- AppSystem β Application and process management.
- UIWindowSystem β Desktop windowing environment.
- ConsoleSystem β Terminal/console integration.