License

Open Source Initiative

1. Introduction

Castle Game Engine is a free software and open source game engine.

You can use it to develop commercial (including closed-source) games and applications.

2. Summary

  • Castle Game Engine is covered by the "LGPL with static linking exception" license.

  • It is the same license as used by FPC (Free Pascal Compiler) run-time library and LCL (Lazarus Component Library).

  • The gist of it is:

    • You can use Castle Game Engine to develop any applications, including closed-source.

    • If you modify the Castle Game Engine units, you need to share your modifications.

      How it works exactly: Following LGPL, people that receive your application in binary form can ask for CGE sources. If you didn’t modify CGE, just point them to https://castle-engine.io/ , you don’t need to host anything. Otherwise you’ll have to show your CGE mods.

    • Other than that, you don’t need to share your code, regardless of how it is using CGE. Your game code is yours.

    • The CGE code is covered by our copyrights. E.g. if you distribute the Castle Game Engine sources yourself (modified or not), you must clearly specify our copyrights to the original code.

  • All example code, and almost all examples data, are covered by a much more permissive "modified BSD 3-clause" license. So you can use our examples (stuff in examples/ subdirectory) as a basis for your applications easily, without the need to share anything you did based on these examples.

  • Some tools (in particular, the castle-editor), are covered by a more strict GPL license. To put it simply, you cannot make a closed-source fork of our Castle Game Engine visual editor.

The above is a quick summary of our licensing terms.

Please note that the text above is not "legally binding". E.g. "the need to share your modifications" mentioned above is a simplification of the license terms. The precise license requirements discuss (non-internal) distribution of the application and other details. The exact legal text of the licenses is linked below, and they are analyzed in depth in many places on the Internet.

3. Engine core: permissive LGPL with static linking exception

The core of the Castle Game Engine is available on terms of the GNU Lesser General Public License (version 2 or above, whichever you like). See the doc/licenses/COPYING.LGPL2.txt for the exact LGPL 2 license text, see the http://www.gnu.org/copyleft/lesser.html for the current version, FAQs etc.

Moreover, we add the so-called "static linking exception" to the LGPL terms. The idea of this exception is to allow statically linking with the engine on the same terms as dynamically linking. Static linking is what usually happens when you compile a program using the engine units (without wrapping the engine in a dynamic library (dll, so, dylib) or Delphi runtime package).

The exact legal text of this "static linking exception" is this:

As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.

By "engine core" we mean everything that can be found in the GitHub repository https://github.com/castle-engine/castle-engine/ except the exceptions mentioned in the section below (tools/castle-editor, examples).

4. Engine examples: very permissive (do what you want) BSD

This section applies to all files within the examples/ subdirectory:

The example code, and most example data (unless specified otherwise using the AUTHORS.txt file in example data subdirectory) are covered by a permissive "modified BSD (3-clause)" license. See the file doc/licenses/COPYING.BSD-3-clause.txt for the exact license text.

In short, you only need to retain our copyright (just keep somewhere line like "This code is based on Castle Game Engine example") in sources or docs. You don’t need to share anything you do (you don’t need to share the sources/docs). Whatever modifications you do to the example code are yours.

5. Visual editor (castle-editor), some example data, some website data: GPL

The items listed below are covered by a more strict GNU General Public License (version 2 or above, whichever you like). See the file doc/licenses/COPYING.GPL2.txt for the exact license text. See http://www.gnu.org/copyleft/gpl.html for more information about this license (including translations of it to various languages) and philosophy of the free software.

In short, it means that: If you use the items listed below (modified or not) to create your own application, then you need to share the code of your entire application, as the complete work must be covered also by the GPL license.

The items covered by the GPL license are:

  • castle-editor in tools/castle-editor/ directory.

  • The data files of some examples (the examples are in examples/ subdirectory, and their "data files" are in data/ subdirectories beneath). They are clearly marked by the existence of COPYING.GPL2.txt and AUTHORS.txt files in their respective directories.

  • Some files included as part of our PasDoc-generated documentation (in doc/pasdoc/html-parts/ and doc/reference/) come from

    The relevant files are clearly marked as having "GNU General Public License" in the header.

    Note that the documentation also includes some projects (Bootstrap, jQuery, Tipue) on more permissive license. Consult the appropriate files for details.

  • Note that we also develop some tools / games related to the Castle Game Engine, available in other repositories in GitHub CGE organization. For example:

    These tools / games are covered by their own license terms, and in general they use more strict GPL license.


To improve this documentation just edit this page and create a pull request to cge-www repository.