Skip to main content

Client Runtime Overview

What is the Client Runtime?

The Client Runtime is the player-facing layer of OpenCore. It handles interaction with the GTA V engine, UI management, and local entity control. Unlike the server which handles global authority, the client focuses on responsiveness, visuals, and local player interaction.

Automatic Injection

Just like on the server, OpenCore handles the lifecycle of client services automatically. Use @Controller() to define entry points, and inject services via the constructor.

@Controller()
export class MyUIController {
constructor(private readonly notification: NotificationService) {}

@Key('E')
onPressE() {
this.notification.show('You pressed E!')
}
}

Key rule: Never use new MyService(). Define the service in your constructor to receive the framework-managed instance.

Core Responsibilities

The client runtime handles several critical areas:

  • Streaming — Loading and unloading models, animations, and textures.
  • Visuals — Managing blips, markers, and native notifications.
  • Life Cycle — Handling the complex process of spawning and resurrecting the player.
  • Interactions — Displaying progress bars and managing NUI communication.
  • Input — Binding keyboard keys and game events to controller methods.

Available Client APIs

APIResponsibility
SpawnOrchestrates the complete player spawn/respawn lifecycle.
AppearanceManages ped aesthetics (clothing, face, tattoos).
NotificationsDisplays native GTA V notifications, help text, and subtitles.
BlipsManages map icons for entities, positions, and radii.
MarkersRenders 3D markers in the game world.
PedsSpawns and manages NPCs with animations and AI tasks.
TextUIRenders 2D/3D text prompts and labels.
StreamingHigh-level API for requesting and releasing game assets.
ProgressDisplays progress bars with animation and prop support.
VehicleClient-side vehicle interaction (synchronized and local).

Design Notes

  • Client controllers are event-driven, not request-driven.
  • Prefer @Interval() over @OnTick() when possible to reduce CPU usage.
  • @LocalEvent() is the recommended way to communicate between client systems.
  • NUI communication is explicit and isolated through @OnView().