-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation
This document introduces the design principles guiding the lustre
voxel game engine, focusing on Data-Oriented Design (DOD) and Data-Oriented Programming (DOP). It explains how these approaches enable performance and flexibility for planetary-scale worlds with voxel-based gameplay and orbital mechanics. The content is high-level, aimed at understanding the concepts behind lustre
’s architecture.
- Data-Oriented Design (DOD)
- Data-Oriented Programming (DOP)
- Review
Definition: DOD shapes how lustre
organizes and processes data to maximize hardware efficiency, making the most of CPU capabilities for fast, smooth gameplay. It’s essential for managing vast numbers of voxels—tiny 3D blocks that form planets, moons, and other environments.
-
Efficient Data Storage: Voxel information, like type (e.g., stone, air) and properties (e.g., strength), is stored in compact, continuous blocks of memory. This setup allows the CPU to quickly grab only what it needs, like fetching just the types for rendering a scene, without wasting time on unrelated data.
-
Minimal Overhead: Each voxel uses only the smallest amount of memory necessary. For example, voxel types are stored in a way that supports thousands of possibilities while taking up minimal space, leaving room for more complex worlds.
-
Fast Access Patterns: Data is arranged so the engine can process it in a straight line, like reading a book from start to finish. This predictability helps the CPU anticipate what’s next, speeding up tasks like building terrain or checking collisions.
-
Parallel Processing: DOD allows
lustre
to split work across multiple CPU cores. For instance, generating one part of a planet doesn’t interfere with another, so different regions can be built simultaneously without bottlenecks.
Definition: DOP guides how lustre
structures its logic to be flexible and easy to maintain, ensuring the engine can grow with new features like modding or multiplayer without becoming tangled.
-
Stable Data: Core information, like how tough a voxel is, doesn’t change unexpectedly. Systems read this data without altering it, preventing errors and making behavior predictable.
-
Flexible Systems:
lustre
’s systems—like those for rendering or physics—are designed to work with any data that fits their needs. For example, a rendering system can handle any voxel-based object, whether it’s a planet or a player-built structure, without custom tweaks. -
Modular Architecture: The engine uses a system where objects (like planets or players) are collections of simple data pieces. This setup lets developers add new behaviors, like a new type of terrain, by combining existing pieces in new ways, keeping the codebase clean.
-
DOD’s Role: Powers
lustre
’s performance by ensuring data is lean and accessible, enabling seamless exploration of massive worlds. - DOP’s Role: Keeps the engine adaptable, making it easier to add features or support community mods.
-
Together: DOD delivers speed for real-time voxel interactions; DOP ensures the engine stays manageable as it scales. This balance creates a robust foundation for
lustre
’s ambitious vision.