The OpenRA Universe: A Developer's Guide - guidebee/OpenRA GitHub Wiki

The OpenRA Universe: A Developer's Guide

The Universe and Its Worlds

Once upon a time, in the vast expanse of digital space, there existed a grand universe governed by immutable laws of physics and behavior. This universe, known as the OpenRA Engine, established the fundamental principles that all entities within it must follow. Just as our universe has laws of gravity, thermodynamics, and quantum mechanics, the OpenRA universe has its own set of core principles: Traits and Orders.

The Universal Laws: Traits and Orders

Imagine the OpenRA Engine as a cosmic creator that established two fundamental laws:

Traits: The Building Blocks of Existence

In our OpenRA universe, everything that exists is composed of Traits - the fundamental properties that define what an entity is capable of. Much like how atoms in our world have properties like electron configuration and valence that determine how they interact, traits in OpenRA define the capabilities of every entity.

A tank isn't just a "tank" - it's a collection of traits:
- It can move (Mobile trait)
- It can attack (Armament trait)
- It has health (Health trait)
- It makes sound when moving (WithIdleAnimation trait)
- It leaves tracks on the ground (LeavesTrails trait)

These traits are the universal constants - they function the same way regardless of which world they appear in.

Orders: The Laws of Motion and Interaction

Orders are the universal language of interaction. Just as physics dictates how objects interact through forces, Orders dictate how entities in the OpenRA universe respond to events and commands.

When a player clicks to move a unit:
1. A Move Order is created
2. The Order is sent to the entity
3. The entity's Mobile trait interprets and executes the Order
4. The universe's timeline advances, and the entity changes position

Parallel Worlds: The Mods

Within this universe, different Worlds (Mods) have formed, each with its own unique interpretation of the universal laws. Think of these as parallel dimensions, each with distinctive properties but all obeying the same fundamental physics.

Red Alert World

In the Red Alert world, Cold War technology reigns supreme. Tesla coils harness electricity as weapons, and nations battle with tanks and aircraft carriers.

Tiberian Dawn World

The Tiberian Dawn world is being transformed by an alien crystal, altering landscapes and creating new political factions fighting for control of this resource.

Dune 2000 World

The Dune 2000 world is a desert planet where noble houses compete for control of the precious spice melange, using ornithopters and harvesters to gather resources.

The Inhabitants: Actors, Buildings, and Weapons

Within each world, various entities exist - collectively called Actors. These might be:

  • Units: Mobile beings that traverse the landscape
  • Buildings: Stationary structures that produce units or provide capabilities
  • Terrain: The landscape upon which the drama unfolds

Each actor, while unique to its world, must still adhere to the universal Traits and Orders system. A tank in Red Alert and a trike in Dune 2000 may look different, but both implement the Mobile trait to move and the Armament trait to attack.

The Cosmic Dance: Real-Time Gameplay

When a player starts a game, they initiate a timeline within one of these worlds. As the universal clock ticks forward:

  1. Actors carry out their Orders
  2. Their Traits determine how they interact with the world
  3. Resources are gathered, buildings constructed, and battles fought
  4. The timeline advances inexorably, with each tick bringing new interactions

This cosmic dance continues until one faction achieves dominance over the others.

The Multiverse: Modding

The most fascinating aspect of the OpenRA universe is that it is not fixed. New worlds can be created by those who understand the universal laws. By defining new Actors with unique combinations of Traits, a developer can forge an entirely new reality.

As a new developer approaching this universe, you are like a god peering into a multiverse of possibilities. You can observe the existing worlds, understand their unique properties, and eventually create your own dimension with its own rules, all while adhering to the fundamental laws of Traits and Orders.

A Day in the Life: A Short Story

Commander Sarah materialized at her command console, her digital consciousness now linked to the Red Alert world. Around her, the landscape was quiet—a momentary peace before the inevitable storm of battle.

"Build a Power Plant," she commanded.

In the digital fabric of the universe, her Order was translated:

Order: BuildBuilding
Building: power
Location: X:45, Y:32

The Construction Yard—a complex Actor with a ProductionTrait—received the Order, and began the construction sequence. Its internal clock ticked as it spent the required time and resources to create a new Power Plant Actor.

As the Power Plant materialized, its PowerTrait activated, feeding energy into Sarah's power grid. This energy would enable the construction of more advanced structures—each with their own unique set of Traits.

"Build a Barracks," came the next command.

As the Barracks formed, enemy reconnaissance—an Actor with the ScoutTrait—spotted the new construction. In another part of the digital dimension, Commander Alex received this intelligence.

"Prepare an attack force. Five rifle infantry, two grenadiers," Alex ordered.

In Alex's Barracks, Actors with ProductionTraits began creating units—each a collection of Traits that allowed them to move, attack, and eventually die in the looming conflict.

Sarah, anticipating this, ordered defensive structures along her perimeter. "Build two pillboxes to the east."

The pillboxes—Actors with defensive Traits but lacking mobility—formed a barrier against the approaching threat.

And so the dance continued, Orders flowing, Traits interacting, the world's timeline marching forward in its eternal real-time progression...


For the Technical Developer

Behind the narrative, the OpenRA engine is an open-source game engine for early Westwood Studios real-time strategy games. Its architecture is elegantly modular:

  • The Engine defines the core systems: rendering, networking, input handling, and the fundamental trait system
  • Mods define specific game rules, units, buildings, and behaviors by composing traits
  • The Trait System allows for entity composition rather than inheritance, making it highly flexible
  • Orders provide a clean command pattern for user interactions and AI decisions

As a developer, you'll find that understanding this architecture allows you to:

  1. Modify existing mods by adjusting actor definitions
  2. Create new units by composing existing traits
  3. Implement new traits to expand what actors can do
  4. Eventually create entirely new mods with unique gameplay

The beauty of this system is that once you understand the core principles, you gain the power to create or modify any aspect of the game worlds within the constraints of the engine's universal laws.