11
\$\begingroup\$

Title says it all, here are my concerns.

  1. I want a copyleft license, but not at the cost of having to reveal private code in a game project.
  2. I mostly just want to create a game engine that can serve as a 'base' that other developers can build distros with that may target different languages, platforms, runtimes etc etc.

I will likely be building my app with GTK and some language bindings, but those are my main concerns. Otherwise, If companies have to release their code with my engine, I would switch to something more permissive like Apache 2.0 If anyone can give me an in depth answer for someone who wants to do exclusively open source, please let me know! Thank you very much ahead of time!

Edit 1: So just to be clear, I am looking at GPL/LGPL but if game developers have to release their source code for their game, I would like an alternative. I am mostly just concerned about the GPL 'share source code' clause with new projects that build off my soon to be work.

Edit 2 (IMPORTANT!): I love all the answers here everyone and I learned a lot! I decided to split my project into two licenses, and instead go with the more 'permissive' MPLv2 and LGPLv3. While all the answers were a great resource, be sure to do your own research on licensing! A great bit of helpful resources I found during this mission.

MPL compatibility: https://www.fsf.org/blogs/licensing/mpl-2.0-release General License List: https://www.gnu.org/licenses/license-list.html

And of course, the MPL license itself: https://www.mozilla.org/en-US/MPL/2.0/FAQ/

As noted by the highlighted answer, none of us (including me) is a lawyer. Be skeptical but also inquisitive.

Thank you all so much!

\$\endgroup\$
4

4 Answers 4

19
\$\begingroup\$

I'm not a lawyer, this is not legal advice.

When you make a model in Blender, despite blender being under GPL, the model is not. Similarly when you make a program with GCC, despite GCC being under GPL, the program is not. This is because the model and the program, do not include any part of the code of Blender or GCC respectively... But that is not how game engines work.

To be able to properly answer this question I need to define Game Engine, game development and game development framework.

For the purposes of this answer, I'll define them like this:

  • A game development library, is a library intended to be used by game developers as a part of their game.

  • A game development framework, is also a library, which also covers most of the needs of game development and provides extension points for the game specific code to be added.

  • A game engine is at least a few components:

    • An executable runtime, which is what actually make the games run.
    • An authoring tool (game development environment or editor) which is used to create games.
    • A building tool, which converts the projects made with the authoring tool into the final game (which uses the executable runtime).

    I'd argue that what makes engine the engine is the executable runtime. Addendum: I'm not trying to define what features you would expect an engine to have, but what is the bare minimum to make the category.

Now, while the final game created with a game engine would likely not include any code from the authoring tool, or the building tool, but it would include the runtime. And so we have to consider the license of the runtime when licensing the games. So let us talk about the runtime...

The game engine runtimes are not libraries, so (unlike game development libraries and frameworks) they provide the entry point. Also (unlike game development libraries, but similarly to frameworks) they have extension points where code created by the game authors can execute. This means that the code of the game is a plugin to the game engine, and not the other way around.

So if the final executable of the game includes the runtime (it is bundled in the same program), we can consider the games created with a game engine to be derived software to the game engine runtime, meaning that licenses such as GPL which apply to derived software (a.k.a. viral licenses) would carry from the game engine to the game.

One possible way to work around this is to create the games as a separate package (including scripts and other assets), which the runtime loads. This way the package can be under a license unrelated to the runtime. Addendum: While I frame this is a workaround for copyleft, this is how many non-copyleft game engines work, both open source and closed source.

Notice that the mentioned package would have to be created in a standard format for the runtime to load it, and if said runtime is open source, the code to load said package is open source. Thus, the code of the game is practically revealed regardless. Similarly, we can argue that whatever runs on the end machine could be reverse engineered anyway (given enough time, effort and resources). But not necessarily legally.

It is also worth noting that LGPL might allow developers to use the code as a library... Which means that to allow game developers to use any license on their game, you might make your code as a library under LGPL that game developers can include with their code... Meaning that it would be closer to a game development framework than to an game engine.

Of course, if the definitions used in this answer do not align with the software you have you have in mind, I hope at least to have given you a working model to reason about this.

Be aware that this answer is not a replacement to reading the aforementioned licenses or asking a lawyer.


Addendum on adding an exception to GPL: I agree that parts of the code can be exempt from the license. However, the way I read the question the exception would have to be based on usage (using it for creating game vs using it for creating game engines). I want to reiterate that I'm not a lawyer to emphasize that I do know if such exception would be compatible with GPL. Please hire a lawyer instead of relying on comments on the internet alleging it to be possible or not.

\$\endgroup\$
6
  • 9
    \$\begingroup\$ Node that building using GCC a program is generally very much dependent on code included with GCC (the startup/shutdown), such programs built are specifically exempted from the GPL. (Much like flex and bison make no claim on the generated source code) (with particular reservations about making parsers IIRC). \$\endgroup\$ Commented Dec 10, 2023 at 21:45
  • \$\begingroup\$ The LGPL is perfectly usable even for a genuine "engine" in your sense, where the engine is the main executable program and loads the game logic as a separate library, script, or whatever. Nothing about the LGPL inherently requires a particular library architecture, just that recipients of the combined work receive the source code for the LGPL'd work and the right to modify it and re-integrate the modified version of the LGPL'd work with the rest of the combined work for their own personal use. \$\endgroup\$ Commented Dec 11, 2023 at 22:55
  • \$\begingroup\$ Kind-of besides the point, but I'd say that the term 'game engine' does not necessarily include bespoke authoring or build tools. They're usually part of big reusable game engines sure, but I'd call the runtime the engine and everything else just tools that come with it. \$\endgroup\$
    – Cubic
    Commented Dec 12, 2023 at 9:23
  • \$\begingroup\$ Using a GPL program to execute non-GPL-compatible code (the "one possible way to work around this") would be ethically dubious, even if it may or may not violate the letter of the license... unless you add an exception, which you can always do without trying to jump through hoops. GPL explicitly allows you to make it more permissive. OTOH, it's probably simpler to just use LGPL. \$\endgroup\$
    – Matthew
    Commented Dec 12, 2023 at 17:16
  • \$\begingroup\$ @Matthew how is that ethically dubious? It's what happens every time you run a non-GPL program on linux. \$\endgroup\$
    – mbrig
    Commented Dec 13, 2023 at 0:05
8
\$\begingroup\$

It depends. The Open Source Stack Exchange has a question about GPL game engines and an answer that address some of your questions (emphasis is my own):

A game engine has properties similar to both these cases. The input and output of the game engine (e.g. models, textures, rendered frames) are not subject to the GPL. The output (e.g. screenshots of a rendered scene) may be subject to the GPL if it shows GPL-licensed assets or other media that were somehow generated by the engine authors. (A similar case is discussed in the GPL FAQ here and here: “Keep in mind that some programs, particularly video games, can have artwork/audio that is licensed separately from the underlying GPLed game.”)

Scripts executed by the game engine would usually be subject to the GPL because they will call into APIs provided by the game engine. This can be avoided if the authors of the game engine explicitly issue an exception to the GPL requirements. The GPLv3 includes a specific, well-defined mechanism for issuing exceptions to the GPL. The LGPLv3 license is in fact implemented as such an exception. As an alternative, the game engine can offer merely a language and not an API. This is in many cases entirely sufficient, but could mean that the engine implements its own domain-specific language, rather than adding APIs to a known scripting language such as Lua or Python.

So my read of that is a carefully worded GPL license could cover the engine and changes in a strong copyleft manner (meaning if someone else used the engine code to make a variant engine, that engine would be subject to GPL) but would not automatically subject games made with the engine to GPL. Because of the potential complexity, I would strong recommend working with a legal professional with experience in licensing to craft it.

The id Tech 4 (also known as the Doom 3 engine) might be a good example how you might use the GPL as you described. It's licensed under the terms of the GNU General Public License v3.0 or later and here's an excerpt from their (now archived) licensing page:

D. You keep it!
You get to keep the technology you create. We do not ask for your proprietary technology - which stifles innovation and creativity. If another of our licensees likes something that you come up with, we allow you to license your innovations to them (certain restrictions apply pertaining to id Software maintaining its proprietary interest in the underlying engine technology). This allows licensees to build equity within their own modified engine, which they can license out or keep to themselves for use in future licensed titles.

There are a number of Id Tech 4 games using proprietary licenses. This demonstrates that it is possible to put a game engine out with GPL, but force GPL on games built using that engine.

\$\endgroup\$
3
  • \$\begingroup\$ Upvoted for the suggestion of GPL + exception, and for the advice to consult a lawyer. However, I'm not sure the id Software page you cite is a good example: the section you quote does not seem to be phrased or intended as a license exception (but rather more like an FAQ or perhaps a statement of intent behind such an exception), and I don't think it would function as such. (It's way too vague and not phrased in terms that the GPL uses.) Something like the Classpath exception might be a better example. \$\endgroup\$ Commented Dec 11, 2023 at 2:15
  • \$\begingroup\$ Thanks! Yes, the page I cited was more of an FAQ about the license & not the license itself. If I find a more direct example of their license which allows for closed source use, I'll edit that in. I agree that other options (such as Classpath) might work (possibly even better), but OP was asking specifically about GPL, so I focused on that. If you're knowledgably about Classpath & feel that OP should consider it as an option, I encourage you to share that as an answer. \$\endgroup\$
    – Pikalek
    Commented Dec 11, 2023 at 3:06
  • 1
    \$\begingroup\$ id Tech 4 may not be a good example. All but one of the proprietary games listed were released before id Tech 4 was open sourced, with the last being released by id software themselves who of course are not bound by the GPL. The licensing page also likely predates open sourcing. It seems more like an example of dual licensing (with GPL licensing coming later than proprietary) rather than building commercial games with GPL. \$\endgroup\$
    – James_pic
    Commented Dec 11, 2023 at 11:21
4
\$\begingroup\$

Normally the way you do this, and make a living, is to license your engine under very tight copyleft (GPL or even AGPL), but retain full copyright yourself (either don't accept third party contributions, or only accept contributions under a CLA or copyright assignment) and offer alternative commercial license to anyone who wants to pay to use it in a game. Then, anyone making free games (or commercial games they're willing to accept the terms of the GPL for) gets to use your engine at no cost, while commercial users who want the privilege of keeping their source closed while they take advantage of you have to fairly compensate you for getting to profit off your work.

\$\endgroup\$
1
\$\begingroup\$

Instead of the GNU GPL or LGPL, you can use the Mozilla Public License 2 or Eclipse Public License 2. These only require you to publish changes to the source files under that license (the engine, in this case), rather than requiring you to open source the entire software/game.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .