Overview
RuneLite is built on a modular, dependency injection-based architecture that enables powerful extensibility through plugins. The client is structured around several key components that work together to provide a rich Old School RuneScape experience.Core Architecture Components
Dependency Injection
Google Guice manages all dependencies and component lifecycle
Event Bus
Central event-driven communication between components
Plugin System
Modular plugins that extend functionality
Configuration
Persistent configuration with profile support
Application Startup Flow
The RuneLite client follows a well-defined initialization sequence:Bootstrap
The
main() method in RuneLite.java parses command-line arguments and initializes the HTTP clientDependency Injection with Guice
RuneLite uses Google Guice for dependency injection, which provides loose coupling and testability.RuneLiteModule Configuration
TheRuneLiteModule class configures all the bindings:
RuneLiteModule.java:80-148
All major RuneLite components are
@Singleton scoped, ensuring only one instance exists throughout the application lifecycle.Key Directories and Storage
RuneLite stores data in the user’s home directory:RuneLite.java:105-112
Directory Structure
Directory Structure
.runelite/- Main RuneLite directorycache/- HTTP cache and game assetsplugins/- External plugin JARsscreenshots/- Captured screenshotslogs/- Application logsnotifications/- Notification sound filesfonts/- Custom fontssettings.properties- Configuration storageprofiles/- Configuration profiles
Threading Model
RuneLite operates with multiple threads:Client Thread
Runs the game logic at ~50fps. All game state access must occur on this thread.
Event Dispatch Thread (EDT)
Handles all Swing UI operations. Plugins start/stop on this thread.
Executor Service
Background tasks like HTTP requests and scheduled operations.
Render Thread
GPU plugin rendering (when enabled).
Client API vs Client Implementation
RuneLite separates the API interface from implementation:Client interface provides access to:
- Game state (players, NPCs, objects)
- Widget/interface data
- World information
- Player inventory and equipment
- Game settings and configuration
The actual game client is loaded dynamically and implements the
Client interface through bytecode manipulation (mixins).HTTP Client
RuneLite provides a configured OkHttpClient for making HTTP requests:RuneLite.java:427-478
The HTTP client includes automatic User-Agent headers, response caching, and connection pooling.
Command-Line Options
RuneLite supports several command-line flags for development and debugging:| Option | Description |
|---|---|
--developer-mode | Enables developer tools and side-loaded plugins |
--debug | Enables debug logging output |
--safe-mode | Disables external plugins and GPU plugin |
--profile <name> | Uses a specific configuration profile |
--sessionfile <file> | Specifies session file location |
--insecure-skip-tls-verification | Disables TLS certificate verification |
Version Information
RuneLite tracks version information throughRuneLiteProperties:
RuneLite.java:115
Next Steps
Plugin System
Learn how plugins extend RuneLite functionality
Event Bus
Understand event-driven communication
Configuration
Manage persistent settings
UI Overlays
Create custom UI overlays