πŸ–₯️ 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:

  1. Initialization (Hardware Layer)

    • The Computer component 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.

  2. Operating System Load

    • The OperatingSystem component is instantiated and attached.
    • Core subsystems are initialized (ConsoleSystemHost, AppSystemHost, etc.).
    • The system can show a boot sequence (text logs, loading visuals).
  3. 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.

  4. 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