backup old work

This commit is contained in:
anyreso 2024-10-16 19:59:38 -04:00
parent 4f93aee203
commit 36168ed18c
84 changed files with 1632 additions and 186 deletions

View file

@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/Exo2.ttf-29e177e92d885ac8d1871efda37915d4.fon
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48

View file

@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/The Most Beautiful Gift One.otf-1996dbf32044a
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48

View file

@ -17,6 +17,7 @@ nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
@ -28,6 +29,7 @@ animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1

View file

@ -17,6 +17,7 @@ nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
@ -28,6 +29,7 @@ animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1

View file

@ -25,15 +25,30 @@ enum FlagState {
@export var state : FlagState = FlagState.ON_STAND
@onready var area : Area3D = $GripArea3D
@onready var area : Area3D = $GripArea
@onready var mesh : Node3D = $Mesh
@onready var waypoint : Waypoint3D = $Waypoint
var last_carrier : FlagCarryComponent
var dropped_duration_max := 30.
## This timer is responsible for returning the flag when it is dropped for more than [member dropped_duration_max].
var respawn_timer := Timer.new()
func _process(_delta:float) -> void:
if state == FlagState.DROPPED and not respawn_timer.is_stopped():
waypoint.text = "%.2f s" % respawn_timer.time_left
else:
waypoint.text = ""
func _ready() -> void:
area.body_entered.connect(_on_body_entered)
grabbed.connect(_on_grabbed)
dropped.connect(_on_dropped)
if multiplayer.is_server():
respawn_timer.wait_time = dropped_duration_max
respawn_timer.one_shot = true
add_child(respawn_timer)
func _on_body_entered(body: Node) -> void:
if body is Player:

View file

@ -1,9 +1,8 @@
[gd_scene load_steps=8 format=3 uid="uid://c88l3h0ph00c7"]
[gd_scene load_steps=7 format=3 uid="uid://c88l3h0ph00c7"]
[ext_resource type="Script" path="res://entities/flag/flag.gd" id="1_y7d3d"]
[ext_resource type="PackedScene" uid="uid://d3l7fvbdg6m5g" path="res://entities/flag/assets/flag.glb" id="2_i78em"]
[ext_resource type="Shape3D" uid="uid://dfko4x6uq27q" path="res://entities/flag/resources/collider.tres" id="2_kx0v0"]
[ext_resource type="Shape3D" uid="uid://b5a6oybteqj6n" path="res://entities/flag/resources/grip_area.tres" id="3_uhsc8"]
[ext_resource type="Shape3D" uid="uid://cc4von3ac65kl" path="res://entities/flag/resources/capsule_shape.tres" id="2_ig160"]
[ext_resource type="PackedScene" uid="uid://2350a3ce4xs8" path="res://interfaces/waypoint/waypoint3d.tscn" id="4_y8nj0"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_4ymrw"]
@ -20,10 +19,10 @@ properties/1/replication_mode = 1
properties/2/path = NodePath(".:visible")
properties/2/spawn = true
properties/2/replication_mode = 2
properties/3/path = NodePath(".:state")
properties/3/path = NodePath(".:sleeping")
properties/3/spawn = true
properties/3/replication_mode = 2
properties/4/path = NodePath(".:sleeping")
properties/4/path = NodePath(".:state")
properties/4/spawn = true
properties/4/replication_mode = 2
@ -42,13 +41,13 @@ script = ExtResource("1_y7d3d")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0.00601196)
shape = ExtResource("2_kx0v0")
shape = ExtResource("2_ig160")
[node name="GripArea3D" type="Area3D" parent="."]
[node name="GripArea" type="Area3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="GripArea3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="GripArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = ExtResource("3_uhsc8")
shape = ExtResource("2_ig160")
[node name="Mesh" parent="." instance=ExtResource("2_i78em")]
@ -56,5 +55,13 @@ shape = ExtResource("3_uhsc8")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.25, 0)
foreground_color = Color(0, 0.75, 0.75, 1)
[node name="Label3D" parent="Waypoint" index="0"]
modulate = Color(0, 0.75, 0.75, 1)
[node name="Sprite3D" parent="Waypoint" index="1"]
modulate = Color(0, 0.75, 0.75, 1)
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_lpijf")
[editable path="Waypoint"]

View file

@ -0,0 +1,4 @@
[gd_resource type="CapsuleShape3D" format=3 uid="uid://cc4von3ac65kl"]
[resource]
radius = 0.25

View file

@ -1,4 +0,0 @@
[gd_resource type="BoxShape3D" format=3 uid="uid://dfko4x6uq27q"]
[resource]
size = Vector3(0.5, 2, 0.164246)

View file

@ -1,4 +0,0 @@
[gd_resource type="BoxShape3D" format=3 uid="uid://b5a6oybteqj6n"]
[resource]
size = Vector3(0.5, 2, 0.5)

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://dmf12llra7aq5"
path.s3tc="res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.s3tc.ctex"
path.etc2="res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://entities/player/assets/jetpackfx/Particle01.png"
dest_files=["res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.s3tc.ctex", "res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.etc2.ctex"]
dest_files=["res://.godot/imported/Particle01.png-789728e4e363d58f11747b3cf3c5d5a3.s3tc.ctex"]
[params]

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://ct1v5iadtpadm"
path.s3tc="res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.s3tc.ctex"
path.etc2="res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://entities/player/assets/jetpackfx/smoke_01.png"
dest_files=["res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.s3tc.ctex", "res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.etc2.ctex"]
dest_files=["res://.godot/imported/smoke_01.png-5c3d69bc74b2f317eac64d37cd67aed3.s3tc.ctex"]
[params]

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://doxo4vfn0bjlp"
path.s3tc="res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.s3tc.ctex"
path.etc2="res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://entities/player/assets/jetpackfx/smoke_02.png"
dest_files=["res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.s3tc.ctex", "res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.etc2.ctex"]
dest_files=["res://.godot/imported/smoke_02.png-a5343a97ff1cefeebcd82e41218739ca.s3tc.ctex"]
[params]

View file

@ -17,6 +17,7 @@ nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=0.01
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
@ -28,6 +29,7 @@ animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={
"animations": {

View file

@ -4,9 +4,8 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://ia3bdpe4rm1m"
path.bptc="res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.bptc.ctex"
path.astc="res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
@ -14,7 +13,7 @@ generator_parameters={}
[deps]
source_file="res://entities/player/assets/vanguard_0.png"
dest_files=["res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.bptc.ctex", "res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.astc.ctex"]
dest_files=["res://.godot/imported/vanguard_0.png-601f36bc664114e126d425d5f45085ef.bptc.ctex"]
[params]

View file

@ -4,9 +4,8 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://bvgfmpb2l1juf"
path.bptc="res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.bptc.ctex"
path.astc="res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
@ -14,7 +13,7 @@ generator_parameters={}
[deps]
source_file="res://entities/player/assets/vanguard_1.png"
dest_files=["res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.bptc.ctex", "res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.astc.ctex"]
dest_files=["res://.godot/imported/vanguard_1.png-39b5712c4c4119a42b3540a159f8b3f2.bptc.ctex"]
[params]

View file

@ -4,9 +4,8 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://vtrbc3eja3df"
path.bptc="res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.bptc.ctex"
path.astc="res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
@ -14,7 +13,7 @@ generator_parameters={}
[deps]
source_file="res://entities/player/assets/vanguard_2.png"
dest_files=["res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.bptc.ctex", "res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.astc.ctex"]
dest_files=["res://.godot/imported/vanguard_2.png-986e3665904b0d4758f584d5d3b7b726.bptc.ctex"]
[params]

View file

@ -326,10 +326,60 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0,
spine_ik_target_attachment = NodePath("../../Pivot/SpineIKTarget")
[node name="Skeleton3D" parent="ThirdPerson/Mesh/Node" index="0"]
bones/0/position = Vector3(-0.0048219, 0.946668, 0.00678214)
bones/0/rotation = Quaternion(-0.0341192, -0.409249, -0.0209221, 0.911545)
bones/2/rotation = Quaternion(-0.00595832, -0.0014545, 0.0101407, 0.99993)
bones/4/rotation = Quaternion(0.0691268, 0.00227406, 0.0147948, 0.997496)
bones/6/rotation = Quaternion(0.160951, 0.00623474, 0.0096637, 0.986895)
bones/8/rotation = Quaternion(0.675761, -0.399581, 0.409695, 0.464577)
bones/10/rotation = Quaternion(0.212344, -0.0870591, -0.287653, 0.929831)
bones/12/rotation = Quaternion(0.0811501, 0.206806, -0.754068, 0.618084)
bones/14/rotation = Quaternion(0.00943715, 0.0971687, -0.145046, 0.984597)
bones/20/rotation = Quaternion(-0.123455, 0.0248346, 0.23344, 0.964183)
bones/24/rotation = Quaternion(0.0450683, -0.000817796, 0.0508488, 0.997689)
bones/26/rotation = Quaternion(0.100545, -1.16532e-07, 0.00792588, 0.994901)
bones/28/rotation = Quaternion(0.288532, -1.83796e-07, 0.0227447, 0.9572)
bones/32/rotation = Quaternion(0.00674081, -0.0316083, 0.105474, 0.993897)
bones/34/rotation = Quaternion(0.780684, 4.23384e-08, 0.0615407, 0.621889)
bones/36/rotation = Quaternion(0.580978, -1.56224e-07, 0.0457976, 0.81263)
bones/40/rotation = Quaternion(0.0913739, 0.113691, 0.100265, 0.984211)
bones/42/rotation = Quaternion(0.836841, 4.40546e-07, 0.0659669, 0.543457)
bones/44/rotation = Quaternion(0.633142, 6.48257e-09, 0.04991, 0.772425)
bones/50/rotation = Quaternion(0.729888, -4.88266e-08, 0.0575362, 0.681141)
bones/52/rotation = Quaternion(0.624011, -9.63141e-08, 0.04919, 0.779865)
bones/56/rotation = Quaternion(-0.0254885, 0.0439755, -0.00910637, 0.998666)
bones/58/rotation = Quaternion(-0.0119802, 0.289956, -0.0527053, 0.955513)
bones/62/rotation = Quaternion(0.689943, 0.375565, -0.410267, 0.463261)
bones/64/rotation = Quaternion(0.337746, -0.290519, 0.159479, 0.880961)
bones/66/rotation = Quaternion(0.540371, -0.580679, 0.406779, 0.453147)
bones/68/position = Vector3(-1.77636e-17, 0.240718, 0)
bones/68/rotation = Quaternion(0.0150529, -0.289001, 0.0720108, 0.954498)
bones/70/rotation = Quaternion(0.155965, 0.0109114, -0.00107202, 0.987702)
bones/72/rotation = Quaternion(0.563923, 4.19095e-08, -0.0577906, 0.823803)
bones/74/rotation = Quaternion(0.285209, 0.0197164, -0.0936782, 0.953673)
bones/78/rotation = Quaternion(0.057484, -0.0698946, -0.0100642, 0.995846)
bones/80/rotation = Quaternion(0.433127, 5.44824e-08, -0.0443866, 0.900239)
bones/82/rotation = Quaternion(0.274138, -1.97906e-08, -0.0280937, 0.96128)
bones/86/rotation = Quaternion(0.244152, 0.0521336, 0.176446, 0.952123)
bones/88/rotation = Quaternion(0.0146391, -1.48637e-07, -0.121951, 0.992428)
bones/90/rotation = Quaternion(-0.147655, -0.0737763, 0.197847, 0.966236)
bones/94/rotation = Quaternion(0.180682, 0.0832945, -0.00387314, 0.980001)
bones/96/rotation = Quaternion(0.245651, -6.35919e-08, -0.0251742, 0.969032)
bones/98/rotation = Quaternion(0.246432, 7.6252e-08, -0.0252543, 0.968831)
bones/102/rotation = Quaternion(0.179829, 0.0890365, -0.000307644, 0.97966)
bones/104/rotation = Quaternion(0.388149, 1.28057e-07, -0.0397774, 0.920738)
bones/106/rotation = Quaternion(0.372324, -1.37021e-07, -0.0381557, 0.927318)
bones/110/rotation = Quaternion(-0.167577, 0.223934, 0.958827, 0.0492099)
bones/112/rotation = Quaternion(-0.466474, -0.0088339, -0.0232928, 0.884184)
bones/114/rotation = Quaternion(0.575696, 0.0793941, -0.0250592, 0.813414)
bones/116/rotation = Quaternion(0.355062, 0.0493655, 0.0246355, 0.933213)
bones/120/rotation = Quaternion(0.115252, 0.282473, 0.945749, -0.111737)
bones/122/rotation = Quaternion(-0.494906, -0.0647935, 0.0183973, 0.866332)
bones/124/rotation = Quaternion(0.417677, -0.0431149, 0.00625689, 0.90755)
bones/126/rotation = Quaternion(0.397818, -0.0427722, -0.00601182, 0.916447)
[node name="HandAttachment" parent="ThirdPerson/Mesh/Node/Skeleton3D" index="0"]
transform = Transform3D(-0.152213, 0.0548833, 0.986823, 0.933991, 0.334546, 0.125458, -0.323252, 0.94078, -0.102183, -0.261612, 1.14328, 0.0896012)
transform = Transform3D(-0.152214, 0.0548832, 0.986823, 0.933991, 0.334546, 0.125459, -0.323252, 0.94078, -0.102183, -0.261612, 1.14328, 0.0896011)
[node name="grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.6068e-14, -1.19209e-07, 9.53674e-07)
@ -349,32 +399,20 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.6068e-14, -1.19209e-07, 9.5
[node name="sides" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/SpaceGun/Mesh/Armature/Skeleton3D/sides" index="0"]
layers = 2
[node name="BarrelsInner" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="BarrelsInner" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D/BarrelsInner" index="0"]
layers = 2
[node name="BarrelsOuter" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="BarrelsOuter" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D/BarrelsOuter" index="0"]
layers = 2
[node name="Base" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Base" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D/Base" index="0"]
layers = 2
[node name="Grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D" index="3"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.692504, 1.30946)
[node name="Grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun/Armature/Skeleton3D/Grip" index="0"]
layers = 2
[node name="Barrels" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/ChainGun" index="2"]
transform = Transform3D(-1, 0, 8.74227e-08, 8.74227e-08, 0, 1, 0, 1, 0, -2.32831e-10, 0.692504, 0.756307)
transform = Transform3D(-1, 0, 8.9407e-08, 8.47504e-08, 0, 1, 0, 1, -3.72529e-09, -1.19209e-07, 4.76837e-07, -0.55315)
[node name="Skeleton3D" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature" index="0"]
bones/0/rotation = Quaternion(0, 0.707107, 0.707107, 0)
@ -382,21 +420,12 @@ bones/1/rotation = Quaternion(0, 0.707107, 0.707107, 0)
bones/2/rotation = Quaternion(0, 0.707107, 0.707107, 0)
bones/3/rotation = Quaternion(0, 0.707107, 0.707107, 0)
[node name="barrel" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="0"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19209e-07, 0)
[node name="barrel" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D/barrel" index="0"]
layers = 2
[node name="grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.082471, -0.0653242)
[node name="grip" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D/grip" index="0"]
layers = 2
[node name="main" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D" index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.19209e-07, 0)
[node name="main" parent="ThirdPerson/Mesh/Node/Skeleton3D/HandAttachment/GrenadeLauncher/Armature/Skeleton3D/main" index="0"]
layers = 2

View file

@ -42,22 +42,24 @@ func _physics_process(_delta: float) -> void:
# overlapping bodies signal handler
func _on_body_shape_entered(_body_rid: RID, body: Node, _body_shape_idx: int, local_shape_idx: int) -> void:
# retrieve area shape
var shape : SphereShape3D = shape_owner_get_shape(
shape_find_owner(local_shape_idx), local_shape_idx)
# retrieve vector from current node origin to body global center of mass
var direction: Vector3 = (body.global_transform.origin + body.center_of_mass) - global_transform.origin
# sample curve texture if any to get falloff value at current distance
var weight := 1.0
if falloff:
weight = falloff.sample(direction.length() / shape.radius)
# handle blast
if body is RigidBody3D:
var impulse: Vector3 = direction.normalized() * (1000 * weight)
# apply body impulse based on distance from explosion origin
body.apply_impulse(impulse, global_transform.origin)
# handle blast damages
if body is Player:
# deal damage based on distance from explosion origin
body.damage.emit(source, body, damage * weight)
if multiplayer.is_server():
# retrieve area shape
var shape : SphereShape3D = shape_owner_get_shape(
shape_find_owner(local_shape_idx), local_shape_idx)
# retrieve vector from current node origin to body global center of mass
var direction: Vector3 = (body.global_transform.origin + body.center_of_mass) - global_transform.origin
# sample curve texture if any to get falloff value at current distance
var weight := 1.0
if falloff:
weight = falloff.sample(direction.length() / shape.radius)
# handle blast
if body is RigidBody3D:
var impulse: Vector3 = direction.normalized() * (1000 * weight)
# apply body impulse based on distance from explosion origin
body.apply_impulse(impulse, global_transform.origin)
# handle blast damages
if body is Player:
# deal damage based on distance from explosion origin
body.damage.emit(source, body, damage * weight)
if body is Flag:
body.respawn_timer.start(clampf(body.respawn_timer.time_left + 5., 0., body.dropped_duration_max))

View file

@ -17,6 +17,7 @@ nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
@ -28,6 +29,7 @@ animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1

View file

@ -17,6 +17,7 @@ nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
@ -28,6 +29,7 @@ animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1

View file

@ -17,6 +17,7 @@ nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
@ -28,6 +29,7 @@ animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://chchhrpwmho2c"
path.s3tc="res://.godot/imported/Flare00.png-75515c1e8df86aba86a9e55bb8ca7901.s3tc.ctex"
path.etc2="res://.godot/imported/Flare00.png-75515c1e8df86aba86a9e55bb8ca7901.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://entities/weapons/grenade_launcher/assets/textures/Flare00.png"
dest_files=["res://.godot/imported/Flare00.png-75515c1e8df86aba86a9e55bb8ca7901.s3tc.ctex", "res://.godot/imported/Flare00.png-75515c1e8df86aba86a9e55bb8ca7901.etc2.ctex"]
dest_files=["res://.godot/imported/Flare00.png-75515c1e8df86aba86a9e55bb8ca7901.s3tc.ctex"]
[params]

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://dt6c44uknktrg"
path.s3tc="res://.godot/imported/explosion_texture_alb.png-1ff7964ed65c51040c0956ec9ef6a893.s3tc.ctex"
path.etc2="res://.godot/imported/explosion_texture_alb.png-1ff7964ed65c51040c0956ec9ef6a893.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://entities/weapons/grenade_launcher/assets/textures/explosion_texture_alb.png"
dest_files=["res://.godot/imported/explosion_texture_alb.png-1ff7964ed65c51040c0956ec9ef6a893.s3tc.ctex", "res://.godot/imported/explosion_texture_alb.png-1ff7964ed65c51040c0956ec9ef6a893.etc2.ctex"]
dest_files=["res://.godot/imported/explosion_texture_alb.png-1ff7964ed65c51040c0956ec9ef6a893.s3tc.ctex"]
[params]

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://b6pjaen40x34u"
path.s3tc="res://.godot/imported/explosion_texture_flowmap.png-3137b307308713f172b3be796ef584b9.s3tc.ctex"
path.etc2="res://.godot/imported/explosion_texture_flowmap.png-3137b307308713f172b3be796ef584b9.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://entities/weapons/grenade_launcher/assets/textures/explosion_texture_flowmap.png"
dest_files=["res://.godot/imported/explosion_texture_flowmap.png-3137b307308713f172b3be796ef584b9.s3tc.ctex", "res://.godot/imported/explosion_texture_flowmap.png-3137b307308713f172b3be796ef584b9.etc2.ctex"]
dest_files=["res://.godot/imported/explosion_texture_flowmap.png-3137b307308713f172b3be796ef584b9.s3tc.ctex"]
[params]

View file

@ -17,6 +17,7 @@ nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
@ -28,6 +29,7 @@ animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1

View file

@ -192,9 +192,9 @@ visible = false
layout_mode = 2
value = 100.0
fill_mode = 4
texture_progress = ExtResource("6_rrus8")
radial_initial_angle = 293.0
radial_fill_degrees = 135.0
texture_progress = ExtResource("6_rrus8")
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_interval = 0.1

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://cpb6vpa0c74rl"
path.s3tc="res://.godot/imported/waypoint.svg-e7e029f470e2f863636e9426f3893ced.s3tc.ctex"
path.etc2="res://.godot/imported/waypoint.svg-e7e029f470e2f863636e9426f3893ced.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://interfaces/waypoint/assets/waypoint.svg"
dest_files=["res://.godot/imported/waypoint.svg-e7e029f470e2f863636e9426f3893ced.s3tc.ctex", "res://.godot/imported/waypoint.svg-e7e029f470e2f863636e9426f3893ced.etc2.ctex"]
dest_files=["res://.godot/imported/waypoint.svg-e7e029f470e2f863636e9426f3893ced.s3tc.ctex"]
[params]

View file

@ -15,6 +15,8 @@
@tool
class_name Waypoint3D extends Node3D
signal text_changed(new_text: String)
# If `true`, the waypoint sticks to the viewport's edges when moving off-screen.
@export var sticky : bool = true
@ -25,9 +27,7 @@ class_name Waypoint3D extends Node3D
@export var text : String:
set(value):
text = value
# The label's text can only be set once the node is ready.
if is_inside_tree():
label.text = value
text_changed.emit(value)
## The foreground color to modulate the waypoint color
@export var foreground_color : Color = Color.WHITE
@ -37,7 +37,7 @@ class_name Waypoint3D extends Node3D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass
text_changed.connect(label.set_text)
func _process(_delta : float) -> void:
sprite.modulate = foreground_color

View file

@ -9,9 +9,11 @@ script = ExtResource("1_kq7bj")
[node name="Label3D" type="Label3D" parent="."]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
offset = Vector2(0, 48)
billboard = 2
billboard = 1
double_sided = false
no_depth_test = true
fixed_size = true
font_size = 24
line_spacing = 32.025
[node name="Sprite3D" type="Sprite3D" parent="."]

BIN
maps/blaze/assets/blaze.exr Normal file

Binary file not shown.

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bayymrhy4267x"
path="res://.godot/imported/blaze.exr-43b8bafb5f1828acf4d97f7e1f0106be.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/blaze.exr"
dest_files=["res://.godot/imported/blaze.exr-43b8bafb5f1828acf4d97f7e1f0106be.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: 1.8 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://8n7op8gk8r52"
path="res://.godot/imported/Ground068.png-b94c23b9ef93cc384fdaa6c6193d2c88.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068.png"
dest_files=["res://.godot/imported/Ground068.png-b94c23b9ef93cc384fdaa6c6193d2c88.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

View file

@ -0,0 +1,42 @@
<?xml version="1.0"?>
<materialx version="1.38" fileprefix="./">
<standard_surface name="Ground068_1K_PNG_StandardSurface" xpos="6.159420" type="surfaceshader" ypos="-1.879310">
<input name="specular" value="0" type="float" />
<input name="coat" value="1" type="float" />
<input name="coat_color" value="1, 1, 1" type="color3" />
<input name="base" value="1" type="float" />
<input name="base_color" nodename="Ground068_1K_PNG_Color" type="color3" />
<input name="normal" nodename="normalmap" type="vector3" />
<input name="coat_normal" nodename="normalmap" type="vector3" />
<input name="specular_roughness" nodename="Ground068_1K_PNG_Roughness" type="float" />
<input name="coat_roughness" nodename="Ground068_1K_PNG_Roughness" type="float" />
</standard_surface>
<surfacematerial name="Ground068_1K_PNG" xpos="8.695652" type="material" ypos="0.000000">
<input name="surfaceshader" nodename="Ground068_1K_PNG_StandardSurface" type="surfaceshader" />
<input name="displacementshader" nodename="displacement" type="displacementshader" />
</surfacematerial>
<tiledimage name="Ground068_1K_PNG_Color" xpos="3.623188" type="color3" ypos="-3.103448">
<input name="file" value="Ground068_1K-PNG_Color.png" colorspace="srgb_texture" type="filename" />
<input name="uvtiling" value="1.0, 1.0" type="vector2" />
</tiledimage>
<tiledimage name="Ground068_1K_PNG_Displacement" xpos="3.623188" type="float" ypos="5.163793">
<input name="file" value="Ground068_1K-PNG_Displacement.png" type="filename" />
<input name="uvtiling" value="1.0, 1.0" type="vector2" />
</tiledimage>
<displacement name="displacement" xpos="6.159420" type="displacementshader" ypos="1.879310">
<input name="displacement" nodename="Ground068_1K_PNG_Displacement" type="float" />
<input name="scale" value="1.0" type="float" />
</displacement>
<tiledimage name="Ground068_1K_PNG_NormalGL" xpos="1.086957" type="vector3" ypos="0.879310">
<input name="file" value="Ground068_1K-PNG_NormalGL.png" type="filename" />
<input name="uvtiling" value="1.0, 1.0" type="vector2" />
</tiledimage>
<normalmap name="normalmap" xpos="3.623188" type="vector3" ypos="3.586207">
<input name="in" nodename="Ground068_1K_PNG_NormalGL" type="vector3" />
<input name="scale" value="1.0" type="float" />
</normalmap>
<tiledimage name="Ground068_1K_PNG_Roughness" xpos="3.623188" type="float" ypos="-0.413793">
<input name="file" value="Ground068_1K-PNG_Roughness.png" type="filename" />
<input name="uvtiling" value="1.0, 1.0" type="vector2" />
</tiledimage>
</materialx>

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cqiv8ufimrdp1"
path="res://.godot/imported/Ground068_1K-PNG_AmbientOcclusion.png-c5feec392bf17120c5b23b9dbb87c6e7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_AmbientOcclusion.png"
dest_files=["res://.godot/imported/Ground068_1K-PNG_AmbientOcclusion.png-c5feec392bf17120c5b23b9dbb87c6e7.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: 2.2 MiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b3hocnuaq1y5g"
path.bptc="res://.godot/imported/Ground068_1K-PNG_Color.png-6296d72fb7e2274af838a52dde0f3815.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_Color.png"
dest_files=["res://.godot/imported/Ground068_1K-PNG_Color.png-6296d72fb7e2274af838a52dde0f3815.bptc.ctex"]
[params]
compress/mode=2
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=2
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: 1.7 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://4jx5diqu0g0y"
path="res://.godot/imported/Ground068_1K-PNG_Displacement.png-82b5215bee07e1618827c19d93dfbddb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_Displacement.png"
dest_files=["res://.godot/imported/Ground068_1K-PNG_Displacement.png-82b5215bee07e1618827c19d93dfbddb.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: 5.6 MiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c43blkvrhgves"
path.s3tc="res://.godot/imported/Ground068_1K-PNG_NormalDX.png-e9dac81ff40c43a512b79784c6544be2.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_NormalDX.png"
dest_files=["res://.godot/imported/Ground068_1K-PNG_NormalDX.png-e9dac81ff40c43a512b79784c6544be2.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: 5.6 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://rgy08nj7vr3b"
path="res://.godot/imported/Ground068_1K-PNG_NormalGL.png-cdc83ce981058ab880d6422801589c89.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_NormalGL.png"
dest_files=["res://.godot/imported/Ground068_1K-PNG_NormalGL.png-cdc83ce981058ab880d6422801589c89.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: 657 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://svyh8ik0nqaq"
path="res://.godot/imported/Ground068_1K-PNG_Roughness.png-6ca1b86d54142190556cba5010957d00.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_Roughness.png"
dest_files=["res://.godot/imported/Ground068_1K-PNG_Roughness.png-6ca1b86d54142190556cba5010957d00.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: 1.9 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cwbie0p610ml8"
path="res://.godot/imported/Ground074.png-8f48a9275098e464e51ae1812ba23132.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074.png"
dest_files=["res://.godot/imported/Ground074.png-8f48a9275098e464e51ae1812ba23132.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

View file

@ -0,0 +1,42 @@
<?xml version="1.0"?>
<materialx version="1.38" fileprefix="./">
<standard_surface ypos="-1.879310" xpos="6.159420" type="surfaceshader" name="Ground074_1K_PNG_StandardSurface">
<input type="float" value="0" name="specular" />
<input type="float" value="1" name="coat" />
<input type="color3" value="1, 1, 1" name="coat_color" />
<input type="float" value="1" name="base" />
<input type="color3" nodename="Ground074_1K_PNG_Color" name="base_color" />
<input type="vector3" nodename="normalmap" name="normal" />
<input type="vector3" nodename="normalmap" name="coat_normal" />
<input type="float" nodename="Ground074_1K_PNG_Roughness" name="specular_roughness" />
<input type="float" nodename="Ground074_1K_PNG_Roughness" name="coat_roughness" />
</standard_surface>
<surfacematerial ypos="0.000000" xpos="8.695652" type="material" name="Ground074_1K_PNG">
<input type="surfaceshader" nodename="Ground074_1K_PNG_StandardSurface" name="surfaceshader" />
<input type="displacementshader" nodename="displacement" name="displacementshader" />
</surfacematerial>
<tiledimage ypos="-3.103448" xpos="3.623188" type="color3" name="Ground074_1K_PNG_Color">
<input colorspace="srgb_texture" type="filename" value="Ground074_1K-PNG_Color.png" name="file" />
<input type="vector2" value="1.0, 1.0" name="uvtiling" />
</tiledimage>
<tiledimage ypos="5.163793" xpos="3.623188" type="float" name="Ground074_1K_PNG_Displacement">
<input type="filename" value="Ground074_1K-PNG_Displacement.png" name="file" />
<input type="vector2" value="1.0, 1.0" name="uvtiling" />
</tiledimage>
<displacement ypos="1.879310" xpos="6.159420" type="displacementshader" name="displacement">
<input type="float" nodename="Ground074_1K_PNG_Displacement" name="displacement" />
<input type="float" value="1.0" name="scale" />
</displacement>
<tiledimage ypos="0.879310" xpos="1.086957" type="vector3" name="Ground074_1K_PNG_NormalGL">
<input type="filename" value="Ground074_1K-PNG_NormalGL.png" name="file" />
<input type="vector2" value="1.0, 1.0" name="uvtiling" />
</tiledimage>
<normalmap ypos="3.586207" xpos="3.623188" type="vector3" name="normalmap">
<input type="vector3" nodename="Ground074_1K_PNG_NormalGL" name="in" />
<input type="float" value="1.0" name="scale" />
</normalmap>
<tiledimage ypos="-0.413793" xpos="3.623188" type="float" name="Ground074_1K_PNG_Roughness">
<input type="filename" value="Ground074_1K-PNG_Roughness.png" name="file" />
<input type="vector2" value="1.0, 1.0" name="uvtiling" />
</tiledimage>
</materialx>

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bm5owst2wh53e"
path="res://.godot/imported/Ground074_1K-PNG_AmbientOcclusion.png-c5ed6d63f37a1f0b55dab22314bf01f1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074_1K-PNG_AmbientOcclusion.png"
dest_files=["res://.godot/imported/Ground074_1K-PNG_AmbientOcclusion.png-c5ed6d63f37a1f0b55dab22314bf01f1.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: 2.2 MiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cyw6oism6152n"
path.bptc="res://.godot/imported/Ground074_1K-PNG_Color.png-58ebf2bfc30f821c3dacf4da29c89f0c.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074_1K-PNG_Color.png"
dest_files=["res://.godot/imported/Ground074_1K-PNG_Color.png-58ebf2bfc30f821c3dacf4da29c89f0c.bptc.ctex"]
[params]
compress/mode=2
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=2
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: 1.6 MiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d2clq7gtuscif"
path="res://.godot/imported/Ground074_1K-PNG_Displacement.png-872d3266fe1a1b2793e2bfc59930cd97.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074_1K-PNG_Displacement.png"
dest_files=["res://.godot/imported/Ground074_1K-PNG_Displacement.png-872d3266fe1a1b2793e2bfc59930cd97.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: 5.6 MiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dghus3a2kg2fx"
path.bptc="res://.godot/imported/Ground074_1K-PNG_NormalDX.png-4bc7e2721e1f89ccc5d24aa2d77b2540.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074_1K-PNG_NormalDX.png"
dest_files=["res://.godot/imported/Ground074_1K-PNG_NormalDX.png-4bc7e2721e1f89ccc5d24aa2d77b2540.bptc.ctex"]
[params]
compress/mode=2
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=2
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: 5.6 MiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://yk8or1hydypl"
path.s3tc="res://.godot/imported/Ground074_1K-PNG_NormalGL.png-2a281104853dd52db69981ba1c6c5dfd.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074_1K-PNG_NormalGL.png"
dest_files=["res://.godot/imported/Ground074_1K-PNG_NormalGL.png-2a281104853dd52db69981ba1c6c5dfd.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: 636 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dv2qxoc1iu1cx"
path="res://.godot/imported/Ground074_1K-PNG_Roughness.png-e1c4777c6100b98d74813237f1c08372.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074_1K-PNG_Roughness.png"
dest_files=["res://.godot/imported/Ground074_1K-PNG_Roughness.png-e1c4777c6100b98d74813237f1c08372.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

89
maps/blaze/blaze.tscn Normal file
View file

@ -0,0 +1,89 @@
[gd_scene load_steps=15 format=3 uid="uid://rqirbdfmt2g6"]
[ext_resource type="Terrain3DStorage" uid="uid://ba71qjh77d5xe" path="res://maps/blaze/resources/storage.res" id="1_c5mnl"]
[ext_resource type="Script" path="res://maps/map.gd" id="1_mnbe8"]
[ext_resource type="Terrain3DMaterial" uid="uid://by5l8p52isb5w" path="res://maps/blaze/resources/material.tres" id="2_swjtx"]
[ext_resource type="Texture2D" uid="uid://cyw6oism6152n" path="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074_1K-PNG_Color.png" id="4_g7p33"]
[ext_resource type="Texture2D" uid="uid://b3hocnuaq1y5g" path="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_Color.png" id="5_ako74"]
[ext_resource type="Texture2D" uid="uid://c43blkvrhgves" path="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_NormalDX.png" id="6_7no1c"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_8mbvu"]
sky_top_color = Color(0, 0.584314, 0.670588, 1)
sky_horizon_color = Color(0.819608, 0.592157, 0.556863, 1)
sky_curve = 0.235375
ground_bottom_color = Color(0.819608, 0.592157, 0.556863, 1)
ground_horizon_color = Color(0.819608, 0.592157, 0.556863, 1)
[sub_resource type="Sky" id="Sky_mobku"]
sky_material = SubResource("ProceduralSkyMaterial_8mbvu")
[sub_resource type="Environment" id="Environment_3veb0"]
background_mode = 2
sky = SubResource("Sky_mobku")
ambient_light_color = Color(0.5, 0.4, 0, 1)
ambient_light_sky_contribution = 0.75
ambient_light_energy = 2.0
tonemap_mode = 3
ssr_enabled = true
fog_enabled = true
fog_density = 0.0001
fog_aerial_perspective = 1.0
fog_height = 39.86
fog_height_density = 0.005
volumetric_fog_density = 0.005
adjustment_brightness = 0.85
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_g0h3m"]
cull_mode = 2
vertex_color_use_as_albedo = true
backlight_enabled = true
backlight = Color(0.5, 0.5, 0.5, 1)
[sub_resource type="Terrain3DMeshAsset" id="Terrain3DMeshAsset_rwwg2"]
height_offset = 0.5
density = 10.0
material_override = SubResource("StandardMaterial3D_g0h3m")
generated_type = 1
[sub_resource type="Terrain3DTextureAsset" id="Terrain3DTextureAsset_ukab7"]
name = "Rock"
albedo_color = Color(0.898039, 0.760784, 0.905882, 1)
albedo_texture = ExtResource("4_g7p33")
normal_texture = ExtResource("6_7no1c")
[sub_resource type="Terrain3DTextureAsset" id="Terrain3DTextureAsset_wpn65"]
name = "Ground"
id = 1
albedo_color = Color(0.882353, 0.764706, 0.87451, 1)
albedo_texture = ExtResource("5_ako74")
normal_texture = ExtResource("6_7no1c")
[sub_resource type="Terrain3DAssets" id="Terrain3DAssets_rej0g"]
mesh_list = Array[Terrain3DMeshAsset]([SubResource("Terrain3DMeshAsset_rwwg2")])
texture_list = Array[Terrain3DTextureAsset]([SubResource("Terrain3DTextureAsset_ukab7"), SubResource("Terrain3DTextureAsset_wpn65")])
[node name="Blaze" type="Node3D" node_paths=PackedStringArray("players", "objectives")]
script = ExtResource("1_mnbe8")
players = [NodePath("Spawns/PlayerSpawn")]
objectives = [NodePath("Spawns/NeutralObjectiveSpawn")]
[node name="Sunlight" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.204973, 0.153214, -0.966701, 0.88677, 0.388975, 0.249674, 0.414276, -0.908418, -0.0561367, 0, 0, 0)
shadow_enabled = true
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_3veb0")
[node name="Terrain3D" type="Terrain3D" parent="."]
storage = ExtResource("1_c5mnl")
material = ExtResource("2_swjtx")
assets = SubResource("Terrain3DAssets_rej0g")
collision_layer = 2147483649
[node name="Spawns" type="Node" parent="."]
[node name="PlayerSpawn" type="Node3D" parent="Spawns"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 84.3897, 0)
[node name="NeutralObjectiveSpawn" type="Node3D" parent="Spawns"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -383.22, 116.253, -62.8721)

View file

@ -0,0 +1,623 @@
[gd_resource type="Terrain3DMaterial" load_steps=5 format=3 uid="uid://by5l8p52isb5w"]
[sub_resource type="Gradient" id="Gradient_b6eo8"]
offsets = PackedFloat32Array(0.2, 1)
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
[sub_resource type="FastNoiseLite" id="FastNoiseLite_mcady"]
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_r2cfv"]
seamless = true
seamless_blend_skirt = 1.0
color_ramp = SubResource("Gradient_b6eo8")
noise = SubResource("FastNoiseLite_mcady")
[sub_resource type="Shader" id="Shader_ypt1p"]
code = "shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
/* This shader is generated based upon the debug views you have selected.
* The terrain function depends on this shader. So don't change:
* - vertex positioning in vertex()
* - terrain normal calculation in fragment()
* - the last function being fragment() as the editor injects code before the closing }
*
* Most will only want to customize the material calculation and PBR application in fragment()
*
* Uniforms that begin with _ are private and will not display in the inspector. However,
* you can set them via code. You are welcome to create more of your own hidden uniforms.
*
* This system only supports albedo, height, normal, roughness. Most textures don't need the other
* PBR channels. Height can be used as an approximation for AO. For the rare textures do need
* additional channels, you can add maps for that one texture. e.g. an emissive map for lava.
*
*/
// Private uniforms
uniform float _region_size = 1024.0;
uniform float _region_texel_size = 0.0009765625; // = 1/1024
uniform float _mesh_vertex_spacing = 1.0;
uniform float _mesh_vertex_density = 1.0; // = 1/_mesh_vertex_spacing
uniform int _region_map_size = 16;
uniform int _region_map[256];
uniform vec2 _region_offsets[256];
uniform sampler2DArray _height_maps : repeat_disable;
uniform usampler2DArray _control_maps : repeat_disable;
uniform sampler2DArray _color_maps : source_color, filter_linear_mipmap_anisotropic, repeat_disable;
uniform sampler2DArray _texture_array_albedo : source_color, filter_linear_mipmap_anisotropic, repeat_enable;
uniform sampler2DArray _texture_array_normal : hint_normal, filter_linear_mipmap_anisotropic, repeat_enable;
uniform sampler2D noise_texture : source_color, filter_linear_mipmap_anisotropic, repeat_enable;
uniform float _texture_uv_scale_array[32];
uniform float _texture_detile_array[32];
uniform vec4 _texture_color_array[32];
uniform uint _background_mode = 1u; // NONE = 0, FLAT = 1, NOISE = 2
uniform uint _mouse_layer = 0x80000000u; // Layer 32
// Public uniforms
uniform float vertex_normals_distance : hint_range(0, 1024) = 128.0;
uniform bool height_blending = true;
uniform float blend_sharpness : hint_range(0, 1) = 0.87;
uniform float auto_slope : hint_range(0, 10) = 1.0;
uniform float auto_height_reduction : hint_range(0, 1) = 0.1;
uniform int auto_base_texture : hint_range(0, 31) = 0;
uniform int auto_overlay_texture : hint_range(0, 31) = 1;
uniform int dual_scale_texture : hint_range(0,31) = 0;
uniform float dual_scale_reduction : hint_range(0.001,1) = 0.3;
uniform float tri_scale_reduction : hint_range(0.001,1) = 0.3;
uniform float dual_scale_far : hint_range(0,1000) = 170.0;
uniform float dual_scale_near : hint_range(0,1000) = 100.0;
uniform vec3 macro_variation1 : source_color = vec3(1.);
uniform vec3 macro_variation2 : source_color = vec3(1.);
// Generic noise at 3 scales, which can be used for anything
uniform float noise1_scale : hint_range(0.001, 1.) = 0.04; // Used for macro variation 1. Scaled up 10x
uniform float noise1_angle : hint_range(0, 6.283) = 0.;
uniform vec2 noise1_offset = vec2(0.5);
uniform float noise2_scale : hint_range(0.001, 1.) = 0.076; // Used for macro variation 2. Scaled up 10x
uniform float noise3_scale : hint_range(0.001, 1.) = 0.225; // Used for texture blending edge.
// Varyings & Types
struct Material {
vec4 alb_ht;
vec4 nrm_rg;
int base;
int over;
float blend;
};
varying flat vec3 v_vertex; // World coordinate vertex location
varying flat vec3 v_camera_pos;
varying float v_vertex_xz_dist;
varying flat ivec3 v_region;
varying flat vec2 v_uv_offset;
varying flat vec2 v_uv2_offset;
varying vec3 v_normal;
varying float v_region_border_mask;
////////////////////////
// Vertex
////////////////////////
// Takes in UV world space coordinates, returns ivec3 with:
// XY: (0 to _region_size) coordinates within a region
// Z: layer index used for texturearrays, -1 if not in a region
ivec3 get_region_uv(vec2 uv) {
uv *= _region_texel_size;
ivec2 pos = ivec2(floor(uv)) + (_region_map_size / 2);
int bounds = int(pos.x >= 0 && pos.x < _region_map_size && pos.y >= 0 && pos.y < _region_map_size);
int layer_index = _region_map[ pos.y * _region_map_size + pos.x ] * bounds - 1;
return ivec3(ivec2((uv - _region_offsets[layer_index]) * _region_size), layer_index);
}
// Takes in UV2 region space coordinates, returns vec3 with:
// XY: (0 to 1) coordinates within a region
// Z: layer index used for texturearrays, -1 if not in a region
vec3 get_region_uv2(vec2 uv) {
// Vertex function added half a texel to UV2, to center the UV's. vertex(), fragment() and get_height()
// call this with reclaimed versions of UV2, so to keep the last row/column within the correct
// window, take back the half pixel before the floor().
ivec2 pos = ivec2(floor(uv - vec2(_region_texel_size * 0.5))) + (_region_map_size / 2);
int bounds = int(pos.x >= 0 && pos.x < _region_map_size && pos.y >= 0 && pos.y < _region_map_size);
int layer_index = _region_map[ pos.y * _region_map_size + pos.x ] * bounds - 1;
// The return value is still texel-centered.
return vec3(uv - _region_offsets[layer_index], float(layer_index));
}
// World Noise
uniform sampler2D _region_blend_map : hint_default_black, filter_linear, repeat_disable;
uniform int world_noise_max_octaves : hint_range(0, 15) = 4;
uniform int world_noise_min_octaves : hint_range(0, 15) = 2;
uniform float world_noise_lod_distance : hint_range(0, 40000, 1) = 7500.;
uniform float world_noise_scale : hint_range(0.25, 20, 0.01) = 5.0;
uniform float world_noise_height : hint_range(0, 1000, 0.1) = 64.0;
uniform vec3 world_noise_offset = vec3(0.0);
uniform float world_noise_blend_near : hint_range(0, .95, 0.01) = 0.5;
uniform float world_noise_blend_far : hint_range(.05, 1, 0.01) = 1.0;
float hashf(float f) {
return fract(sin(f) * 1e4);
}
float hashv2(vec2 v) {
return fract(1e4 * sin(17.0 * v.x + v.y * 0.1) * (0.1 + abs(sin(v.y * 13.0 + v.x))));
}
// https://iquilezles.org/articles/morenoise/
vec3 noise2D(vec2 x) {
vec2 f = fract(x);
// Quintic Hermine Curve. Similar to SmoothStep()
vec2 u = f*f*f*(f*(f*6.0-15.0)+10.0);
vec2 du = 30.0*f*f*(f*(f-2.0)+1.0);
vec2 p = floor(x);
// Four corners in 2D of a tile
float a = hashv2( p+vec2(0,0) );
float b = hashv2( p+vec2(1,0) );
float c = hashv2( p+vec2(0,1) );
float d = hashv2( p+vec2(1,1) );
// Mix 4 corner percentages
float k0 = a;
float k1 = b - a;
float k2 = c - a;
float k3 = a - b - c + d;
return vec3( k0 + k1 * u.x + k2 * u.y + k3 * u.x * u.y,
du * ( vec2(k1, k2) + k3 * u.yx) );
}
float world_noise(vec2 p) {
float a = 0.0;
float b = 1.0;
vec2 d = vec2(0.0);
int octaves = int( clamp(
float(world_noise_max_octaves) - floor(v_vertex_xz_dist/(world_noise_lod_distance)),
float(world_noise_min_octaves), float(world_noise_max_octaves)) );
for( int i=0; i < octaves; i++ ) {
vec3 n = noise2D(p);
d += n.yz;
a += b * n.x / (1.0 + dot(d,d));
b *= 0.5;
p = mat2( vec2(0.8, -0.6), vec2(0.6, 0.8) ) * p * 2.0;
}
return a;
}
// World Noise end
// 1 lookup
float get_height(vec2 uv) {
highp float height = 0.0;
vec3 region = get_region_uv2(uv);
if (region.z >= 0.) {
height = texture(_height_maps, region).r;
}
// World Noise
if (_background_mode == 2u) {
float weight = texture(_region_blend_map, (uv / float(_region_map_size)) + 0.5).r;
float rmap_half_size = float(_region_map_size) * .5;
if (abs(uv.x) > rmap_half_size + .5 || abs(uv.y) > rmap_half_size + .5) {
weight = 0.;
} else {
if (abs(uv.x) > rmap_half_size - .5) {
weight = mix(weight, 0., abs(uv.x) - (rmap_half_size-.5));
}
if (abs(uv.y) > rmap_half_size - .5) {
weight = mix(weight, 0., abs(uv.y) - (rmap_half_size-.5));
}
}
height = mix(height, world_noise((uv + world_noise_offset.xz) * world_noise_scale * .1) *
world_noise_height * 10. + world_noise_offset.y * 100.,
clamp(smoothstep(world_noise_blend_near, world_noise_blend_far, 1.0 - weight), 0.0, 1.0));
}
return height;
}
void vertex() {
// Get camera pos in world vertex coords
v_camera_pos = INV_VIEW_MATRIX[3].xyz;
// Get vertex of flat plane in world coordinates and set world UV
v_vertex = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz;
// Camera distance to vertex on flat plane
v_vertex_xz_dist = length(v_vertex.xz - v_camera_pos.xz);
// UV coordinates in world space. Values are 0 to _region_size within regions
UV = round(v_vertex.xz * _mesh_vertex_density);
// UV coordinates in region space + texel offset. Values are 0 to 1 within regions
UV2 = (UV + vec2(0.5)) * _region_texel_size;
// Discard vertices for Holes. 1 lookup
v_region = get_region_uv(UV);
uint control = texelFetch(_control_maps, v_region, 0).r;
bool hole = bool(control >>2u & 0x1u);
// Show holes to all cameras except mouse camera (on exactly 1 layer)
if ( !(CAMERA_VISIBLE_LAYERS == _mouse_layer) &&
(hole || (_background_mode == 0u && v_region.z < 0)) ) {
VERTEX.x = 0. / 0.;
} else {
// Set final vertex height & calculate vertex normals. 3 lookups.
VERTEX.y = get_height(UV2);
v_vertex.y = VERTEX.y;
v_normal = vec3(
v_vertex.y - get_height(UV2 + vec2(_region_texel_size, 0)),
_mesh_vertex_spacing,
v_vertex.y - get_height(UV2 + vec2(0, _region_texel_size))
);
// Due to a bug caused by the GPUs linear interpolation across edges of region maps,
// mask region edges and use vertex normals only across region boundaries.
v_region_border_mask = mod(UV.x + 2.5, _region_size) - fract(UV.x) < 5.0 || mod(UV.y + 2.5, _region_size) - fract(UV.y) < 5.0 ? 1. : 0.;
}
// Transform UVs to local to avoid poor precision during varying interpolation.
v_uv_offset = MODEL_MATRIX[3].xz * _mesh_vertex_density;
UV -= v_uv_offset;
v_uv2_offset = v_uv_offset * _region_texel_size;
UV2 -= v_uv2_offset;
}
////////////////////////
// Fragment
////////////////////////
// 0 - 3 lookups
vec3 get_normal(vec2 uv, out vec3 tangent, out vec3 binormal) {
float u, v, height;
vec3 normal;
// Use vertex normals within radius of vertex_normals_distance, and along region borders.
if (v_region_border_mask > 0.5 || v_vertex_xz_dist < vertex_normals_distance) {
normal = normalize(v_normal);
} else {
height = get_height(uv);
u = height - get_height(uv + vec2(_region_texel_size, 0));
v = height - get_height(uv + vec2(0, _region_texel_size));
normal = normalize(vec3(u, _mesh_vertex_spacing, v));
}
tangent = cross(normal, vec3(0, 0, 1));
binormal = cross(normal, tangent);
return normal;
}
vec3 unpack_normal(vec4 rgba) {
vec3 n = rgba.xzy * 2.0 - vec3(1.0);
n.z *= -1.0;
return n;
}
vec4 pack_normal(vec3 n, float a) {
n.z *= -1.0;
return vec4((n.xzy + vec3(1.0)) * 0.5, a);
}
float random(in vec2 xy) {
return fract(sin(dot(xy, vec2(12.9898, 78.233))) * 43758.5453);
}
vec2 rotate(vec2 v, float cosa, float sina) {
return vec2(cosa * v.x - sina * v.y, sina * v.x + cosa * v.y);
}
// Moves a point around a pivot point.
vec2 rotate_around(vec2 point, vec2 pivot, float angle){
float x = pivot.x + (point.x - pivot.x) * cos(angle) - (point.y - pivot.y) * sin(angle);
float y = pivot.y + (point.x - pivot.x) * sin(angle) + (point.y - pivot.y) * cos(angle);
return vec2(x, y);
}
vec4 height_blend(vec4 a_value, float a_height, vec4 b_value, float b_height, float blend) {
if(height_blending) {
float ma = max(a_height + (1.0 - blend), b_height + blend) - (1.001 - blend_sharpness);
float b1 = max(a_height + (1.0 - blend) - ma, 0.0);
float b2 = max(b_height + blend - ma, 0.0);
return (a_value * b1 + b_value * b2) / (b1 + b2);
} else {
float contrast = 1.0 - blend_sharpness;
float factor = (blend - contrast) / contrast;
return mix(a_value, b_value, clamp(factor, 0.0, 1.0));
}
}
vec2 detiling(vec2 uv, vec2 uv_center, int mat_id, inout float normal_rotation){
if (_texture_detile_array[mat_id] >= 0.001){
uv_center = floor(uv_center) + 0.5;
float detile = (random(uv_center) - 0.5) * 2.0 * TAU * _texture_detile_array[mat_id]; // -180deg to 180deg
uv = rotate_around(uv, uv_center, detile);
// Accumulate total rotation for normal rotation
normal_rotation += detile;
}
return uv;
}
vec2 rotate_normal(vec2 normal, float angle) {
angle += PI * 0.5;
float new_y = dot(vec2(cos(angle), sin(angle)), normal);
angle -= PI * 0.5;
float new_x = dot(vec2(cos(angle) ,sin(angle)) ,normal);
return vec2(new_x, new_y);
}
// 2-4 lookups
void get_material(vec2 base_uv, uint control, ivec3 iuv_center, vec3 normal, out Material out_mat) {
out_mat = Material(vec4(0.), vec4(0.), 0, 0, 0.0);
vec2 uv_center = vec2(iuv_center.xy);
int region = iuv_center.z;
// Enable Autoshader if outside regions or painted in regions, otherwise manual painted
bool auto_shader = region < 0 || bool(control & 0x1u);
out_mat.base = int(auto_shader) * auto_base_texture + int(!auto_shader) * int(control >>27u & 0x1Fu);
out_mat.over = int(auto_shader) * auto_overlay_texture + int(!auto_shader) * int(control >> 22u & 0x1Fu);
out_mat.blend = float(auto_shader) * clamp(
dot(vec3(0., 1., 0.), normal * auto_slope * 2. - (auto_slope * 2. - 1.))
- auto_height_reduction * .01 * v_vertex.y // Reduce as vertices get higher
, 0., 1.) +
float(!auto_shader) * float(control >>14u & 0xFFu) * 0.003921568627450; // 1./255.0
// Control map scale & rotation, apply to both base and
// uv_center. Translate uv center to the current region.
uv_center += _region_offsets[region] * _region_size;
// Define base scale from control map value as array index. 0.5 as baseline.
float[8] scale_array = { 0.5, 0.4, 0.3, 0.2, 0.1, 0.8, 0.7, 0.6};
float control_scale = scale_array[(control >>7u & 0x7u)];
base_uv *= control_scale;
uv_center *= control_scale;
// calculate baseline derivatives
vec2 ddx = dFdxCoarse(base_uv);
vec2 ddy = dFdyCoarse(base_uv);
// Apply global uv rotation from control map.
float uv_rotation = float(control >>10u & 0xFu) / 16. * TAU;
base_uv = rotate_around(base_uv, vec2(0), uv_rotation);
uv_center = rotate_around(uv_center, vec2(0), uv_rotation);
vec2 matUV = base_uv;
vec4 albedo_ht = vec4(0.);
vec4 normal_rg = vec4(0.5f, 0.5f, 1.0f, 1.0f);
vec4 albedo_far = vec4(0.);
vec4 normal_far = vec4(0.5f, 0.5f, 1.0f, 1.0f);
float mat_scale = _texture_uv_scale_array[out_mat.base];
float normal_angle = uv_rotation;
vec2 ddx1 = ddx;
vec2 ddy1 = ddy;
// If dual scaling, apply to base texture
if(region < 0) {
mat_scale *= tri_scale_reduction;
}
//each time we change scale, recalculate antitiling from baseline to maintain continuity.
matUV = detiling(base_uv * mat_scale, uv_center * mat_scale, out_mat.base, normal_angle);
ddx1 *= mat_scale;
ddy1 *= mat_scale;
albedo_ht = textureGrad(_texture_array_albedo, vec3(matUV, float(out_mat.base)), ddx1, ddy1);
normal_rg = textureGrad(_texture_array_normal, vec3(matUV, float(out_mat.base)), ddx1, ddy1);
// Unpack & rotate base normal for blending
normal_rg.xz = unpack_normal(normal_rg).xz;
normal_rg.xz = rotate_normal(normal_rg.xz, normal_angle);
if(out_mat.base == dual_scale_texture || out_mat.over == dual_scale_texture) {
mat_scale *= dual_scale_reduction;
ddx1 *= dual_scale_reduction;
ddy1 *= dual_scale_reduction;
float dual_scale_normal = uv_rotation; //do not add near & far rotations
// Do not apply detiling if tri-scale reduction occurs.
matUV = region < 0 ? base_uv * mat_scale : detiling(base_uv * mat_scale, uv_center * mat_scale, dual_scale_texture, dual_scale_normal);
albedo_far = textureGrad(_texture_array_albedo, vec3(matUV, float(dual_scale_texture)), ddx1, ddy1);
normal_far = textureGrad(_texture_array_normal, vec3(matUV, float(dual_scale_texture)), ddx1, ddy1);
// Unpack & rotate dual scale normal for blending
normal_far.xz = unpack_normal(normal_far).xz;
normal_far.xz = rotate_normal(normal_far.xz, dual_scale_normal);
}
float far_factor = clamp(smoothstep(dual_scale_near, dual_scale_far, length(v_vertex - v_camera_pos)), 0.0, 1.0);
if(out_mat.base == dual_scale_texture) {
albedo_ht = mix(albedo_ht, albedo_far, far_factor);
normal_rg = mix(normal_rg, normal_far, far_factor);
}
// Apply color to base
albedo_ht.rgb *= _texture_color_array[out_mat.base].rgb;
// Setup overlay texture to blend
float mat_scale2 = _texture_uv_scale_array[out_mat.over];
float normal_angle2 = uv_rotation;
vec2 matUV2 = detiling(base_uv * mat_scale2, uv_center * mat_scale2, out_mat.over, normal_angle2);
vec2 ddx2 = ddx * mat_scale2;
vec2 ddy2 = ddy * mat_scale2;
vec4 albedo_ht2 = textureGrad(_texture_array_albedo, vec3(matUV2, float(out_mat.over)), ddx2, ddy2);
vec4 normal_rg2 = textureGrad(_texture_array_normal, vec3(matUV2, float(out_mat.over)), ddx2, ddy2);
// Though it would seem having the above lookups in this block, or removing the branch would
// be more optimal, the first introduces artifacts #276, and the second is noticably slower.
// It seems the branching off dual scaling and the color array lookup is more optimal.
if (out_mat.blend > 0.f) {
// Unpack & rotate overlay normal for blending
normal_rg2.xz = unpack_normal(normal_rg2).xz;
normal_rg2.xz = rotate_normal(normal_rg2.xz, normal_angle2);
// If dual scaling, apply to overlay texture
if(out_mat.over == dual_scale_texture) {
albedo_ht2 = mix(albedo_ht2, albedo_far, far_factor);
normal_rg2 = mix(normal_rg2, normal_far, far_factor);
}
// Apply color to overlay
albedo_ht2.rgb *= _texture_color_array[out_mat.over].rgb;
// Blend overlay and base
albedo_ht = height_blend(albedo_ht, albedo_ht.a, albedo_ht2, albedo_ht2.a, out_mat.blend);
normal_rg = height_blend(normal_rg, albedo_ht.a, normal_rg2, albedo_ht2.a, out_mat.blend);
}
// Repack normals and return material
normal_rg = pack_normal(normal_rg.xyz, normal_rg.a);
out_mat.alb_ht = albedo_ht;
out_mat.nrm_rg = normal_rg;
return;
}
float blend_weights(float weight, float detail) {
weight = smoothstep(0.0, 1.0, weight);
weight = sqrt(weight * 0.5);
float result = max(0.1 * weight, 10.0 * (weight + detail) + 1.0f - (detail + 10.0));
return result;
}
void fragment() {
// Recover UVs
vec2 uv = UV + v_uv_offset;
vec2 uv2 = UV2 + v_uv2_offset;
// Calculate Terrain Normals. 4 lookups
vec3 w_tangent, w_binormal;
vec3 w_normal = get_normal(uv2, w_tangent, w_binormal);
NORMAL = mat3(VIEW_MATRIX) * w_normal;
TANGENT = mat3(VIEW_MATRIX) * w_tangent;
BINORMAL = mat3(VIEW_MATRIX) * w_binormal;
// Idenfity 4 vertices surrounding this pixel
vec2 texel_pos = uv;
highp vec2 texel_pos_floor = floor(uv);
// Create a cross hatch grid of alternating 0/1 horizontal and vertical stripes 1 unit wide in XY
vec4 mirror = vec4(fract(texel_pos_floor * 0.5) * 2.0, 1.0, 1.0);
// And the opposite grid in ZW
mirror.zw = vec2(1.0) - mirror.xy;
// Get the region and control map ID for the vertices
ivec3 indexUV[4] = {
get_region_uv(texel_pos_floor + mirror.xy),
get_region_uv(texel_pos_floor + mirror.xw),
get_region_uv(texel_pos_floor + mirror.zy),
get_region_uv(texel_pos_floor + mirror.zw)
};
// Lookup adjacent vertices. 4 lookups
uint control[4] = {
texelFetch(_control_maps, indexUV[0], 0).r,
texelFetch(_control_maps, indexUV[1], 0).r,
texelFetch(_control_maps, indexUV[2], 0).r,
texelFetch(_control_maps, indexUV[3], 0).r
};
// Get the textures for each vertex. 8-16 lookups (2-4 ea)
Material mat[4];
get_material(uv, control[0], indexUV[0], w_normal, mat[0]);
get_material(uv, control[1], indexUV[1], w_normal, mat[1]);
get_material(uv, control[2], indexUV[2], w_normal, mat[2]);
get_material(uv, control[3], indexUV[3], w_normal, mat[3]);
// Macro variation. 2 Lookups
float noise1 = texture(noise_texture, rotate(uv * noise1_scale * .1, cos(noise1_angle), sin(noise1_angle)) + noise1_offset).r;
float noise2 = texture(noise_texture, uv * noise2_scale * .1).r;
vec3 macrov = mix(macro_variation1, vec3(1.), clamp(noise1 + v_vertex_xz_dist * .0002, 0., 1.));
macrov *= mix(macro_variation2, vec3(1.), clamp(noise2 + v_vertex_xz_dist * .0002, 0., 1.));
// Calculate weight for the pixel position between the vertices
// Bilinear interpolation of difference of uv and floor(uv)
vec2 weights1 = clamp(texel_pos - texel_pos_floor, 0, 1);
weights1 = mix(weights1, vec2(1.0) - weights1, mirror.xy);
vec2 weights0 = vec2(1.0) - weights1;
// Adjust final weights by texture's height/depth + noise. 1 lookup
float noise3 = texture(noise_texture, uv * noise3_scale).r;
vec4 weights;
weights.x = blend_weights(weights0.x * weights0.y, clamp(mat[0].alb_ht.a + noise3, 0., 1.));
weights.y = blend_weights(weights0.x * weights1.y, clamp(mat[1].alb_ht.a + noise3, 0., 1.));
weights.z = blend_weights(weights1.x * weights0.y, clamp(mat[2].alb_ht.a + noise3, 0., 1.));
weights.w = blend_weights(weights1.x * weights1.y, clamp(mat[3].alb_ht.a + noise3, 0., 1.));
float weight_sum = weights.x + weights.y + weights.z + weights.w;
float weight_inv = 1.0 / weight_sum;
// Weighted average of albedo & height
vec4 albedo_height = weight_inv * (
mat[0].alb_ht * weights.x +
mat[1].alb_ht * weights.y +
mat[2].alb_ht * weights.z +
mat[3].alb_ht * weights.w );
// Weighted average of normal & rough
vec4 normal_rough = weight_inv * (
mat[0].nrm_rg * weights.x +
mat[1].nrm_rg * weights.y +
mat[2].nrm_rg * weights.z +
mat[3].nrm_rg * weights.w );
// Determine if we're in a region or not (region_uv.z>0)
vec3 region_uv = get_region_uv2(uv2);
// Colormap. 1 lookup
vec4 color_map = vec4(1., 1., 1., .5);
if (region_uv.z >= 0.) {
float lod = textureQueryLod(_color_maps, uv2.xy).y;
color_map = textureLod(_color_maps, region_uv, lod);
}
// Wetness/roughness modifier, converting 0-1 range to -1 to 1 range
float roughness = fma(color_map.a - 0.5, 2.0, normal_rough.a);
// Apply PBR
ALBEDO = albedo_height.rgb * color_map.rgb * macrov;
ROUGHNESS = roughness;
SPECULAR = 1. - normal_rough.a;
NORMAL_MAP = normal_rough.rgb;
NORMAL_MAP_DEPTH = 1.0;
}
"
[resource]
_shader_parameters = {
"auto_base_texture": 0,
"auto_height_reduction": 0.15,
"auto_overlay_texture": 1,
"auto_slope": 1.25,
"blend_sharpness": 0.7,
"dual_scale_far": 170.0,
"dual_scale_near": 100.0,
"dual_scale_reduction": 0.2,
"dual_scale_texture": 1,
"height_blending": true,
"macro_variation1": Color(0.8, 1, 0.8, 1),
"macro_variation2": Color(0.6, 0.75, 0.6, 1),
"noise1_angle": 0.0,
"noise1_offset": Vector2(0.5, 0.5),
"noise1_scale": 0.165,
"noise2_scale": 0.076,
"noise3_scale": 0.225,
"noise_texture": SubResource("NoiseTexture2D_r2cfv"),
"tri_scale_reduction": 0.125,
"vertex_normals_distance": 128.0,
"world_noise_blend_far": 1.0,
"world_noise_blend_near": 0.5,
"world_noise_height": 24.0,
"world_noise_lod_distance": 7500.0,
"world_noise_max_octaves": 4,
"world_noise_min_octaves": 2,
"world_noise_offset": Vector3(0, 0, 0),
"world_noise_scale": 16.0
}
world_background = 2
auto_shader = true
dual_scaling = true
shader_override_enabled = true
shader_override = SubResource("Shader_ypt1p")

Binary file not shown.

View file

@ -0,0 +1,23 @@
[gd_resource type="Terrain3DTextureList" load_steps=7 format=3 uid="uid://cagob7oo8lyew"]
[ext_resource type="Texture2D" uid="uid://cyw6oism6152n" path="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074_1K-PNG_Color.png" id="1_fwk7q"]
[ext_resource type="Texture2D" uid="uid://cr3i366ttq5ac" path="res://maps/blaze/assets/textures/Rock035_1K-PNG/Rock035_1K-PNG_NormalGL.png" id="2_hi28g"]
[ext_resource type="Texture2D" uid="uid://cngjywcua4vv8" path="res://maps/desert/assets/textures/ground054_alb_ht.png" id="3_08gvu"]
[ext_resource type="Texture2D" uid="uid://cbk7l6hs0yrcc" path="res://maps/desert/assets/textures/ground054_nrm_rgh.png" id="4_52t6p"]
[sub_resource type="Terrain3DTexture" id="Terrain3DTexture_wue72"]
name = "Rock"
albedo_texture = ExtResource("1_fwk7q")
normal_texture = ExtResource("2_hi28g")
uv_scale = 0.05
[sub_resource type="Terrain3DTexture" id="Terrain3DTexture_dkh73"]
name = "Sand"
texture_id = 1
albedo_color = Color(0.792157, 0.72549, 0.694118, 1)
albedo_texture = ExtResource("3_08gvu")
normal_texture = ExtResource("4_52t6p")
uv_scale = 0.15
[resource]
textures = Array[Terrain3DTexture]([SubResource("Terrain3DTexture_wue72"), SubResource("Terrain3DTexture_dkh73")])

View file

@ -17,6 +17,7 @@ nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
@ -28,6 +29,7 @@ animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={
"nodes": {

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://cngjywcua4vv8"
path.bptc="res://.godot/imported/ground054_alb_ht.png-460d3ac5c09d7955ca61b8b57742b1a9.bptc.ctex"
path.astc="res://.godot/imported/ground054_alb_ht.png-460d3ac5c09d7955ca61b8b57742b1a9.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://maps/desert/assets/textures/ground054_alb_ht.png"
dest_files=["res://.godot/imported/ground054_alb_ht.png-460d3ac5c09d7955ca61b8b57742b1a9.bptc.ctex", "res://.godot/imported/ground054_alb_ht.png-460d3ac5c09d7955ca61b8b57742b1a9.astc.ctex"]
dest_files=["res://.godot/imported/ground054_alb_ht.png-460d3ac5c09d7955ca61b8b57742b1a9.bptc.ctex"]
[params]

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://cbk7l6hs0yrcc"
path.bptc="res://.godot/imported/ground054_nrm_rgh.png-9ea209f1a7f6e48624db85005a037890.bptc.ctex"
path.astc="res://.godot/imported/ground054_nrm_rgh.png-9ea209f1a7f6e48624db85005a037890.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://maps/desert/assets/textures/ground054_nrm_rgh.png"
dest_files=["res://.godot/imported/ground054_nrm_rgh.png-9ea209f1a7f6e48624db85005a037890.bptc.ctex", "res://.godot/imported/ground054_nrm_rgh.png-9ea209f1a7f6e48624db85005a037890.astc.ctex"]
dest_files=["res://.godot/imported/ground054_nrm_rgh.png-9ea209f1a7f6e48624db85005a037890.bptc.ctex"]
[params]

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://dwk8islw7ebab"
path.bptc="res://.godot/imported/rock029_alb_ht.png-dd746789bc129bafaa8d1cc908de0e3e.bptc.ctex"
path.astc="res://.godot/imported/rock029_alb_ht.png-dd746789bc129bafaa8d1cc908de0e3e.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://maps/desert/assets/textures/rock029_alb_ht.png"
dest_files=["res://.godot/imported/rock029_alb_ht.png-dd746789bc129bafaa8d1cc908de0e3e.bptc.ctex", "res://.godot/imported/rock029_alb_ht.png-dd746789bc129bafaa8d1cc908de0e3e.astc.ctex"]
dest_files=["res://.godot/imported/rock029_alb_ht.png-dd746789bc129bafaa8d1cc908de0e3e.bptc.ctex"]
[params]

View file

@ -4,16 +4,15 @@ importer="texture"
type="CompressedTexture2D"
uid="uid://lgfhdcsb2ryx"
path.bptc="res://.godot/imported/rock029_nrm_rgh.png-3bf029664d0f58a1c79abd2d6666ba90.bptc.ctex"
path.astc="res://.godot/imported/rock029_nrm_rgh.png-3bf029664d0f58a1c79abd2d6666ba90.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://maps/desert/assets/textures/rock029_nrm_rgh.png"
dest_files=["res://.godot/imported/rock029_nrm_rgh.png-3bf029664d0f58a1c79abd2d6666ba90.bptc.ctex", "res://.godot/imported/rock029_nrm_rgh.png-3bf029664d0f58a1c79abd2d6666ba90.astc.ctex"]
dest_files=["res://.godot/imported/rock029_nrm_rgh.png-3bf029664d0f58a1c79abd2d6666ba90.bptc.ctex"]
[params]
@ -33,4 +32,4 @@ 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
detect_3d/compress_to=0

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=7 format=3 uid="uid://btlkog4b87p4x"]
[gd_scene load_steps=8 format=3 uid="uid://btlkog4b87p4x"]
[ext_resource type="Terrain3DStorage" uid="uid://wgmg245njt8e" path="res://maps/desert/resources/storage.res" id="1_lmk23"]
[ext_resource type="Terrain3DMaterial" uid="uid://c3isipd4wqxpk" path="res://maps/desert/resources/material.tres" id="2_n44fh"]
[ext_resource type="Terrain3DTextureList" uid="uid://d1j24k8sq8qpj" path="res://maps/desert/resources/textures.tres" id="3_w6mwl"]
[ext_resource type="Terrain3DAssets" uid="uid://d1j24k8sq8qpj" path="res://maps/desert/resources/textures.tres" id="3_w6mwl"]
[ext_resource type="Environment" uid="uid://nw62ce5cglvs" path="res://maps/desert/resources/env.tres" id="4_m7p64"]
[ext_resource type="Script" path="res://maps/map.gd" id="4_o1mfe"]
[ext_resource type="PackedScene" uid="uid://b40ts3kdv4in0" path="res://maps/desert/assets/boundaries.glb" id="5_dyuqn"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_wu2oa"]
@ -13,9 +14,10 @@ backface_collision = true
[node name="Desert" type="Terrain3D"]
storage = ExtResource("1_lmk23")
material = ExtResource("2_n44fh")
texture_list = ExtResource("3_w6mwl")
assets = ExtResource("3_w6mwl")
collision_layer = 2147483648
collision_mask = 2147483648
script = ExtResource("4_o1mfe")
[node name="Sunlight" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.5, 0.55667, -0.663414, 0, 0.766044, 0.642788, 0.866025, -0.321394, 0.383022, -1613.38, 2730.74, 446.64)

View file

@ -31,8 +31,8 @@ _shader_parameters = {
"blend_sharpness": 0.85,
"dual_scale_far": 100.0,
"dual_scale_near": 0.0,
"dual_scale_reduction": 0.8,
"dual_scale_texture": 1,
"dual_scale_reduction": 0.3,
"dual_scale_texture": 0,
"height_blending": true,
"macro_variation1": Color(1, 1, 1, 1),
"macro_variation2": Color(0.968627, 0.929412, 0.905882, 1),
@ -43,7 +43,7 @@ _shader_parameters = {
"noise3_scale": 0.225,
"noise_texture": SubResource("NoiseTexture2D_esvkc"),
"tri_scale_reduction": 0.075,
"vertex_normals_distance": null,
"vertex_normals_distance": 0.0,
"world_noise_blend_far": 1.0,
"world_noise_blend_near": 0.75,
"world_noise_height": 50.0,

Binary file not shown.

File diff suppressed because one or more lines are too long

13
maps/map.gd Normal file
View file

@ -0,0 +1,13 @@
class_name Map extends Node
@export_group("Spawns")
@export var players : Array[Node]
@export var objectives : Array[Node]
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#pass

View file

@ -12,7 +12,7 @@ config_version=5
config/name="open-fpsz"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.2", "Forward Plus")
config/features=PackedStringArray("4.3", "Forward Plus")
config/icon="res://icon.svg"
[autoload]
@ -29,7 +29,6 @@ gdscript/warnings/unused_variable=2
gdscript/warnings/unused_local_constant=2
gdscript/warnings/unused_private_class_variable=2
gdscript/warnings/unused_parameter=2
gdscript/warnings/unused_signal=2
gdscript/warnings/shadowed_variable=2
gdscript/warnings/shadowed_variable_base_class=2
gdscript/warnings/shadowed_global_identifier=2
@ -38,11 +37,11 @@ gdscript/warnings/unreachable_pattern=2
gdscript/warnings/standalone_expression=2
gdscript/warnings/standalone_ternary=2
gdscript/warnings/incompatible_ternary=2
gdscript/warnings/untyped_declaration=1
gdscript/warnings/static_called_on_instance=0
gdscript/warnings/property_used_as_function=2
gdscript/warnings/constant_used_as_function=2
gdscript/warnings/function_used_as_property=2
gdscript/warnings/untyped_declaration=1
gdscript/warnings/static_called_on_instance=0
[display]
@ -64,27 +63,27 @@ import/blender/enabled=false
forward={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
]
}
left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
]
}
right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
]
}
backward={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
]
}
ski={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
]
}
secondary={
@ -94,22 +93,22 @@ secondary={
}
exit={
"deadzone": 0.5,
"events": [null, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [null, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
camera={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":80,"key_label":0,"unicode":112,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":80,"key_label":0,"unicode":112,"location":0,"echo":false,"script":null)
]
}
window_mode={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194342,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194342,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
mouse_mode={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194332,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194332,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
primary={
@ -119,17 +118,17 @@ primary={
}
throw={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
]
}
scoreboard={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194306,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194306,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
respawn={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":75,"key_label":0,"unicode":107,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":75,"key_label":0,"unicode":107,"location":0,"echo":false,"script":null)
]
}

View file

@ -1,20 +0,0 @@
# This file is part of open-fpsz.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
class_name ArrayPackedSceneResource extends Resource
@export var _packed_scenes : Array[PackedScene] = []
func get_items() -> Array[PackedScene]:
return _packed_scenes

View file

@ -1,7 +0,0 @@
[gd_resource type="Resource" script_class="ArrayPackedSceneResource" load_steps=2 format=3 uid="uid://cpnargstkucch"]
[ext_resource type="Script" path="res://resources/array_packed_scene.gd" id="1_xcy3p"]
[resource]
script = ExtResource("1_xcy3p")
_packed_scenes = Array[PackedScene]([])

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=3 format=3 uid="uid://c4h2mdvdwndxl"]
[gd_scene load_steps=4 format=3 uid="uid://c4h2mdvdwndxl"]
[ext_resource type="Script" path="res://systems/maps_manager.gd" id="1_a1ovw"]
[ext_resource type="PackedScene" uid="uid://btlkog4b87p4x" path="res://maps/desert/desert.tscn" id="2_v1r16"]
[ext_resource type="PackedScene" uid="uid://rqirbdfmt2g6" path="res://maps/blaze/blaze.tscn" id="3_qd02q"]
[node name="MapsManager" type="Node"]
script = ExtResource("1_a1ovw")
maps = Array[PackedScene]([ExtResource("2_v1r16")])
maps = Array[PackedScene]([ExtResource("2_v1r16"), ExtResource("3_qd02q")])

View file

@ -52,7 +52,7 @@ enum Mode {
@export var _FLAG : PackedScene
## This is the match timer.
var timer:Timer = null
var timer:Timer
## The [Teams] manager.
@onready var teams : Teams = $Teams
@ -94,6 +94,7 @@ func start_server(port : int, map_scene : PackedScene, _mode: Mode = mode, usern
timer = Timer.new()
timer.one_shot = true
add_child(timer)
map = map_scene.instantiate()
mode = _mode
@ -102,10 +103,16 @@ func start_server(port : int, map_scene : PackedScene, _mode: Mode = mode, usern
match mode:
Mode.RABBIT:
var flag : Flag = _FLAG.instantiate()
objectives.add_child(flag)
var flagstand : Marker3D = map.get_node("FlagStand")
objectives.add_child(flag)
if flagstand:
flag.global_position = flagstand.global_position
flag.respawn_timer.timeout.connect(func() -> void:
if flagstand:
flag.waypoint.text = ""
flag.global_position = flagstand.global_position
flag.state = flag.FlagState.ON_STAND
)
teams.team_added.connect(_on_team_added)
teams.team_erased.connect(_on_team_erased)
@ -113,11 +120,15 @@ func start_server(port : int, map_scene : PackedScene, _mode: Mode = mode, usern
flag.grabbed.connect(
func(carry:FlagCarryComponent) -> void:
carry.owner.hud.objective_label.set_visible(true)
switch_team(carry.owner.peer_id, "rabbit"))
switch_team(carry.owner.peer_id, "rabbit")
flag.respawn_timer.stop()
)
flag.dropped.connect(
func(carry:FlagCarryComponent) -> void:
carry.owner.hud.objective_label.set_visible(false)
switch_team(carry.owner.peer_id, "chasers"))
switch_team(carry.owner.peer_id, "chasers")
flag.respawn_timer.start()
)
_scoreboard_spawn_root.add_child(
RabbitScoringComponent.new(scoreboard, flag))
@ -143,7 +154,6 @@ func start_server(port : int, map_scene : PackedScene, _mode: Mode = mode, usern
players.child_entered_tree.connect(func(_player:Player) -> void:
# make sure we have enough players to start the match
if players.get_child_count() > 1 and timer.is_stopped():
_start_match()
)

View file

@ -16,13 +16,15 @@ class_name Singleplayer extends Node
@onready var player : Player = $Player
@onready var flag : Flag = $Flag
@onready var map : Node = $Desert
@onready var map : Node = $Blaze
func _ready() -> void:
player.health.exhausted.connect(_on_player_dead)
var flagstand : Marker3D = map.get_node("FlagStand")
if flagstand:
flag.global_position = flagstand.position
var flag_spawn : Node = map.objectives.front()
flag.global_position = flag_spawn.global_position
#var flagstand : Marker3D = map.get_node("FlagStand")
#if flagstand:
#flag.global_position = flagstand.position
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("exit"):

View file

@ -1,16 +1,48 @@
[gd_scene load_steps=7 format=3 uid="uid://boviiugcnfyrj"]
[gd_scene load_steps=15 format=3 uid="uid://boviiugcnfyrj"]
[ext_resource type="Script" path="res://types/singleplayer/demo.gd" id="1_kkjqs"]
[ext_resource type="PackedScene" uid="uid://cbhx1xme0sb7k" path="res://entities/player/player.tscn" id="2_6wbjq"]
[ext_resource type="PackedScene" uid="uid://c88l3h0ph00c7" path="res://entities/flag/flag.tscn" id="4_1j2pw"]
[ext_resource type="PackedScene" uid="uid://btlkog4b87p4x" path="res://maps/desert/desert.tscn" id="4_dogmv"]
[ext_resource type="PackedScene" uid="uid://dpnu1lvfncx6q" path="res://entities/dummy_target/dummy_target.tscn" id="5_euor2"]
[ext_resource type="PackedScene" uid="uid://rqirbdfmt2g6" path="res://maps/blaze/blaze.tscn" id="6_8mg0m"]
[ext_resource type="Texture2D" uid="uid://cyw6oism6152n" path="res://maps/blaze/assets/textures/Ground074_1K-PNG/Ground074_1K-PNG_Color.png" id="6_gw0iq"]
[ext_resource type="Texture2D" uid="uid://c43blkvrhgves" path="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_NormalDX.png" id="7_esfkt"]
[ext_resource type="Texture2D" uid="uid://b3hocnuaq1y5g" path="res://maps/blaze/assets/textures/Ground068_1K-PNG/Ground068_1K-PNG_Color.png" id="8_dd3kf"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_c5jqv"]
resource_local_to_scene = true
bounce = 1.0
absorbent = true
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_45637"]
cull_mode = 2
vertex_color_use_as_albedo = true
backlight_enabled = true
backlight = Color(0.5, 0.5, 0.5, 1)
[sub_resource type="Terrain3DMeshAsset" id="Terrain3DMeshAsset_rjj13"]
height_offset = 0.5
density = 10.0
material_override = SubResource("StandardMaterial3D_45637")
generated_type = 1
[sub_resource type="Terrain3DTextureAsset" id="Terrain3DTextureAsset_h772r"]
name = "Rock"
albedo_color = Color(0.898039, 0.760784, 0.905882, 1)
albedo_texture = ExtResource("6_gw0iq")
normal_texture = ExtResource("7_esfkt")
[sub_resource type="Terrain3DTextureAsset" id="Terrain3DTextureAsset_jkohr"]
name = "Ground"
id = 1
albedo_color = Color(0.882353, 0.764706, 0.87451, 1)
albedo_texture = ExtResource("8_dd3kf")
normal_texture = ExtResource("7_esfkt")
[sub_resource type="Terrain3DAssets" id="Terrain3DAssets_5xdp6"]
mesh_list = Array[Terrain3DMeshAsset]([SubResource("Terrain3DMeshAsset_rjj13")])
texture_list = Array[Terrain3DTextureAsset]([SubResource("Terrain3DTextureAsset_h772r"), SubResource("Terrain3DTextureAsset_jkohr")])
[node name="Demo" type="Node"]
script = ExtResource("1_kkjqs")
@ -18,10 +50,15 @@ script = ExtResource("1_kkjqs")
transform = Transform3D(-0.000506087, 0, -1, 0, 1, 0, 1, 0, -0.000506087, 612.497, 211.292, 853.632)
physics_material_override = SubResource("PhysicsMaterial_c5jqv")
[node name="Desert" parent="." instance=ExtResource("4_dogmv")]
[node name="DummyTarget" parent="." instance=ExtResource("5_euor2")]
transform = Transform3D(-0.997996, 0, -0.0632782, 0, 1, 0, 0.0632782, 0, -0.997996, 901.962, 145.367, 882.65)
[node name="Flag" parent="." instance=ExtResource("4_1j2pw")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 895.356, 145.367, 888.261)
[node name="Blaze" parent="." instance=ExtResource("6_8mg0m")]
[node name="Terrain3D" parent="Blaze" index="2"]
assets = SubResource("Terrain3DAssets_5xdp6")
[editable path="Blaze"]