This section encodes the engineering discipline behind the DreamWeave OpenMW-Lua corpus.
The point is not to turn taste into law. The point is to separate engine contracts, measured behavior, derived constraints, and preferences, then explain why the preferences exist.
Start with Contracts, Measurements, Derivations, and Preferences. Effective OpenMW Lua Foundations carries forward the basic discipline from Yvan/Hebi's original educational work. If you only read one opinionated page, read Error Handling.
For stateful systems, continue with Object Lifetime and Stable Identity, State Ownership and Invalidation, and Save Compatibility. For reusable infrastructure, read API and Interface Design.
Contracts, Measurements, Derivations, and Preferences
Know what kind of claim you are making before turning it into doctrine.
Effective OpenMW Lua Foundations
The basic discipline carried forward from Effective OpenMW Lua: narrow scope, explicit control flow, clear tables, and functions with one job.
Readability Is a Performance Feature for Humans
Full-word names, semantic whitespace, narrow scopes, and almost no narration comments.
Error Handling
Fail fast on programmer errors; protect only real recovery or cleanup boundaries.
Object Lifetime and Stable Identity
Live engine-backed objects are not interchangeable with IDs, records, or persisted data.
State Ownership and Invalidation
One source of truth, explicit derived state, bounded caches, and generations for delayed work.
Validate and Normalize at Ingress
Turn flexible external data into strict internal data once, before it reaches hot or stateful code.
Module and API Design
Small contracts, explicit ownership, and abstractions that have earned their existence.
Save Compatibility and Persistent State
Persist contracts, not implementation accidents; version or rebuild state that can outlive the code that wrote it.
Event Architecture
Events are ownership boundaries, not free decoupling.
API and Interface Design
Small explicit contracts, stable ownership, typed payloads, and no accidental export of implementation state.
Validation and Testing
Make correctness cheap to prove and regressions expensive to hide.