How polivilas/unrealenginesdkgenerator works
Main Components to Highlight
• SDK Generation Core: Represent the main “Engine” module that contains the common utility files (Logger.cpp/hpp, NameValidator, PatternFinder, etc.). This module embeds support for multiple Unreal Engine versions (subfolders UE1, UE2, UE3, UE4) to handle version-specific differences.
• Game Template Projects: The “Target” folder contains subdirectories for each supported game (e.g., ARKSurvivalEvolved, Borderlands2, Fortnite, etc.). Each template holds adjustable files such as EngineClasses.hpp, Generator.cpp, GenericTypes.cpp, NamesStore.cpp, and ObjectsStore.cpp that are used to customize the SDK generation.
• Project Generation Scripts: The CreateNewProject.bat and CreateNewProject.ps1 scripts act as a front end to copy and modify a template project based on user-provided inputs (source game and new game name).
• Visual Studio Integration: The .vcxproj files and the solution file (UnrealEngineSDKGenerator.sln) serve as integration points for compiling and injecting the DLL into the target game.
• Generated SDK Output: The process produces an output folder containing multiple files (SDK.hpp, SDK folder with various “XXX_…” files, and log/dump files) that represent the final SDK.
Component Interactions and Data Flow
• User Input and Template Selection: The developer chooses a game version from the shipped list in the README. This selection feeds into the project generation script.
• New Project Generation Process: When the CreateNewProject.bat script is executed, it reads the “copy from” (template project in Target) and “new name” parameters. It then triggers file copying and text replacement between the template and the new project.
• SDK Generation Engine: Once the new project files are in place, the system (via the methods in Generator.cpp, the configuration settings, and the reverse-engineered engine classes) interacts with the Engine module to produce the SDK files. Here, multiple functions (GetOutputDirectory, GetGameName, etc.) determine how the code is output.
• Compilation & Deployment: Finally, the generated project (represented by its .vcxproj) is added to the solution file. After compiling, the DLL is injected, and the SDK is generated (with associated log and dump output).
Important Architectural Patterns/Design Principles
• Template-Based Generation: The project relies on predefined templates (found in Target subdirectories) for different Unreal Engine versions and games.
• Modularity & Abstraction: The separation between common generator logic (Engine) and game-specific configuration (in each Target project) is clear. This separation is key to extensibility.
• Configuration Driven: Many generation behaviors are controlled by configurable methods in Generator.cpp (such as output directory, conversion of static methods, or inclusion of headers), making the tool adaptable to many game types with minimal manual changes.
• Use of Reverse Engineering: The tool includes methods and hints for reverse engineering engine classes and signature searches, which are core to its function.