Plugging an external 3d game engine in c++ ?

I have a developers question. Is it possible to plug an external 3d game engine in c++, and what it will require if it’s not implemented yet?

Yes, it is possible.

It will take a lot of time and effort. A lot.

If you’re embedding it and distributing the result, it will also need to be GPL-compatible.

But the content created in Blender doesn’t have to be GPL? Could you theoritcally make your own game engine, code a c++ interface to blender so content creation, and animation, and logics are all made in blender and you can just hit P to run your 3rd party game engine within blender.

then upon release you make an export and exports all the assets and logics out of blender and distribute your propietary game engine not in GPL?

Yes, it is possible.

It will take a lot of time and effort. A lot.

That dont tells much, im more interested, what files and etc, i have to change.

If you’re embedding it and distributing the result, it will also need to be GPL-compatible.

Nah, its just gonna be used as an map editor.

But the content created in Blender doesn’t have to be GPL? Could you theoritcally make your own game engine, code a c++ interface to blender so content creation, and animation, and logics are all made in blender and you can just hit P to run your 3rd party game engine within blender.

then upon release you make an export and exports all the assets and logics out of blender and distribute your propietary game engine not in GPL?

Exactly the idea. :slight_smile: Now if some blender dev could give more concrete answers, to which parts of the blender code the touch…

If you want specific answers like that I think you’re going to have to give a much more specific description of what you want to do and how you want it to behave.

As long as your not taking Python/C/C++ from Blender’s code base and mixing with your own (non GPL compatible code & then distributing it) — your OK.

From the explanation above, export doesn’t involve yanking code from Blender, so this sounds like very straightforward case that complies with the GPL.

As long as you link the game via C++ (i.e. via source code) and distribute the result, the code in question needs to be released under the GPL. There isn’t really a way around that. As the OP asked about “plug(ging) an external 3d game engine in c++ I made the assumption he was talking about interfacing through said C++ code (I can’t really see how to read it another way to be honest).

If there is no C++ interface between the content created in Blender and the actual game itself - then sure, the GPL doesn’t apply to the situation. However, if you are adding code to Blender (C++ or Python) and distributing the compiled result, legally speaking, the code needs to be released under the GPL. If the game engine is plugged in via source code or through a dynamic library sharing code with Blender (e.g. the plug-in headers), according to the FSF, the GPL applies to the game engine as well. The GPL is designed to do that.

The only real way around this is to create some form of “generic interface library” to your game engine, licensed under a BSD/MIT style licence that can be used/controlled by any program and then use that library in the Blender add-on/plug-in linking it to your game engine. At that point, the interface library is released under GPL-compatible terms (BSD/MIT fit the requirements) and the GPL doesn’t carry over to the game engine itself. Legally speaking, the generic library acts as a firewall of sorts where both Blender & the game engine are using library in accordance with their own & the library’s license.

Im asking the question from the developer of the game engine. Until i get back with him(if that is a correct statement).
The game engine is licensed under the zlib/libpng License. I believe the idea is to use blender as the map editor and just like the bge pressing the “p” key should run the game in the viewport, so is there some api interface, and what it will require if it’s not implemented yet?

zlib & gpl are compatible
https://www.gnu.org/licenses/license-list.html#ZLib

@ideasman42, as an experienced blender developer, would you answer to my post question?

You don’t give much information, so I can only say in general terms - these kinds of integration projects aren’t easy.

So try figure out your minimum-viable-product, If you can get a basic level of integration working. Then you can iterate and improve as needed.

Suggest you focus on blender as a level editor for your engine, rather then trying to execute the game engine as a plugin in the same process (sharing OpenGL context, passing keyboard events etc… can become tricky).

Thank you, that helps.

Just saw this. I don’t know if that’s what you want but it sounds to be pretty close.

Yeah, i know about it.