Download

Game Module Plugin

Hello Everyone,

I am trying to make a plugin to the engine (with a source directory), and distribute it in binary form. The plugin works fine when it is in tested in the editor, or generate a standalone game on the same machine that has the source code. However, if I copy the plugin folder (Binary, resources and .uplugin file) to another machine. It works fine in the editor but the generated stand-alone game (not PIE) fails to start and the log says it can’t find some of the structures and functions from this plugin. Even though in the .uplugin file, the required module is defined as “runtime” module.

Is there anyway we can distribute plugins or game modules in binary format, so a game can be generated without distributing source code as well?

All of the available tutorials seem to generate an editor plugin, rather than run time.

Thanks alot

Ahmed

Hi Ahmed,

Did you compile Win32 versions of your binaries? A cooked standalone game will be Win32 by default instead of the Win64 editor targets used for uncooked games.

Cheers,
Michael Noland

Hi Michael,

Thanks for your quick reply. Yes I tested that, and also made sure that the game targets Win64, (In the game folder the exe is found under Binaries/Win64 folder), but still the same problem. It seems that it does not even try to compile my plugin as a static lib to be linked in the game.

Looking around the source code and binary distribution of UE4, I noticed that some of the engine plugins are compiled as dlls and static .lib as well. Is there a special option in the Build.cs file I need to use to get it to link in the game.

Thanks a lot for your help. Keep up the good work with such a brilliant engine

Ahmed

To use the binary plugin in the game at runtime, you should only need to:

  • Make sure the game has the plugin enabled in its default configuration file
  • Make sure your distributed plugin contains the precompiled static libraries (or DLLs, for any editor-specific plugin modules)

It looks like you may have found a bug. We’re investigating a similar issue on our side, where plugins distributed without source aren’t able to be statically linked against from a game project. We’re hoping to have that issue fixed before the next release. But from your post it’s not clear if your game is statically linking against a plugin module, or if you are simply relying on the plugin being “loaded” automatically at startup.

–Mike

Hi Mike,

I am trying to statically link the game against my plugin, how ever that does not work. As the UBT does not generate the static libraries for the plugin. The editor modules (dll) are generated fine with no problem, but no static libs.

I have found a work around by adding this line to the game .Target.cs file, in the constructor of the GameTarget class :).


AdditionalPlugins.AddRange(new string] { "pluginname" });

Now when I compile the game in either development or shipping I get a static library gamename-pluginname-platform.lib, to distribute this I had to change the name to pluginname-platform.lib.

Thanks a lot for your help.

Ahmed

Is there some news about this? I’m in the same situation. I worked on version 4.6 preview in order to be ready when version 4.6 comes out.

I have a 2 plugins based on WmfMedia and MediaPlayerEditor. They are really similar since I added webcam and frame grabber capture functionality. So I started from these 2 plugins, and really tried to stick to the way they works to avoid any problem.

When I work from my own build copy of unreal, I can work from the editor, package some game, and run it. All is fine. I make sure to build my stuffs with the version.h file modified to fit my installed version of UN 4.6.

Now I copy my plugin stuffs under C:\Program Files\Unreal Engine\4.6\Engine\Plugins\Media. Launch Unreal. The plugins are correctly loaded and I can use it in the game creation. Then I package my game and when I launch it, it says:failed to load because module ImmersiveCapture could not be found.

if ( FailureReason == EModuleLoadResult::FileNotFound )
{
FailureMessage = FText::Format( LOCTEXT(“PluginModuleNotFound”, “Plugin ‘{0}’ failed to load because module ‘{1}’ could not be found. Please ensure the plugin is properly installed, otherwise consider disabling the plugin for this project.”), PluginNameText, TextModuleName );
}
PluginManager.cpp, line 379.

I see one difference with WmfMedia : I don’t have the static lib generated : WmfMedia-Static.lib.

How can it be generated?

I really would like to be able the distribute that plugin, so some help would be appreciated.

Bryan