I’ve created a tool for creating new C++ modules. The plug-in adds a new entry to the File menu and opens the window you can see below.
The tool automatically generates all needed files, updates your .uproject files, and regenerates your Visual Studio solution. I found myself doing all these steps so often in my own projects that I got fed up and wrote a tool to automate it. I share it here in hopes it will be useful to you. I also intend on releasing this on the Marketplace for free to facilitate installation.
The tool can be cloned / downloaded from this Git repository. Feel free to make pull requests.
You can get the tool on the Unreal Marketplace for free.
For those left wondering what a C++ module is: here’s a documentation link :).
I believe in making tools like this free for everybody. If you’d like support with a donation, here’s my PayPal.
Most time I spent learning Unreal’s editor APIs; its systems I have never worked with before since I usually do game development.
There was a bunch of stuff:
Thisresource helped for getting the menu extension in.
I looked similar modules, such as AddCodeToProject (Visual Studio ctrl + t was so useful)
I had to learn scripted UMG using C++, SNew() and so on, for creating the window
I needed to figure out the somewhat complicated JSON API for updating the .uproject file
Regenerating the Visual Studio solution was really simple: I found thisin the module implementing “Add new C++ class”
Hi! this is a very useful plugin, I have created a pull request in your repository to add compatibility with plugins. If you think that is useful you can add it to the main branch
The entire engine is made of modules: Core, Slate, AiModule, etc. Modules consist of functionality that have a common purpose.
You could structure your project code in a similar fashion. I can recommend Clean Architecture if you are interested. There’s two main advantages to structuring your code like this:
faster compilation; prevents unnecessary compilation of unrelated code.
clean, independent code; code is encouraged to be more modular and re-usable.
This also allows more for easily unit testable code.
This tool simply automates the process of creating modules since creating modules is related to creating a few required files.