Remove non-redistributable art from the repo; record licence terms
Researched the licence at each of the four itch.io sources. Two of the four
forbid redistribution, and publishing a repository containing them is exactly
that, so they are out of the tree.
0x72 DungeonTileset II CC0 1.0 commercial ok, no credit required
Helton Yan Pixel Combat CC BY 4.0 commercial ok, CREDIT REQUIRED
Fire Pixel Bullet 16x16 custom non-commercial, NO REDISTRIBUTION
750+ Effect and FX Pixel custom non-commercial, NO REDISTRIBUTION
Both bdragon1727 packs state verbatim: "You cannot do: Resell / redistribute
this asset." The FX pack's paid tier is no better for this purpose -- "You can
NOT re-distribute the file, no matter how much you modify it" -- so paying does
not unlock it and neither does editing the art.
bullets.png and impact.png therefore move to assets/local/, gitignored.
Art.bullets_texture() / impact_texture() load them at runtime and return null
when absent; the bullet renderer falls back to the generated dot it used before,
tinted per kind so bullet types stay distinguishable. Nothing there may be
preload()ed -- preload resolves at compile time and would fail the build on
every machine without the files, which is every clone.
Verified both ways rather than assumed: with the files present the game uses
them and no fallback triggers; with them moved aside, 156/156 tests pass and the
game runs clean on the generated dots.
Added CREDITS.md, because Helton Yan's CC BY 4.0 makes attribution a licence
obligation rather than a courtesy. A file in the source tree does not discharge
it once the game ships -- an in-game credits screen is now a tracked todo, and
flagged as a licence requirement rather than polish.
NOT addressed here, and it needs a decision: these files remain in git history
at 9fa2e26. Removing them from the tip does not remove them from a clone. If
this repo is ever made public, history has to be rewritten (git filter-repo)
and force-pushed. Also, both bdragon packs are non-commercial in their free
tier, which conflicts with the stated Steam goal -- either contribute for the
commercial tier (still no redistribution) or replace with CC0 art, which would
solve both problems and let the assets back into the repo.
This commit is contained in:
+36
-2
@@ -10,9 +10,43 @@ extends RefCounted
|
||||
## Everything in this file is view-only. Nothing under src/sim/ may reference it:
|
||||
## the simulation has no idea the game has art.
|
||||
|
||||
## Redistributable, so committed and safe to preload.
|
||||
const TILESET := preload("res://assets/sprites/dungeon_tileset.png")
|
||||
const BULLETS := preload("res://assets/sprites/bullets.png")
|
||||
const IMPACT := preload("res://assets/sprites/impact.png")
|
||||
|
||||
## NOT redistributable: bdragon1727's licence says "You cannot do: Resell /
|
||||
## redistribute this asset", and shipping them in a public repo would be exactly
|
||||
## that. They live in the untracked assets/local/ and are loaded at RUNTIME.
|
||||
##
|
||||
## preload() would be resolved at compile time and would fail the entire build
|
||||
## on any machine that does not have them -- which is every fresh clone. Hence
|
||||
## load() behind an existence check, and a generated fallback in the renderer.
|
||||
const LOCAL_BULLETS := "res://assets/local/bullets.png"
|
||||
const LOCAL_IMPACT := "res://assets/local/impact.png"
|
||||
|
||||
static var _bullets: Texture2D = null
|
||||
static var _impact: Texture2D = null
|
||||
static var _optional_loaded: bool = false
|
||||
|
||||
|
||||
static func _load_optional() -> void:
|
||||
if _optional_loaded:
|
||||
return
|
||||
_optional_loaded = true
|
||||
if ResourceLoader.exists(LOCAL_BULLETS):
|
||||
_bullets = load(LOCAL_BULLETS)
|
||||
if ResourceLoader.exists(LOCAL_IMPACT):
|
||||
_impact = load(LOCAL_IMPACT)
|
||||
|
||||
|
||||
## Null when the licence-restricted art is not present. Callers must cope.
|
||||
static func bullets_texture() -> Texture2D:
|
||||
_load_optional()
|
||||
return _bullets
|
||||
|
||||
|
||||
static func impact_texture() -> Texture2D:
|
||||
_load_optional()
|
||||
return _impact
|
||||
|
||||
## Source art is 16px; the world's tiles are 32. Drawn at 2x with nearest
|
||||
## filtering (project-wide `default_texture_filter=0`) so it stays crisp.
|
||||
|
||||
@@ -10,17 +10,34 @@ extends Node2D
|
||||
## sheet. Four kinds means four draw calls, which is nothing, and it avoids a
|
||||
## custom shader passing UV offsets through per-instance custom data.
|
||||
|
||||
## Used only in fallback mode, where every bullet is the same generated dot and
|
||||
## colour is the only thing distinguishing a kind.
|
||||
const _FALLBACK_COLOURS: Array[Color] = [
|
||||
Color(0.45, 0.95, 1.0), # KIND_PLAYER_SHOT
|
||||
Color(1.0, 0.35, 0.75), # KIND_ORB
|
||||
Color(1.0, 0.85, 0.3), # KIND_NEEDLE
|
||||
Color(1.0, 0.45, 0.2), # KIND_HEAVY
|
||||
]
|
||||
|
||||
var _layers: Array[MultiMeshInstance2D] = []
|
||||
## Advances the bullets' own animation, independent of the simulation.
|
||||
var _anim_tick: int = 0
|
||||
## True when the licence-restricted bullet sheet is absent and we are drawing
|
||||
## generated dots instead. See Art.bullets_texture().
|
||||
var _fallback: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var sheet := Art.bullets_texture()
|
||||
_fallback = sheet == null
|
||||
var art: Texture2D = sheet if sheet != null else _make_dot_texture()
|
||||
if _fallback:
|
||||
GameLog.info("view", "bullet sheet absent, drawing generated dots")
|
||||
var quad := QuadMesh.new()
|
||||
quad.size = Vector2.ONE
|
||||
for kind in SimConfig.KIND_HEAVY + 1:
|
||||
var layer := MultiMeshInstance2D.new()
|
||||
layer.texture = Art.BULLETS
|
||||
layer.texture = art
|
||||
var mm := MultiMesh.new()
|
||||
mm.transform_format = MultiMesh.TRANSFORM_2D
|
||||
mm.use_colors = true
|
||||
@@ -34,7 +51,24 @@ func _ready() -> void:
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
_anim_tick += 1
|
||||
_apply_frame()
|
||||
if not _fallback:
|
||||
_apply_frame()
|
||||
|
||||
|
||||
## A soft-edged disc with a bright core, generated at runtime. This is what the
|
||||
## game draws when the bullet sheet is not present, which is the case for any
|
||||
## clone of the repository -- the sheet's licence forbids redistributing it.
|
||||
func _make_dot_texture() -> ImageTexture:
|
||||
var size := 32
|
||||
var img := Image.create(size, size, false, Image.FORMAT_RGBA8)
|
||||
var centre := Vector2(size, size) * 0.5
|
||||
for y in size:
|
||||
for x in size:
|
||||
var d := Vector2(x + 0.5, y + 0.5).distance_to(centre) / (size * 0.5)
|
||||
var alpha := pow(clampf(1.0 - d, 0.0, 1.0), 0.6)
|
||||
var core := clampf(1.0 - d * 1.9, 0.0, 1.0)
|
||||
img.set_pixel(x, y, Color(1.0, 1.0, 1.0, alpha).lerp(Color.WHITE, core * 0.8))
|
||||
return ImageTexture.create_from_image(img)
|
||||
|
||||
|
||||
## Point each layer's texture at this frame's cell in the sheet. Every bullet in
|
||||
@@ -50,7 +84,7 @@ func _apply_frame() -> void:
|
||||
var atlas := _layers[kind].texture as AtlasTexture
|
||||
if atlas == null:
|
||||
atlas = AtlasTexture.new()
|
||||
atlas.atlas = Art.BULLETS
|
||||
atlas.atlas = Art.bullets_texture()
|
||||
_layers[kind].texture = atlas
|
||||
atlas.region = region
|
||||
|
||||
@@ -73,7 +107,8 @@ func render_pool(pool: BulletPool) -> void:
|
||||
var angle: float = (pool.vel[i] as Vector2).angle()
|
||||
_layers[kind].multimesh.set_instance_transform_2d(
|
||||
n, Transform2D(angle, Vector2(d, d), 0.0, pool.pos[i]))
|
||||
_layers[kind].multimesh.set_instance_color(n, Color.WHITE)
|
||||
_layers[kind].multimesh.set_instance_color(n,
|
||||
_FALLBACK_COLOURS[kind] if _fallback else Color.WHITE)
|
||||
counts[kind] = n + 1
|
||||
for kind in _layers.size():
|
||||
_layers[kind].multimesh.visible_instance_count = counts[kind]
|
||||
|
||||
Reference in New Issue
Block a user