Code Review of "Skyward Scammer" - C++ Game with SDL2
0:00 Introduction and Game Overview: The video reviews the code of "Skyward Scammer," an RPG game built with C++ and SDL2, focusing on code structure, asset management, and initialization.
2:11 Platform Portability: The reviewer praises the use of CMake for cross-platform support (Mac, Linux, Windows), emphasizing the importance of avoiding platform-specific project files and using portable libraries like SDL2.
7:57 Game Engine Structure (Singleton Pattern Critique): The review dives into the game's core architecture, criticizing the heavy use of static members and the Singleton pattern in the GameEngine class. This is seen as hindering flexibility and maintainability.
8:51 Tree-like Structure Recommendation: The reviewer advocates for a hierarchical, tree-like structure for game objects, promoting modularity and easier resource management.
13:38 Initialization Process (Constructor vs. Init): The review highlights an inconsistency in the initialization process, with some initialization happening in the GameEngine constructor and some in the on_init function. A unified approach is recommended.
16:57 Asset Management (Manual String IDs): The reviewer finds the manual string-based asset management system (using a fixed array of strings) cumbersome and error-prone.
19:17 Dynamic Asset Loading Suggestion: A dynamic asset loading system that scans the asset directory at runtime is proposed to improve flexibility and ease of adding new assets.
20:30 String Usage for Paths (File System API): The use of strings for file paths is discouraged. The reviewer recommends using std::filesystem::path for better path handling, especially since the project uses C++17.
21:41 Potential Use of Smart Pointers: The use of raw pointers for resource management (textures) is noted, with the suggestion to consider using shared pointers for improved memory management in more complex projects.
23:20 Upcoming Pseudo-3D Plane Review: The video concludes by teasing a deeper dive into the game's pseudo-3D rendering technique in a future installment.