Zum Hauptinhalt springen

Chapter 18

Runtime Composition

"Within the Cube Framework, runtime objects achieve completeness through composition rather than through isolated construction."


Why This Chapter Exists

Runtime Assembly creates executable runtime objects.

However, creating runtime objects is only part of the process.

A runtime object must also become a coherent composition.

Meshes must be assigned.

Sockets must become available.

Parent relationships must be resolved.

Attachments must be established.

Only when every participating runtime element has been connected does the runtime object become a complete architectural composition.


Runtime Objects Are Collections

Within the Cube Framework, a weapon is never treated as a single mesh.

Nor is it considered a single component.

Instead, a weapon is viewed as a collection of cooperating runtime elements.

Every element contributes a specific responsibility.

Some elements provide visual representation.

Others provide attachment points.

Others contribute runtime statistics.

Together they form a single runtime object.

Composition is driven by authored Definitions rather than handcrafted construction logic.

The framework assembles runtime objects by interpreting prepared data instead of relying on hardcoded object creation.


Composition Begins With Assignment

The first step of Runtime Composition is assigning runtime components.

Every runtime entry receives the component required to represent its authored definition.

Depending on the authored asset, this may be a Skeletal Mesh Component or a Static Mesh Component.

At this stage the runtime object begins acquiring its physical representation.

The object now exists visually.

Its relationships, however, are not yet complete.


Relationships Are Built Afterwards

The Cube Framework deliberately separates component creation from relationship creation.

Once every runtime component has been assigned, the framework resolves the relationships between them.

Parent links are established.

Available sockets are collected.

Attachment hierarchies are constructed.

This separation ensures that relationships are created only after every participating runtime component actually exists.


Composition Is Deterministic

Runtime Composition follows a predictable sequence.

Components are assigned.

Socket information is collected.

Parent references are resolved.

Attachments are created.

Finally, the framework verifies that every required runtime component has been assembled successfully.

Only then does the Build complete.

This deterministic process guarantees that every runtime object reaches the same final state regardless of asset loading order.


Runtime Composition Is Incremental

The Cube Framework intentionally supports asynchronous asset loading.

As a consequence, runtime composition does not assume that every asset becomes available simultaneously.

Instead, every newly loaded asset contributes another piece of the runtime composition.

As additional runtime elements become available, the framework continuously attempts to complete the remaining relationships.

Composition therefore evolves progressively until the runtime object becomes complete.


Composition Before Gameplay

Gameplay never participates in Runtime Composition.

By the time gameplay receives a runtime object, composition has already finished.

Every runtime component exists.

Every attachment has been established.

Every socket relationship has been resolved.

Gameplay interacts only with the finished result.

This separation keeps gameplay systems independent from runtime construction.


Why Runtime Composition Matters

The Cube Framework separates composition from gameplay because they solve fundamentally different problems.

Composition answers:

How does this runtime object become structurally complete?

Gameplay answers:

How should this completed runtime object behave?

Treating these responsibilities independently allows the framework to evolve each layer without affecting the other.


Design Note

Whenever a new runtime element is introduced, avoid attaching it immediately during creation.

Instead ask:

"Should this element first become part of the Runtime Composition?"

Construction should always precede interaction.


Framework Law XVIII

Within the Cube Framework, runtime objects become complete through composition rather than isolated construction.

Every runtime element contributes to the final structure.

No individual element represents the runtime object on its own.


Looking Ahead

Runtime Composition produces a complete runtime representation.

The next chapter explores where this representation lives and how the Runtime Host coordinates the systems that operate upon it.


Revision History

Version 1.0

Initial publication.