How gaspardculis/robot-rumble-rs works
Main Components
• Main Game Loop & Entry Point: Located in src/main.rs, which ties all modules together.
• Core Systems: In src/core, you have components for background rendering, camera management, gravity & physics, and world generation. These modules are the backbone of the game’s simulation and rendering mechanics.
• Entities: In src/entities – specifically the planet and player submodules. Planets include configurations and various material shader files (found in both src/entities/planet and assets/shaders/planet), while player modules manage sprites, animations, and skins.
• Networking: Found in the src/network folder handling game inputs, synchronization (synctest), and possibly connection management for the multiplayer aspect.
• Utilities: In src/utils, which provide shared functions and helpers (math, gradients, spritesheet handling) that support game logic and rendering.
• Asset Management: The assets directory clearly organizes configuration files (in RON format), shader code (for background and planet visuals), and skins data.
Relationships and Interactions
• The Main Game Loop calls into the Core Systems to update game physics, manage the camera, and generate/update the world.
• The Core interacts with the Entities subsystem to update state and render the game world (e.g., player movement, planet physics).
• The Entities (players and planets) use data defined in the asset configurations (shader files and config files) to render their appearance and behavior.
• The Networking module provides data flow between connected clients, feeding into the game loop and updating the game state based on remote player inputs.
• Utilities support several components by providing common maths, gradient computations, and spritesheet handling.
Architectural Patterns and Technologies
• Modular Design: The separation into core, entities, network, and utils shows a clear modular architecture. This modularity also extends to assets that allow flexible configurations (using RON for planet config and network settings).
• Separation of Concerns: Rendering, physics, world generation, and networking are clearly separated, ensuring each module can be updated or replaced independently.
• Data-Driven Design: Config files in the assets directory allow for dynamic changes in shaders, planet kinds, and skins without recompiling code.
• Multiplayer Architecture: Although details are sparse, the README notes the use of [matchbox] for multiplayer, suggesting a peer-to-peer or lightweight server-mediated networking structure.