From f6383bef638e200cd9db253ffcd9d23264b20a81 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Sat, 24 Feb 2024 09:20:26 -0500 Subject: [PATCH 01/32] Create tileset resource This is the barest-bones version, exporting the textures used by the terrain system. Some textures have been renamed to remove potential ambiguity (corner -> endcap, shade -> shadow, edge -> side). --- tilesets/tileset.gd | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tilesets/tileset.gd diff --git a/tilesets/tileset.gd b/tilesets/tileset.gd new file mode 100644 index 000000000..52a106529 --- /dev/null +++ b/tilesets/tileset.gd @@ -0,0 +1,10 @@ +class_name Tileset +extends Resource + +@export var body: Texture2D +@export var top: Texture2D +@export var top_shadow: Texture2D +@export var top_endcap: Texture2D +@export var top_endcap_shadow: Texture2D +@export var side: Texture2D +@export var bottom: Texture2D From 06f9c4a2c98f8b0a231bf387c30832df9100977a Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 01:34:24 -0400 Subject: [PATCH 02/32] Rename Tileset to TerrainSkin Because objectively it's *not* a tileset; tilesets are used in tilemap systems. The new name is somewhat in keeping with the existing DoorSkin, I think.... --- tilesets/{tileset.gd => terrain_skin.gd} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tilesets/{tileset.gd => terrain_skin.gd} (91%) diff --git a/tilesets/tileset.gd b/tilesets/terrain_skin.gd similarity index 91% rename from tilesets/tileset.gd rename to tilesets/terrain_skin.gd index 52a106529..cc397b899 100644 --- a/tilesets/tileset.gd +++ b/tilesets/terrain_skin.gd @@ -1,4 +1,4 @@ -class_name Tileset +class_name TerrainSkin extends Resource @export var body: Texture2D From 4ba4af6dd7814cf918188018f6f2f950af44f23c Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 01:38:54 -0400 Subject: [PATCH 03/32] Integrate skin resource into Terrain Simplest possible integration. In theory, the textures are being referenced instead of copied here, so there's no duplication.... Naturally, things are now completely broken. I gotta get a test terrain resource going. --- classes/solid/terrain/terrain_polygon.gd | 25 +++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/classes/solid/terrain/terrain_polygon.gd b/classes/solid/terrain/terrain_polygon.gd index f27c6ed9e..b1b0b2c8e 100644 --- a/classes/solid/terrain/terrain_polygon.gd +++ b/classes/solid/terrain/terrain_polygon.gd @@ -6,7 +6,7 @@ extends Polygon2D const COLLISION_LAYER_TERRAIN = 1 -@export var texture_spritesheet: Texture2D: set = update_spritesheets +@export var skin: TerrainSkin: set = reload_tileset var body: Texture2D var top: Texture2D @@ -64,17 +64,14 @@ func set_null(_new_val): pass -func update_spritesheets(new_sheet: Texture2D): - texture_spritesheet = new_sheet +func reload_tileset(new_ts: TerrainSkin): + skin = new_ts - # Create textures from the spritesheet. - # Can't just use atlas textures, they don't loop like we need. - - body = ImageTexture.create_from_image(texture_spritesheet.get_image().get_region( Rect2(36, 3, 32, 32) ) ) - edge = ImageTexture.create_from_image(texture_spritesheet.get_image().get_region( Rect2(3, 3, 32, 32) ) ) - bottom = ImageTexture.create_from_image(texture_spritesheet.get_image().get_region( Rect2(36, 36, 32, 32) ) ) - - top = ImageTexture.create_from_image(texture_spritesheet.get_image().get_region( Rect2(105, 3, 32, 32) ) ) - top_corner = ImageTexture.create_from_image(texture_spritesheet.get_image().get_region( Rect2(72, 3, 32, 32) ) ) - top_shade = ImageTexture.create_from_image(texture_spritesheet.get_image().get_region( Rect2(105, 36, 32, 32) ) ) - top_corner_shade = ImageTexture.create_from_image(texture_spritesheet.get_image().get_region( Rect2(72, 36, 32, 32) ) ) + body = new_ts.body + edge = new_ts.side + bottom = new_ts.bottom + + top = new_ts.top + top_corner = new_ts.top_endcap + top_shade = new_ts.top_shadow + top_corner_shade = new_ts.top_endcap_shadow From d67655da38db9eea3ba68c5e1ba3bbfd30ac9c2f Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 01:45:55 -0400 Subject: [PATCH 04/32] Rename tilesets folder to terrain_skins In keeping with the resource file. Might have to update `test-tilesets` to align though.... --- {tilesets => terrain_skins}/terrain_skin.gd | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {tilesets => terrain_skins}/terrain_skin.gd (100%) diff --git a/tilesets/terrain_skin.gd b/terrain_skins/terrain_skin.gd similarity index 100% rename from tilesets/terrain_skin.gd rename to terrain_skins/terrain_skin.gd From 49177ccb0f68ae5699f43a691981fa2423989ef9 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 01:51:22 -0400 Subject: [PATCH 05/32] Clear textures when no terrain skin is set This is the most expected behavior, I think--clearing the skin should also clear set textures. Otherwise you'd get all kinds of nasty postmortem data hanging on.... --- classes/solid/terrain/terrain_polygon.gd | 26 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/classes/solid/terrain/terrain_polygon.gd b/classes/solid/terrain/terrain_polygon.gd index b1b0b2c8e..83c2a1353 100644 --- a/classes/solid/terrain/terrain_polygon.gd +++ b/classes/solid/terrain/terrain_polygon.gd @@ -67,11 +67,21 @@ func set_null(_new_val): func reload_tileset(new_ts: TerrainSkin): skin = new_ts - body = new_ts.body - edge = new_ts.side - bottom = new_ts.bottom - - top = new_ts.top - top_corner = new_ts.top_endcap - top_shade = new_ts.top_shadow - top_corner_shade = new_ts.top_endcap_shadow + if skin != null: + body = new_ts.body + edge = new_ts.side + bottom = new_ts.bottom + + top = new_ts.top + top_corner = new_ts.top_endcap + top_shade = new_ts.top_shadow + top_corner_shade = new_ts.top_endcap_shadow + else: + body = null + edge = null + bottom = null + + top = null + top_corner = null + top_shade = null + top_corner_shade = null From 451f4383294bc759dd365e4d167a0a8977a6b9fe Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 02:09:50 -0400 Subject: [PATCH 06/32] Rename things in terrain border generators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And since I'm renaming as well, I might as well replace the root node's texture variables with direct refs to the textures in the skin. (The reason I kept the variables was so I wouldn't have to replace all call sites in the border scripts, but. I'm retouching the border scripts anyway ( ͡° ͜ʖ ͡°)) --- classes/solid/terrain/terrain_border.gd | 28 +++++++++---------- .../solid/terrain/terrain_border_endcaps.gd | 6 ++-- classes/solid/terrain/terrain_polygon.gd | 27 ------------------ 3 files changed, 17 insertions(+), 44 deletions(-) diff --git a/classes/solid/terrain/terrain_border.gd b/classes/solid/terrain/terrain_border.gd index 57a40ffad..a299e1564 100644 --- a/classes/solid/terrain/terrain_border.gd +++ b/classes/solid/terrain/terrain_border.gd @@ -18,7 +18,7 @@ const QUAD_RADIUS = 16 @onready var root = $".." @onready var body_polygon: Polygon2D = $"../Body" -@onready var top_edges: TerrainBorderEndcaps = $"../TopEdgeEndcaps" +@onready var endcaps: TerrainBorderEndcaps = $"../TopEdgeEndcaps" func _draw(): @@ -27,19 +27,19 @@ func _draw(): child.queue_free() # Load appearance from the root. - body_polygon.texture = root.body + body_polygon.texture = root.skin.body body_polygon.polygon = root.polygon body_polygon.color = root.tint_color if root.tint else Color(1, 1, 1) - # Clear the draw queue for top edges - top_edges.area_queue = [] + # Clear the draw queue for endcaps. + endcaps.area_queue = [] # Draw all terrain polygons. - add_full(root.polygon) - # Queue drawing the top edges. - top_edges.queue_redraw() + draw_all_borders(root.polygon) + # Queue drawing the endcaps. + endcaps.queue_redraw() -func add_full(poly: PackedVector2Array): +func draw_all_borders(poly: PackedVector2Array): # Dictionary of segments which have had their type ID evaluated. # Types are indexed by first vertex: overrides[3] will return the # type ID of segment (3, 4). @@ -60,7 +60,7 @@ func add_full(poly: PackedVector2Array): # Valid chains contain at least 2 vertices. # If the chain is valid, draw it. if list.size() >= 2: - generate_polygons(list, root.edge, 0) + generate_polygons(list, root.skin.side, 0) # Now the bottom as well--same exact deal as the sides. latest_index = 0 @@ -68,7 +68,7 @@ func add_full(poly: PackedVector2Array): var list = [] latest_index = get_segment_chain(list, type_ids, poly, latest_index, EdgeType.BOTTOM) if list.size() >= 2: - generate_polygons(list, root.bottom, 0) + generate_polygons(list, root.skin.bottom, 0) # Now the top--which has a special polygon-gen function to make endcaps. latest_index = 0 @@ -157,12 +157,12 @@ func generate_polygons_top(lines, z_order = 2): # Draw everything # Mark the left-side area for drawing. - top_edges.area_queue.append([true, areas.front()]) + endcaps.area_queue.append([true, areas.front()]) # Draw all areas. for area in areas: # Turn this area into a polygon node. - var poly2d = _create_polygon(area.verts, area.normal, z_order, root.top, + var poly2d = _create_polygon(area.verts, area.normal, z_order, root.skin.top, 0 if area.type == "quad" or (area.clock_dir == -1 and area.type == "trio") else area.verts.size() - 2) @@ -173,11 +173,11 @@ func generate_polygons_top(lines, z_order = 2): # TODO: This may be meant to get clipped to within the polygon's body. if !root.tint: var shade = poly2d.duplicate() - shade.texture = root.top_shade + shade.texture = root.skin.top_shadow add_child(shade) # Mark the right-side area for drawing. - top_edges.area_queue.append([false, areas.back()]) + endcaps.area_queue.append([false, areas.back()]) func _add_inbetween_segment(areas, start: Vector2, end: Vector2, circumcenter: Vector2): diff --git a/classes/solid/terrain/terrain_border_endcaps.gd b/classes/solid/terrain/terrain_border_endcaps.gd index b650705e6..6e03aa0ee 100644 --- a/classes/solid/terrain/terrain_border_endcaps.gd +++ b/classes/solid/terrain/terrain_border_endcaps.gd @@ -132,14 +132,14 @@ func add_cap_segment(is_left, area): var clip_uv = clip_box[1] # VALIDATE: Make sure the cut box is 4 verts if clip_poly.size() == 4: - draw_polygon(clip_poly, colors, clip_uv, root.top_corner_shade) + draw_polygon(clip_poly, colors, clip_uv, root.skin.top_endcap_shadow) else: # This should not happen! #print("oh no: ", area.index, ": ", clip_poly.size(), " - ", clip_uv.size()) pass # If the polygon is fully surrounded, simply draw the shadow. else: - draw_polygon(cap_verts, colors, uvs, root.top_corner_shade) + draw_polygon(cap_verts, colors, uvs, root.skin.top_endcap_shadow) # Draw the actual endcap on top of the shadow. - draw_polygon(cap_verts, colors, uvs, root.top_corner) + draw_polygon(cap_verts, colors, uvs, root.skin.top_endcap) diff --git a/classes/solid/terrain/terrain_polygon.gd b/classes/solid/terrain/terrain_polygon.gd index 83c2a1353..6d5796641 100644 --- a/classes/solid/terrain/terrain_polygon.gd +++ b/classes/solid/terrain/terrain_polygon.gd @@ -8,14 +8,6 @@ const COLLISION_LAYER_TERRAIN = 1 @export var skin: TerrainSkin: set = reload_tileset -var body: Texture2D -var top: Texture2D -var top_shade: Texture2D -var top_corner: Texture2D -var top_corner_shade: Texture2D -var edge: Texture2D -var bottom: Texture2D - @export var up_direction = Vector2(0, -1): set = set_down_direction # TODO: This should always == -up_direction. @export var down_direction = Vector2(0, 1): set = set_null @@ -66,22 +58,3 @@ func set_null(_new_val): func reload_tileset(new_ts: TerrainSkin): skin = new_ts - - if skin != null: - body = new_ts.body - edge = new_ts.side - bottom = new_ts.bottom - - top = new_ts.top - top_corner = new_ts.top_endcap - top_shade = new_ts.top_shadow - top_corner_shade = new_ts.top_endcap_shadow - else: - body = null - edge = null - bottom = null - - top = null - top_corner = null - top_shade = null - top_corner_shade = null From 4348f64a085573dda5dbd21f0d76dab98cfa8087 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 02:19:21 -0400 Subject: [PATCH 07/32] Create simple grass tileset Not my ideal case--I'd much prefer to be generating directly from terrain templates via importer plugin. Still, it does let me test, and let me verify that it does indeed work. (And it cuts out a lot of terrain_polygon.tscn! Maybe now it'll stop getting labeled "diff is too big to display by default.") --- classes/solid/terrain/terrain_polygon.tscn | 21 +++-------- scenes/levels/tutorial_1/tutorial_1_1.tscn | 2 +- terrain_skins/grass/grass.tres | 20 +++++++++++ terrain_skins/grass/grass_body.png | Bin 0 -> 550 bytes terrain_skins/grass/grass_body.png.import | 34 ++++++++++++++++++ terrain_skins/grass/grass_bottom.png | Bin 0 -> 187 bytes terrain_skins/grass/grass_bottom.png.import | 34 ++++++++++++++++++ terrain_skins/grass/grass_endcap.png | Bin 0 -> 281 bytes terrain_skins/grass/grass_endcap.png.import | 34 ++++++++++++++++++ terrain_skins/grass/grass_endcap_shadow.png | Bin 0 -> 212 bytes .../grass/grass_endcap_shadow.png.import | 34 ++++++++++++++++++ terrain_skins/grass/grass_side.png | Bin 0 -> 270 bytes terrain_skins/grass/grass_side.png.import | 34 ++++++++++++++++++ terrain_skins/grass/grass_top.png | Bin 0 -> 524 bytes terrain_skins/grass/grass_top.png.import | 34 ++++++++++++++++++ terrain_skins/grass/grass_top_shadow.png | Bin 0 -> 240 bytes .../grass/grass_top_shadow.png.import | 34 ++++++++++++++++++ 17 files changed, 264 insertions(+), 17 deletions(-) create mode 100644 terrain_skins/grass/grass.tres create mode 100644 terrain_skins/grass/grass_body.png create mode 100644 terrain_skins/grass/grass_body.png.import create mode 100644 terrain_skins/grass/grass_bottom.png create mode 100644 terrain_skins/grass/grass_bottom.png.import create mode 100644 terrain_skins/grass/grass_endcap.png create mode 100644 terrain_skins/grass/grass_endcap.png.import create mode 100644 terrain_skins/grass/grass_endcap_shadow.png create mode 100644 terrain_skins/grass/grass_endcap_shadow.png.import create mode 100644 terrain_skins/grass/grass_side.png create mode 100644 terrain_skins/grass/grass_side.png.import create mode 100644 terrain_skins/grass/grass_top.png create mode 100644 terrain_skins/grass/grass_top.png.import create mode 100644 terrain_skins/grass/grass_top_shadow.png create mode 100644 terrain_skins/grass/grass_top_shadow.png.import diff --git a/classes/solid/terrain/terrain_polygon.tscn b/classes/solid/terrain/terrain_polygon.tscn index ebc030626..eff6c08b6 100644 --- a/classes/solid/terrain/terrain_polygon.tscn +++ b/classes/solid/terrain/terrain_polygon.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=8 format=3 uid="uid://uxujeycb0ytl"] +[gd_scene load_steps=7 format=3 uid="uid://uxujeycb0ytl"] [ext_resource type="Script" path="res://classes/solid/terrain/terrain_polygon.gd" id="1"] -[ext_resource type="Texture2D" uid="uid://bfx115eob35tv" path="res://classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png" id="3"] +[ext_resource type="Resource" uid="uid://b6lmtx75rts72" path="res://terrain_skins/grass/grass.tres" id="2_s1sd3"] +[ext_resource type="Texture2D" uid="uid://bbujtjtisgabh" path="res://terrain_skins/grass/grass_body.png" id="3_ecg2a"] [ext_resource type="Script" path="res://classes/solid/terrain/terrain_border.gd" id="4"] [ext_resource type="Script" path="res://classes/solid/terrain/terrain_border_endcaps.gd" id="10"] @@ -9,28 +10,16 @@ resource_name = "TerrainMaterial" light_mode = 1 -[sub_resource type="Image" id="Image_55jnb"] -data = { -"data": PackedByteArray(205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255), -"format": "RGBA8", -"height": 32, -"mipmaps": false, -"width": 32 -} - -[sub_resource type="ImageTexture" id="ImageTexture_uklmc"] -image = SubResource("Image_55jnb") - [node name="TerrainPolygon" type="Polygon2D"] texture_repeat = 2 material = SubResource("CanvasItemMaterial_j0k2v") script = ExtResource("1") -texture_spritesheet = ExtResource("3") +skin = ExtResource("2_s1sd3") [node name="Body" type="Polygon2D" parent="."] texture_repeat = 2 use_parent_material = true -texture = SubResource("ImageTexture_uklmc") +texture = ExtResource("3_ecg2a") [node name="Borders" type="Node2D" parent="."] use_parent_material = true diff --git a/scenes/levels/tutorial_1/tutorial_1_1.tscn b/scenes/levels/tutorial_1/tutorial_1_1.tscn index 6053be5a6..5bafc9397 100644 --- a/scenes/levels/tutorial_1/tutorial_1_1.tscn +++ b/scenes/levels/tutorial_1/tutorial_1_1.tscn @@ -4,7 +4,7 @@ [ext_resource type="PackedScene" uid="uid://ckc4syjyp8xrq" path="res://classes/solid/log/log.tscn" id="2"] [ext_resource type="PackedScene" uid="uid://c5p3x7s08jvob" path="res://classes/solid/log/log_fall.tscn" id="3"] [ext_resource type="PackedScene" uid="uid://bujgheqb6pmrc" path="res://classes/player/player.tscn" id="4"] -[ext_resource type="PackedScene" path="res://classes/solid/rocks/big_rock/big_rock.tscn" id="5"] +[ext_resource type="PackedScene" uid="uid://bhiyyqle055lo" path="res://classes/solid/rocks/big_rock/big_rock.tscn" id="5"] [ext_resource type="PackedScene" uid="uid://do78au40k7meh" path="res://classes/decorative/big_tree.tscn" id="7"] [ext_resource type="PackedScene" uid="uid://hr76pxvm5b6f" path="res://classes/water/water.tscn" id="8"] [ext_resource type="Texture2D" uid="uid://w4khahd820d5" path="res://classes/decorative/fossil/fossils.png" id="13_dyv3u"] diff --git a/terrain_skins/grass/grass.tres b/terrain_skins/grass/grass.tres new file mode 100644 index 000000000..dff7821f0 --- /dev/null +++ b/terrain_skins/grass/grass.tres @@ -0,0 +1,20 @@ +[gd_resource type="Resource" script_class="TerrainSkin" load_steps=9 format=3 uid="uid://b6lmtx75rts72"] + +[ext_resource type="Texture2D" uid="uid://bbujtjtisgabh" path="res://terrain_skins/grass/grass_body.png" id="1_21lkl"] +[ext_resource type="Script" path="res://terrain_skins/terrain_skin.gd" id="1_juhca"] +[ext_resource type="Texture2D" uid="uid://jdi44e5ytsvo" path="res://terrain_skins/grass/grass_bottom.png" id="2_f6esm"] +[ext_resource type="Texture2D" uid="uid://bnyj6ay56a4g6" path="res://terrain_skins/grass/grass_side.png" id="4_ecf0v"] +[ext_resource type="Texture2D" uid="uid://bv1i70c70fuhl" path="res://terrain_skins/grass/grass_top.png" id="5_nmf3i"] +[ext_resource type="Texture2D" uid="uid://bmhto3rq6npjj" path="res://terrain_skins/grass/grass_endcap.png" id="6_s0nkd"] +[ext_resource type="Texture2D" uid="uid://cb7qjvsiyrsyk" path="res://terrain_skins/grass/grass_endcap_shadow.png" id="7_b2wus"] +[ext_resource type="Texture2D" uid="uid://dlywt426oyykc" path="res://terrain_skins/grass/grass_top_shadow.png" id="8_8w8xv"] + +[resource] +script = ExtResource("1_juhca") +body = ExtResource("1_21lkl") +top = ExtResource("5_nmf3i") +top_shadow = ExtResource("8_8w8xv") +top_endcap = ExtResource("6_s0nkd") +top_endcap_shadow = ExtResource("7_b2wus") +side = ExtResource("4_ecf0v") +bottom = ExtResource("2_f6esm") diff --git a/terrain_skins/grass/grass_body.png b/terrain_skins/grass/grass_body.png new file mode 100644 index 0000000000000000000000000000000000000000..3f99b95bb699927e8e909c46c4e673ea123b4fd6 GIT binary patch literal 550 zcmV+>0@?kEP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00E9kL_t(o!^M{|Zi6rshW{cY z4@s>?89n2-~0Xk?>TVy z{_^~d1tY@35$_LbcxcKV08m#vNU=1N0DvUFoI5supcj%{p(%TBLefm0b4PRwl01Uh zovE=uDC@+d8JHu2vNxtC8e_?&fk@hirckf!Xdq9g`{kPrfRe0rEw-0biq2L4MhcW*>Zr2V6|oGP3= zhT4)_pt=AHau1lGdKp7~BJ*}TetrZQ!|i5g-I`Y&&rkRA< zovBe2+&b~-DVQUIvNxh8(*99fP8Cj`f;5u@8!k|7z+|{FG(ojPPO@q7zvJcK2h3Ni z)w%-!-19C-v6Ex~fL1X#1A3uV46AkLO~^?yt0>8WRxvLhCUwPc7AG+H>@sKVulIsGl#t{r~^~07*qoM6N<$f@bvG_5c6? literal 0 HcmV?d00001 diff --git a/terrain_skins/grass/grass_body.png.import b/terrain_skins/grass/grass_body.png.import new file mode 100644 index 000000000..8cfe7ceaa --- /dev/null +++ b/terrain_skins/grass/grass_body.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bbujtjtisgabh" +path="res://.godot/imported/grass_body.png-a41e5367d9478931c0f5c515d0e789a8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://terrain_skins/grass/grass_body.png" +dest_files=["res://.godot/imported/grass_body.png-a41e5367d9478931c0f5c515d0e789a8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/terrain_skins/grass/grass_bottom.png b/terrain_skins/grass/grass_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..b970c5b4b5625c55b060f5d0b0424ad52b763e77 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7X}9gdxn!a_SXGC5zYdS z$YKTtZeb8+WSBKa0w~B{;_2(k{(@DSjaw>N!C(EZzkxv|`NZHfHF(l&f+Y60A4hQpw;}iV;MX_FL+rYx`W8JdNQVb8a ZGSBp245*o3v<|3(!PC{xWt~$(69Cz?F+~6X literal 0 HcmV?d00001 diff --git a/terrain_skins/grass/grass_bottom.png.import b/terrain_skins/grass/grass_bottom.png.import new file mode 100644 index 000000000..b9932208e --- /dev/null +++ b/terrain_skins/grass/grass_bottom.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://jdi44e5ytsvo" +path="res://.godot/imported/grass_bottom.png-14f95bf545580b6bfd41dcca06e2acfc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://terrain_skins/grass/grass_bottom.png" +dest_files=["res://.godot/imported/grass_bottom.png-14f95bf545580b6bfd41dcca06e2acfc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/terrain_skins/grass/grass_endcap.png b/terrain_skins/grass/grass_endcap.png new file mode 100644 index 0000000000000000000000000000000000000000..11874545b86ebf99559ef154cd3c11679d65f0e9 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7X}9gdxn!a_SXGC5zYdS z$YKTtZeb8+WSBKa0w~B{;_2(k{(@DSjay^&_e3S2kYtH#M2T~LZfQKP4eV@Sl|zopr09hbeSO5S3 literal 0 HcmV?d00001 diff --git a/terrain_skins/grass/grass_endcap.png.import b/terrain_skins/grass/grass_endcap.png.import new file mode 100644 index 000000000..67c7bf4f6 --- /dev/null +++ b/terrain_skins/grass/grass_endcap.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bmhto3rq6npjj" +path="res://.godot/imported/grass_endcap.png-c32a134dbb31342162e6c6b2135c8be9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://terrain_skins/grass/grass_endcap.png" +dest_files=["res://.godot/imported/grass_endcap.png-c32a134dbb31342162e6c6b2135c8be9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/terrain_skins/grass/grass_endcap_shadow.png b/terrain_skins/grass/grass_endcap_shadow.png new file mode 100644 index 0000000000000000000000000000000000000000..991ba589d4d980a4d1558b9519b5013eaeeea0c5 GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7X}9gdxn!a_SXGC5zYdS z$YKTtZeb8+WSBKa0w~B{;_2(k{(@DSjfdePbG$rINV3E=qQp5rH#aq}gu%HeHL)Z$ zMWH;iBtya7(>EZzkxv|`$i~yfF(l&f+e;gH84Ng>9i7kS^h~b|c0I-B_Gta$>PQcu zngeFBR{!U|TQFxslj;N4mg>eCpL(j56UrHgTe~DWM4fR`EMi literal 0 HcmV?d00001 diff --git a/terrain_skins/grass/grass_endcap_shadow.png.import b/terrain_skins/grass/grass_endcap_shadow.png.import new file mode 100644 index 000000000..dec72509e --- /dev/null +++ b/terrain_skins/grass/grass_endcap_shadow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cb7qjvsiyrsyk" +path="res://.godot/imported/grass_endcap_shadow.png-31f2fb5e29c79464ee35b726eec50064.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://terrain_skins/grass/grass_endcap_shadow.png" +dest_files=["res://.godot/imported/grass_endcap_shadow.png-31f2fb5e29c79464ee35b726eec50064.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/terrain_skins/grass/grass_side.png b/terrain_skins/grass/grass_side.png new file mode 100644 index 0000000000000000000000000000000000000000..5623e482f0b0fbca75a2f7d9e1db67516255a629 GIT binary patch literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7X}9gdxn!a_SXGC5zYdS z$YKTtZeb8+WSBKa0w~B{;_2(k{(@DSjhn4pG3PB%NV3E=qQp5rH#aq}gu%HeHL)Z$ zMWH;iBtya7(>EZzkxv|`sLa#FF(l$}a)Jcw;slYNra%KOw}TAKZW4#j9{Xg^%*=dv z`|IPK*Ul`>Jh|cZi9)xcFNePv-QqC*<33H`*VzZoYnbnCG|F)lR}QoH(O)bt-~8Rd zjgi~zpznN%Z9VK*Y=Z#^FfepmN&h{-_2d%J1q`09elF{r5}E)H CBveWO literal 0 HcmV?d00001 diff --git a/terrain_skins/grass/grass_side.png.import b/terrain_skins/grass/grass_side.png.import new file mode 100644 index 000000000..db6937fc9 --- /dev/null +++ b/terrain_skins/grass/grass_side.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bnyj6ay56a4g6" +path="res://.godot/imported/grass_side.png-cac4f2f07444cf50d14e6705f51e2687.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://terrain_skins/grass/grass_side.png" +dest_files=["res://.godot/imported/grass_side.png-cac4f2f07444cf50d14e6705f51e2687.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/terrain_skins/grass/grass_top.png b/terrain_skins/grass/grass_top.png new file mode 100644 index 0000000000000000000000000000000000000000..2825ca695d256b5e42e3f4cef26f70a4c28a3582 GIT binary patch literal 524 zcmV+n0`vWeP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00DGKL_t(o!|j!=PQy?f#ZMay zj*OX^CDheF~Tkr3j|3|YGFfuYS`tP#nhx22U{NZZ*d(KM4sys4&wS{HT!=uL;hP`!l z82bc=A9*d5vR@Z{3?|bWpA`-^Q6Tj2Jj+^FFSBykTjTQNw9#RhCiuL0ufCr>kA>Vm zo-j=i`vlhQ>$uc~&KEvLo~td+dmipRCG$kSVZD*NQZ)^LPKCR8!Zd-c0%!;grPnSV z9c#CNvcf@_CY?5s6;7*04p^W|0omHwJXzB$Z_5HjYiI9?CZqT0^z0U7o3K^WhiOuU z#6GDWMVr+Fz$OYXU-;@@fqUIAN1m$QG}<9V@Sl|w-+}GHW=_Y2d+M!!*j@iXVOh0hFU$oZI)X9 zUaP)7mj+bHz|@y^JzO%?>(_?OMK#ldQ+I~{m=gO`#CArlv&m*z1O2|f6Hh{ZZVvyU c*8P7M Date: Mon, 27 May 2024 02:24:43 -0400 Subject: [PATCH 08/32] Re-add root node texture variables Silly me. I forgot that accessing the skin directly left no protection from null variables. Can't get a property from no skin--so get it from the root and let it sanitize for us. Take this opportunity to update the variable names. --- classes/solid/terrain/terrain_border.gd | 10 +++---- .../solid/terrain/terrain_border_endcaps.gd | 6 ++--- classes/solid/terrain/terrain_polygon.gd | 27 +++++++++++++++++++ 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/classes/solid/terrain/terrain_border.gd b/classes/solid/terrain/terrain_border.gd index a299e1564..28aceead9 100644 --- a/classes/solid/terrain/terrain_border.gd +++ b/classes/solid/terrain/terrain_border.gd @@ -27,7 +27,7 @@ func _draw(): child.queue_free() # Load appearance from the root. - body_polygon.texture = root.skin.body + body_polygon.texture = root.body body_polygon.polygon = root.polygon body_polygon.color = root.tint_color if root.tint else Color(1, 1, 1) @@ -60,7 +60,7 @@ func draw_all_borders(poly: PackedVector2Array): # Valid chains contain at least 2 vertices. # If the chain is valid, draw it. if list.size() >= 2: - generate_polygons(list, root.skin.side, 0) + generate_polygons(list, root.side, 0) # Now the bottom as well--same exact deal as the sides. latest_index = 0 @@ -68,7 +68,7 @@ func draw_all_borders(poly: PackedVector2Array): var list = [] latest_index = get_segment_chain(list, type_ids, poly, latest_index, EdgeType.BOTTOM) if list.size() >= 2: - generate_polygons(list, root.skin.bottom, 0) + generate_polygons(list, root.bottom, 0) # Now the top--which has a special polygon-gen function to make endcaps. latest_index = 0 @@ -162,7 +162,7 @@ func generate_polygons_top(lines, z_order = 2): # Draw all areas. for area in areas: # Turn this area into a polygon node. - var poly2d = _create_polygon(area.verts, area.normal, z_order, root.skin.top, + var poly2d = _create_polygon(area.verts, area.normal, z_order, root.top, 0 if area.type == "quad" or (area.clock_dir == -1 and area.type == "trio") else area.verts.size() - 2) @@ -173,7 +173,7 @@ func generate_polygons_top(lines, z_order = 2): # TODO: This may be meant to get clipped to within the polygon's body. if !root.tint: var shade = poly2d.duplicate() - shade.texture = root.skin.top_shadow + shade.texture = root.top_shadow add_child(shade) # Mark the right-side area for drawing. diff --git a/classes/solid/terrain/terrain_border_endcaps.gd b/classes/solid/terrain/terrain_border_endcaps.gd index 6e03aa0ee..3358bc3db 100644 --- a/classes/solid/terrain/terrain_border_endcaps.gd +++ b/classes/solid/terrain/terrain_border_endcaps.gd @@ -132,14 +132,14 @@ func add_cap_segment(is_left, area): var clip_uv = clip_box[1] # VALIDATE: Make sure the cut box is 4 verts if clip_poly.size() == 4: - draw_polygon(clip_poly, colors, clip_uv, root.skin.top_endcap_shadow) + draw_polygon(clip_poly, colors, clip_uv, root.top_endcap_shadow) else: # This should not happen! #print("oh no: ", area.index, ": ", clip_poly.size(), " - ", clip_uv.size()) pass # If the polygon is fully surrounded, simply draw the shadow. else: - draw_polygon(cap_verts, colors, uvs, root.skin.top_endcap_shadow) + draw_polygon(cap_verts, colors, uvs, root.top_endcap_shadow) # Draw the actual endcap on top of the shadow. - draw_polygon(cap_verts, colors, uvs, root.skin.top_endcap) + draw_polygon(cap_verts, colors, uvs, root.top_endcap) diff --git a/classes/solid/terrain/terrain_polygon.gd b/classes/solid/terrain/terrain_polygon.gd index 6d5796641..ed50a31fc 100644 --- a/classes/solid/terrain/terrain_polygon.gd +++ b/classes/solid/terrain/terrain_polygon.gd @@ -25,6 +25,14 @@ const COLLISION_LAYER_TERRAIN = 1 var properties: Dictionary = {} +var body: Texture2D +var top: Texture2D +var top_shadow: Texture2D +var top_endcap: Texture2D +var top_endcap_shadow: Texture2D +var side: Texture2D +var bottom: Texture2D + @onready var decorations: TerrainBorder = $Borders @onready var collision_body: StaticBody2D = $Static @onready var collision_shape: CollisionPolygon2D = $Static/Collision @@ -58,3 +66,22 @@ func set_null(_new_val): func reload_tileset(new_ts: TerrainSkin): skin = new_ts + + if skin != null: + body = new_ts.body + side = new_ts.side + bottom = new_ts.bottom + + top = new_ts.top + top_endcap = new_ts.top_endcap + top_shadow = new_ts.top_shadow + top_endcap_shadow = new_ts.top_endcap_shadow + else: + body = null + side = null + bottom = null + + top = null + top_endcap = null + top_shadow = null + top_endcap_shadow = null \ No newline at end of file From 1ce3b0400d268cc2177a6b553ad6cdf94ab2dd32 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 02:43:27 -0400 Subject: [PATCH 09/32] Rename shadow textures to "clip" In the future, I'd like to use this set of textures for non-shadow purposes. I'm trying to keep changes limited to MVP terrain-skin resource implementation, but this one is going to be inconvenient to change in the future, so I'm changing it now. --- classes/solid/terrain/terrain_border.gd | 7 ++--- .../solid/terrain/terrain_border_endcaps.gd | 26 +++++++++---------- classes/solid/terrain/terrain_polygon.gd | 12 ++++----- terrain_skins/grass/grass.tres | 4 +-- terrain_skins/terrain_skin.gd | 4 +-- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/classes/solid/terrain/terrain_border.gd b/classes/solid/terrain/terrain_border.gd index 28aceead9..12d897872 100644 --- a/classes/solid/terrain/terrain_border.gd +++ b/classes/solid/terrain/terrain_border.gd @@ -169,11 +169,12 @@ func generate_polygons_top(lines, z_order = 2): # Add it as a child. add_child(poly2d) - # Make a duplicate polygon to hold the shadow texture. - # TODO: This may be meant to get clipped to within the polygon's body. + # Make a duplicate polygon to hold the clip texture. + # This texture is meant to get clipped to within the polygon's body. + # TODO: Is it doing that though? if !root.tint: var shade = poly2d.duplicate() - shade.texture = root.top_shadow + shade.texture = root.top_clip add_child(shade) # Mark the right-side area for drawing. diff --git a/classes/solid/terrain/terrain_border_endcaps.gd b/classes/solid/terrain/terrain_border_endcaps.gd index 3358bc3db..01ea9a364 100644 --- a/classes/solid/terrain/terrain_border_endcaps.gd +++ b/classes/solid/terrain/terrain_border_endcaps.gd @@ -105,8 +105,15 @@ func add_cap_segment(is_left, area): ]) var vert_count = cap_verts.size() # TODO: Always == 4 :P + + # Tint the polygon. + # (TODO: Done differently than in terrain_border_endcaps.gd???) + var base_color = Color(1, 1, 1) + if root.tint: + base_color = root.tint_color + var colors = PackedColorArray([base_color, base_color, base_color, base_color]) - # Check if our cap should have a shadow or not + # Check if our cap should show its clip tex or not var inside_count = 0 var verts_inside = [] for vert in cap_verts: @@ -115,14 +122,7 @@ func add_cap_segment(is_left, area): verts_inside.append(vert) inside_count += 1 - # Tint the polygon. - # (TODO: Done differently than in pencil.gd???) - var base_color = Color(1, 1, 1) - if root.tint: - base_color = root.tint_color - var colors = PackedColorArray([base_color, base_color, base_color, base_color]) - - # Draw the shadow if there's any point inside the polygon. + # Draw the clip tex if there's any point inside the polygon. if inside_count > 0: # Is the polygon if inside_count != vert_count: @@ -132,14 +132,14 @@ func add_cap_segment(is_left, area): var clip_uv = clip_box[1] # VALIDATE: Make sure the cut box is 4 verts if clip_poly.size() == 4: - draw_polygon(clip_poly, colors, clip_uv, root.top_endcap_shadow) + draw_polygon(clip_poly, colors, clip_uv, root.top_endcap_clip) else: # This should not happen! #print("oh no: ", area.index, ": ", clip_poly.size(), " - ", clip_uv.size()) pass - # If the polygon is fully surrounded, simply draw the shadow. + # If the polygon is fully surrounded, simply draw the texture. else: - draw_polygon(cap_verts, colors, uvs, root.top_endcap_shadow) + draw_polygon(cap_verts, colors, uvs, root.top_endcap_clip) - # Draw the actual endcap on top of the shadow. + # Draw the regular endcap on top of the clip texture. draw_polygon(cap_verts, colors, uvs, root.top_endcap) diff --git a/classes/solid/terrain/terrain_polygon.gd b/classes/solid/terrain/terrain_polygon.gd index ed50a31fc..84f5ce4e8 100644 --- a/classes/solid/terrain/terrain_polygon.gd +++ b/classes/solid/terrain/terrain_polygon.gd @@ -27,9 +27,9 @@ var properties: Dictionary = {} var body: Texture2D var top: Texture2D -var top_shadow: Texture2D +var top_clip: Texture2D var top_endcap: Texture2D -var top_endcap_shadow: Texture2D +var top_endcap_clip: Texture2D var side: Texture2D var bottom: Texture2D @@ -74,8 +74,8 @@ func reload_tileset(new_ts: TerrainSkin): top = new_ts.top top_endcap = new_ts.top_endcap - top_shadow = new_ts.top_shadow - top_endcap_shadow = new_ts.top_endcap_shadow + top_clip = new_ts.top_clip + top_endcap_clip = new_ts.top_endcap_clip else: body = null side = null @@ -83,5 +83,5 @@ func reload_tileset(new_ts: TerrainSkin): top = null top_endcap = null - top_shadow = null - top_endcap_shadow = null \ No newline at end of file + top_clip = null + top_endcap_clip = null diff --git a/terrain_skins/grass/grass.tres b/terrain_skins/grass/grass.tres index dff7821f0..f5b71f12a 100644 --- a/terrain_skins/grass/grass.tres +++ b/terrain_skins/grass/grass.tres @@ -13,8 +13,8 @@ script = ExtResource("1_juhca") body = ExtResource("1_21lkl") top = ExtResource("5_nmf3i") -top_shadow = ExtResource("8_8w8xv") +top_clip = ExtResource("8_8w8xv") top_endcap = ExtResource("6_s0nkd") -top_endcap_shadow = ExtResource("7_b2wus") +top_endcap_clip = ExtResource("7_b2wus") side = ExtResource("4_ecf0v") bottom = ExtResource("2_f6esm") diff --git a/terrain_skins/terrain_skin.gd b/terrain_skins/terrain_skin.gd index cc397b899..6e6d87aeb 100644 --- a/terrain_skins/terrain_skin.gd +++ b/terrain_skins/terrain_skin.gd @@ -3,8 +3,8 @@ extends Resource @export var body: Texture2D @export var top: Texture2D -@export var top_shadow: Texture2D +@export var top_clip: Texture2D @export var top_endcap: Texture2D -@export var top_endcap_shadow: Texture2D +@export var top_endcap_clip: Texture2D @export var side: Texture2D @export var bottom: Texture2D From f8a7b59a14d2640a3f64722ae48a2e04e44875df Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 03:20:52 -0400 Subject: [PATCH 10/32] Force terrain redraw on tileset change There we go! This solves the problem where changing tileset texture wouldn't update the visuals until you moved a vertex. Probably could've implemented this without the resource, actually. --- classes/solid/terrain/terrain_polygon.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/solid/terrain/terrain_polygon.gd b/classes/solid/terrain/terrain_polygon.gd index 84f5ce4e8..c1f3b9389 100644 --- a/classes/solid/terrain/terrain_polygon.gd +++ b/classes/solid/terrain/terrain_polygon.gd @@ -85,3 +85,5 @@ func reload_tileset(new_ts: TerrainSkin): top_endcap = null top_clip = null top_endcap_clip = null + + decorations.queue_redraw() From 5db3093c4102f731ab0515f7fedb163ddb8a28fd Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 04:12:01 -0400 Subject: [PATCH 11/32] Emit changed signal when skin is modified So stupid that you have to do this manually per field, but there you go. Better to be explicit than inflexible, right? --- terrain_skins/terrain_skin.gd | 48 ++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/terrain_skins/terrain_skin.gd b/terrain_skins/terrain_skin.gd index 6e6d87aeb..f757a8bad 100644 --- a/terrain_skins/terrain_skin.gd +++ b/terrain_skins/terrain_skin.gd @@ -1,10 +1,44 @@ class_name TerrainSkin extends Resource -@export var body: Texture2D -@export var top: Texture2D -@export var top_clip: Texture2D -@export var top_endcap: Texture2D -@export var top_endcap_clip: Texture2D -@export var side: Texture2D -@export var bottom: Texture2D +@export var body: Texture2D: + set(value): + if value != body: + emit_changed() + body = value + +@export var top: Texture2D: + set(value): + if value != top: + emit_changed() + top = value + +@export var top_clip: Texture2D: + set(value): + if value != top_clip: + emit_changed() + top_clip = value + +@export var top_endcap: Texture2D: + set(value): + if value != top_endcap: + emit_changed() + top_endcap = value + +@export var top_endcap_clip: Texture2D: + set(value): + if value != top_endcap_clip: + emit_changed() + top_endcap_clip = value + +@export var side: Texture2D: + set(value): + if value != side: + emit_changed() + side = value + +@export var bottom: Texture2D: + set(value): + if value != bottom: + emit_changed() + bottom = value From 591353d06af4f180101c5e393c83efb518c1bf4c Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 04:21:48 -0400 Subject: [PATCH 12/32] Register terrain to terrain skin's change signal ...so that when the terrain skin stays the same but its contents are modified, the terrain polygons will still update After fighting my way through the quirks of Callables (don't use a lambda), I find that...it isn't actually doing anything. It appears my TerrainSkin changed emissions are coming out before the data is actually updated. That's kind of annoying. --- classes/solid/terrain/terrain_polygon.gd | 65 +++++++++++++++++------- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/classes/solid/terrain/terrain_polygon.gd b/classes/solid/terrain/terrain_polygon.gd index c1f3b9389..08a2ec191 100644 --- a/classes/solid/terrain/terrain_polygon.gd +++ b/classes/solid/terrain/terrain_polygon.gd @@ -65,25 +65,56 @@ func set_null(_new_val): func reload_tileset(new_ts: TerrainSkin): - skin = new_ts + # Callback to make the terrain lump update when the skin is modified. + var redraw_on_skin_change = Callable(self, "update_and_redraw") + # Clean up this terrain lump's callback from off the old skin (if it exists). if skin != null: - body = new_ts.body - side = new_ts.side - bottom = new_ts.bottom - - top = new_ts.top - top_endcap = new_ts.top_endcap - top_clip = new_ts.top_clip - top_endcap_clip = new_ts.top_endcap_clip + #assert(skin.changed.is_connected(redraw_on_skin_change)) + + skin.disconnect("changed", redraw_on_skin_change.bind(skin)) + + # Replace the old skin with the new. + skin = new_ts + + if new_ts != null: + # If the new skin isn't nothing, read in its new textures. + update_textures(new_ts) + # Also subscribe to updates, so this lump stays in sync. + new_ts.changed.connect(redraw_on_skin_change.bind(new_ts)) + + assert(new_ts.changed.is_connected(redraw_on_skin_change)) else: - body = null - side = null - bottom = null - - top = null - top_endcap = null - top_clip = null - top_endcap_clip = null + # If the new skin is nothing, set the textures to nothing as well. + clear_textures() + # Push graphics updates to child nodes. + decorations.queue_redraw() + + +func update_and_redraw(new_skin: TerrainSkin): + update_textures(new_skin) decorations.queue_redraw() + + +func update_textures(src_skin: TerrainSkin): + body = src_skin.body + side = src_skin.side + bottom = src_skin.bottom + + top = src_skin.top + top_endcap = src_skin.top_endcap + top_clip = src_skin.top_clip + top_endcap_clip = src_skin.top_endcap_clip + + +func clear_textures(): + body = null + side = null + bottom = null + + top = null + top_endcap = null + top_clip = null + top_endcap_clip = null + From b2e4beb6710977b8adbe375288ffef352574bdbd Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 05:21:03 -0400 Subject: [PATCH 13/32] Make TerrainSkin properly call emit_changed Turns out the problem was twofold! Not only was I calling "changed" before it was actually changed, but I'd forgotten to set the resource as a toolscript, so the setters weren't even running in the editor! Switching a terrain skin's texture now properly updates terrain lumps using it. --- classes/solid/terrain/terrain_polygon.gd | 2 +- terrain_skins/terrain_skin.gd | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/classes/solid/terrain/terrain_polygon.gd b/classes/solid/terrain/terrain_polygon.gd index 08a2ec191..a2fe886ae 100644 --- a/classes/solid/terrain/terrain_polygon.gd +++ b/classes/solid/terrain/terrain_polygon.gd @@ -70,7 +70,7 @@ func reload_tileset(new_ts: TerrainSkin): # Clean up this terrain lump's callback from off the old skin (if it exists). if skin != null: - #assert(skin.changed.is_connected(redraw_on_skin_change)) + assert(skin.changed.is_connected(redraw_on_skin_change)) skin.disconnect("changed", redraw_on_skin_change.bind(skin)) diff --git a/terrain_skins/terrain_skin.gd b/terrain_skins/terrain_skin.gd index f757a8bad..a58c1566f 100644 --- a/terrain_skins/terrain_skin.gd +++ b/terrain_skins/terrain_skin.gd @@ -1,44 +1,45 @@ +@tool class_name TerrainSkin extends Resource @export var body: Texture2D: set(value): if value != body: + body = value emit_changed() - body = value @export var top: Texture2D: set(value): if value != top: + top = value emit_changed() - top = value @export var top_clip: Texture2D: set(value): if value != top_clip: + top_clip = value emit_changed() - top_clip = value @export var top_endcap: Texture2D: set(value): if value != top_endcap: + top_endcap = value emit_changed() - top_endcap = value @export var top_endcap_clip: Texture2D: set(value): if value != top_endcap_clip: + top_endcap_clip = value emit_changed() - top_endcap_clip = value @export var side: Texture2D: set(value): if value != side: + side = value emit_changed() - side = value @export var bottom: Texture2D: set(value): if value != bottom: + bottom = value emit_changed() - bottom = value From 3e055c0cfa4f7491d3c2719a5bb4a8843064d960 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 05:24:00 -0400 Subject: [PATCH 14/32] Don't update borders if border node is null This does apparently happen when starting up the editor. --- classes/solid/terrain/terrain_polygon.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/solid/terrain/terrain_polygon.gd b/classes/solid/terrain/terrain_polygon.gd index a2fe886ae..a9b34f6bd 100644 --- a/classes/solid/terrain/terrain_polygon.gd +++ b/classes/solid/terrain/terrain_polygon.gd @@ -89,7 +89,10 @@ func reload_tileset(new_ts: TerrainSkin): clear_textures() # Push graphics updates to child nodes. - decorations.queue_redraw() + # Said nodes can apparently be null right when the editor starts up, + # so only update when these nodes exist. + if decorations != null: + decorations.queue_redraw() func update_and_redraw(new_skin: TerrainSkin): From be467bee176b345c31405ea0133f7f368070cdf7 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 06:08:26 -0400 Subject: [PATCH 15/32] Don't draw terrain parts with no textures Not only is it a waste of GPU time to render no border texture, but...it appears that untextured polygons actually show up as white by default, rather than fully transparent. So if I don't do this, terrain skins with blank texture slots appear outright wrong! --- classes/solid/terrain/terrain_border.gd | 26 +++++++++++++------ .../solid/terrain/terrain_border_endcaps.gd | 13 +++++----- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/classes/solid/terrain/terrain_border.gd b/classes/solid/terrain/terrain_border.gd index 12d897872..2e13ab393 100644 --- a/classes/solid/terrain/terrain_border.gd +++ b/classes/solid/terrain/terrain_border.gd @@ -16,7 +16,7 @@ enum EdgeType { const QUAD_RADIUS = 16 -@onready var root = $".." +@onready var root: TerrainPolygon = $".." @onready var body_polygon: Polygon2D = $"../Body" @onready var endcaps: TerrainBorderEndcaps = $"../TopEdgeEndcaps" @@ -26,10 +26,15 @@ func _draw(): for child in get_children(): child.queue_free() - # Load appearance from the root. - body_polygon.texture = root.body - body_polygon.polygon = root.polygon - body_polygon.color = root.tint_color if root.tint else Color(1, 1, 1) + # Load body appearance from the root, if there's a body texture. + if root.body != null: + body_polygon.visible = true + body_polygon.texture = root.body + body_polygon.polygon = root.polygon + body_polygon.color = root.tint_color if root.tint else Color(1, 1, 1) + # If the root has no body texture, hide the body polygon. + else: + body_polygon.visible = false # Clear the draw queue for endcaps. endcaps.area_queue = [] @@ -166,10 +171,11 @@ func generate_polygons_top(lines, z_order = 2): 0 if area.type == "quad" or (area.clock_dir == -1 and area.type == "trio") else area.verts.size() - 2) - # Add it as a child. - add_child(poly2d) + # Add it as a child, if its texture exists. + if root.top != null: + add_child(poly2d) - # Make a duplicate polygon to hold the clip texture. + # Make a duplicate polygon to hold the clip texture, if any. # This texture is meant to get clipped to within the polygon's body. # TODO: Is it doing that though? if !root.tint: @@ -228,6 +234,10 @@ func _add_inbetween_segment(areas, start: Vector2, end: Vector2, circumcenter: V func generate_polygons(lines: Array, texture: Texture2D, z_order: int): + # If this chain of polygons has no texture set, completely skip it. + if texture == null: + return + var p_len = lines.size() for ind in range(p_len - 1): # First create quads from each line segment. diff --git a/classes/solid/terrain/terrain_border_endcaps.gd b/classes/solid/terrain/terrain_border_endcaps.gd index 01ea9a364..489b59475 100644 --- a/classes/solid/terrain/terrain_border_endcaps.gd +++ b/classes/solid/terrain/terrain_border_endcaps.gd @@ -17,7 +17,7 @@ const QUAD_SIZE = 32 #2*TerrainBorder.QUAD_RADIUS # type: String = "quad" or "trio" depending on vert count. @export var area_queue: Array -@onready var root = $".." +@onready var root: TerrainPolygon = $".." func _draw(): @@ -113,7 +113,7 @@ func add_cap_segment(is_left, area): base_color = root.tint_color var colors = PackedColorArray([base_color, base_color, base_color, base_color]) - # Check if our cap should show its clip tex or not + # Check if any point of the cap is inside the polygon. var inside_count = 0 var verts_inside = [] for vert in cap_verts: @@ -122,9 +122,9 @@ func add_cap_segment(is_left, area): verts_inside.append(vert) inside_count += 1 - # Draw the clip tex if there's any point inside the polygon. - if inside_count > 0: - # Is the polygon + # Draw the clip tex (if it exists) if there's any point inside the polygon + if inside_count > 0 and root.top_endcap_clip != null: + # Is any point *outside* the polygon? if inside_count != vert_count: # Clip the box so it fits in the polygon var clip_box = polygon_clip_box(cap_verts, uvs) @@ -142,4 +142,5 @@ func add_cap_segment(is_left, area): draw_polygon(cap_verts, colors, uvs, root.top_endcap_clip) # Draw the regular endcap on top of the clip texture. - draw_polygon(cap_verts, colors, uvs, root.top_endcap) + if root.top_endcap != null: + draw_polygon(cap_verts, colors, uvs, root.top_endcap) From c00cc7553a85f7fb682be2fe20ba3db684f28d4e Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 01:28:40 -0400 Subject: [PATCH 16/32] Create importer plugin Basically a stub at this point, but it's got a skeleton I can fill out, so that's a good start. --- addons/tileset_from_image/plugin.cfg | 7 ++ addons/tileset_from_image/plugin.gd | 15 ++++ .../tileset_from_image/tileset_from_image.gd | 75 +++++++++++++++++++ project.godot | 4 + 4 files changed, 101 insertions(+) create mode 100644 addons/tileset_from_image/plugin.cfg create mode 100644 addons/tileset_from_image/plugin.gd create mode 100644 addons/tileset_from_image/tileset_from_image.gd diff --git a/addons/tileset_from_image/plugin.cfg b/addons/tileset_from_image/plugin.cfg new file mode 100644 index 000000000..8a7048afb --- /dev/null +++ b/addons/tileset_from_image/plugin.cfg @@ -0,0 +1,7 @@ +[plugin] + +name="Tileset Resource from Template Image" +description="Automatically creates tileset textures from template images." +author="Redux Team" +version="0.0.1" +script="plugin.gd" diff --git a/addons/tileset_from_image/plugin.gd b/addons/tileset_from_image/plugin.gd new file mode 100644 index 000000000..b59ea9988 --- /dev/null +++ b/addons/tileset_from_image/plugin.gd @@ -0,0 +1,15 @@ +@tool +extends EditorPlugin + +# Declared here so it can be cleaned up in _exit_tree(). +var plugin + + +func _enter_tree(): + # Load and instantiate the actual script. + plugin = preload("res://addons/tileset_from_image/tileset_from_image.gd").new() + add_import_plugin(plugin) + + +func _exit_tree(): + remove_import_plugin(plugin) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd new file mode 100644 index 000000000..7bcb69686 --- /dev/null +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -0,0 +1,75 @@ +@tool +extends EditorImportPlugin + +enum Presets { + ## The format originally designed for the Tiny Demo. + FORMAT_V1 +} + + +## Returns the number of presets. +func _get_preset_count(): + return Presets.size() + + +## Returns the user-facing names of the indexed preset. +func _get_preset_name(preset_index): + match preset_index: + Presets.FORMAT_V1: + return "Tiny Demo-era" + _: + return "Unknown" + + +## Returns the actual parameters of the indexed preset. +func _get_import_options(path, preset_index): + match preset_index: + Presets.FORMAT_V1: + return [] + _: # + return [] + + +func _get_importer_name(): + return "63r.tileset_template" + + +func _get_visible_name(): + return "Tileset Template" + + +func _get_recognized_extensions(): + return ["png", "gif"] + + +func _get_save_extension(): + return "res" + + +func _get_resource_type(): + return "Tileset" + + +## Returns true for any option which is visible. +func _get_option_visibility(path, option_name, options): + return true # Stubbed while no options exist. + + +func _import(source_file, save_path, options, r_platform_variants, r_gen_files): + # Open the given file (and error if invalid). + var file = FileAccess.open(source_file, FileAccess.READ) + if file == null: + return FileAccess.get_open_error() + + # TODO: Do things with the loaded file. + # Like validate that it's an image, for example. + var out_res: Resource + + # If there's different variants of this resource for different platforms, + # push the feature tag to r_platform_variants, then insert the tag between + # save_path and _get_save_extension() (. separated) when returning. + + # If extra files are written outside the import settings, push their paths + # to r_gen_files. + + return ResourceSaver.save(out_res, "%s.%s" % [save_path, _get_save_extension()]) diff --git a/project.godot b/project.godot index 61bfe7e88..f5a44846e 100644 --- a/project.godot +++ b/project.godot @@ -36,6 +36,10 @@ mouse_cursor/custom_image_hotspot=Vector2(1, 1) project/assembly_name="Super Mario 63 Redux" +[editor_plugins] + +enabled=PackedStringArray("res://addons/tileset_from_image/plugin.cfg") + [gui] theme/custom="res://gui/theme_gui.tres" From 831afa200fa2f9ce39e8b2994560c15db176d6c0 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 22:46:12 -0400 Subject: [PATCH 17/32] Rename Tileset to TerrainTemplate in importer Did that in the rest of the codebase. Let's commit to it. --- addons/tileset_from_image/plugin.cfg | 4 ++-- addons/tileset_from_image/tileset_from_image.gd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/tileset_from_image/plugin.cfg b/addons/tileset_from_image/plugin.cfg index 8a7048afb..a9ad31640 100644 --- a/addons/tileset_from_image/plugin.cfg +++ b/addons/tileset_from_image/plugin.cfg @@ -1,7 +1,7 @@ [plugin] -name="Tileset Resource from Template Image" -description="Automatically creates tileset textures from template images." +name="Terrain Skin from Template Image" +description="Automatically creates terrain skins from multi-texture template images." author="Redux Team" version="0.0.1" script="plugin.gd" diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index 7bcb69686..f4bc6f7ca 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -31,11 +31,11 @@ func _get_import_options(path, preset_index): func _get_importer_name(): - return "63r.tileset_template" + return "63r.terrain_skin" func _get_visible_name(): - return "Tileset Template" + return "Terrain Skin Template" func _get_recognized_extensions(): From e00042ebb34cb4a40fd7f63f70007ecc6d8d1b46 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Mon, 27 May 2024 23:00:41 -0400 Subject: [PATCH 18/32] Fill out import function Now correctly creates TerrainSkin resources from the v1 template, which I can verify by importing jungle_normal_spritesheet.png as a TerrainSkin. (new_atlastexture.tres references the tileset image, but it appears to be completely unused, so. In the bin :P) --- .../tileset_from_image/tileset_from_image.gd | 53 +++++++++++++++---- .../jungle_normal_spritesheet.png.import | 28 ++-------- .../level_designer/new_atlastexture.tres | 8 --- 3 files changed, 47 insertions(+), 42 deletions(-) delete mode 100644 scenes/menus/level_designer/new_atlastexture.tres diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index f4bc6f7ca..37afa1f5e 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -39,7 +39,7 @@ func _get_visible_name(): func _get_recognized_extensions(): - return ["png", "gif"] + return ["bmp", "png", "jpg", "jpeg", "tga", "webp"] func _get_save_extension(): @@ -47,9 +47,12 @@ func _get_save_extension(): func _get_resource_type(): - return "Tileset" + return "Resource" +func _get_import_order(): + return 0 + ## Returns true for any option which is visible. func _get_option_visibility(path, option_name, options): return true # Stubbed while no options exist. @@ -57,19 +60,49 @@ func _get_option_visibility(path, option_name, options): func _import(source_file, save_path, options, r_platform_variants, r_gen_files): # Open the given file (and error if invalid). - var file = FileAccess.open(source_file, FileAccess.READ) + var file := FileAccess.get_file_as_bytes(source_file) if file == null: return FileAccess.get_open_error() - # TODO: Do things with the loaded file. - # Like validate that it's an image, for example. - var out_res: Resource + # Load image data from the bytes. + var img := Image.new() + var parse_result + match source_file.get_extension().to_lower() : + "bmp": + parse_result = img.load_bmp_from_buffer(file) + "png": + parse_result = img.load_png_from_buffer(file) + "jpg", "jpeg": + # Not an ideal format, but heck, no reason to prevent it + parse_result = img.load_jpg_from_buffer(file) + "tga": + parse_result = img.load_tga_from_buffer(file) + "webp": # why + parse_result = img.load_webp_from_buffer(file) + _: + parse_result = ERR_INVALID_DATA + # Abort if the load failed. + if parse_result != OK: + return parse_result + + var out_res := TerrainSkin.new() + + # Slice textures from the spritesheet. + # Can't just use atlas textures, they don't loop like we need. + out_res.body = ImageTexture.create_from_image(img.get_region( Rect2(36, 3, 32, 32) ) ) + out_res.side = ImageTexture.create_from_image(img.get_region( Rect2(3, 3, 32, 32) ) ) + out_res.bottom = ImageTexture.create_from_image(img.get_region( Rect2(36, 36, 32, 32) ) ) + + out_res.top = ImageTexture.create_from_image(img.get_region( Rect2(105, 3, 32, 32) ) ) + out_res.top_endcap = ImageTexture.create_from_image(img.get_region( Rect2(72, 3, 32, 32) ) ) + out_res.top_clip = ImageTexture.create_from_image(img.get_region( Rect2(105, 36, 32, 32) ) ) + out_res.top_endcap_clip = ImageTexture.create_from_image(img.get_region( Rect2(72, 36, 32, 32) ) ) + + # If we want to save the sliced textures separately, use ResourceSaver, + # then push their paths to r_gen_files. # If there's different variants of this resource for different platforms, # push the feature tag to r_platform_variants, then insert the tag between - # save_path and _get_save_extension() (. separated) when returning. - - # If extra files are written outside the import settings, push their paths - # to r_gen_files. + # save_path and _get_save_extension() (. separated) when saving the files. return ResourceSaver.save(out_res, "%s.%s" % [save_path, _get_save_extension()]) diff --git a/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import b/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import index 6bc2110bc..dea8ed334 100644 --- a/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import +++ b/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import @@ -1,34 +1,14 @@ [remap] -importer="texture" -type="CompressedTexture2D" +importer="63r.terrain_skin" +type="Resource" uid="uid://bfx115eob35tv" -path="res://.godot/imported/jungle_normal_spritesheet.png-5e9f32a8f565203dc1c45345dc90e191.ctex" -metadata={ -"vram_texture": false -} +path="res://.godot/imported/jungle_normal_spritesheet.png-5e9f32a8f565203dc1c45345dc90e191.res" [deps] source_file="res://classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png" -dest_files=["res://.godot/imported/jungle_normal_spritesheet.png-5e9f32a8f565203dc1c45345dc90e191.ctex"] +dest_files=["res://.godot/imported/jungle_normal_spritesheet.png-5e9f32a8f565203dc1c45345dc90e191.res"] [params] -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/scenes/menus/level_designer/new_atlastexture.tres b/scenes/menus/level_designer/new_atlastexture.tres deleted file mode 100644 index f2443dc07..000000000 --- a/scenes/menus/level_designer/new_atlastexture.tres +++ /dev/null @@ -1,8 +0,0 @@ -[gd_resource type="AtlasTexture" load_steps=2 format=2] - -[ext_resource path="res://classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png" type="Texture2D" id=1] - -[resource] -flags = 2 -atlas = ExtResource( 1 ) -region = Rect2( 36, 3, 32, 32 ) From a3434baae4460e7773c0e1fdf4f596748ebac8bd Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Tue, 28 May 2024 20:52:02 -0400 Subject: [PATCH 19/32] Give names to terrain texture subresources Was hoping this would make it so TerrainPolygon didn't have to save a copy of the body texture in its own data. No dice; no reason to undo this tho. --- addons/tileset_from_image/tileset_from_image.gd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index 37afa1f5e..e84c489b4 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -101,6 +101,18 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): # If we want to save the sliced textures separately, use ResourceSaver, # then push their paths to r_gen_files. + # Name the new texture resources. + # This does not allow TerrainPolygon to reference these rather than + # storing a copy, unfortunately. + var tex_name = source_file.get_file() + out_res.body.resource_name = "%s_body" % tex_name + out_res.side.resource_name = "%s_side" % tex_name + out_res.bottom.resource_name = "%s_bottom" % tex_name + out_res.top.resource_name = "%s_top" % tex_name + out_res.top_endcap.resource_name = "%s_top_endcap" % tex_name + out_res.top_clip.resource_name = "%s_top_clip" % tex_name + out_res.top_endcap_clip.resource_name = "%s_top_endcap_clip" % tex_name + # If there's different variants of this resource for different platforms, # push the feature tag to r_platform_variants, then insert the tag between # save_path and _get_save_extension() (. separated) when saving the files. From 32a3fb8edeadbcd466815422fc1b873e0e6cebb0 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Tue, 28 May 2024 23:26:11 -0400 Subject: [PATCH 20/32] Make texture slice regions configurable And THIS is the key feature that ties everything together! It's now not only possible to import terskins from templates, it's possible to actually use the sized-up texture feature. As well as to support template formats other than just the original. --- .../tileset_from_image/tileset_from_image.gd | 53 +++++++++++++++---- .../jungle_normal_spritesheet.png.import | 8 +++ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index e84c489b4..218e19822 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -25,7 +25,42 @@ func _get_preset_name(preset_index): func _get_import_options(path, preset_index): match preset_index: Presets.FORMAT_V1: - return [] + return [ + { + "name": "Texture Rects", + "default_value": null, + "usage": PROPERTY_USAGE_GROUP | PROPERTY_USAGE_INTERNAL, + }, + { + "name": "body", + "default_value": Rect2(36, 3, 32, 32) + }, + { + "name": "side", + "default_value": Rect2(3, 3, 32, 32) + }, + { + "name": "bottom", + "default_value": Rect2(36, 36, 32, 32) + }, + + { + "name": "top", + "default_value": Rect2(105, 3, 32, 32) + }, + { + "name": "top_endcap", + "default_value": Rect2(72, 3, 32, 32) + }, + { + "name": "top_clip", + "default_value": Rect2(105, 36, 32, 32) + }, + { + "name": "top_endcap_clip", + "default_value": Rect2(72, 36, 32, 32) + }, + ] _: # return [] @@ -89,14 +124,14 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): # Slice textures from the spritesheet. # Can't just use atlas textures, they don't loop like we need. - out_res.body = ImageTexture.create_from_image(img.get_region( Rect2(36, 3, 32, 32) ) ) - out_res.side = ImageTexture.create_from_image(img.get_region( Rect2(3, 3, 32, 32) ) ) - out_res.bottom = ImageTexture.create_from_image(img.get_region( Rect2(36, 36, 32, 32) ) ) - - out_res.top = ImageTexture.create_from_image(img.get_region( Rect2(105, 3, 32, 32) ) ) - out_res.top_endcap = ImageTexture.create_from_image(img.get_region( Rect2(72, 3, 32, 32) ) ) - out_res.top_clip = ImageTexture.create_from_image(img.get_region( Rect2(105, 36, 32, 32) ) ) - out_res.top_endcap_clip = ImageTexture.create_from_image(img.get_region( Rect2(72, 36, 32, 32) ) ) + out_res.body = ImageTexture.create_from_image(img.get_region( options["body"] ) ) + out_res.side = ImageTexture.create_from_image(img.get_region( options["side"] ) ) + out_res.bottom = ImageTexture.create_from_image(img.get_region( options["bottom"] ) ) + + out_res.top = ImageTexture.create_from_image(img.get_region( options["top"] ) ) + out_res.top_endcap = ImageTexture.create_from_image(img.get_region( options["top_endcap"] ) ) + out_res.top_clip = ImageTexture.create_from_image(img.get_region( options["top_clip"] ) ) + out_res.top_endcap_clip = ImageTexture.create_from_image(img.get_region( options["top_endcap_clip"] ) ) # If we want to save the sliced textures separately, use ResourceSaver, # then push their paths to r_gen_files. diff --git a/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import b/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import index dea8ed334..be9d9bd43 100644 --- a/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import +++ b/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import @@ -12,3 +12,11 @@ dest_files=["res://.godot/imported/jungle_normal_spritesheet.png-5e9f32a8f565203 [params] +Texture Rects=null +body=Rect2(36, 3, 32, 32) +side=Rect2(3, 3, 32, 32) +bottom=Rect2(36, 36, 32, 32) +top=Rect2(105, 3, 32, 32) +top_endcap=Rect2(72, 3, 32, 32) +top_clip=Rect2(105, 36, 32, 32) +top_endcap_clip=Rect2(72, 36, 32, 32) From 36afe561496f48283ed7d5219a439e2c0b184619 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 00:01:23 -0400 Subject: [PATCH 21/32] Don't create textures when size is 0 Size of 0 shall be interpreted as an explicit request not to use this texture. Can't have it erroring because of that. --- .../tileset_from_image/tileset_from_image.gd | 59 ++++++++++++------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index 218e19822..86c1aaf2f 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -121,33 +121,48 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): return parse_result var out_res := TerrainSkin.new() + out_res.resource_path = "%s.%s" % [save_path, _get_save_extension()] + var tex_name = source_file.get_file() + out_res.resource_name = tex_name - # Slice textures from the spritesheet. - # Can't just use atlas textures, they don't loop like we need. - out_res.body = ImageTexture.create_from_image(img.get_region( options["body"] ) ) - out_res.side = ImageTexture.create_from_image(img.get_region( options["side"] ) ) - out_res.bottom = ImageTexture.create_from_image(img.get_region( options["bottom"] ) ) - - out_res.top = ImageTexture.create_from_image(img.get_region( options["top"] ) ) - out_res.top_endcap = ImageTexture.create_from_image(img.get_region( options["top_endcap"] ) ) - out_res.top_clip = ImageTexture.create_from_image(img.get_region( options["top_clip"] ) ) - out_res.top_endcap_clip = ImageTexture.create_from_image(img.get_region( options["top_endcap_clip"] ) ) + # For each texture with at least one pixel, slice it from the spritesheet. + # (Can't just use atlas textures, they don't loop like we need.) + # Then name them and give them a path (in an unsuccessful attempt to allow + # TerrainPolygon to reference these rather than storing a copy of the + # texture data in its scene file). + if options["body"].size.x > 0 and options["body"].size.y > 0: + out_res.body = ImageTexture.create_from_image(img.get_region( options["body"] ) ) + out_res.body.resource_name = "%s_body" % tex_name + out_res.body.resource_path = "%s::body" % out_res.resource_path + if options["side"].size.x > 0 and options["side"].size.y > 0: + out_res.side = ImageTexture.create_from_image(img.get_region( options["side"] ) ) + out_res.side.resource_name = "%s_side" % tex_name + out_res.side.resource_path = "%s::side" % out_res.resource_path + if options["bottom"].size.x > 0 and options["bottom"].size.y > 0: + out_res.bottom = ImageTexture.create_from_image(img.get_region( options["bottom"] ) ) + out_res.bottom.resource_name = "%s_bottom" % tex_name + out_res.bottom.resource_path = "%s::bottom" % out_res.resource_path + + if options["top"].size.x > 0 and options["top"].size.y > 0: + out_res.top = ImageTexture.create_from_image(img.get_region( options["top"] ) ) + out_res.top.resource_name = "%s_top" % tex_name + out_res.top.resource_path = "%s::top" % out_res.resource_path + if options["top_endcap"].size.x > 0 and options["top_endcap"].size.y > 0: + out_res.top_endcap = ImageTexture.create_from_image(img.get_region( options["top_endcap"] ) ) + out_res.top_endcap.resource_name = "%s_top_endcap" % tex_name + out_res.top_endcap.resource_path = "%s::top_endcap" % out_res.resource_path + if options["top_clip"].size.x > 0 and options["top_clip"].size.y > 0: + out_res.top_clip = ImageTexture.create_from_image(img.get_region( options["top_clip"] ) ) + out_res.top_clip.resource_name = "%s_top_clip" % tex_name + out_res.top_clip.resource_path = "%s::top_clip" % out_res.resource_path + if options["top_endcap_clip"].size.x > 0 and options["top_endcap_clip"].size.y > 0: + out_res.top_endcap_clip = ImageTexture.create_from_image(img.get_region( options["top_endcap_clip"] ) ) + out_res.top_endcap_clip.resource_name = "%s_top_endcap_clip" % tex_name + out_res.top_endcap_clip.resource_path = "%s::top_endcap_clip" % out_res.resource_path # If we want to save the sliced textures separately, use ResourceSaver, # then push their paths to r_gen_files. - # Name the new texture resources. - # This does not allow TerrainPolygon to reference these rather than - # storing a copy, unfortunately. - var tex_name = source_file.get_file() - out_res.body.resource_name = "%s_body" % tex_name - out_res.side.resource_name = "%s_side" % tex_name - out_res.bottom.resource_name = "%s_bottom" % tex_name - out_res.top.resource_name = "%s_top" % tex_name - out_res.top_endcap.resource_name = "%s_top_endcap" % tex_name - out_res.top_clip.resource_name = "%s_top_clip" % tex_name - out_res.top_endcap_clip.resource_name = "%s_top_endcap_clip" % tex_name - # If there's different variants of this resource for different platforms, # push the feature tag to r_platform_variants, then insert the tag between # save_path and _get_save_extension() (. separated) when saving the files. From 040e63a8fc3fdf461578799a85ef467e39bef7c1 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 00:23:49 -0400 Subject: [PATCH 22/32] Don't create texture when all alpha is 0 Because when there's no graphic, it's cheaper to just not render it...and this is how we indicate not to render it. --- .../tileset_from_image/tileset_from_image.gd | 67 ++++++++++++------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index 86c1aaf2f..a8d639d92 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -125,40 +125,57 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): var tex_name = source_file.get_file() out_res.resource_name = tex_name - # For each texture with at least one pixel, slice it from the spritesheet. + # Slice each non-zero-sized texture from the spritesheet. # (Can't just use atlas textures, they don't loop like we need.) - # Then name them and give them a path (in an unsuccessful attempt to allow - # TerrainPolygon to reference these rather than storing a copy of the - # texture data in its scene file). if options["body"].size.x > 0 and options["body"].size.y > 0: - out_res.body = ImageTexture.create_from_image(img.get_region( options["body"] ) ) - out_res.body.resource_name = "%s_body" % tex_name - out_res.body.resource_path = "%s::body" % out_res.resource_path + var slice = img.get_region(options["body"]) + # If the slice has any visible pixels... + if !slice.is_invisible(): + # ...save it to the resource. + out_res.body = ImageTexture.create_from_image(slice) + # Then name them and give them a path (in an unsuccessful attempt to allow + # TerrainPolygon to reference these rather than storing a copy of the + # texture data in its scene file). + out_res.body.resource_name = "%s_body" % tex_name + out_res.body.resource_path = "%s::body" % out_res.resource_path + # Do the same for every texture. if options["side"].size.x > 0 and options["side"].size.y > 0: - out_res.side = ImageTexture.create_from_image(img.get_region( options["side"] ) ) - out_res.side.resource_name = "%s_side" % tex_name - out_res.side.resource_path = "%s::side" % out_res.resource_path + var slice = img.get_region(options["side"]) + if !slice.is_invisible(): + out_res.side = ImageTexture.create_from_image(slice) + out_res.side.resource_name = "%s_side" % tex_name + out_res.side.resource_path = "%s::side" % out_res.resource_path if options["bottom"].size.x > 0 and options["bottom"].size.y > 0: - out_res.bottom = ImageTexture.create_from_image(img.get_region( options["bottom"] ) ) - out_res.bottom.resource_name = "%s_bottom" % tex_name - out_res.bottom.resource_path = "%s::bottom" % out_res.resource_path + var slice = img.get_region(options["bottom"]) + if !slice.is_invisible(): + out_res.bottom = ImageTexture.create_from_image(slice) + out_res.bottom.resource_name = "%s_bottom" % tex_name + out_res.bottom.resource_path = "%s::bottom" % out_res.resource_path if options["top"].size.x > 0 and options["top"].size.y > 0: - out_res.top = ImageTexture.create_from_image(img.get_region( options["top"] ) ) - out_res.top.resource_name = "%s_top" % tex_name - out_res.top.resource_path = "%s::top" % out_res.resource_path + var slice = img.get_region(options["top"]) + if !slice.is_invisible(): + out_res.top = ImageTexture.create_from_image(slice) + out_res.top.resource_name = "%s_top" % tex_name + out_res.top.resource_path = "%s::top" % out_res.resource_path if options["top_endcap"].size.x > 0 and options["top_endcap"].size.y > 0: - out_res.top_endcap = ImageTexture.create_from_image(img.get_region( options["top_endcap"] ) ) - out_res.top_endcap.resource_name = "%s_top_endcap" % tex_name - out_res.top_endcap.resource_path = "%s::top_endcap" % out_res.resource_path + var slice = img.get_region(options["top_endcap"]) + if !slice.is_invisible(): + out_res.top_endcap = ImageTexture.create_from_image(slice) + out_res.top_endcap.resource_name = "%s_top_endcap" % tex_name + out_res.top_endcap.resource_path = "%s::top_endcap" % out_res.resource_path if options["top_clip"].size.x > 0 and options["top_clip"].size.y > 0: - out_res.top_clip = ImageTexture.create_from_image(img.get_region( options["top_clip"] ) ) - out_res.top_clip.resource_name = "%s_top_clip" % tex_name - out_res.top_clip.resource_path = "%s::top_clip" % out_res.resource_path + var slice = img.get_region(options["top_clip"]) + if !slice.is_invisible(): + out_res.top_clip = ImageTexture.create_from_image(slice) + out_res.top_clip.resource_name = "%s_top_clip" % tex_name + out_res.top_clip.resource_path = "%s::top_clip" % out_res.resource_path if options["top_endcap_clip"].size.x > 0 and options["top_endcap_clip"].size.y > 0: - out_res.top_endcap_clip = ImageTexture.create_from_image(img.get_region( options["top_endcap_clip"] ) ) - out_res.top_endcap_clip.resource_name = "%s_top_endcap_clip" % tex_name - out_res.top_endcap_clip.resource_path = "%s::top_endcap_clip" % out_res.resource_path + var slice = img.get_region(options["top_endcap_clip"]) + if !slice.is_invisible(): + out_res.top_endcap_clip = ImageTexture.create_from_image(slice) + out_res.top_endcap_clip.resource_name = "%s_top_endcap_clip" % tex_name + out_res.top_endcap_clip.resource_path = "%s::top_endcap_clip" % out_res.resource_path # If we want to save the sliced textures separately, use ResourceSaver, # then push their paths to r_gen_files. From 00cbd2ea13d83e97c0d00eef39c6729afe633db8 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 00:36:18 -0400 Subject: [PATCH 23/32] Replace temp resource with imported spritesheet Gone are these extra loose files. Now, it's just the one, as it was always meant to be. It annoys me that terrain_polygon has gone back to storing a copy of the body texture, but hey, there's not much I can do about that. Apart from one thing, I guess. --- classes/solid/terrain/terrain_polygon.tscn | 23 +++++++++--- ..._normal_spritesheet_explenation.png.import | 34 ------------------ .../grass}/dark_ground.png | Bin .../grass}/dark_ground.png.import | 6 ++-- .../grass/grass.png | Bin .../grass/grass.png.import | 6 ++-- terrain_skins/grass/grass.tres | 20 ----------- terrain_skins/grass/grass_body.png | Bin 550 -> 0 bytes terrain_skins/grass/grass_body.png.import | 34 ------------------ terrain_skins/grass/grass_bottom.png | Bin 187 -> 0 bytes terrain_skins/grass/grass_endcap.png | Bin 281 -> 0 bytes terrain_skins/grass/grass_endcap.png.import | 34 ------------------ terrain_skins/grass/grass_endcap_shadow.png | Bin 212 -> 0 bytes .../grass/grass_endcap_shadow.png.import | 34 ------------------ terrain_skins/grass/grass_side.png | Bin 270 -> 0 bytes terrain_skins/grass/grass_side.png.import | 34 ------------------ terrain_skins/grass/grass_top.png | Bin 524 -> 0 bytes terrain_skins/grass/grass_top.png.import | 34 ------------------ terrain_skins/grass/grass_top_shadow.png | Bin 240 -> 0 bytes .../grass/grass_top_shadow.png.import | 34 ------------------ .../spritesheet_explenation.png | Bin ...ort => spritesheet_explenation.png.import} | 8 ++--- 22 files changed, 28 insertions(+), 273 deletions(-) delete mode 100644 classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet_explenation.png.import rename {classes/solid/terrain/tilesets/jungle => terrain_skins/grass}/dark_ground.png (100%) rename {classes/solid/terrain/tilesets/jungle => terrain_skins/grass}/dark_ground.png.import (69%) rename classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png => terrain_skins/grass/grass.png (100%) rename classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import => terrain_skins/grass/grass.png.import (53%) delete mode 100644 terrain_skins/grass/grass.tres delete mode 100644 terrain_skins/grass/grass_body.png delete mode 100644 terrain_skins/grass/grass_body.png.import delete mode 100644 terrain_skins/grass/grass_bottom.png delete mode 100644 terrain_skins/grass/grass_endcap.png delete mode 100644 terrain_skins/grass/grass_endcap.png.import delete mode 100644 terrain_skins/grass/grass_endcap_shadow.png delete mode 100644 terrain_skins/grass/grass_endcap_shadow.png.import delete mode 100644 terrain_skins/grass/grass_side.png delete mode 100644 terrain_skins/grass/grass_side.png.import delete mode 100644 terrain_skins/grass/grass_top.png delete mode 100644 terrain_skins/grass/grass_top.png.import delete mode 100644 terrain_skins/grass/grass_top_shadow.png delete mode 100644 terrain_skins/grass/grass_top_shadow.png.import rename classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet_explenation.png => terrain_skins/spritesheet_explenation.png (100%) rename terrain_skins/{grass/grass_bottom.png.import => spritesheet_explenation.png.import} (65%) diff --git a/classes/solid/terrain/terrain_polygon.tscn b/classes/solid/terrain/terrain_polygon.tscn index eff6c08b6..4d48ca8fb 100644 --- a/classes/solid/terrain/terrain_polygon.tscn +++ b/classes/solid/terrain/terrain_polygon.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=7 format=3 uid="uid://uxujeycb0ytl"] +[gd_scene load_steps=8 format=3 uid="uid://uxujeycb0ytl"] [ext_resource type="Script" path="res://classes/solid/terrain/terrain_polygon.gd" id="1"] -[ext_resource type="Resource" uid="uid://b6lmtx75rts72" path="res://terrain_skins/grass/grass.tres" id="2_s1sd3"] -[ext_resource type="Texture2D" uid="uid://bbujtjtisgabh" path="res://terrain_skins/grass/grass_body.png" id="3_ecg2a"] +[ext_resource type="Resource" uid="uid://bfx115eob35tv" path="res://terrain_skins/grass/grass.png" id="2_tuqqw"] [ext_resource type="Script" path="res://classes/solid/terrain/terrain_border.gd" id="4"] [ext_resource type="Script" path="res://classes/solid/terrain/terrain_border_endcaps.gd" id="10"] @@ -10,16 +9,30 @@ resource_name = "TerrainMaterial" light_mode = 1 +[sub_resource type="Image" id="Image_hah7x"] +data = { +"data": PackedByteArray(205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255), +"format": "RGBA8", +"height": 32, +"mipmaps": false, +"width": 32 +} + +[sub_resource type="ImageTexture" id="ImageTexture_eq5xp"] +resource_name = "grass.png_body" +image = SubResource("Image_hah7x") + [node name="TerrainPolygon" type="Polygon2D"] texture_repeat = 2 material = SubResource("CanvasItemMaterial_j0k2v") script = ExtResource("1") -skin = ExtResource("2_s1sd3") +skin = ExtResource("2_tuqqw") +tint_color = Color(1, 1, 1, 0.501961) [node name="Body" type="Polygon2D" parent="."] texture_repeat = 2 use_parent_material = true -texture = ExtResource("3_ecg2a") +texture = SubResource("ImageTexture_eq5xp") [node name="Borders" type="Node2D" parent="."] use_parent_material = true diff --git a/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet_explenation.png.import b/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet_explenation.png.import deleted file mode 100644 index 66f4e9b1b..000000000 --- a/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet_explenation.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://p8n6lgy1kx1c" -path="res://.godot/imported/jungle_normal_spritesheet_explenation.png-42a0cfa6024da24c02141b392a1bd4b4.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet_explenation.png" -dest_files=["res://.godot/imported/jungle_normal_spritesheet_explenation.png-42a0cfa6024da24c02141b392a1bd4b4.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/classes/solid/terrain/tilesets/jungle/dark_ground.png b/terrain_skins/grass/dark_ground.png similarity index 100% rename from classes/solid/terrain/tilesets/jungle/dark_ground.png rename to terrain_skins/grass/dark_ground.png diff --git a/classes/solid/terrain/tilesets/jungle/dark_ground.png.import b/terrain_skins/grass/dark_ground.png.import similarity index 69% rename from classes/solid/terrain/tilesets/jungle/dark_ground.png.import rename to terrain_skins/grass/dark_ground.png.import index 27297df4f..5203e6bb3 100644 --- a/classes/solid/terrain/tilesets/jungle/dark_ground.png.import +++ b/terrain_skins/grass/dark_ground.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://buqa465et8vd6" -path="res://.godot/imported/dark_ground.png-2132f77797c414290bf383556a3e4f61.ctex" +path="res://.godot/imported/dark_ground.png-755ec2eba480b27877169d207e1eafed.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://classes/solid/terrain/tilesets/jungle/dark_ground.png" -dest_files=["res://.godot/imported/dark_ground.png-2132f77797c414290bf383556a3e4f61.ctex"] +source_file="res://terrain_skins/grass/dark_ground.png" +dest_files=["res://.godot/imported/dark_ground.png-755ec2eba480b27877169d207e1eafed.ctex"] [params] diff --git a/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png b/terrain_skins/grass/grass.png similarity index 100% rename from classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png rename to terrain_skins/grass/grass.png diff --git a/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import b/terrain_skins/grass/grass.png.import similarity index 53% rename from classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import rename to terrain_skins/grass/grass.png.import index be9d9bd43..b0391e611 100644 --- a/classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png.import +++ b/terrain_skins/grass/grass.png.import @@ -3,12 +3,12 @@ importer="63r.terrain_skin" type="Resource" uid="uid://bfx115eob35tv" -path="res://.godot/imported/jungle_normal_spritesheet.png-5e9f32a8f565203dc1c45345dc90e191.res" +path="res://.godot/imported/grass.png-335b218b9e2737131bc8650c2e58216f.res" [deps] -source_file="res://classes/solid/terrain/tilesets/jungle/jungle_normal_spritesheet.png" -dest_files=["res://.godot/imported/jungle_normal_spritesheet.png-5e9f32a8f565203dc1c45345dc90e191.res"] +source_file="res://terrain_skins/grass/grass.png" +dest_files=["res://.godot/imported/grass.png-335b218b9e2737131bc8650c2e58216f.res"] [params] diff --git a/terrain_skins/grass/grass.tres b/terrain_skins/grass/grass.tres deleted file mode 100644 index f5b71f12a..000000000 --- a/terrain_skins/grass/grass.tres +++ /dev/null @@ -1,20 +0,0 @@ -[gd_resource type="Resource" script_class="TerrainSkin" load_steps=9 format=3 uid="uid://b6lmtx75rts72"] - -[ext_resource type="Texture2D" uid="uid://bbujtjtisgabh" path="res://terrain_skins/grass/grass_body.png" id="1_21lkl"] -[ext_resource type="Script" path="res://terrain_skins/terrain_skin.gd" id="1_juhca"] -[ext_resource type="Texture2D" uid="uid://jdi44e5ytsvo" path="res://terrain_skins/grass/grass_bottom.png" id="2_f6esm"] -[ext_resource type="Texture2D" uid="uid://bnyj6ay56a4g6" path="res://terrain_skins/grass/grass_side.png" id="4_ecf0v"] -[ext_resource type="Texture2D" uid="uid://bv1i70c70fuhl" path="res://terrain_skins/grass/grass_top.png" id="5_nmf3i"] -[ext_resource type="Texture2D" uid="uid://bmhto3rq6npjj" path="res://terrain_skins/grass/grass_endcap.png" id="6_s0nkd"] -[ext_resource type="Texture2D" uid="uid://cb7qjvsiyrsyk" path="res://terrain_skins/grass/grass_endcap_shadow.png" id="7_b2wus"] -[ext_resource type="Texture2D" uid="uid://dlywt426oyykc" path="res://terrain_skins/grass/grass_top_shadow.png" id="8_8w8xv"] - -[resource] -script = ExtResource("1_juhca") -body = ExtResource("1_21lkl") -top = ExtResource("5_nmf3i") -top_clip = ExtResource("8_8w8xv") -top_endcap = ExtResource("6_s0nkd") -top_endcap_clip = ExtResource("7_b2wus") -side = ExtResource("4_ecf0v") -bottom = ExtResource("2_f6esm") diff --git a/terrain_skins/grass/grass_body.png b/terrain_skins/grass/grass_body.png deleted file mode 100644 index 3f99b95bb699927e8e909c46c4e673ea123b4fd6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 550 zcmV+>0@?kEP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00E9kL_t(o!^M{|Zi6rshW{cY z4@s>?89n2-~0Xk?>TVy z{_^~d1tY@35$_LbcxcKV08m#vNU=1N0DvUFoI5supcj%{p(%TBLefm0b4PRwl01Uh zovE=uDC@+d8JHu2vNxtC8e_?&fk@hirckf!Xdq9g`{kPrfRe0rEw-0biq2L4MhcW*>Zr2V6|oGP3= zhT4)_pt=AHau1lGdKp7~BJ*}TetrZQ!|i5g-I`Y&&rkRA< zovBe2+&b~-DVQUIvNxh8(*99fP8Cj`f;5u@8!k|7z+|{FG(ojPPO@q7zvJcK2h3Ni z)w%-!-19C-v6Ex~fL1X#1A3uV46AkLO~^?yt0>8WRxvLhCUwPc7AG+H>@sKVulIsGl#t{r~^~07*qoM6N<$f@bvG_5c6? diff --git a/terrain_skins/grass/grass_body.png.import b/terrain_skins/grass/grass_body.png.import deleted file mode 100644 index 8cfe7ceaa..000000000 --- a/terrain_skins/grass/grass_body.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bbujtjtisgabh" -path="res://.godot/imported/grass_body.png-a41e5367d9478931c0f5c515d0e789a8.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://terrain_skins/grass/grass_body.png" -dest_files=["res://.godot/imported/grass_body.png-a41e5367d9478931c0f5c515d0e789a8.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/terrain_skins/grass/grass_bottom.png b/terrain_skins/grass/grass_bottom.png deleted file mode 100644 index b970c5b4b5625c55b060f5d0b0424ad52b763e77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7X}9gdxn!a_SXGC5zYdS z$YKTtZeb8+WSBKa0w~B{;_2(k{(@DSjaw>N!C(EZzkxv|`NZHfHF(l&f+Y60A4hQpw;}iV;MX_FL+rYx`W8JdNQVb8a ZGSBp245*o3v<|3(!PC{xWt~$(69Cz?F+~6X diff --git a/terrain_skins/grass/grass_endcap.png b/terrain_skins/grass/grass_endcap.png deleted file mode 100644 index 11874545b86ebf99559ef154cd3c11679d65f0e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7X}9gdxn!a_SXGC5zYdS z$YKTtZeb8+WSBKa0w~B{;_2(k{(@DSjay^&_e3S2kYtH#M2T~LZfQKP4eV@Sl|zopr09hbeSO5S3 diff --git a/terrain_skins/grass/grass_endcap.png.import b/terrain_skins/grass/grass_endcap.png.import deleted file mode 100644 index 67c7bf4f6..000000000 --- a/terrain_skins/grass/grass_endcap.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bmhto3rq6npjj" -path="res://.godot/imported/grass_endcap.png-c32a134dbb31342162e6c6b2135c8be9.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://terrain_skins/grass/grass_endcap.png" -dest_files=["res://.godot/imported/grass_endcap.png-c32a134dbb31342162e6c6b2135c8be9.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/terrain_skins/grass/grass_endcap_shadow.png b/terrain_skins/grass/grass_endcap_shadow.png deleted file mode 100644 index 991ba589d4d980a4d1558b9519b5013eaeeea0c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7X}9gdxn!a_SXGC5zYdS z$YKTtZeb8+WSBKa0w~B{;_2(k{(@DSjfdePbG$rINV3E=qQp5rH#aq}gu%HeHL)Z$ zMWH;iBtya7(>EZzkxv|`$i~yfF(l&f+e;gH84Ng>9i7kS^h~b|c0I-B_Gta$>PQcu zngeFBR{!U|TQFxslj;N4mg>eCpL(j56UrHgTe~DWM4fR`EMi diff --git a/terrain_skins/grass/grass_endcap_shadow.png.import b/terrain_skins/grass/grass_endcap_shadow.png.import deleted file mode 100644 index dec72509e..000000000 --- a/terrain_skins/grass/grass_endcap_shadow.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cb7qjvsiyrsyk" -path="res://.godot/imported/grass_endcap_shadow.png-31f2fb5e29c79464ee35b726eec50064.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://terrain_skins/grass/grass_endcap_shadow.png" -dest_files=["res://.godot/imported/grass_endcap_shadow.png-31f2fb5e29c79464ee35b726eec50064.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/terrain_skins/grass/grass_side.png b/terrain_skins/grass/grass_side.png deleted file mode 100644 index 5623e482f0b0fbca75a2f7d9e1db67516255a629..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 270 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7X}9gdxn!a_SXGC5zYdS z$YKTtZeb8+WSBKa0w~B{;_2(k{(@DSjhn4pG3PB%NV3E=qQp5rH#aq}gu%HeHL)Z$ zMWH;iBtya7(>EZzkxv|`sLa#FF(l$}a)Jcw;slYNra%KOw}TAKZW4#j9{Xg^%*=dv z`|IPK*Ul`>Jh|cZi9)xcFNePv-QqC*<33H`*VzZoYnbnCG|F)lR}QoH(O)bt-~8Rd zjgi~zpznN%Z9VK*Y=Z#^FfepmN&h{-_2d%J1q`09elF{r5}E)H CBveWO diff --git a/terrain_skins/grass/grass_side.png.import b/terrain_skins/grass/grass_side.png.import deleted file mode 100644 index db6937fc9..000000000 --- a/terrain_skins/grass/grass_side.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bnyj6ay56a4g6" -path="res://.godot/imported/grass_side.png-cac4f2f07444cf50d14e6705f51e2687.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://terrain_skins/grass/grass_side.png" -dest_files=["res://.godot/imported/grass_side.png-cac4f2f07444cf50d14e6705f51e2687.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/terrain_skins/grass/grass_top.png b/terrain_skins/grass/grass_top.png deleted file mode 100644 index 2825ca695d256b5e42e3f4cef26f70a4c28a3582..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 524 zcmV+n0`vWeP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00DGKL_t(o!|j!=PQy?f#ZMay zj*OX^CDheF~Tkr3j|3|YGFfuYS`tP#nhx22U{NZZ*d(KM4sys4&wS{HT!=uL;hP`!l z82bc=A9*d5vR@Z{3?|bWpA`-^Q6Tj2Jj+^FFSBykTjTQNw9#RhCiuL0ufCr>kA>Vm zo-j=i`vlhQ>$uc~&KEvLo~td+dmipRCG$kSVZD*NQZ)^LPKCR8!Zd-c0%!;grPnSV z9c#CNvcf@_CY?5s6;7*04p^W|0omHwJXzB$Z_5HjYiI9?CZqT0^z0U7o3K^WhiOuU z#6GDWMVr+Fz$OYXU-;@@fqUIAN1m$QG}<9V@Sl|w-+}GHW=_Y2d+M!!*j@iXVOh0hFU$oZI)X9 zUaP)7mj+bHz|@y^JzO%?>(_?OMK#ldQ+I~{m=gO`#CArlv&m*z1O2|f6Hh{ZZVvyU c*8P7M Date: Wed, 29 May 2024 00:57:39 -0400 Subject: [PATCH 24/32] Deduplicate tex-slice-creation code This duplication is intolerable. Even with VSCode's multi-cursor feature, it was becoming impractical to add things to, and was already straining the limits of readability. I tried to add something new, and just went "nope." Doing it this way also sets up for a potential future in which terrain skins can have arbitrarily many border textures. Not in this PR though. --- .../tileset_from_image/tileset_from_image.gd | 64 +++++-------------- 1 file changed, 15 insertions(+), 49 deletions(-) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index a8d639d92..c3a118cec 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -127,55 +127,21 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): # Slice each non-zero-sized texture from the spritesheet. # (Can't just use atlas textures, they don't loop like we need.) - if options["body"].size.x > 0 and options["body"].size.y > 0: - var slice = img.get_region(options["body"]) - # If the slice has any visible pixels... - if !slice.is_invisible(): - # ...save it to the resource. - out_res.body = ImageTexture.create_from_image(slice) - # Then name them and give them a path (in an unsuccessful attempt to allow - # TerrainPolygon to reference these rather than storing a copy of the - # texture data in its scene file). - out_res.body.resource_name = "%s_body" % tex_name - out_res.body.resource_path = "%s::body" % out_res.resource_path - # Do the same for every texture. - if options["side"].size.x > 0 and options["side"].size.y > 0: - var slice = img.get_region(options["side"]) - if !slice.is_invisible(): - out_res.side = ImageTexture.create_from_image(slice) - out_res.side.resource_name = "%s_side" % tex_name - out_res.side.resource_path = "%s::side" % out_res.resource_path - if options["bottom"].size.x > 0 and options["bottom"].size.y > 0: - var slice = img.get_region(options["bottom"]) - if !slice.is_invisible(): - out_res.bottom = ImageTexture.create_from_image(slice) - out_res.bottom.resource_name = "%s_bottom" % tex_name - out_res.bottom.resource_path = "%s::bottom" % out_res.resource_path - - if options["top"].size.x > 0 and options["top"].size.y > 0: - var slice = img.get_region(options["top"]) - if !slice.is_invisible(): - out_res.top = ImageTexture.create_from_image(slice) - out_res.top.resource_name = "%s_top" % tex_name - out_res.top.resource_path = "%s::top" % out_res.resource_path - if options["top_endcap"].size.x > 0 and options["top_endcap"].size.y > 0: - var slice = img.get_region(options["top_endcap"]) - if !slice.is_invisible(): - out_res.top_endcap = ImageTexture.create_from_image(slice) - out_res.top_endcap.resource_name = "%s_top_endcap" % tex_name - out_res.top_endcap.resource_path = "%s::top_endcap" % out_res.resource_path - if options["top_clip"].size.x > 0 and options["top_clip"].size.y > 0: - var slice = img.get_region(options["top_clip"]) - if !slice.is_invisible(): - out_res.top_clip = ImageTexture.create_from_image(slice) - out_res.top_clip.resource_name = "%s_top_clip" % tex_name - out_res.top_clip.resource_path = "%s::top_clip" % out_res.resource_path - if options["top_endcap_clip"].size.x > 0 and options["top_endcap_clip"].size.y > 0: - var slice = img.get_region(options["top_endcap_clip"]) - if !slice.is_invisible(): - out_res.top_endcap_clip = ImageTexture.create_from_image(slice) - out_res.top_endcap_clip.resource_name = "%s_top_endcap_clip" % tex_name - out_res.top_endcap_clip.resource_path = "%s::top_endcap_clip" % out_res.resource_path + for tex_type in [ + "body", + "top", "top_clip", + "top_endcap", "top_endcap_clip", + "side", "bottom" + ]: + if options[tex_type].size.x > 0 and options[tex_type].size.y > 0: + var slice = img.get_region(options[tex_type]) + # If the slice has any visible pixels... + if !slice.is_invisible(): + # ...save it to the resource. + out_res.set(tex_type, ImageTexture.create_from_image(slice)) + # Then name it. + out_res.get(tex_type).resource_name = "%s_%s" % \ + [tex_name, tex_type] # If we want to save the sliced textures separately, use ResourceSaver, # then push their paths to r_gen_files. From b292c9a295d081aede9b96bf50294460e27062f3 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 02:05:46 -0400 Subject: [PATCH 25/32] Formally update project to Godot 4.2 This shouldn't be a breaking change, but it's still helpful to do these things as Formal Changes so everyone sees that This Is What We're Doing now. --- project.godot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.godot b/project.godot index 61bfe7e88..976bde06c 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="Super Mario 63 Redux" run/main_scene="res://scenes/menus/title/title.tscn" -config/features=PackedStringArray("4.1") +config/features=PackedStringArray("4.2") boot_splash/image="res://splash.png" boot_splash/use_filter=false config/icon="res://icon.png" From 2e45d3f28993aaecf7bc03d3720a6087205a5dd2 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 03:15:05 -0400 Subject: [PATCH 26/32] Add option to store terrain textures separate Technically, this is the last key ingredient needed for the importer to be capable of everything either system could do. I'd like to add a system to detect when a texture has changed separate from the importer, to avoid overwriting people's work, but the system is technically usable at this point. --- .../tileset_from_image/tileset_from_image.gd | 85 ++++++++++++++++--- 1 file changed, 75 insertions(+), 10 deletions(-) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index c3a118cec..1da8d4f0c 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -26,10 +26,14 @@ func _get_import_options(path, preset_index): match preset_index: Presets.FORMAT_V1: return [ + { + "name": "external_textures", + "default_value": false + }, { "name": "Texture Rects", "default_value": null, - "usage": PROPERTY_USAGE_GROUP | PROPERTY_USAGE_INTERNAL, + "usage": PROPERTY_USAGE_GROUP, }, { "name": "body", @@ -122,9 +126,33 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): var out_res := TerrainSkin.new() out_res.resource_path = "%s.%s" % [save_path, _get_save_extension()] + + var in_extension = source_file.get_extension() var tex_name = source_file.get_file() - out_res.resource_name = tex_name + # Remove the extension from the end of name. + tex_name = tex_name.erase( + tex_name.length() - (in_extension.length() + 1), + in_extension.length() + 1 + ) + out_res.resource_name = tex_name + + # Needed when "External Textures" is checked. + var tex_folder: String + var editor_fs: EditorFileSystem + if options["external_textures"]: + # Create a folder to store the separated texture resources. + tex_folder = "%s/%s" % [source_file.get_base_dir(), tex_name] + DirAccess.make_dir_absolute(tex_folder) + + # Get access to the editor filesystem--need this to make the editor + # acknowledge newly created files. + editor_fs = EditorInterface.get_resource_filesystem() + + # Make the editor acknowledge the textures directory. + editor_fs.update_file(tex_folder) + + # Slice each non-zero-sized texture from the spritesheet. # (Can't just use atlas textures, they don't loop like we need.) for tex_type in [ @@ -137,14 +165,51 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): var slice = img.get_region(options[tex_type]) # If the slice has any visible pixels... if !slice.is_invisible(): - # ...save it to the resource. - out_res.set(tex_type, ImageTexture.create_from_image(slice)) - # Then name it. - out_res.get(tex_type).resource_name = "%s_%s" % \ - [tex_name, tex_type] - - # If we want to save the sliced textures separately, use ResourceSaver, - # then push their paths to r_gen_files. + # ...create a texture from it. + var tex = ImageTexture.create_from_image(slice) + #tex.set_meta(&"_source_image", out_res. + + # Name the texture resource. + tex.resource_name = "%s_%s" % [tex_name, tex_type] + + # If we want separate texture files, save those. + if options["external_textures"]: + var tex_path = "%s/%s.png" % \ + [tex_folder, tex_type] + + # Save this texture into that folder. + var ext_file = FileAccess.open(tex_path, FileAccess.WRITE) + if ext_file == null: + push_error("Failed to write to %s: %s" % [ + tex_path, + error_string(FileAccess.get_open_error()), + ]) + ext_file.store_buffer(slice.save_png_to_buffer()) + ext_file.close() + + # Make the editor acknowledge this file. + editor_fs.update_file(tex_path) + + # Try importing the sliced texture. + var imp_result = append_import_external_resource( + tex_path, + ) + # If import failed, report and leave the texture blank. + if imp_result != OK: + push_error("%s's %s texture failed to import: %s" % [ + tex_name, tex_type.capitalize(), + error_string(imp_result) + ]) + continue + + # Register this as one of the generated files. + r_gen_files.push_back(tex_path) + + # Replace the source texture with the one on disk. + tex = ResourceLoader.load(tex_path, "Texture2D") + + # Separate or embedded, save it to the resource. + out_res.set(tex_type, tex) # If there's different variants of this resource for different platforms, # push the feature tag to r_platform_variants, then insert the tag between From 686a99c8e438810cefa04c6ed9a5f0f54cfab460 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 05:01:31 -0400 Subject: [PATCH 27/32] Don't overwrite externally modified textures This is meant to be a safety feature. If the textures are external, it's probably so you can modify them by hand; consequently, it'd be real stupid if the system could overwrite your changes "on a whim" and leave you with all your work gone. --- .../tileset_from_image/tileset_from_image.gd | 88 ++++++++++++------- 1 file changed, 56 insertions(+), 32 deletions(-) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index 1da8d4f0c..d61426f7b 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -124,9 +124,10 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): if parse_result != OK: return parse_result + # Create output file. var out_res := TerrainSkin.new() - out_res.resource_path = "%s.%s" % [save_path, _get_save_extension()] + # Get the raw source filename. var in_extension = source_file.get_extension() var tex_name = source_file.get_file() # Remove the extension from the end of name. @@ -136,6 +137,7 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): ) out_res.resource_name = tex_name + out_res.resource_path = "%s.%s" % [save_path, _get_save_extension()] # Needed when "External Textures" is checked. var tex_folder: String @@ -167,7 +169,6 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): if !slice.is_invisible(): # ...create a texture from it. var tex = ImageTexture.create_from_image(slice) - #tex.set_meta(&"_source_image", out_res. # Name the texture resource. tex.resource_name = "%s_%s" % [tex_name, tex_type] @@ -177,36 +178,59 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): var tex_path = "%s/%s.png" % \ [tex_folder, tex_type] - # Save this texture into that folder. - var ext_file = FileAccess.open(tex_path, FileAccess.WRITE) - if ext_file == null: - push_error("Failed to write to %s: %s" % [ - tex_path, - error_string(FileAccess.get_open_error()), - ]) - ext_file.store_buffer(slice.save_png_to_buffer()) - ext_file.close() - - # Make the editor acknowledge this file. - editor_fs.update_file(tex_path) - - # Try importing the sliced texture. - var imp_result = append_import_external_resource( - tex_path, - ) - # If import failed, report and leave the texture blank. - if imp_result != OK: - push_error("%s's %s texture failed to import: %s" % [ - tex_name, tex_type.capitalize(), - error_string(imp_result) - ]) - continue - - # Register this as one of the generated files. - r_gen_files.push_back(tex_path) - - # Replace the source texture with the one on disk. - tex = ResourceLoader.load(tex_path, "Texture2D") + # If the file's been modified outside the importer, + # do not save over it. + var overwrite_safe := true + if ResourceLoader.exists(tex_path): + var existing = ResourceLoader.load(tex_path) + + # Check when the imported resource was last modified. + # If it exists. Otherwise it's 0. + var last_imp_time = 0 + if FileAccess.file_exists(out_res.resource_path): + last_imp_time = FileAccess.get_modified_time(out_res.resource_path) + + # Check the texture's current modify time. + var modified_time = FileAccess.get_modified_time(tex_path) + + # If the texture's modify time is unset or mismatches + # the resource file, the texture has been modified + # externally and is not safe to replace. + if modified_time == 0 or modified_time != last_imp_time: + overwrite_safe = false + push_warning( + "%s's %s texture appears to have been externally modified. Skipping over it." + % [ + tex_name, tex_type.capitalize() + ] + ) + + # If it's safe to overwrite, save this texture into that folder. + if overwrite_safe: + # Write the texture. + var save_result = ResourceSaver.save(tex, tex_path) + if save_result != OK: + push_error("Failed to write to %s: %s" % [ + tex_path, + error_string(save_result), + ]) + continue + + # Tell the editor this file exists. + editor_fs.update_file(tex_path) + + # Try importing the sliced texture. + var imp_result = append_import_external_resource(tex_path) + # If import failed, report and leave the texture blank. + if imp_result != OK: + push_error("%s's %s texture failed to import: %s" % [ + tex_name, tex_type.capitalize(), + error_string(imp_result) + ]) + continue + + # Register this as one of the generated files. + r_gen_files.push_back(tex_path) # Separate or embedded, save it to the resource. out_res.set(tex_type, tex) From 63a116143bfd2f23e0166147497bc3dda69bb88a Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 05:03:31 -0400 Subject: [PATCH 28/32] Use output resource's pre-set path in save I was setting that path specifically so I could do this :P (and now I've built change detection around it, so I'd better not leave room for mistakes to creep in.) --- addons/tileset_from_image/tileset_from_image.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index d61426f7b..3dd2dbfe3 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -239,4 +239,4 @@ func _import(source_file, save_path, options, r_platform_variants, r_gen_files): # push the feature tag to r_platform_variants, then insert the tag between # save_path and _get_save_extension() (. separated) when saving the files. - return ResourceSaver.save(out_res, "%s.%s" % [save_path, _get_save_extension()]) + return ResourceSaver.save(out_res) From 80d47a17ae367724c11a21aed04c35c32b9802c7 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 05:05:08 -0400 Subject: [PATCH 29/32] Save grass skin's external-textures preference Version control noise waiting to happen, here. Let's just head that possibility.... --- terrain_skins/grass/grass.png.import | 1 + 1 file changed, 1 insertion(+) diff --git a/terrain_skins/grass/grass.png.import b/terrain_skins/grass/grass.png.import index b0391e611..9767162c4 100644 --- a/terrain_skins/grass/grass.png.import +++ b/terrain_skins/grass/grass.png.import @@ -12,6 +12,7 @@ dest_files=["res://.godot/imported/grass.png-335b218b9e2737131bc8650c2e58216f.re [params] +external_textures=false Texture Rects=null body=Rect2(36, 3, 32, 32) side=Rect2(3, 3, 32, 32) From 34f7aaad2179a36d4dfc2e7c840252f768fcdbda Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 07:09:41 -0400 Subject: [PATCH 30/32] Hide top clip texture when it's empty There we go. Just the top border showing when it shouldn't clearly suggests something silly like this (forgetting to add a condition to part of the code). --- classes/solid/terrain/terrain_border.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/solid/terrain/terrain_border.gd b/classes/solid/terrain/terrain_border.gd index 2e13ab393..d44879fd8 100644 --- a/classes/solid/terrain/terrain_border.gd +++ b/classes/solid/terrain/terrain_border.gd @@ -178,7 +178,7 @@ func generate_polygons_top(lines, z_order = 2): # Make a duplicate polygon to hold the clip texture, if any. # This texture is meant to get clipped to within the polygon's body. # TODO: Is it doing that though? - if !root.tint: + if !root.tint and root.top_clip != null: var shade = poly2d.duplicate() shade.texture = root.top_clip add_child(shade) From 772ea2c76c3e55d72c303530e5e90a209184a47a Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Wed, 29 May 2024 23:26:21 -0400 Subject: [PATCH 31/32] Reorder terrain skin rect imports Move side and bottom below the top textures, because that just feels more intuitive. --- .../tileset_from_image/tileset_from_image.gd | 18 +++++++++--------- terrain_skins/grass/grass.png.import | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/tileset_from_image/tileset_from_image.gd b/addons/tileset_from_image/tileset_from_image.gd index 3dd2dbfe3..e01e5a6dd 100644 --- a/addons/tileset_from_image/tileset_from_image.gd +++ b/addons/tileset_from_image/tileset_from_image.gd @@ -39,15 +39,6 @@ func _get_import_options(path, preset_index): "name": "body", "default_value": Rect2(36, 3, 32, 32) }, - { - "name": "side", - "default_value": Rect2(3, 3, 32, 32) - }, - { - "name": "bottom", - "default_value": Rect2(36, 36, 32, 32) - }, - { "name": "top", "default_value": Rect2(105, 3, 32, 32) @@ -64,6 +55,15 @@ func _get_import_options(path, preset_index): "name": "top_endcap_clip", "default_value": Rect2(72, 36, 32, 32) }, + { + "name": "side", + "default_value": Rect2(3, 3, 32, 32) + }, + { + "name": "bottom", + "default_value": Rect2(36, 36, 32, 32) + }, + ] _: # return [] diff --git a/terrain_skins/grass/grass.png.import b/terrain_skins/grass/grass.png.import index 9767162c4..5b8138a25 100644 --- a/terrain_skins/grass/grass.png.import +++ b/terrain_skins/grass/grass.png.import @@ -15,9 +15,9 @@ dest_files=["res://.godot/imported/grass.png-335b218b9e2737131bc8650c2e58216f.re external_textures=false Texture Rects=null body=Rect2(36, 3, 32, 32) -side=Rect2(3, 3, 32, 32) -bottom=Rect2(36, 36, 32, 32) top=Rect2(105, 3, 32, 32) top_endcap=Rect2(72, 3, 32, 32) top_clip=Rect2(105, 36, 32, 32) top_endcap_clip=Rect2(72, 36, 32, 32) +side=Rect2(3, 3, 32, 32) +bottom=Rect2(36, 36, 32, 32) From 8f171a66a51593c671a086d13d038afe4c8cbe69 Mon Sep 17 00:00:00 2001 From: Koopa1018 Date: Sun, 2 Jun 2024 17:02:19 -0400 Subject: [PATCH 32/32] Reattach grass texture I...thought I already commited this? --- classes/solid/terrain/terrain_polygon.tscn | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/solid/terrain/terrain_polygon.tscn b/classes/solid/terrain/terrain_polygon.tscn index 4d48ca8fb..2099471c8 100644 --- a/classes/solid/terrain/terrain_polygon.tscn +++ b/classes/solid/terrain/terrain_polygon.tscn @@ -9,7 +9,7 @@ resource_name = "TerrainMaterial" light_mode = 1 -[sub_resource type="Image" id="Image_hah7x"] +[sub_resource type="Image" id="Image_etd47"] data = { "data": PackedByteArray(205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 252, 186, 85, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 186, 116, 69, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 216, 145, 90, 255, 216, 145, 90, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 229, 159, 83, 255, 216, 145, 90, 255, 216, 145, 90, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255, 205, 133, 97, 255), "format": "RGBA8", @@ -18,9 +18,9 @@ data = { "width": 32 } -[sub_resource type="ImageTexture" id="ImageTexture_eq5xp"] -resource_name = "grass.png_body" -image = SubResource("Image_hah7x") +[sub_resource type="ImageTexture" id="ImageTexture_x1753"] +resource_name = "grass_body" +image = SubResource("Image_etd47") [node name="TerrainPolygon" type="Polygon2D"] texture_repeat = 2 @@ -32,7 +32,7 @@ tint_color = Color(1, 1, 1, 0.501961) [node name="Body" type="Polygon2D" parent="."] texture_repeat = 2 use_parent_material = true -texture = SubResource("ImageTexture_eq5xp") +texture = SubResource("ImageTexture_x1753") [node name="Borders" type="Node2D" parent="."] use_parent_material = true