diff --git a/.gitignore b/.gitignore index 1f0e54f..35b59a6 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ !project.godot !project.code-workspace .godot/ +addons/ assets/ \ No newline at end of file diff --git a/README.md b/README.md index 84497ad..77104a5 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,14 @@ There is `git lfs prune` for the client side, but we need it on the server side Therefore the `client/assets` directory needs to be downloaded separately. Download link will be here in the future. +## Addons + +The `client/addons` must be downloaded separately just like the assets. +The following addons are required: + +- [Terrain3D](https://github.com/TokisanGames/Terrain3D) +- [Godot Jolt](https://github.com/godot-jolt/godot-jolt) + ## Features - UDP based messaging diff --git a/client/Main.tscn b/client/Main.tscn index 0fa26fe..64cba1f 100644 --- a/client/Main.tscn +++ b/client/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=37 format=3 uid="uid://b40y7iuskv1ar"] +[gd_scene load_steps=34 format=3 uid="uid://b40y7iuskv1ar"] [ext_resource type="Script" path="res://Main.gd" id="1_cw3ws"] [ext_resource type="Script" path="res://network/Client.gd" id="2_8hxcx"] @@ -17,11 +17,8 @@ [ext_resource type="Environment" uid="uid://dixa0yso2s1u3" path="res://world/Environment.tres" id="14_kuej8"] [ext_resource type="Script" path="res://world/generator/Generator.gd" id="15_25nmg"] [ext_resource type="PackedScene" uid="uid://cb2t7bvvf3gwh" path="res://enemy/slime/Slime.tscn" id="15_hgl78"] -[ext_resource type="MeshLibrary" uid="uid://c401giuqolkut" path="res://assets/grid/MeshLibrary.tres" id="15_qkcdq"] -[ext_resource type="Script" path="res://world/grid/WorldGrid.gd" id="16_36yv3"] [ext_resource type="Script" path="res://world/PlayerManager.gd" id="16_dp6bj"] [ext_resource type="PackedScene" uid="uid://dagn5bf7ou3sd" path="res://ui/UI.tscn" id="17_43qhq"] -[ext_resource type="PackedScene" uid="uid://hvc8oecqweko" path="res://world/grass/Grass.tscn" id="17_iovfi"] [ext_resource type="FastNoiseLite" uid="uid://d3f4lk8q04haa" path="res://world/trees/TreeNoise.tres" id="19_ctwmw"] [ext_resource type="Script" path="res://world/generator/TreeGenerator.gd" id="19_kcwnm"] [ext_resource type="PackedScene" uid="uid://tr0tn0pkr1ea" path="res://world/trees/Callistemon.tscn" id="19_x2ulu"] @@ -31,13 +28,9 @@ [ext_resource type="Material" uid="uid://cxlib6jo32hxg" path="res://world/trees/LeafMaterial2.tres" id="22_k67l0"] [ext_resource type="Material" uid="uid://c8o7cihkhrqf6" path="res://world/trees/LeafMaterial3.tres" id="23_lxn2x"] [ext_resource type="AudioStream" uid="uid://b36mntcqlt553" path="res://assets/audio/ambience/Wind-Vegetation-Leaves-Gusts.wav" id="30_b3a1m"] - -[sub_resource type="FastNoiseLite" id="FastNoiseLite_3ubsr"] - -[sub_resource type="FastNoiseLite" id="FastNoiseLite_1khdm"] - -[sub_resource type="FastNoiseLite" id="FastNoiseLite_b46lq"] -frequency = 0.005 +[ext_resource type="Terrain3DStorage" uid="uid://c38e3dyrl8lao" path="res://assets/terrain/Storage.res" id="30_bvq0o"] +[ext_resource type="Terrain3DMaterial" uid="uid://nhcs8ekjedbb" path="res://world/terrain/Material.tres" id="31_of12o"] +[ext_resource type="Terrain3DTextureList" uid="uid://cpq0eq7wr08kf" path="res://world/terrain/TextureList.tres" id="32_d5ywf"] [sub_resource type="FastNoiseLite" id="FastNoiseLite_xy4ll"] seed = 300 @@ -109,25 +102,13 @@ autostart = true [node name="World" type="Node3D" parent="."] -[node name="Environment" type="WorldEnvironment" parent="World"] -environment = ExtResource("14_kuej8") - -[node name="Sun" type="DirectionalLight3D" parent="World/Environment"] -transform = Transform3D(-0.350207, 0.827032, -0.439741, 0, 0.469472, 0.882948, 0.936672, 0.309215, -0.164412, 0, 3, 0) -light_energy = 1.8 -shadow_enabled = true -script = ExtResource("11_4jb08") - -[node name="Grid" type="GridMap" parent="World"] -mesh_library = ExtResource("15_qkcdq") -cell_center_y = false -script = ExtResource("16_36yv3") -moisture_noise = SubResource("FastNoiseLite_3ubsr") -temperature_noise = SubResource("FastNoiseLite_1khdm") -altitude_noise = SubResource("FastNoiseLite_b46lq") -grass = ExtResource("17_iovfi") +[node name="Terrain3D" type="Terrain3D" parent="World"] +storage = ExtResource("30_bvq0o") +material = ExtResource("31_of12o") +texture_list = ExtResource("32_d5ywf") [node name="Houses" type="Node3D" parent="World"] +visible = false script = ExtResource("15_25nmg") scene = ExtResource("20_xjraj") noise = SubResource("FastNoiseLite_xy4ll") @@ -138,6 +119,7 @@ density = 0.3 scale_max = 2.0 [node name="Trees" type="Node3D" parent="World"] +visible = false script = ExtResource("19_kcwnm") tree_materials = Array[Material]([ExtResource("20_seiv4")]) leaf_materials = Array[Material]([ExtResource("21_v66do"), ExtResource("22_k67l0"), ExtResource("23_lxn2x")]) @@ -163,6 +145,15 @@ tilt = 0.15 [node name="Follow" parent="World" instance=ExtResource("12_aljdh")] +[node name="Environment" type="WorldEnvironment" parent="World"] +environment = ExtResource("14_kuej8") + +[node name="Sun" type="DirectionalLight3D" parent="World/Environment"] +transform = Transform3D(-0.350207, 0.827032, -0.439741, 0, 0.469472, 0.882948, 0.936672, 0.309215, -0.164412, 0, 3, 0) +light_energy = 1.8 +shadow_enabled = true +script = ExtResource("11_4jb08") + [node name="Ambience" type="AudioStreamPlayer" parent="World"] stream = ExtResource("30_b3a1m") autoplay = true diff --git a/client/enemy/slime/Slime.tscn b/client/enemy/slime/Slime.tscn index 4eedf5c..3ea54c3 100644 --- a/client/enemy/slime/Slime.tscn +++ b/client/enemy/slime/Slime.tscn @@ -9,7 +9,7 @@ [ext_resource type="PackedScene" uid="uid://dl4vcp04t8iyr" path="res://item/soul/Soul.tscn" id="7_i0rtb"] [ext_resource type="PackedScene" uid="uid://c8lifxuvpchu3" path="res://player/visibility/VisibilityComponent.tscn" id="9_ssc7p"] -[sub_resource type="SphereShape3D" id="SphereShape3D_s5ct7"] +[sub_resource type="SphereShape3D" id="SphereShape3D_mjr4a"] radius = 0.4 [sub_resource type="Animation" id="Animation_vjs0t"] @@ -61,7 +61,7 @@ script = ExtResource("1_r5888") [node name="Collision" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.4, 0) -shape = SubResource("SphereShape3D_s5ct7") +shape = SubResource("SphereShape3D_mjr4a") [node name="HUD" parent="." node_paths=PackedStringArray("health") instance=ExtResource("3_4jtio")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.986405, 0) @@ -91,6 +91,7 @@ animation = NodePath("../Animation") drop = ExtResource("7_i0rtb") [node name="Visibility" parent="." node_paths=PackedStringArray("health", "hud") instance=ExtResource("9_ssc7p")] +wait_time = 1.0 health = NodePath("../Health") hud = NodePath("../HUD") physics_distance = 50.0 diff --git a/client/project.godot b/client/project.godot index 8227305..410ff6f 100644 --- a/client/project.godot +++ b/client/project.godot @@ -42,6 +42,10 @@ window/vsync/vsync_mode=0 run/main_run_args="--offline" +[editor_plugins] + +enabled=PackedStringArray("res://addons/terrain_3d/plugin.cfg") + [gui] theme/custom="res://ui/theme/theme.tres" @@ -164,4 +168,4 @@ skill_4={ [physics] -3d/run_on_separate_thread=true +3d/physics_engine="JoltPhysics3D" diff --git a/client/world/grid/WorldGrid.gd b/client/world/grid/WorldGrid.gd index 1b226ba..f3fce50 100644 --- a/client/world/grid/WorldGrid.gd +++ b/client/world/grid/WorldGrid.gd @@ -11,6 +11,9 @@ var depth := 60 var current_pos := Vector3i(0, 0, 0) var old_pos := Vector3i(NAN, NAN, NAN) +func _ready(): + set_process(visible) + func _process(_delta): current_pos = local_to_map(Global.player.position) diff --git a/client/world/terrain/Material.tres b/client/world/terrain/Material.tres new file mode 100644 index 0000000..d2afa99 --- /dev/null +++ b/client/world/terrain/Material.tres @@ -0,0 +1,38 @@ +[gd_resource type="Terrain3DMaterial" load_steps=4 format=3 uid="uid://nhcs8ekjedbb"] + +[sub_resource type="Gradient" id="Gradient_3bxf2"] +offsets = PackedFloat32Array(0.2, 1) +colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1) + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_v4p6k"] +noise_type = 2 +frequency = 0.03 +cellular_jitter = 3.0 +cellular_return_type = 0 +domain_warp_enabled = true +domain_warp_type = 1 +domain_warp_amplitude = 50.0 +domain_warp_fractal_type = 2 +domain_warp_fractal_lacunarity = 1.5 +domain_warp_fractal_gain = 1.0 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_njlw8"] +seamless = true +color_ramp = SubResource("Gradient_3bxf2") +noise = SubResource("FastNoiseLite_v4p6k") + +[resource] +_shader_parameters = { +"_mouse_layer": 2147483648, +"blend_sharpness": null, +"height_blending": null, +"macro_variation1": null, +"macro_variation2": null, +"noise1_angle": null, +"noise1_offset": null, +"noise1_scale": null, +"noise2_scale": null, +"noise3_scale": null, +"noise_texture": SubResource("NoiseTexture2D_njlw8") +} +show_checkered = true diff --git a/client/world/terrain/TextureList.tres b/client/world/terrain/TextureList.tres new file mode 100644 index 0000000..7451ab3 --- /dev/null +++ b/client/world/terrain/TextureList.tres @@ -0,0 +1,3 @@ +[gd_resource type="Terrain3DTextureList" format=3 uid="uid://cpq0eq7wr08kf"] + +[resource] diff --git a/project.code-workspace b/project.code-workspace index 0c2a115..bd242db 100644 --- a/project.code-workspace +++ b/project.code-workspace @@ -15,7 +15,9 @@ ], "settings": { "files.exclude": { - ".godot": true + ".godot": true, + "addons": true, + "assets": true } } } \ No newline at end of file