Open-source code and free assets

Play this lesson

One command, dozens of packages

Kai wants sparkly explosions in Hyper Shards and runs one command: npm install with a particle library. Seconds later the node_modules folder holds dozens of new packages. Kai only asked for one.

Every package is code someone else wrote, so it is copyrighted. We can still ship most of it in a game we sell, because it is open source: code whose authors publish it with a license that lets anyone use, change and share it. Each license has its own rules, though.

Permissive licenses: MIT and Apache 2.0

Permissive licenses allow almost anything, including use in a closed game we sell, as long as we follow a few conditions.

Copyleft: the GPL shares alike

Copyleft licenses pass their freedom forward. The best known is the GPL (GNU General Public License). It allows commercial use, even selling. But if we distribute a program that includes GPL code, the whole program must be released under the GPL, with its complete source code available to the people who get it.

That is "share alike" for code. For Hyper Shards, a closed game we sell, one GPL package inside would mean publishing all our source code, or taking the package out.

Quick check

Which license would require us to release all of Hyper Shards' source code if we shipped a package under it inside the game?

  1. MIT
  2. Apache 2.0
  3. GPL-3.0
Show the answer

GPL-3.0

The GPL is copyleft: a larger program that includes GPL code must be shared under the GPL, with its source. MIT and Apache 2.0 only ask us to keep their notices (and, for Apache, mark our changes).

Packages have packages

Every npm package declares its license in its package.json with a short standard code called an SPDX identifier: "MIT", "Apache-2.0", "GPL-3.0-only". "(MIT OR Apache-2.0)" means we may pick either. "UNLICENSED" means the author grants nobody the right to use it.

Packages depend on other packages, which have their own dependencies: a whole tree. npm ls --all prints the tree, and license-checking tools list every license in it. We check before installing, and again before each release.

License scan

deps-report.txt
Hyper Shards dependencies (made-up names)star-particles     MITtiny-tween         Apache-2.0wave-physics       GPL-3.0-onlypixel-text         (MIT OR Apache-2.0)sound-sprite       UNLICENSED

Before paid Hyper Shards ships, which two packages must the team replace, or get the author's written permission for?

  1. Lines 2 and 3
  2. Lines 4 and 6
  3. Lines 3 and 5
  4. Line 5 only
Show the answer

Lines 4 and 6

wave-physics is GPL, so shipping it would mean releasing all our code under the GPL. sound-sprite grants nobody a license at all. MIT and Apache-2.0 are fine with their notices, and with an OR license we pick the one we prefer.

Notices travel with the game

Our credits and license list already tracks every asset (the Copyright and licenses lesson explains it). Code adds a duty: MIT, Apache and most open-source licenses require their copyright notice and license text to travel with the game, not just sit in our repo.

So the studio ships a THIRD-PARTY-NOTICES.txt file and an "Open-source licenses" screen in the settings menu. An Apache package may include a NOTICE file, whose credits we pass on too. Build tools can collect all this, and we read the result before release.

Free asset licenses, element by element

CC0 and the license basics are in the Copyright and licenses lesson. Here is what each Creative Commons element means for a real sprite, sound or font:

Asset check

Asset page, Space Laser Pack
Free download! 40 laser sounds. License: CC BY-ND 4.0

Kai wants one of these lasers, sped up and cut shorter, in paid Hyper Shards. Is that allowed?

  1. Yes, because the pack is a free download
  2. No. ND means no changes, so we use it unchanged with a credit, or find a pack that allows edits
  3. Yes, as long as we credit the creator
Show the answer

No. ND means no changes, so we use it unchanged with a credit, or find a pack that allows edits

ND (no derivatives) allows only unchanged copies, so speeding it up and cutting it is not allowed, credit or not. Used unchanged with a proper credit, it is fine even in a paid game, because the license has no NC.

Where good free assets come from

Free to download is not the same as free to use in a game we sell. These sources are popular with game makers, and each works differently:

Bolt says: Save each license page (a screenshot or PDF, with the date) next to the asset on our list. If a license changes later, we can show what we agreed to.

True story: the fee that never started

Unity is a commercial game engine, the toolkit behind many games, and Unity writes its own terms. In 2023, Unity announced a new Runtime Fee: from 1 January 2024, games made with Unity would pay a fee based on how many times they were installed.

Many developers objected. On 22 September 2023, Unity's Marc Whitten wrote, "I want to start with this: I am sorry," and changed the plan. On 12 September 2024, Unity cancelled the fee for games. It never took effect.

The terms of the code and tools we build on can change. We read them, and keep a dated copy.

Source: Unity is canceling the Runtime Fee (12 September 2024), unity.com

Bolt says: Next: EULAs, the license players agree to when they get our games.

Fact-checked 11 October 2026