diff --git a/project/avatar_interaction.gd b/project/avatar_interaction.gd index a1de703..db74e90 100644 --- a/project/avatar_interaction.gd +++ b/project/avatar_interaction.gd @@ -7,6 +7,7 @@ const COLLISION_LAYER_AVATAR = 2 var _terrain = null var _cursor = null + onready var _head = get_parent().get_node("Camera") diff --git a/project/character_avatar.tscn b/project/character_avatar.tscn index 1f13f59..04028db 100644 --- a/project/character_avatar.tscn +++ b/project/character_avatar.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://character_controller.gd" type="Script" id=1] [ext_resource path="res://mouse_look.gd" type="Script" id=2] @@ -6,18 +6,14 @@ [ext_resource path="res://crosshair.png" type="Texture" id=4] [ext_resource path="res://center.gd" type="Script" id=5] -[sub_resource type="CapsuleShape" id=1] - -radius = 0.4 -height = 0.85 - -[sub_resource type="SpatialMaterial" id=2] +[sub_resource type="SpatialMaterial" id=1] flags_transparent = false flags_unshaded = false flags_vertex_lighting = false -flags_on_top = false +flags_no_depth_test = false flags_use_point_size = false +flags_world_triplanar = false flags_fixed_size = false vertex_color_use_as_albedo = true vertex_color_is_srgb = false @@ -45,6 +41,7 @@ anisotropy_enabled = false ao_enabled = false depth_enabled = false subsurf_scatter_enabled = false +transmission_enabled = false refraction_enabled = false detail_enabled = false uv1_scale = Vector3( 1, 1, 1 ) @@ -56,20 +53,15 @@ uv2_offset = Vector3( 0, 0, 0 ) uv2_triplanar = false uv2_triplanar_sharpness = 1.0 -[sub_resource type="CubeMesh" id=3] +[sub_resource type="CubeMesh" id=2] size = Vector3( 0.8, 1.8, 0.8 ) subdivide_width = 0 subdivide_height = 0 subdivide_depth = 0 -[node name="CharacterAvatar" type="KinematicBody"] +[node name="CharacterAvatar" type="Spatial"] -input_ray_pickable = true -input_capture_on_drag = false -collision_layer = 3 -collision_mask = 1 -collision/safe_margin = 0.001 script = ExtResource( 1 ) speed = 5.0 gravity = 40.0 @@ -77,12 +69,6 @@ jump_force = 8.0 head = NodePath("Camera") terrain = null -[node name="CollisionShape" type="CollisionShape" parent="."] - -transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 ) -shape = SubResource( 1 ) -disabled = false - [node name="Camera" type="Camera" parent="."] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.702764, 0 ) @@ -91,7 +77,7 @@ fov = 90.0 near = 0.1 far = 500.0 keep_aspect = 1 -current = false +current = true cull_mask = 1048575 environment = null h_offset = 0.0 @@ -109,7 +95,7 @@ distance = 4.0 script = ExtResource( 3 ) terrain_path = null -cursor_material = SubResource( 2 ) +cursor_material = SubResource( 1 ) [node name="debug_label" type="Label" parent="."] @@ -146,7 +132,6 @@ shadow_enabled = false shadow_color = Color( 0, 0, 0, 1 ) shadow_bias = 0.1 shadow_contact = 0.0 -shadow_max_distance = 0.0 shadow_reverse_cull_face = false editor_only = false omni_range = 10.0 @@ -165,7 +150,7 @@ lod_min_distance = 0.0 lod_min_hysteresis = 0.0 lod_max_distance = 0.0 lod_max_hysteresis = 0.0 -mesh = SubResource( 3 ) +mesh = SubResource( 2 ) skeleton = NodePath("..") material/0 = null diff --git a/project/character_controller.gd b/project/character_controller.gd index 34fc5a8..2e65e68 100644 --- a/project/character_controller.gd +++ b/project/character_controller.gd @@ -1,4 +1,4 @@ -extends KinematicBody +extends Spatial const BoxPhysics = preload("res://box_physics.gd") @@ -132,7 +132,10 @@ func move_with_box_physics(motion): z += 1 motion = BoxPhysics.get_motion(box, motion, potential_boxes) - move(motion) + # TODO If any Godot physics is used here, it will break box physics and you'll fall through the map! + # TODO Latest KinematicBody fucks up my motion, no idea why. Changed to Spatial + #move_and_slide(motion) + global_translate(motion) return motion diff --git a/project/crosshair.png.import b/project/crosshair.png.import index d3348bf..253ee93 100644 --- a/project/crosshair.png.import +++ b/project/crosshair.png.import @@ -8,6 +8,8 @@ path="res://.import/crosshair.png-b7f9cb2e0fc32a087972fec001d3421e.stex" compress/mode=0 compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/normal_map=0 flags/repeat=0 flags/filter=false flags/mipmaps=false @@ -15,6 +17,8 @@ flags/anisotropic=false flags/srgb=2 process/fix_alpha_border=false process/premult_alpha=false +process/HDR_as_SRGB=false stream=false size_limit=0 detect_3d=true +svg/scale=1.0 diff --git a/project/icon.png.import b/project/icon.png.import index e62992f..d01c747 100644 --- a/project/icon.png.import +++ b/project/icon.png.import @@ -8,6 +8,8 @@ path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" compress/mode=0 compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/normal_map=0 flags/repeat=0 flags/filter=true flags/mipmaps=false @@ -15,6 +17,8 @@ flags/anisotropic=false flags/srgb=2 process/fix_alpha_border=true process/premult_alpha=true +process/HDR_as_SRGB=false stream=false size_limit=0 detect_3d=true +svg/scale=1.0 diff --git a/project/main.tscn b/project/main.tscn index eec5eab..8d3b2b7 100644 --- a/project/main.tscn +++ b/project/main.tscn @@ -143,8 +143,9 @@ voxels/1 = SubResource( 4 ) flags_transparent = false flags_unshaded = false flags_vertex_lighting = false -flags_on_top = false +flags_no_depth_test = false flags_use_point_size = false +flags_world_triplanar = false flags_fixed_size = false vertex_color_use_as_albedo = false vertex_color_is_srgb = false @@ -172,6 +173,7 @@ anisotropy_enabled = false ao_enabled = false depth_enabled = false subsurf_scatter_enabled = false +transmission_enabled = false refraction_enabled = false detail_enabled = false uv1_scale = Vector3( 1, 1, 1 ) @@ -188,8 +190,9 @@ uv2_triplanar_sharpness = 1.0 flags_transparent = false flags_unshaded = true flags_vertex_lighting = false -flags_on_top = false +flags_no_depth_test = false flags_use_point_size = false +flags_world_triplanar = false flags_fixed_size = false vertex_color_use_as_albedo = true vertex_color_is_srgb = false @@ -217,6 +220,7 @@ anisotropy_enabled = false ao_enabled = false depth_enabled = false subsurf_scatter_enabled = false +transmission_enabled = false refraction_enabled = false detail_enabled = false uv1_scale = Vector3( 1, 1, 1 ) @@ -286,7 +290,6 @@ shadow_enabled = true shadow_color = Color( 0, 0, 0, 1 ) shadow_bias = 0.1 shadow_contact = 0.0 -shadow_max_distance = 100.0 shadow_reverse_cull_face = false editor_only = false directional_shadow_mode = 2 @@ -295,11 +298,14 @@ directional_shadow_split_2 = 0.2 directional_shadow_split_3 = 0.5 directional_shadow_blend_splits = false directional_shadow_normal_bias = 0.1 +directional_shadow_bias_split_scale = 0.25 +directional_shadow_depth_range = 0 +directional_shadow_max_distance = 200.0 _sections_unfolded = [ "Directional Shadow", "Light", "Shadow" ] [node name="CharacterAvatar" parent="." instance=ExtResource( 6 )] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 25, 17 ) +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 58.0914, 17 ) terrain = NodePath("../VoxelTerrain") [node name="axes" parent="." instance=ExtResource( 7 )] diff --git a/project/noise_distorted.png.import b/project/noise_distorted.png.import index 1b32d3e..74df169 100644 --- a/project/noise_distorted.png.import +++ b/project/noise_distorted.png.import @@ -21,4 +21,4 @@ process/HDR_as_SRGB=false stream=false size_limit=0 detect_3d=true -scale=1.0 +svg/scale=1.0 diff --git a/project/project.godot b/project/project.godot index 368d918..31fa37d 100644 --- a/project/project.godot +++ b/project/project.godot @@ -15,6 +15,10 @@ name="Voxel Game" main_scene="res://main.tscn" icon="res://icon.png" +[gdnative] + +singletons=[ ] + [input] action1=[ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) diff --git a/project/provider_heightmap.gd b/project/provider_heightmap.gd index af21f01..ba8007e 100644 --- a/project/provider_heightmap.gd +++ b/project/provider_heightmap.gd @@ -1,3 +1,4 @@ +tool extends VoxelProvider diff --git a/project/terrain.png.import b/project/terrain.png.import index 06ea0d6..f83e636 100644 --- a/project/terrain.png.import +++ b/project/terrain.png.import @@ -8,6 +8,8 @@ path="res://.import/terrain.png-84a626877af7de08ecf24965bda52835.stex" compress/mode=3 compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/normal_map=0 flags/repeat=true flags/filter=false flags/mipmaps=false @@ -15,6 +17,8 @@ flags/anisotropic=false flags/srgb=0 process/fix_alpha_border=true process/premult_alpha=false +process/HDR_as_SRGB=false stream=false size_limit=0 detect_3d=false +svg/scale=1.0