Hot reload of project plugins isn’t working for us and I’m trying to figure out why.
We have our own build of the engine. I’m working on a plugin that’s in the project area. (<Project>/Plugins/<PluginName>/Source/<PluginName>)
If the engine is running, then when I build in visual studio it produces hot reload files. (<Project>/Plugins/<PluginName>/Binaries/Win64/UE4Editor-<PluginName>-1234.dll)
If the engine is not running, then when I build in visual studio it deletes the hot reload files and generates regular dlls (<Project>/Plugins/<PluginName>/Binaries/Win64/UE4Editor-<PluginName>.dll)
Even when hot reload files are generated, the editor doesn’t reload them.
When I click “Compile” in the main editor window it doesn’t seem to actually recompile the plugin or attempt to reload anything.
Under Window>Developer Tools>Modules my plugin doesn’t have Unload or Reload buttons.
The one thing that DOES work is the Recompile button in the Modules window next to my plugin. Is building from the Modules window the only supported workflow, or should it be possible to build from visual studio and/or the compile button in the main editor window? Ideally I’d prefer to compile from visual studio and then just reload the plugin in unreal.
As far as I can tell this is not supposed to work. The editor seems only able to hot-reload game modules. Everything underneath “Plugins” must be compiled on the outside and, if in “Development Editor” configuration, linked without the editor running so it drops the file handle.
Ah, okay. The distinction between plugins and game modules wasn’t clear to me. When should code go into a plugin vs game modules? Are there different features and limitations of each? (or is there a good doc somewhere that describes the differences?)
Plugins are portable modules.
If you want a set of classes, systems, to be usable across multiple projects you most likely don’t want it hardcoded to your project source.
Example, I had a FSM component in a project, but wanted to easily move it to another ones, so I made a plugin module for it and moved the system out of my main project; every time I make changes to the plugin, all game projects using it are updated with latest module revision.
If still hardcoded to the game project, a lot of copy/paste would be needed.
Plugins also makes feasible to work on two separate Uproject for the same game, one client project and the other for server project. If you code everything in project modules you cannot do that without a ton of duplicated classes and assets, for example.
Hello guys, maybe it’s late, but i made a tutorial for developing plugins using the hot reload feature. I’m using a workaround for that (creating game modules first and converting them to a plugin later).