Engine Coding Guidelines
Core Principles
Stability first.
Code must remain predictable and safe under both MSVC and Clang.
Performance-focused.
All changes must consider CPU, GPU, and memory impact, with ARM-class ~1 GHz CPU as a baseline target. Performance measured on a local desktop CPU must not be treated as sufficient or representative of real-world target hardware.
Strict Clang 16+ compliance.
No MSVC-specific behavior, compiler extensions, or undefined constructs.
Licensing clarity.
All contributions must be copyright-clean. Code may be included only if it is:
Original work by the contributor or
Licensed under permissive licenses (e.g. MIT, Apache 2.0, BSD, Zlib)
ABI safety.
Do not modify engine bitmask layouts, payload structures, serialization formats, or any CPU/GPU-shared binary contracts.
Forbidden Usage
Recursion
Recursion is banned; use iterative patterns.
No virtual functions
Do not add new virtuals unless strictly required.
Kismet/Blueprint API additions
No new BlueprintCallable or BlueprintPure functions unless explicitly approved.
Template usage avoidance
Avoid templates unless they provide a clear performance or architectural benefit.
Do not introduce template-heavy patterns that increase compile times, binary size, or code complexity.
ABI-breaking modifications Do NOT modify:
Ray tracing payload bitfields
Shader-visible enums or flags
Packed bitmasks used by RHI or RenderCore
Reflection system bitmask definitions
Any CPU/GPU shared struct layouts
Such modifications break PSO caching, ray tracing stability, serialization, and cross-platform/vendor GPU behavior.
Commit Naming
Use the following Prefixes:
[Optimization]
[Rendering Feature]
[VR]
[Mobile]
[Plugin]
[Fix]
When making backports or adding a plugin, include the correct links to original commits/repos.
Technical Standards
No undefined behavior or non-standard extensions.
Avoid implicit type conversions.
Maintain memory correctness: avoid large stack allocations, minimize dynamic memory
Prefer constexpr, FORCEINLINE, and zero-cost abstractions.
Performance Rules
Favor contiguous memory and cache-friendly layouts.
Avoid unpredictable branching in hot paths.
No FString processing, reflection calls, dynamic allocation, or virtual dispatch inside per-frame loops.
Use SIMD-friendly math (SSE/AVX/NEON) when appropriate.
WIP work/Branches
Commit to alternative branches to pass WIP work
Give a brief commentary on what’s left to be done
Delete unnecessary temporal branches
Make other forkers aware of the WIP work
Verification Requirements
Compilation
Must compile cleanly under MSVC and be Clang compliant.
Stability
No crashes on startup, shutdown, or on the Tech Showcase project.
No log spam.
Guard all code not necessary for shipping
ABI
All shader-visible structs must remain bit-for-bit identical.
No changes to payloads, bitmask layouts, uniform buffers, or reflection flags.
ABI violations result in immediate rejection.
Review Checklist Before PR, one must confirm:
No recursion
No added virtual calls (and cache existing engine virtuals where possible)
No new Kismet exposure
Copyright-free code
ABI and bitmask integrity preserved
Strict Clang compliance
No undefined behavior
No performance regressions
No unnecessary binary size increases
No shader or RHI ABI mismatches