How Do I Distribute C++ Code?

I’m building a product for the marketplace that contains quite a lot of C++ code. What’s the best way of packaging my project for the marketplace so that a down loader is not forced to use c++?

Then obvious way is to expose the C++ functions to blueprints. But this still requires C++ source code to be integrated with the project. A Blueprint Function Library is another way, but again this still requires the C++ code to be present inside the project. I don’t know if either of these methods is suitable for something deployed to the marketplace. Plugins might be another way (experimenting with this at the moment), but again I’m not sure if this will work for something deployed on the marketplace.

There doesn’t appear to be anything in the UE4 documentation or on AnswerHub that addresses this. Has anyone got any ideas?

I don’t know what you doing, but best way is to make a Plugin which can be enabled in any project:

Not sure how content distribution works with plugins right now, but i guess there might be ways to include demo project, you need to look up in market place information.

If you not aware of that yet, Projects and Plugins are just diffrent ways to place code and assets to engine in organized way, in reality your project and plugins creates one single engine in one body, in fact UE4 is first to introduce projects and plugins, before that you would need engine installation for each project (look UE3/UDK), you could imagine what pain it was.

Because of that C++ modules works the same regardless if they are n C++ project, plugin or part of engine source code so moving code to plugin should not be a problem (as long as you don’t change name of module), you probably only will need to change main module class because C++ project puts default game module template in it’s module, there a plugin wizard, you can use it to start plugin which should be good start.

Also “Blueprint Function Library” is nothing special, it’s purely cosmetic thing, it’s just place to put blueprint node static function unrelated to specific class, but nodes will work from any UObject class regardless where they are, it’s up to you how you organize your code.