godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.1k stars 69 forks source link

Include a license file for the Godot engine when exporting projects #3107

Open quisquama opened 3 years ago

quisquama commented 3 years ago

Describe the project you are working on

Games exported to steam, itch.io etc that need to handle licensing.

Describe the problem or limitation you are having in your project

I was using steamdb to browse games built with Godot (note it's heuristics based so some of these are wrong). I noticed that some games don't include any sort licensing file so, or any sort of credits screen.

Take this game on steam (also on itch.io) for example which only includes an executable and a .pck file with no credits screen.

Most of the licenses used by Godot have some form of clause eg:

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Also, doing a search on Github for uses of Godot's API for copyright info shows sparing use at best: only 11 results of get_copyright_info() being used.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It's easy to forget to give appropriate attribution when exporting a Godot project, so I think it would be a good idea for the Godot to generate some sort of godot_license.txt when exporting projects.

Documentation/tutorials for exporting should probably encourage including a license file too: https://gramps.github.io/GodotSteam/tutorials-exporting-shipping.html#shipping (although I think this one for steam is not maintained by Godot devs themselves), and provide examples on how to attribute correctly with Godot's API.

The plugin/module system should also provide licensing information in functions like get_license_info so that it's easier to give correct attribution to plugins made by the community. (It might already work like this, but I haven't checked)

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

There should be a tab in Project Settings or Export menu for licensing so you can control the generation of a godot_license.txt and the license for your project as a whole. So when you export a project the license will be generated along side the exe and pck files.

Also the documentation for complying with licenses should provide a code snippet that generates license text that can easily be used to give correct attribution on a credits screen. Ie how to use Engine.get_copyright_info() and friends to provide similar information as provide by COPYRIGHT.txt.

If this enhancement will not be used often, can it be worked around with a few lines of script?

This is a feature that everybody who exports Godot projects should use.

Is there a reason why this should be core and not an add-on in the asset library?

Giving correct attribution to the work done by open source projects is important, so it should be in core.

Xrayez commented 3 years ago

I think the most realistic way of improving the licensing situation is via documentation. There will be always cases when including just Godot's copyright info might not be enough. For example, I distribute custom Godot builds with Goost, and I also kind of replicate the same process of generating copyright info which are later exposed via GoostEngine.get_copyright_info() etc. Since Goost is maintained semi-officially, Godot core developers will have no way to know what kind of licensing information I provide at run-time.

However, if Godot core developers think that implementing a unified system that allows to collect licensing info from various sources such as plugin and modules makes sense and worth the maintenance burden, then yeah I think it would be possible to implement.

Calinou commented 3 years ago

I recently opened a pull request to address this: https://github.com/godotengine/godot/pull/51028

Godot's MIT license and the third-party licenses included do not require you to prominently display them. They just need to be readable by the user somehow. If the above pull request is merged, you could do this by specifying a snippet as follows on your game's page:

This game uses Godot and includes third-party libraries under open source licenses. Run the executable with the --about license, --about thirdparty-copyrights or --about thirdparty-licenses command line arguments to view the copyright and license information.

For mobile/HTML5 games, a different solution will have to be made (such as adding a built-in GUI that can be displayed by calling a single method). This is planned in the long run too, but maybe not for 4.0 due to time constraints.

Alternatively, you can link to https://godotengine.org/license on your project page or in the game itself (using OS.shell_open() to open the URL in the default browser). However, this method is likely less future-proof in the long run, since it relies on an online resource being available.

quisquama commented 3 years ago

I think the most realistic way of improving the licensing situation is via documentation.

Yeah you can't cover every use case with some automated system so good documentation is important. However, I'm thinking more about people pulling stuff from the Godot asset library. Eg if you got a lot of different shaders from the asset library, having an automated system to manage the licensing attribution for you would be very helpful.

Also, it might be good to include some sort of logic for copyleft vs permissive licenses. For example, this template from the asset library is licensed under the AGPLv3. I think a lot Godot users will probably be new to the world of software licenses, so they won't realize that the AGPL would actual force them to open source their game.

I recently opened a pull request to address this [...]

That's an ok solution, but it's a bit weird asking the end user to launch your game from cmd with flags just to read the license text. A think even non-programmers can figure out how to access a license.txt without needing to be told.

And you'd still need to included those instructions somewhere in your documentation, so I think it's easier for the game-dev and end user just to bundle the license in a text file along side your game.

For [...] HTML5 games

Isn't it pretty common practice just to include/reference the the license inside the js/html files themselves?

Calinou commented 3 years ago

Isn't it pretty common practice just to include/reference the the license inside the js/html files themselves?

Including all third-party license statements within those files would increase their size significantly, while this information is already available within the engine .wasm file itself. The same issue applies with bundling a license.txt file on desktop platforms, although the file size issue isn't as important there.

dryluggage commented 2 years ago

i think a better idea is just to have a warning on the export screen that explains to the user to put the license somewhere readable a like creditscreen