full remade of tile structure

This commit is contained in:
leca 2024-06-03 22:25:56 +03:00
parent f35508958f
commit 952d1c0fdf
37 changed files with 417 additions and 80 deletions

View File

@ -1,5 +1,7 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://bltqm36w3bbsq"] [gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bltqm36w3bbsq"]
[ext_resource type="Texture2D" uid="uid://bkbekh1kval7e" path="res://models/textures/tile-empty.png" id="1_iwmoe"]
[resource] [resource]
transparency = 1 transparency = 1
albedo_color = Color(0.203922, 0.458824, 0.113725, 0.337255) albedo_texture = ExtResource("1_iwmoe")

View File

@ -1,4 +1,9 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://xxyp1mwtshbe"] [gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://xxyp1mwtshbe"]
[ext_resource type="Texture2D" uid="uid://d1tyjae355uni" path="res://models/textures/tile-plain.png" id="1_nijc4"]
[resource] [resource]
albedo_color = Color(0.203922, 0.458824, 0.113725, 1) resource_name = "Material"
cull_mode = 2
albedo_texture = ExtResource("1_nijc4")
roughness = 0.5

View File

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 102 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://twfvba5yg8sd"
path="res://.godot/imported/Tree texture.png-c3667e1931972e81a1b96662c37fb42a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://models/blend/textures/Tree texture.png"
dest_files=["res://.godot/imported/Tree texture.png-c3667e1931972e81a1b96662c37fb42a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

View File

@ -2,16 +2,16 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://cs0pf7ogpaqm0" uid="uid://b5ocbi3spyll3"
path="res://.godot/imported/Tree texture.png-f926170428cfb15d629cee223218cb1e.ctex" path="res://.godot/imported/Untitled.png-a372666e74d4b8f44f5980380f664280.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://models/textures/Tree texture.png" source_file="res://models/blend/textures/Untitled.png"
dest_files=["res://.godot/imported/Tree texture.png-f926170428cfb15d629cee223218cb1e.ctex"] dest_files=["res://.godot/imported/Untitled.png-a372666e74d4b8f44f5980380f664280.ctex"]
[params] [params]

Binary file not shown.

View File

@ -0,0 +1,50 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://ca36vyutl0wps"
path="res://.godot/imported/tile-empty.blend-3cf0459a6d557538c1f986fe8d5b6396.scn"
[deps]
source_file="res://models/blend/tile-empty.blend"
dest_files=["res://.godot/imported/tile-empty.blend-3cf0459a6d557538c1f986fe8d5b6396.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
blender/nodes/visible=0
blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/colors=false
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/tangents=true
blender/meshes/skins=2
blender/meshes/export_bones_deforming_mesh_only=false
blender/materials/unpack_enabled=true
blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true

Binary file not shown.

View File

@ -0,0 +1,50 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://7tbhao6mmwx8"
path="res://.godot/imported/tile-plain.blend-edb1362025b943d0bd18b1a9186b3d11.scn"
[deps]
source_file="res://models/blend/tile-plain.blend"
dest_files=["res://.godot/imported/tile-plain.blend-edb1362025b943d0bd18b1a9186b3d11.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
blender/nodes/visible=0
blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/colors=false
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/tangents=true
blender/meshes/skins=2
blender/meshes/export_bones_deforming_mesh_only=false
blender/materials/unpack_enabled=true
blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true

View File

@ -3,13 +3,13 @@
importer="scene" importer="scene"
importer_version=1 importer_version=1
type="PackedScene" type="PackedScene"
uid="uid://iex6w53r12mp" uid="uid://bgpqrgj7jnith"
path="res://.godot/imported/tree1.blend-cc08633ad44091cf543995f60bfe014d.scn" path="res://.godot/imported/tree1.blend-9e4f6503a48819efbedc157c446c1b6f.scn"
[deps] [deps]
source_file="res://models/tree1.blend" source_file="res://models/blend/tree1.blend"
dest_files=["res://.godot/imported/tree1.blend-cc08633ad44091cf543995f60bfe014d.scn"] dest_files=["res://.godot/imported/tree1.blend-9e4f6503a48819efbedc157c446c1b6f.scn"]
[params] [params]

BIN
models/glb/tile-empty.glb Normal file

Binary file not shown.

View File

@ -3,13 +3,13 @@
importer="scene" importer="scene"
importer_version=1 importer_version=1
type="PackedScene" type="PackedScene"
uid="uid://bmtdabffpea0c" uid="uid://bdlrjhyhvrlxr"
path="res://.godot/imported/tree1.glb-11071132bbffea34242c0708ce7d8c96.scn" path="res://.godot/imported/tile-empty.glb-c2760d2f332634ea43e90218a07c9101.scn"
[deps] [deps]
source_file="res://models/tree1.glb" source_file="res://models/glb/tile-empty.glb"
dest_files=["res://.godot/imported/tree1.glb-11071132bbffea34242c0708ce7d8c96.scn"] dest_files=["res://.godot/imported/tile-empty.glb-c2760d2f332634ea43e90218a07c9101.scn"]
[params] [params]

BIN
models/glb/tile-plain.glb Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://ddbki54t6pq20"
path="res://.godot/imported/tile-plain.glb-8c9198825dceab8eda1b41ed77bac29a.scn"
[deps]
source_file="res://models/glb/tile-plain.glb"
dest_files=["res://.godot/imported/tile-plain.glb-8c9198825dceab8eda1b41ed77bac29a.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://fyqxthvhsyw"
path.s3tc="res://.godot/imported/Untitled.png-750ea743fe60ddae2591ac3e82bcfc05.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://models/textures/Untitled.png"
dest_files=["res://.godot/imported/Untitled.png-750ea743fe60ddae2591ac3e82bcfc05.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 KiB

View File

@ -2,20 +2,20 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://bmdnagwn484ry" uid="uid://bkbekh1kval7e"
path.s3tc="res://.godot/imported/tree1_Tree texture.png-a307eefd8a9f7394b4f1a33a9ac5ea26.s3tc.ctex" path.s3tc="res://.godot/imported/tile-empty.png-3c5f533ecd8b67644cee26bb6e6d46a1.s3tc.ctex"
metadata={ metadata={
"imported_formats": ["s3tc_bptc"], "imported_formats": ["s3tc_bptc"],
"vram_texture": true "vram_texture": true
} }
generator_parameters={ generator_parameters={
"md5": "608aea78302cc1f1db9655a5e11c59a2" "md5": "932ab463af687ce89053c175a97dc539"
} }
[deps] [deps]
source_file="res://models/tree1_Tree texture.png" source_file="res://models/textures/tile-empty.png"
dest_files=["res://.godot/imported/tree1_Tree texture.png-a307eefd8a9f7394b4f1a33a9ac5ea26.s3tc.ctex"] dest_files=["res://.godot/imported/tile-empty.png-3c5f533ecd8b67644cee26bb6e6d46a1.s3tc.ctex"]
[params] [params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 KiB

View File

@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d1tyjae355uni"
path.s3tc="res://.godot/imported/tile-plain.png-513350c74b1a98ae2fd8a5aeb3f94dff.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "29669f6c6d75b14327d9e4d0fbfc3828"
}
[deps]
source_file="res://models/textures/tile-plain.png"
dest_files=["res://.godot/imported/tile-plain.png-513350c74b1a98ae2fd8a5aeb3f94dff.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

BIN
models/tile-plain.blend Normal file

Binary file not shown.

View File

@ -0,0 +1,50 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://u0raext4vrjh"
path="res://.godot/imported/tile-plain.blend-9c51a5298ebaaac790bb6caa0f19539d.scn"
[deps]
source_file="res://models/tile-plain.blend"
dest_files=["res://.godot/imported/tile-plain.blend-9c51a5298ebaaac790bb6caa0f19539d.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
blender/nodes/visible=0
blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/colors=false
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/tangents=true
blender/meshes/skins=2
blender/meshes/export_bones_deforming_mesh_only=false
blender/materials/unpack_enabled=true
blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

10
scenes/models/test.tres Normal file
View File

@ -0,0 +1,10 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bp5hy4eu6xnbo"]
[ext_resource type="Texture2D" uid="uid://d1tyjae355uni" path="res://models/textures/tile-plain.png" id="1_jxv22"]
[resource]
resource_name = "Material"
transparency = 4
cull_mode = 2
albedo_texture = ExtResource("1_jxv22")
roughness = 0.5

View File

@ -0,0 +1,28 @@
[gd_scene load_steps=6 format=3 uid="uid://dj0odn77jplje"]
[ext_resource type="Script" path="res://scripts/Tile.gd" id="1_07rtm"]
[ext_resource type="Material" uid="uid://bltqm36w3bbsq" path="res://materials/empty_tile.tres" id="2_6ssja"]
[ext_resource type="Texture2D" uid="uid://d1k366i5jjtrk" path="res://textures/plus.svg" id="3_2726l"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_scykg"]
data = PackedVector3Array(-5, 2.5, 5, 5, 2.5, 5, -5, -2.5, 5, 5, 2.5, 5, 5, -2.5, 5, -5, -2.5, 5, 5, 2.5, -5, -5, 2.5, -5, 5, -2.5, -5, -5, 2.5, -5, -5, -2.5, -5, 5, -2.5, -5, 5, 2.5, 5, 5, 2.5, -5, 5, -2.5, 5, 5, 2.5, -5, 5, -2.5, -5, 5, -2.5, 5, -5, 2.5, -5, -5, 2.5, 5, -5, -2.5, -5, -5, 2.5, 5, -5, -2.5, 5, -5, -2.5, -5, 5, 2.5, 5, -5, 2.5, 5, 5, 2.5, -5, -5, 2.5, 5, -5, 2.5, -5, 5, 2.5, -5, -5, -2.5, 5, 5, -2.5, 5, -5, -2.5, -5, 5, -2.5, 5, 5, -2.5, -5, -5, -2.5, -5)
[sub_resource type="BoxMesh" id="BoxMesh_kix7d"]
material = ExtResource("2_6ssja")
size = Vector3(10, 5, 10)
[node name="Tile" type="StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.5, 0)
collision_layer = 3
script = ExtResource("1_07rtm")
[node name="CollisionMesh" type="CollisionShape3D" parent="."]
shape = SubResource("ConcavePolygonShape3D_scykg")
[node name="VisibleMesh" type="MeshInstance3D" parent="CollisionMesh"]
mesh = SubResource("BoxMesh_kix7d")
skeleton = NodePath("../..")
[node name="plus_sprite" type="Sprite3D" parent="CollisionMesh"]
transform = Transform3D(2, 0, 0, 0, -8.74228e-08, -2, 0, 2, -8.74228e-08, 0, 2.501, 0)
texture = ExtResource("3_2726l")

View File

@ -1,28 +1,50 @@
[gd_scene load_steps=6 format=3 uid="uid://dj0odn77jplje"] [gd_scene load_steps=5 format=3 uid="uid://bsacm2eokjlas"]
[ext_resource type="Script" path="res://scripts/Tile.gd" id="1_s01tx"] [ext_resource type="Script" path="res://scripts/Tile.gd" id="1_s01tx"]
[ext_resource type="Material" uid="uid://bltqm36w3bbsq" path="res://materials/empty_tile.tres" id="2_4pyp8"]
[ext_resource type="Texture2D" uid="uid://d1k366i5jjtrk" path="res://textures/plus.svg" id="2_cddgt"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_scykg"] [sub_resource type="ArrayMesh" id="ArrayMesh_waern"]
data = PackedVector3Array(-5, 2.5, 5, 5, 2.5, 5, -5, -2.5, 5, 5, 2.5, 5, 5, -2.5, 5, -5, -2.5, 5, 5, 2.5, -5, -5, 2.5, -5, 5, -2.5, -5, -5, 2.5, -5, -5, -2.5, -5, 5, -2.5, -5, 5, 2.5, 5, 5, 2.5, -5, 5, -2.5, 5, 5, 2.5, -5, 5, -2.5, -5, 5, -2.5, 5, -5, 2.5, -5, -5, 2.5, 5, -5, -2.5, -5, -5, 2.5, 5, -5, -2.5, 5, -5, -2.5, -5, 5, 2.5, 5, -5, 2.5, 5, 5, 2.5, -5, -5, 2.5, 5, -5, 2.5, -5, 5, 2.5, -5, -5, -2.5, 5, 5, -2.5, 5, -5, -2.5, -5, 5, -2.5, 5, 5, -2.5, -5, -5, -2.5, -5) _surfaces = [{
"aabb": AABB(-1, -1, -1, 2.00001, 11, 2),
"format": 34896613377,
"index_count": 114,
"index_data": PackedByteArray(10, 0, 6, 0, 2, 0, 10, 0, 9, 0, 6, 0, 9, 0, 4, 0, 6, 0, 9, 0, 11, 0, 4, 0, 5, 0, 3, 0, 1, 0, 5, 0, 7, 0, 3, 0, 8, 0, 2, 0, 0, 0, 8, 0, 10, 0, 2, 0, 11, 0, 0, 0, 4, 0, 11, 0, 8, 0, 0, 0, 14, 0, 8, 0, 11, 0, 14, 0, 12, 0, 8, 0, 12, 0, 10, 0, 8, 0, 12, 0, 13, 0, 10, 0, 15, 0, 11, 0, 9, 0, 15, 0, 14, 0, 11, 0, 13, 0, 9, 0, 10, 0, 13, 0, 15, 0, 9, 0, 3, 0, 15, 0, 13, 0, 3, 0, 7, 0, 15, 0, 7, 0, 14, 0, 15, 0, 7, 0, 5, 0, 14, 0, 1, 0, 13, 0, 12, 0, 1, 0, 3, 0, 13, 0, 5, 0, 12, 0, 14, 0, 5, 0, 1, 0, 12, 0, 0, 0, 18, 0, 19, 0, 0, 0, 2, 0, 18, 0, 2, 0, 20, 0, 18, 0, 2, 0, 6, 0, 20, 0, 6, 0, 17, 0, 20, 0, 6, 0, 4, 0, 17, 0, 16, 0, 17, 0, 19, 0, 17, 0, 0, 0, 19, 0, 17, 0, 4, 0, 0, 0, 20, 0, 16, 0, 18, 0, 17, 0, 16, 0, 20, 0, 18, 0, 16, 0, 19, 0),
"lods": [0.000534981, PackedByteArray(13, 0, 6, 0, 2, 0, 13, 0, 15, 0, 6, 0, 3, 0, 15, 0, 13, 0, 3, 0, 7, 0, 15, 0, 15, 0, 4, 0, 6, 0, 15, 0, 14, 0, 4, 0, 7, 0, 14, 0, 15, 0, 7, 0, 5, 0, 14, 0, 5, 0, 3, 0, 1, 0, 5, 0, 7, 0, 3, 0, 12, 0, 2, 0, 0, 0, 12, 0, 13, 0, 2, 0, 1, 0, 13, 0, 12, 0, 1, 0, 3, 0, 13, 0, 14, 0, 0, 0, 4, 0, 14, 0, 12, 0, 0, 0, 5, 0, 12, 0, 14, 0, 5, 0, 1, 0, 12, 0, 2, 0, 6, 0, 0, 0, 6, 0, 4, 0, 0, 0)],
"name": "Material",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 21,
"vertex_data": PackedByteArray(254, 255, 254, 255, 0, 0, 0, 0, 254, 255, 0, 0, 0, 0, 0, 0, 254, 255, 254, 255, 255, 255, 0, 0, 254, 255, 0, 0, 255, 255, 0, 0, 0, 0, 254, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254, 255, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 254, 255, 0, 230, 0, 0, 0, 0, 0, 0, 0, 230, 255, 255, 0, 0, 254, 255, 0, 230, 255, 255, 0, 0, 0, 0, 0, 230, 0, 0, 0, 0, 254, 255, 104, 145, 0, 0, 0, 0, 254, 255, 104, 145, 255, 255, 0, 0, 0, 0, 104, 145, 0, 0, 0, 0, 0, 0, 104, 145, 255, 255, 0, 0, 255, 127, 254, 255, 255, 127, 0, 0, 255, 63, 254, 255, 255, 63, 0, 0, 255, 191, 254, 255, 255, 191, 0, 0, 255, 191, 254, 255, 255, 63, 0, 0, 255, 63, 254, 255, 255, 191, 0, 0)
}]
blend_shape_mode = 0
[sub_resource type="BoxMesh" id="BoxMesh_kix7d"] [sub_resource type="ArrayMesh" id="ArrayMesh_8ky3l"]
material = ExtResource("2_4pyp8") resource_name = "tile-empty_Cube"
size = Vector3(10, 5, 10) _surfaces = [{
"aabb": AABB(-1, -1, -1, 2.00001, 11, 2),
"attribute_data": PackedByteArray(12, 200, 63, 251, 63, 251, 139, 209, 37, 107, 63, 251, 12, 200, 221, 21, 139, 209, 88, 158, 37, 107, 221, 21, 191, 4, 63, 251, 63, 251, 63, 251, 217, 148, 63, 251, 191, 4, 221, 21, 139, 209, 12, 200, 217, 148, 221, 21, 88, 158, 63, 251, 139, 209, 139, 209, 166, 97, 63, 251, 88, 158, 221, 21, 63, 251, 88, 158, 166, 97, 221, 21, 115, 46, 63, 251, 139, 209, 63, 251, 242, 55, 63, 251, 115, 46, 221, 21, 63, 251, 12, 200, 242, 55, 221, 21, 12, 200, 245, 227, 37, 107, 245, 227, 115, 46, 245, 227, 242, 55, 245, 227, 191, 4, 245, 227, 217, 148, 245, 227, 88, 158, 245, 227, 166, 97, 245, 227, 12, 200, 40, 152, 37, 107, 40, 152, 191, 4, 40, 152, 217, 148, 40, 152, 88, 158, 40, 152, 166, 97, 40, 152, 115, 46, 40, 152, 242, 55, 40, 152, 101, 230, 101, 230, 248, 219, 248, 219, 210, 240, 210, 240, 210, 240, 248, 219, 248, 219, 210, 240),
"format": 34896613399,
"index_count": 114,
"index_data": PackedByteArray(28, 0, 18, 0, 6, 0, 28, 0, 26, 0, 18, 0, 27, 0, 14, 0, 20, 0, 27, 0, 31, 0, 14, 0, 16, 0, 10, 0, 4, 0, 16, 0, 22, 0, 10, 0, 25, 0, 8, 0, 2, 0, 25, 0, 29, 0, 8, 0, 30, 0, 0, 0, 12, 0, 30, 0, 24, 0, 0, 0, 36, 0, 24, 0, 30, 0, 36, 0, 32, 0, 24, 0, 33, 0, 29, 0, 25, 0, 33, 0, 35, 0, 29, 0, 39, 0, 31, 0, 27, 0, 39, 0, 37, 0, 31, 0, 34, 0, 26, 0, 28, 0, 34, 0, 38, 0, 26, 0, 9, 0, 38, 0, 34, 0, 9, 0, 21, 0, 38, 0, 23, 0, 37, 0, 39, 0, 23, 0, 17, 0, 37, 0, 5, 0, 35, 0, 33, 0, 5, 0, 11, 0, 35, 0, 15, 0, 32, 0, 36, 0, 15, 0, 3, 0, 32, 0, 1, 0, 42, 0, 43, 0, 1, 0, 7, 0, 42, 0, 7, 0, 44, 0, 42, 0, 7, 0, 19, 0, 44, 0, 19, 0, 41, 0, 44, 0, 19, 0, 13, 0, 41, 0, 40, 0, 41, 0, 43, 0, 41, 0, 1, 0, 43, 0, 41, 0, 13, 0, 1, 0, 44, 0, 40, 0, 42, 0, 41, 0, 40, 0, 44, 0, 42, 0, 40, 0, 43, 0),
"lods": [0.000534981, PackedByteArray(34, 0, 18, 0, 6, 0, 34, 0, 38, 0, 18, 0, 9, 0, 38, 0, 34, 0, 9, 0, 21, 0, 38, 0, 39, 0, 14, 0, 20, 0, 39, 0, 37, 0, 14, 0, 23, 0, 37, 0, 39, 0, 23, 0, 17, 0, 37, 0, 16, 0, 10, 0, 4, 0, 16, 0, 22, 0, 10, 0, 33, 0, 8, 0, 2, 0, 33, 0, 35, 0, 8, 0, 5, 0, 35, 0, 33, 0, 5, 0, 11, 0, 35, 0, 36, 0, 0, 0, 12, 0, 36, 0, 32, 0, 0, 0, 15, 0, 32, 0, 36, 0, 15, 0, 3, 0, 32, 0, 7, 0, 19, 0, 1, 0, 19, 0, 13, 0, 1, 0)],
"name": "Material",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 45,
"vertex_data": PackedByteArray(254, 255, 254, 255, 0, 0, 255, 255, 254, 255, 254, 255, 0, 0, 255, 191, 254, 255, 254, 255, 0, 0, 255, 255, 254, 255, 0, 0, 0, 0, 255, 255, 254, 255, 0, 0, 0, 0, 255, 255, 254, 255, 0, 0, 0, 0, 255, 255, 254, 255, 254, 255, 255, 255, 255, 255, 254, 255, 254, 255, 255, 255, 255, 191, 254, 255, 254, 255, 255, 255, 255, 255, 254, 255, 0, 0, 255, 255, 255, 255, 254, 255, 0, 0, 255, 255, 255, 255, 254, 255, 0, 0, 255, 255, 255, 255, 0, 0, 254, 255, 0, 0, 255, 255, 0, 0, 254, 255, 0, 0, 255, 191, 0, 0, 254, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 254, 255, 255, 255, 255, 255, 0, 0, 254, 255, 255, 255, 255, 191, 0, 0, 254, 255, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 254, 255, 0, 230, 0, 0, 255, 255, 254, 255, 0, 230, 0, 0, 255, 255, 0, 0, 0, 230, 255, 255, 255, 255, 0, 0, 0, 230, 255, 255, 255, 255, 254, 255, 0, 230, 255, 255, 255, 255, 254, 255, 0, 230, 255, 255, 255, 255, 0, 0, 0, 230, 0, 0, 255, 255, 0, 0, 0, 230, 0, 0, 255, 255, 254, 255, 104, 145, 0, 0, 255, 255, 254, 255, 104, 145, 0, 0, 255, 255, 254, 255, 104, 145, 255, 255, 255, 255, 254, 255, 104, 145, 255, 255, 255, 255, 0, 0, 104, 145, 0, 0, 255, 255, 0, 0, 104, 145, 0, 0, 255, 255, 0, 0, 104, 145, 255, 255, 255, 255, 0, 0, 104, 145, 255, 255, 255, 255, 255, 127, 254, 255, 255, 127, 255, 191, 255, 63, 254, 255, 255, 63, 255, 191, 255, 191, 254, 255, 255, 191, 255, 191, 255, 191, 254, 255, 255, 63, 255, 191, 255, 63, 254, 255, 255, 191, 255, 191, 254, 255, 255, 127, 254, 255, 255, 127, 255, 191, 255, 127, 255, 255, 255, 127, 255, 127, 255, 63, 255, 191, 255, 127, 255, 127, 255, 127, 254, 255, 255, 127, 255, 191, 255, 127, 255, 127, 255, 127, 255, 127, 255, 63, 255, 191, 255, 127, 254, 255, 255, 127, 254, 255, 255, 127, 255, 63, 255, 127, 255, 255, 255, 127, 255, 127, 255, 63, 255, 63, 255, 127, 255, 127, 255, 127, 254, 255, 255, 127, 255, 63, 255, 127, 255, 127, 255, 127, 255, 127, 255, 63, 255, 63, 255, 127, 255, 255, 255, 127, 255, 191, 255, 127, 255, 127, 255, 127, 255, 63, 255, 127, 255, 127, 255, 127, 255, 191, 255, 127, 254, 255, 255, 127, 255, 63, 255, 127, 255, 255, 255, 127, 255, 191, 255, 127, 255, 127, 255, 127, 255, 191, 255, 127, 255, 255, 255, 127, 255, 63, 255, 127, 255, 127, 255, 127, 255, 63, 255, 127, 255, 255, 255, 127, 254, 255, 255, 127, 254, 255, 255, 127, 254, 255, 255, 127, 254, 255, 255, 127)
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_waern")
[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_p1luu"]
points = PackedVector3Array(4.9999, -0.0589142, -5, 4.9999, -0.0589142, -5, 4.9999, -0.0589142, -5, 4.9999, -55.0581, -5, 4.9999, -55.0581, -5, 4.9999, -55.0581, -5, 4.9999, -0.0589142, 5, 4.9999, -0.0589142, 5, 4.9999, -0.0589142, 5, 4.9999, -55.0581, 5, 4.9999, -55.0581, 5, 4.9999, -55.0581, 5, -5, -0.0589142, -5, -5, -0.0589142, -5, -5, -0.0589142, -5, -5, -55.0581, -5, -5, -55.0581, -5, -5, -55.0581, -5, -5, -0.0589142, 5, -5, -0.0589142, 5, -5, -0.0589142, 5, -5, -55.0581, 5, -5, -55.0581, 5, -5, -55.0581, 5, 4.9999, -5.64326, -5, 4.9999, -5.64326, -5, -5, -5.64326, 5, -5, -5.64326, 5, 4.9999, -5.64326, 5, 4.9999, -5.64326, 5, -5, -5.64326, -5, -5, -5.64326, -5, 4.9999, -23.818, -5, 4.9999, -23.818, -5, 4.9999, -23.818, 5, 4.9999, -23.818, 5, -5, -23.818, -5, -5, -23.818, -5, -5, -23.818, 5, -5, -23.818, 5, -5.126e-05, -0.0589142, -7.62939e-05, -2.5001, -0.0589142, -2.50011, 2.5, -0.0589142, 2.49996, 2.5, -0.0589142, -2.50011, -2.5001, -0.0589142, 2.49996)
[node name="Tile" type="StaticBody3D"] [node name="Tile" type="StaticBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.5, 0)
collision_layer = 3
script = ExtResource("1_s01tx") script = ExtResource("1_s01tx")
[node name="VisibleMesh" type="MeshInstance3D" parent="."]
transform = Transform3D(5, 0, 0, 0, 5, 0, 0, 0, 5, 0, -50, 0)
mesh = SubResource("ArrayMesh_8ky3l")
skeleton = NodePath("")
[node name="CollisionMesh" type="CollisionShape3D" parent="."] [node name="CollisionMesh" type="CollisionShape3D" parent="."]
shape = SubResource("ConcavePolygonShape3D_scykg") shape = SubResource("ConvexPolygonShape3D_p1luu")
[node name="VisibleMesh" type="MeshInstance3D" parent="CollisionMesh"]
mesh = SubResource("BoxMesh_kix7d")
skeleton = NodePath("../..")
[node name="plus_sprite" type="Sprite3D" parent="CollisionMesh"]
transform = Transform3D(2, 0, 0, 0, -8.74228e-08, -2, 0, 2, -8.74228e-08, 0, 2.501, 0)
texture = ExtResource("2_cddgt")

View File

@ -1,9 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://diinihb536yya"]
[ext_resource type="PackedScene" uid="uid://bmtdabffpea0c" path="res://models/tree1.glb" id="1_q4afb"]
[node name="Tree1" type="Node3D"]
[node name="tree1" parent="." instance=ExtResource("1_q4afb")]
[editable path="tree1"]

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=6 format=3 uid="uid://ddnlfxwoeywq0"] [gd_scene load_steps=6 format=3 uid="uid://dh52xle0rfx5r"]
[ext_resource type="Script" path="res://scripts/Earth.gd" id="1_u71pd"] [ext_resource type="Script" path="res://scripts/Earth.gd" id="1_u71pd"]
[ext_resource type="PackedScene" uid="uid://b6er1dx11vq1a" path="res://scenes/models/god.tscn" id="2_frpdt"] [ext_resource type="PackedScene" uid="uid://b6er1dx11vq1a" path="res://scenes/models/god.tscn" id="2_pwuqf"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_01wm3"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_01wm3"]
@ -13,13 +13,12 @@ background_mode = 2
sky = SubResource("Sky_oeb53") sky = SubResource("Sky_oeb53")
[node name="World" type="Node3D"] [node name="World" type="Node3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.20056, -2.31495, -0.853709)
[node name="Earth" type="Node3D" parent="."] [node name="Earth" type="Node3D" parent="."]
script = ExtResource("1_u71pd") script = ExtResource("1_u71pd")
[node name="God" parent="." instance=ExtResource("2_frpdt")] [node name="God" parent="." instance=ExtResource("2_pwuqf")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -2.77222, 0.906321, 0) transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -7.55882, 2.65688, 0)
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_4hkk2") environment = SubResource("Environment_4hkk2")

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=6 format=3 uid="uid://dh52xle0rfx5r"] [gd_scene load_steps=6 format=3 uid="uid://ddnlfxwoeywq0"]
[ext_resource type="Script" path="res://scripts/Earth.gd" id="1_u71pd"] [ext_resource type="Script" path="res://scripts/Earth.gd" id="1_u71pd"]
[ext_resource type="PackedScene" uid="uid://b6er1dx11vq1a" path="res://scenes/models/god.tscn" id="2_pwuqf"] [ext_resource type="PackedScene" uid="uid://b6er1dx11vq1a" path="res://scenes/models/god.tscn" id="2_frpdt"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_01wm3"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_01wm3"]
@ -17,8 +17,8 @@ sky = SubResource("Sky_oeb53")
[node name="Earth" type="Node3D" parent="."] [node name="Earth" type="Node3D" parent="."]
script = ExtResource("1_u71pd") script = ExtResource("1_u71pd")
[node name="God" parent="." instance=ExtResource("2_pwuqf")] [node name="God" parent="." instance=ExtResource("2_frpdt")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -7.55882, 2.65688, 0) transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -2.77222, 0.906321, 0)
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_4hkk2") environment = SubResource("Environment_4hkk2")

View File

@ -11,6 +11,7 @@ var tile_exemplar = preload("res://scenes/models/tile.tscn");
func _ready(): func _ready():
var start_tile = tile_exemplar.instantiate() var start_tile = tile_exemplar.instantiate()
start_tile.add_to_group("Persistent") start_tile.add_to_group("Persistent")
start_tile.tile_type = 1
add_child(start_tile); add_child(start_tile);
pass pass

View File

@ -7,17 +7,16 @@ enum TileType {
} }
var tile_materials = [ # must be in the same order as an enum above! var tile_materials = [ # must be in the same order as an enum above!
preload("res://materials/empty_tile.tres"), preload("res://materials/empty_tile.tres"), # Empty
preload("res://materials/plain_tile.tres") preload("res://materials/plain_tile.tres"), # Plain
preload("res://materials/plain_tile.tres") # Forest
] ]
@export var tile_type: TileType = TileType.Empty @export var tile_type: TileType = TileType.Empty
@onready var visible_mesh = $"CollisionMesh/VisibleMesh" @onready var visible_mesh = $VisibleMesh
@onready var plus_sprite = $"CollisionMesh/plus_sprite"
func update_tile(): func update_tile():
visible_mesh.material_override = tile_materials[tile_type] visible_mesh.set_surface_override_material(0, tile_materials[tile_type])
plus_sprite.visible = tile_type == TileType.Empty
func _ready(): func _ready():
update_tile() update_tile()
@ -27,10 +26,10 @@ func get_empty_dirs_around():
var space_state = get_world_3d().direct_space_state var space_state = get_world_3d().direct_space_state
var query_north = PhysicsRayQueryParameters3D.create(self.position + Vector3(0, 2.5, 0), self.position + Vector3(10, 2.5, 0)) var query_north = PhysicsRayQueryParameters3D.create(self.position + Vector3(0, -2.5, 0), self.position + Vector3(10, -2.5, 0))
var query_south = PhysicsRayQueryParameters3D.create(self.position + Vector3(0, 2.5, 0), self.position + Vector3(-12, 2.5, 0)) var query_south = PhysicsRayQueryParameters3D.create(self.position + Vector3(0, -2.5, 0), self.position + Vector3(-12, -2.5, 0))
var query_west = PhysicsRayQueryParameters3D.create(self.position + Vector3(0, 2.5, 0), self.position + Vector3(0, 2.5, -10)) var query_west = PhysicsRayQueryParameters3D.create(self.position + Vector3(0, -2.5, 0), self.position + Vector3(0, -2.5, -10))
var query_east = PhysicsRayQueryParameters3D.create(self.position + Vector3(0, 2.5, 0), self.position + Vector3(0, 2.5, 10)) var query_east = PhysicsRayQueryParameters3D.create(self.position + Vector3(0, -2.5, 0), self.position + Vector3(0, -2.5, 10))
var result_north = space_state.intersect_ray(query_north) var result_north = space_state.intersect_ray(query_north)
var result_south = space_state.intersect_ray(query_south) var result_south = space_state.intersect_ray(query_south)

View File

@ -6,10 +6,6 @@ var world_info = {
"name": "world" "name": "world"
} }
func _ready():
#new_world()
pass
func new_world(): func new_world():
world_info.seed = round(Time.get_unix_time_from_system()) world_info.seed = round(Time.get_unix_time_from_system())
print("World seed is " + str(world_info.seed)) print("World seed is " + str(world_info.seed))
@ -27,24 +23,19 @@ func save_world():
var save_nodes = get_tree().get_nodes_in_group("Persistent") var save_nodes = get_tree().get_nodes_in_group("Persistent")
for node in save_nodes: for node in save_nodes:
# Check the node is an instanced scene so it can be instanced again during load.
if node.scene_file_path.is_empty(): if node.scene_file_path.is_empty():
print("persistent node '%s' is not an instanced scene, skipped" % node.name) print("persistent node '%s' is not an instanced scene, skipped" % node.name)
continue continue
# Check the node has a save function.
if !node.has_method("save"): if !node.has_method("save"):
print("persistent node '%s' is missing a save() function, skipped" % node.name) print("persistent node '%s' is missing a save() function, skipped" % node.name)
continue continue
# Call the node's save function.
var node_data = node.call("save") var node_data = node.call("save")
#print(node_data)
if (node_data == {}): continue if (node_data == {}): continue
# JSON provides a static method to serialized JSON string.
var json_string = JSON.stringify(node_data) var json_string = JSON.stringify(node_data)
# Store the save dictionary as a new line in the save file.
save_game.store_line(json_string) save_game.store_line(json_string)
func load_world(save_name): func load_world(save_name):

2
todo
View File

@ -1,5 +1,3 @@
Увеличить модель тайла по Y, нарисовать разные уровни: камень, грязь без травы и т.д.
Переместить иконку плюсика пустого тайла прям в материал
Создать следующие типы тайлов: Создать следующие типы тайлов:
* Лес * Лес
* Озеро * Озеро