How pshocker/sdlms works
Project’s Purpose and Architectural Style
• The project is a game engine or game framework aimed at re-implementing MapleStory’s experience.
• It is built on an ECS (Entity Component System) architecture. Notice the “Core/ECSSystem.h”, the “Components” directory (which contains game behaviors like AnimatedSprite, Avatar, Camera, etc.), the “Entities” which represent game objects (like Characters, Portals, Background, etc.), and the “Systems” which manage runtime functionalities (InputSystem, RenderSystem, SoundSystem, etc.).
Main Components
a. External Libraries & Dependencies:
• 3rdparty libraries, such as SDL (for rendering/input/audio) and Freetype (for fonts), and wzlibcpp (likely for resource handling).
• Mention FFMPEG configuration as noted in the README for multimedia support.
b. Core Engine Components:
• “Core” module: Manages essential utilities such as file handling, input management, window creation, world management, and helper utilities (e.g., MathHelper).
• “Resource” module: Manages assets and resource loading (e.g., Wz.cpp/Wz.h).
c. Entity Component System Modules:
• “Components”: Defines various individual behaviors (e.g., AnimatedSprite, Camera, Player, etc.)
• “Entities”: Specifies game objects (e.g., Characters, Backgrounds, NPCs, Tiles) that are composed of components.
• “Systems”: Implements game loop processes like input handling (InputSystem), rendering (RenderSystem, SpriteSystem, VideoSystem), physics (PhysicSystem), and other frame-specific tasks (DeltaTimeSystem, CameraSystem, TransformSystem).
d. Build and Platform-Specific Configurations:
• Build scripts via CMake (CMakeLists.txt at both the project and subdirectory levels).
Relationships and Data Flow
• The External Libraries layer that provides foundational support (SDL, Freetype, FFMPEG, etc.).
• The Core/ECS layer which drives the engine mechanics – core functionalities and the ECS framework that orchestrates the Systems, Components, and Entities.
• The Game Content layer representing game-specific entities integrated from “Entities” and ‘Components’, manipulated by various “Systems”.
• How the Core layer calls into external libraries.
• The flow from Systems (e.g., InputSystem, RenderSystem, PhysicSystem) to update Entities based on Component data.
• Resource management flowing from the Resource module to Entities and Components.
• Interactions such as Input -> System update -> Entity state changes -> Render output.
Architectural Patterns and Design Principles
• Separation of concerns:
• The ECS architecture clearly distinguishes between data (Components), behavior (Systems), and aggregates (Entities).
• Core services (like window management and file I/O) are abstracted away from game-specific logic.
• Modularity and platform independence:
• Use of CMake for cross-platform builds is a key design decision.
• The documentation files (doc/Android.md, etc.) point to platform-tailored configurations.