Premier commit

This commit is contained in:
2026-09-01 22:41:37 +02:00
commit 7cff988739
133 changed files with 6412 additions and 0 deletions
@@ -0,0 +1,61 @@
shader_type spatial;
render_mode unshaded, depth_draw_never, cull_disabled;
uniform float width = 15.0;
uniform float height = 15.0;
uniform float density = 5.0;
uniform float line_thickness = 0.1;
uniform vec4 line_color : source_color = vec4( 0.2, 1.0, 1.0, 1.0 );
uniform sampler2D depth_texture : source_color, hint_depth_texture;
uniform vec4 color1: source_color = vec4(1,1,1,.1);
uniform vec4 color2: source_color = vec4(1,1,1,1);
uniform float threshold = .2;
uniform float fresnel_sharpness = 1.0;
uniform float fresnel_factor = 1.0;
float hex_cells( vec2 uv )
{
float x = uv.x * width * density;
float y = mod( floor(x), 2.0 ) * 0.5 + ( uv.y * height ) * density;
vec2 base_chip = abs( vec2( 0.5 ) - mod( vec2( x, y ), 1.0 ) );
return abs( max( base_chip.x * 1.5 + base_chip.y, base_chip.y * 2.0 ) - 1.0 );
}
void fragment( )
{
float depth = texture(depth_texture, SCREEN_UV).x;
//vec3 ndc = vec3(SCREEN_UV, depth) * 2.0 - 1.0;
vec3 ndc = vec3(SCREEN_UV * 2.0 - 1.0, depth);
vec4 view = INV_PROJECTION_MATRIX * vec4(ndc, 1.0);
view.xyz /= view.w;
float linear_depth = -view.z;
float object_depth = FRAGCOORD.z;
//vec3 object_ndc = vec3(SCREEN_UV, object_depth) * 2.0 - 1.0;
vec3 object_ndc = vec3(SCREEN_UV * 2.0 - 1.0, object_depth);
vec4 object_view = INV_PROJECTION_MATRIX * vec4(object_ndc, 1.0);
object_view.xyz /= object_view.w;
float linear_object_depth = -object_view.z;
float fresnel = pow(1.0 - dot(VIEW, NORMAL), fresnel_sharpness) * fresnel_factor;
if (linear_depth - linear_object_depth > threshold) {
float hex = hex_cells( UV );
vec4 final_color = mix(
color1,
line_color,
float( hex < line_thickness )
);
ALBEDO = final_color.rgb;
ALPHA = final_color.a+(fresnel);
}
else {
ALBEDO = color2.rgb;
ALPHA = color2.a+fresnel;
}
}
@@ -0,0 +1 @@
uid://bdveg7wa4kl6y
+35
View File
@@ -0,0 +1,35 @@
shader_type spatial;
render_mode unshaded;
uniform sampler2D sky_texture : source_color;
uniform bool lock_aspect = false;
uniform float aspect_ratio = 1.3333333;
uniform vec2 fov = vec2(180.0, 90.0);
uniform ivec2 tiling = ivec2(1, 1);
uniform vec2 offset = vec2(0.0, 0.0);
// XY offset, ZW tiling
varying vec4 bg_coords;
void vertex() {
// Camera YX rotation per Basis.get_euler source code
float y = atan(VIEW_MATRIX[0][2], VIEW_MATRIX[2][2]);
float x = asin(VIEW_MATRIX[1][2]);
// Map rotation to screen space
bg_coords.xy = vec2(y * -0.5, x) / PI;
bg_coords.y += 0.5;
bg_coords.w = fov.y / 180.0;
bg_coords.z = !lock_aspect ? fov.x / 360.0 : VIEWPORT_SIZE.x / (VIEWPORT_SIZE.y * aspect_ratio) * bg_coords.w;
// Keep background centered vertically when FOV changes
bg_coords.y *= bg_coords.w > 1.0 ? 0.0 : 1.0 - bg_coords.w;
}
void fragment() {
vec2 uv_offset = vec2(-offset.x, offset.y);
vec2 uv = (SCREEN_UV + uv_offset) * bg_coords.zw + bg_coords.xy;
uv *= vec2(tiling);
ALBEDO = texture(sky_texture, uv).rgb;
}
@@ -0,0 +1 @@
uid://dm5226jwt11ae
+13
View File
@@ -0,0 +1,13 @@
@tool
extends Node3D
class_name Dome
@export var size : float = 100. : set = set_size
func _ready():
set_size(size)
func set_size(s : float):
size = s
if is_node_ready():
scale = Vector3.ONE * size
+1
View File
@@ -0,0 +1 @@
uid://jus6nhwewgay
+164
View File
@@ -0,0 +1,164 @@
[gd_scene format=3 uid="uid://nlli5ju37ghy"]
[ext_resource type="Script" uid="uid://jus6nhwewgay" path="res://objects/dome/dome.gd" id="1_jb5pf"]
[ext_resource type="Shader" uid="uid://bdveg7wa4kl6y" path="res://objects/dome/assets/shader/barrier.gdshader" id="3_jb5pf"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_nbcly"]
shading_mode = 0
albedo_color = Color(0.22352941, 0.03529412, 0.2784314, 1)
[sub_resource type="PlaneMesh" id="PlaneMesh_g4v7s"]
material = SubResource("StandardMaterial3D_nbcly")
size = Vector2(50, 50)
[sub_resource type="SphereMesh" id="SphereMesh_omx8k"]
flip_faces = true
[sub_resource type="ShaderMaterial" id="ShaderMaterial_nbcly"]
render_priority = 0
shader = ExtResource("3_jb5pf")
shader_parameter/width = 15.0
shader_parameter/height = 15.0
shader_parameter/density = 15.0
shader_parameter/line_thickness = 0.1
shader_parameter/line_color = Color(0.19999999, 1, 1, 0)
shader_parameter/color1 = Color(0.55, 0.71500003, 1, 0)
shader_parameter/color2 = Color(0.5529412, 0.7176471, 1, 1)
shader_parameter/threshold = 10.0
shader_parameter/fresnel_sharpness = 1.0
shader_parameter/fresnel_factor = 0.1
[sub_resource type="BoxShape3D" id="BoxShape3D_omx8k"]
size = Vector3(0.1, 0.1, 0.1)
[node name="Dome" type="StaticBody3D" unique_id=166719047]
transform = Transform3D(100, 0, 0, 0, 100, 0, 0, 0, 100, 0, 0, 0)
script = ExtResource("1_jb5pf")
[node name="Ground" type="MeshInstance3D" parent="." unique_id=196721357]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.001, 0)
mesh = SubResource("PlaneMesh_g4v7s")
[node name="DomeMesh2" type="MeshInstance3D" parent="." unique_id=1320849271]
mesh = SubResource("SphereMesh_omx8k")
surface_material_override/0 = SubResource("ShaderMaterial_nbcly")
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1870476723]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5479279, 0, 0)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D2" type="CollisionShape3D" parent="." unique_id=1405453928]
transform = Transform3D(0.9781476, 0, -0.2079117, 0, 1, 0, 0.2079117, 0, 0.9781476, -0.5359544, 0, -0.11392062)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D3" type="CollisionShape3D" parent="." unique_id=1799414955]
transform = Transform3D(0.9135454, 0, -0.40673664, 0, 1, 0, 0.40673664, 0, 0.9135454, -0.50055707, 0, -0.22286236)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D4" type="CollisionShape3D" parent="." unique_id=1057204615]
transform = Transform3D(0.809017, 0, -0.58778524, 0, 1, 0, 0.58778524, 0, 0.809017, -0.443283, 0, -0.32206395)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D5" type="CollisionShape3D" parent="." unique_id=995851263]
transform = Transform3D(0.6809604, 0, -0.7323202, 0, 1, 0, 0.7323202, 0, 0.6809604, -0.3731172, 0, -0.40125868)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D6" type="CollisionShape3D" parent="." unique_id=1389588031]
transform = Transform3D(0.51382184, 0, -0.8578968, 0, 1, 0, 0.8578968, 0, 0.51382184, -0.28153732, 0, -0.4700656)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D7" type="CollisionShape3D" parent="." unique_id=763833944]
transform = Transform3D(0.3242268, 0, -0.94597936, 0, 1, 0, 0.94597936, 0, 0.3242268, -0.17765291, 0, -0.5183285)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D8" type="CollisionShape3D" parent="." unique_id=1992446162]
transform = Transform3D(0.12046155, 0, -0.992718, 0, 1, 0, 0.992718, 0, 0.12046155, -0.06600425, 0, -0.5439379)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D9" type="CollisionShape3D" parent="." unique_id=1208280596]
transform = Transform3D(-0.078486145, 0, -0.9969152, 0, 1, 0, 0.9969152, 0, -0.078486145, 0.04300475, 0, -0.5462377)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D10" type="CollisionShape3D" parent="." unique_id=1292859181]
transform = Transform3D(-0.28404135, 0, -0.958812, 0, 1, 0, 0.958812, 0, -0.28404135, 0.15563418, 0, -0.52535987)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D11" type="CollisionShape3D" parent="." unique_id=1997335297]
transform = Transform3D(-0.47718263, 0, -0.87880415, 0, 1, 0, 0.87880415, 0, -0.47718263, 0.26146168, 0, -0.48152134)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D12" type="CollisionShape3D" parent="." unique_id=1449774908]
transform = Transform3D(-0.6494687, 0, -0.7603884, 0, 1, 0, 0.7603884, 0, -0.6494687, 0.35586205, 0, -0.41663802)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D13" type="CollisionShape3D" parent="." unique_id=357259572]
transform = Transform3D(-0.7835071, 0, -0.62138283, 0, 1, 0, 0.62138283, 0, -0.7835071, 0.4293054, 0, -0.340473)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D14" type="CollisionShape3D" parent="." unique_id=1998926365]
transform = Transform3D(-0.89557827, 0, -0.44490382, 0, 1, 0, 0.44490382, 0, -0.89557827, 0.49071234, 0, -0.24377522)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D15" type="CollisionShape3D" parent="." unique_id=1826517219]
transform = Transform3D(-0.96850854, 0, -0.24898036, 0, 1, 0, 0.24898036, 0, -0.96850854, 0.53067285, 0, -0.13642329)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D16" type="CollisionShape3D" parent="." unique_id=228392577]
transform = Transform3D(-0.99999726, 0, -0.0023402646, 0, 1, 0, 0.0023402646, 0, -0.99999726, 0.5421262, 0, -0.027382933)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D17" type="CollisionShape3D" parent="." unique_id=1106193142]
transform = Transform3D(-0.9779057, 0, 0.20904641, 0, 1, 0, -0.20904641, 0, -0.9779057, 0.5300216, 0, 0.08844173)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D18" type="CollisionShape3D" parent="." unique_id=933370103]
transform = Transform3D(-0.913073, 0, 0.40779632, 0, 1, 0, -0.40779632, 0, -0.913073, 0.49449795, 0, 0.19734235)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D19" type="CollisionShape3D" parent="." unique_id=310765754]
transform = Transform3D(-0.8083345, 0, 0.5887234, 0, 1, 0, -0.5887234, 0, -0.8083345, 0.4371088, 0, 0.29647735)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D20" type="CollisionShape3D" parent="." unique_id=1224640466]
transform = Transform3D(-0.68011034, 0, 0.7331097, 0, 1, 0, -0.7331097, 0, -0.68011034, 0.36685118, 0, 0.37559065)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D21" type="CollisionShape3D" parent="." unique_id=394476411]
transform = Transform3D(-0.5128261, 0, 0.8584924, 0, 1, 0, -0.8584924, 0, -0.5128261, 0.2751915, 0, 0.4442913)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D22" type="CollisionShape3D" parent="." unique_id=1040373752]
transform = Transform3D(-0.32312903, 0, 0.94635487, 0, 1, 0, -0.94635487, 0, -0.32312903, 0.17125116, 0, 0.4924336)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D23" type="CollisionShape3D" parent="." unique_id=1667715263]
transform = Transform3D(-0.11930971, 0, 0.99285704, 0, 1, 0, -0.99285704, 0, -0.11930971, 0.059572875, 0, 0.51791346)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D24" type="CollisionShape3D" parent="." unique_id=733623695]
transform = Transform3D(0.07964271, 0, 0.99682343, 0, 1, 0, -0.99682343, 0, 0.07964271, -0.04943871, 0, 0.52008677)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D25" type="CollisionShape3D" parent="." unique_id=640657227]
transform = Transform3D(0.2851536, 0, 0.95848185, 0, 1, 0, -0.95848185, 0, 0.2851536, -0.16204387, 0, 0.49907833)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D26" type="CollisionShape3D" parent="." unique_id=709442725]
transform = Transform3D(0.47820193, 0, 0.8782499, 0, 1, 0, -0.8782499, 0, 0.47820193, -0.26782042, 0, 0.455117)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D27" type="CollisionShape3D" parent="." unique_id=862417486]
transform = Transform3D(0.6503505, 0, 0.7596344, 0, 1, 0, -0.7596344, 0, 0.6503505, -0.36214545, 0, 0.39012423)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D28" type="CollisionShape3D" parent="." unique_id=677375892]
transform = Transform3D(0.7842275, 0, 0.6204733, 0, 1, 0, -0.6204733, 0, 0.7842275, -0.43550038, 0, 0.313874)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D29" type="CollisionShape3D" parent="." unique_id=1813352688]
transform = Transform3D(0.8960939, 0, 0.4438645, 0, 1, 0, -0.4438645, 0, 0.8960939, -0.49679512, 0, 0.2171051)
shape = SubResource("BoxShape3D_omx8k")
[node name="CollisionShape3D30" type="CollisionShape3D" parent="." unique_id=1653439158]
transform = Transform3D(0.96879673, 0, 0.24785648, 0, 1, 0, -0.24785648, 0, 0.96879673, -0.53663105, 0, 0.10970685)
shape = SubResource("BoxShape3D_omx8k")
+87
View File
@@ -0,0 +1,87 @@
@tool
extends Node3D
class_name HexMap
const BASE_TILE_SET_SCENE = preload('res://objects/map/tiles/base_hex_tile_set.tscn') as PackedScene
@export_tool_button("Load Map", "Callable") var load_map_action = load_map
@export var radius = 10
@onready var tile_set : HexTileSet = BASE_TILE_SET_SCENE.instantiate()
var empty_hex_tiles_coords : Array[Vector2i] = []
var hex_tiles_by_pos : Dictionary[String, HexTile] = {}
var hex_tiles_by_id : Dictionary[String, Array] = {}
func load_map():
for c in get_children():
c.queue_free()
empty_hex_tiles_coords = []
hex_tiles_by_pos = {}
empty_hex_tiles_coords = get_all_hex_coords()
empty_hex_tiles_coords.shuffle()
var mandatory_tiles = tile_set.get_all_hex_tiles().filter(
func (tile : HexTile): return tile.mandatory_tile
)
for hex_tile in mandatory_tiles:
for i in range(hex_tile.mandatory_count):
if len(empty_hex_tiles_coords) != 0:
spawn_tile(
empty_hex_tiles_coords.pop_front(),
hex_tile
)
while len(empty_hex_tiles_coords) != 0:
var coord : Vector2i = empty_hex_tiles_coords.pop_front()
spawn_tile(
coord,
get_available_tiles_for_coord(coord).pick_random()
)
func spawn_tile(coord : Vector2i, hex_tile : HexTile):
var new_tile = hex_tile.duplicate()
hex_tiles_by_pos["%d:%d" % [coord.x, coord.y]] = new_tile
if not (new_tile.name in hex_tiles_by_id):
hex_tiles_by_id[new_tile.name] = []
hex_tiles_by_id[new_tile.name].append(new_tile)
new_tile.position = get_world_tile_coord(coord)
new_tile.rotation.y = (randi() % 6)/6. * 2. * PI
add_child(new_tile)
func get_available_tiles_for_coord(_coord : Vector2) -> Array[HexTile]:
return tile_set.get_all_hex_tiles().filter(
func (tile : HexTile): return not tile.mandatory_tile
)
func get_all_hex_coords() -> Array[Vector2i]:
var coords : Array[Vector2i] = []
for x in range(-radius, radius):
for y in range(-radius, radius):
if Vector2(x,y).length() < radius:
coords.append(Vector2i(x,y))
return coords
func get_world_tile_coord(coord: Vector2i) -> Vector3:
return Vector3(
coord.x * HexTile.BASE_TILE_SIZE + (HexTile.BASE_TILE_SIZE/2. if coord.y%2 == 0 else 0.),
0.,
coord.y * HexTile.BASE_TILE_SIZE * cos(PI/6),
)
func get_all_tiles_with_id(id : String) -> Array[HexTile]:
if id in hex_tiles_by_id:
return (hex_tiles_by_id[id] as Array[HexTile])
return ([] as Array[HexTile])
+1
View File
@@ -0,0 +1 @@
uid://da00pdn0rf7t5
Binary file not shown.
+75
View File
@@ -0,0 +1,75 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://c3tu8mi21rbj5"
path="res://.godot/imported/base.blend-1078cc3cc14bf2d0e109d3d1e8d426e3.scn"
[deps]
source_file="res://objects/map/tiles/base/base.blend"
dest_files=["res://.godot/imported/base.blend-1078cc3cc14bf2d0e109d3d1e8d426e3.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
mesh_library/use_node_names_as_mesh_names=false
array_mesh/deduplicate_surfaces=true
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={
"meshes": {
"base_Cylinder_003": {
"generate/lightmap_uv": 0,
"generate/lods": 0,
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 20.0,
"save_to_file/enabled": true,
"save_to_file/fallback_path": "res://objects/map/tiles/base/base.tres",
"save_to_file/path": "uid://dnhk02pm0g1j"
}
}
}
blender/nodes/visible=0
blender/nodes/active_collection_only=false
blender/nodes/punctual_lights=true
blender/nodes/cameras=true
blender/nodes/custom_properties=true
blender/nodes/modifiers=1
blender/meshes/vertex_colors=1
blender/meshes/uvs=true
blender/meshes/normals=true
blender/meshes/export_geometry_nodes_instances=false
blender/meshes/gpu_instances=false
blender/meshes/tangents=true
blender/meshes/skins=2
blender/meshes/export_bones_deforming_mesh_only=false
blender/materials/unpack_enabled=true
blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true
gltf/naming_version=2
gltf/texture_map_mode=1
Binary file not shown.
+33
View File
@@ -0,0 +1,33 @@
[gd_resource type="ArrayMesh" format=4 uid="uid://dnhk02pm0g1j"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_yhyhb"]
[sub_resource type="ArrayMesh" id="ArrayMesh_8mopr"]
_surfaces = [{
"aabb": AABB(-20, -2, -23.094011, 40, 2, 46.188023),
"format": 34896613377,
"index_count": 60,
"index_data": PackedByteArray("AAABAAIAAAADAAEABAACAAEAAwAEAAEABQAAAAIABQADAAAABQACAAYAAwAHAAQACAAFAAYAAwAFAAkACQAFAAgAAwAJAAcABwAKAAQABwAJAAoAAgAEAAsAAgALAAYACwAEAAoACAAGAAsACQALAAoACQAIAAsA"),
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 12,
"vertex_data": PackedByteArray("/38AAAAAAAD//////z8AAP9///8AAAAA//8AAP8/AAD//////78AAAAAAAD/PwAAAAD///8/AAD//wAA/78AAAAAAAD/vwAA/38AAP//AAD/f/////8AAAAA////vwAA")
}]
blend_shape_mode = 0
[resource]
resource_name = "base_Cylinder_003"
_surfaces = [{
"aabb": AABB(-20, -2, -23.094011, 40, 2, 46.188023),
"attribute_data": PackedByteArray("//+kwKnq/3////9/qeqkwKnqpMBU1f9/qer/f1TVpMBU1aTA/7//f1TV/3//v6TA/7+kwKmq/3//v/9/qaqkwJm6e/D/n+/Bmbpz0WSFe/D/n///ZIVz0amqpMBUlf9/qar/f1SVpMBUlaTA/3//f1SV/3//f6TAZMVz0Zn6c9H/3+/B/9///2TFe/CZ+nvw"),
"format": 34896613399,
"index_count": 60,
"index_data": PackedByteArray("AAABAAIAAAADAAEABAAFAAYABAAHAAUACAAJAAoACAALAAkADAANAA4ADAAPAA0AEAARABIAEQAQABMAEwAQABQAEQATABUAFgAXABgAFgAZABcAGgAbABwAGgAdABsAHgAfACAAHwAeACEAIQAeACIAHwAhACMA"),
"material": SubResource("StandardMaterial3D_yhyhb"),
"primitive": 3,
"uv_scale": Vector4(2, 1.98, 0, 0),
"vertex_count": 36,
"vertex_data": PackedByteArray("/38AAAAAqer//////z+p6v9///8AAKnq//8AAP8/qer//wAA/z//v///////v/+///////8//7///wAA/7//v///AAD/v1SV/3//////VJX//////79Ulf9/AAD//1SV/38AAP//VJUAAP///79Ulf9//////1SVAAAAAP+/VJX//////7//v/9///8AAP+///////8//78AAP///7//v/9///////+/AAD///8//78AAAAA/7//vwAA////P/+/AAD///+//78AAAAA/z//vwAAAAD/P6nq/3///wAAqeoAAP///z+p6v9/AAAAAKnqAAAAAP8//z///wAA/z//P/9/AAAAAP8//38AAP///z8AAAAA/7//P///AAD/v/8//38AAP9/AAD/fwAA/38AAP9/AAD/fwAA/38AAP9/AAD/fwAA/38AAP9/AAD/fwAA/3////9/////f////3///////3////9/////f////3////9/////f/9/////f////3////9/////f////3////9/////f///AAD/fwAA/38AAP9/AAD/fwAA/38AAP9/")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_8mopr")
+170
View File
@@ -0,0 +1,170 @@
[gd_scene format=3 uid="uid://ygpr1p4jwi4v"]
[ext_resource type="Script" uid="uid://ovrpkbwq0piy" path="res://objects/map/tiles/hex_tile_set.gd" id="1_sgwpe"]
[ext_resource type="Script" uid="uid://bcelqd50co3p3" path="res://objects/map/tiles/hex_tile.gd" id="2_0fw1f"]
[ext_resource type="ArrayMesh" uid="uid://dnhk02pm0g1j" path="res://objects/map/tiles/base/base.tres" id="3_6x72r"]
[ext_resource type="Script" uid="uid://boba1g0kd5n68" path="res://objects/map/tiles/hex_tile_types/hex_tile_house.gd" id="4_0fw1f"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_oixbx"]
albedo_color = Color(0.35686275, 0.6509804, 0.45882353, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_sgwpe"]
albedo_color = Color(0.47058824, 0.8, 0.43529412, 1)
[sub_resource type="CylinderMesh" id="CylinderMesh_g4v7s"]
bottom_radius = 12.328
height = 21.673828
radial_segments = 10
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_yf5fn"]
albedo_color = Color(0.35686275, 0.6509804, 0.45882353, 1)
[sub_resource type="CylinderShape3D" id="CylinderShape3D_sgwpe"]
height = 24.650146
radius = 9.0859375
[sub_resource type="CylinderShape3D" id="CylinderShape3D_yf5fn"]
height = 24.650146
radius = 12.075195
[sub_resource type="PrismMesh" id="PrismMesh_sgwpe"]
size = Vector3(10, 10, 10)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0fw1f"]
albedo_color = Color(0.8, 0.25882354, 0.36862746, 1)
[sub_resource type="CylinderMesh" id="CylinderMesh_yf5fn"]
height = 200.0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_57qmd"]
transparency = 1
shading_mode = 0
albedo_color = Color(0.8, 0.256, 0.36480018, 0.42352942)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6x72r"]
albedo_color = Color(0.81960785, 0.7058824, 0.7607843, 1)
[sub_resource type="CylinderShape3D" id="CylinderShape3D_6x72r"]
height = 24.650146
radius = 6.894
[sub_resource type="Gradient" id="Gradient_0fw1f"]
interpolation_mode = 1
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_g4v7s"]
gradient = SubResource("Gradient_0fw1f")
width = 300
height = 300
fill = 1
fill_from = Vector2(0.5, 0.5)
fill_to = Vector2(0.5, 1)
[node name="HexTileSet" type="Node3D" unique_id=549438538]
script = ExtResource("1_sgwpe")
[node name="Grass" type="StaticBody3D" parent="." unique_id=940672834]
script = ExtResource("2_0fw1f")
id = &"Grass"
metadata/_custom_type_script = "uid://bcelqd50co3p3"
[node name="Base" type="MeshInstance3D" parent="Grass" unique_id=76705257]
mesh = ExtResource("3_6x72r")
surface_material_override/0 = SubResource("StandardMaterial3D_oixbx")
[node name="Grass2" type="StaticBody3D" parent="." unique_id=1341297106]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40, 0, 0)
script = ExtResource("2_0fw1f")
id = &"Grass2"
metadata/_custom_type_script = "uid://bcelqd50co3p3"
[node name="Base" type="MeshInstance3D" parent="Grass2" unique_id=2047809771]
mesh = ExtResource("3_6x72r")
surface_material_override/0 = SubResource("StandardMaterial3D_sgwpe")
[node name="Tree1" type="StaticBody3D" parent="." unique_id=779600102]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 80, 0, 0)
script = ExtResource("2_0fw1f")
id = &"Tree1"
metadata/_custom_type_script = "uid://bcelqd50co3p3"
[node name="Base2" type="MeshInstance3D" parent="Tree1" unique_id=627081052]
mesh = ExtResource("3_6x72r")
surface_material_override/0 = SubResource("StandardMaterial3D_oixbx")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Tree1" unique_id=1847158047]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.9956665, 9.836914, -4.9558372)
mesh = SubResource("CylinderMesh_g4v7s")
surface_material_override/0 = SubResource("StandardMaterial3D_yf5fn")
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Tree1" unique_id=770818071]
transform = Transform3D(0.515, 0, 0, 0, 0.515, 0, 0, 0, 0.515, 1.0043335, 2.9007664, 4.0441628)
mesh = SubResource("CylinderMesh_g4v7s")
surface_material_override/0 = SubResource("StandardMaterial3D_yf5fn")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Tree1" unique_id=1419584569]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.2411957, 7.078491, -4.7115307)
shape = SubResource("CylinderShape3D_sgwpe")
[node name="Tree2" type="StaticBody3D" parent="." unique_id=1777082018]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 120, 0, 0)
script = ExtResource("2_0fw1f")
id = &"Tree2"
metadata/_custom_type_script = "uid://bcelqd50co3p3"
[node name="Base2" type="MeshInstance3D" parent="Tree2" unique_id=1571316613]
mesh = ExtResource("3_6x72r")
surface_material_override/0 = SubResource("StandardMaterial3D_oixbx")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Tree2" unique_id=1159803776]
transform = Transform3D(1.375, 0, 0, 0, 1.375, 0, 0, 0, 1.375, 0.54029846, 11.831854, -0.09746361)
mesh = SubResource("CylinderMesh_g4v7s")
surface_material_override/0 = SubResource("StandardMaterial3D_yf5fn")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Tree2" unique_id=872651782]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.8638458, 7.078491, 0.41245174)
shape = SubResource("CylinderShape3D_yf5fn")
[node name="House" type="StaticBody3D" parent="." unique_id=2024806559 node_paths=PackedStringArray("life_bar", "house_model", "house_model_broke")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 160, 0, 0)
script = ExtResource("4_0fw1f")
life_bar = NodePath("LifeBar")
house_model = NodePath("HouseModel")
house_model_broke = NodePath("HouseModelBroke")
hp = 100.0
id = &"House"
mandatory_tile = true
mandatory_count = 3
metadata/_custom_type_script = "uid://bcelqd50co3p3"
[node name="Base2" type="MeshInstance3D" parent="House" unique_id=501829296]
mesh = ExtResource("3_6x72r")
surface_material_override/0 = SubResource("StandardMaterial3D_oixbx")
[node name="HouseModel" type="MeshInstance3D" parent="House" unique_id=1045312946]
unique_name_in_owner = true
transform = Transform3D(1.375, 0, 0, 0, 1.375, 0, 0, 0, 1.375, 0.54029846, 5.831854, -0.09746361)
mesh = SubResource("PrismMesh_sgwpe")
surface_material_override/0 = SubResource("StandardMaterial3D_0fw1f")
[node name="MeshInstance3D" type="MeshInstance3D" parent="House/HouseModel" unique_id=670837026]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 100, 0)
mesh = SubResource("CylinderMesh_yf5fn")
surface_material_override/0 = SubResource("StandardMaterial3D_57qmd")
[node name="HouseModelBroke" type="MeshInstance3D" parent="House" unique_id=107368671]
unique_name_in_owner = true
transform = Transform3D(1.375, 0, 0, 0, 1.375, 0, 0, 0, 1.375, 0.54029846, 5.831854, -0.09746361)
visible = false
mesh = SubResource("PrismMesh_sgwpe")
surface_material_override/0 = SubResource("StandardMaterial3D_6x72r")
[node name="CollisionShape3D" type="CollisionShape3D" parent="House" unique_id=907138474]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.8638458, 7.078491, 0.41245174)
shape = SubResource("CylinderShape3D_6x72r")
[node name="LifeBar" type="Sprite3D" parent="House" unique_id=501876162]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.53863525, 16.817535, 0)
billboard = 1
texture = SubResource("GradientTexture2D_g4v7s")
+14
View File
@@ -0,0 +1,14 @@
@tool
extends StaticBody3D
class_name HexTile
const BASE_TILE_SIZE = 40
@export var id = ""
@export_group("Mandatory Tile")
@export var mandatory_tile :bool = false
@export var mandatory_count : int = 5
func _ready():
id = name
+1
View File
@@ -0,0 +1 @@
uid://bcelqd50co3p3
+6
View File
@@ -0,0 +1,6 @@
@tool
extends Node3D
class_name HexTileSet
func get_all_hex_tiles() -> Array[HexTile]:
return get_children() as Array[HexTile]
+1
View File
@@ -0,0 +1 @@
uid://ovrpkbwq0piy
@@ -0,0 +1,30 @@
@tool
extends HexTile
class_name HouseHexTile
@export var life_bar : Sprite3D
@export var house_model : Node3D
@export var house_model_broke : Node3D
@export var max_hp : float = 100.
@export var hp : float = max_hp :
set(v):
hp = v
if is_node_ready():
life_bar.scale = Vector3.ONE * hp / max_hp
@export var destroyed : bool = false : set = set_destroyed
func hit(damage = 1.):
hp = max(0, hp - damage)
if hp == 0:
destroyed = true
func set_destroyed(_destroyed : bool = destroyed):
destroyed = _destroyed
if is_node_ready():
house_model.visible = not destroyed
house_model_broke.visible = destroyed
@@ -0,0 +1 @@
uid://boba1g0kd5n68
@@ -0,0 +1,65 @@
// Stolen here https://godotshaders.com/shader/parallax-mapping-2/
shader_type spatial;
render_mode unshaded;
uniform sampler2D noise_texture;
uniform sampler2D gradient;
group_uniforms depth;
uniform int layers : hint_range(0, 64, 1) = 8;
uniform float depth_amount = 1.0;
uniform float fade_amount : hint_range(0.0, 16.0, 0.01) = 1.0;
vec2 to_polar(vec2 uv) {
uv = uv * 2.0 - 1.0;
float radius = length(uv);
float angle = atan(uv.x, uv.y);
return vec2(angle / PI, radius) / 2.0;
}
float overlay(float a, float b){
float limit = step(0.5, a);
return mix(2.0 * a * b, 1.0 - 2.0 * (1.0 - a) * (1.0 - b), limit);
}
vec2 parallax(float depth, vec3 n, vec3 t, vec3 v) {
vec3 normal = normalize(n);
vec3 tangent = normalize(t);
vec3 bitangent = cross(normal, tangent);
vec3 view = normalize(v);
vec3 view_tangent = vec3(dot(view, tangent), dot(view, bitangent), dot(view, normal));
vec2 offset = (view_tangent.xy / max(view_tangent.z, 0.001)) * depth;
offset = vec2(-offset.x, offset.y);
return offset;
}
void fragment() {
float value = 0.0;
for(int i = 0; i < layers; i++){
float t = float(i) / float(layers);
float depth = t * depth_amount;
vec2 circle_uv = UV + parallax(depth, NORMAL, TANGENT, VIEW);
float circle = length(circle_uv * 2.0 - 1.0);
circle = clamp((circle - 0.2) / 0.8, 0.0, 1.0);
vec2 noise_uv = UV + parallax(depth, NORMAL, TANGENT, VIEW);
noise_uv = to_polar(noise_uv);
noise_uv.y += TIME * 0.1;
noise_uv += t;
float noise = texture(noise_texture, noise_uv).r;
float layer_value = overlay(circle, noise);
layer_value = step(0.5, layer_value);
layer_value *= pow(1.0 - t, fade_amount);
value = max(value, layer_value);
}
vec4 color = texture(gradient, vec2(value));
ALBEDO = color.xyz;
}
@@ -0,0 +1 @@
uid://boy8idm1nge7n
+45
View File
@@ -0,0 +1,45 @@
extends Node3D
const SPAWN_RANDOM_POSITION_RANGE = 10
const SPAWN_RANDOM_ANGLE_RANGE = PI/8
@export var delay : float = 5.
@export var duration : float = 10.
@export var spawn_rate : float = 30.
@export var horde_manager : AlienHordeManager
var current_frame : int = 0
var aliens : Array[Alien] = []
var clusters := []
var clusters_coords : Array[Vector2i] = []
var time_elapsed = 0.
var time_spawning = 0.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if delay > 0:
delay -= delta
else:
spawn_aliens(delta)
func spawn_aliens(delta):
if time_elapsed < duration:
time_elapsed += delta
time_spawning += delta
for i in range(roundi(spawn_rate * time_spawning)):
time_spawning -= 1/spawn_rate
spawn_alien()
func spawn_alien() -> Alien:
var alien_position : Vector3 = Vector3(
%SpawnPoint.global_position.x + randf_range(-SPAWN_RANDOM_POSITION_RANGE, SPAWN_RANDOM_POSITION_RANGE),
0,
%SpawnPoint.global_position.z + randf_range(-SPAWN_RANDOM_POSITION_RANGE, SPAWN_RANDOM_POSITION_RANGE)
)
var alien_rotation : float = rotation.y + randf_range(-SPAWN_RANDOM_ANGLE_RANGE, SPAWN_RANDOM_ANGLE_RANGE)
return horde_manager.spawn_alien(alien_position, alien_rotation)
+1
View File
@@ -0,0 +1 @@
uid://bkljflytckumm
+77
View File
@@ -0,0 +1,77 @@
[gd_scene format=3 uid="uid://c50w214ctcjc7"]
[ext_resource type="Shader" uid="uid://boy8idm1nge7n" path="res://objects/spawner/assets/shaders/portal.gdshader" id="1_jjtoq"]
[ext_resource type="Script" uid="uid://bkljflytckumm" path="res://objects/spawner/spawner.gd" id="1_y68vg"]
[sub_resource type="Animation" id="Animation_s17ww"]
resource_name = "Appear"
length = 0.4
[sub_resource type="Animation" id="Animation_y68vg"]
length = 0.001
[sub_resource type="AnimationLibrary" id="AnimationLibrary_d6t07"]
_data = {
&"Appear": SubResource("Animation_s17ww"),
&"RESET": SubResource("Animation_y68vg")
}
[sub_resource type="SphereMesh" id="SphereMesh_d6t07"]
radius = 0.4
height = 0.8
[sub_resource type="Gradient" id="Gradient_y68vg"]
offsets = PackedFloat32Array(0, 0.043333333, 0.98333335)
colors = PackedColorArray(0, 0, 0, 1, 0.22352941, 0.03529412, 0.2784314, 1, 0, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_fx0gv"]
gradient = SubResource("Gradient_y68vg")
[sub_resource type="FastNoiseLite" id="FastNoiseLite_fcnqv"]
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_vf7ls"]
width = 300
height = 300
noise = SubResource("FastNoiseLite_fcnqv")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_yf5fn"]
render_priority = 0
shader = ExtResource("1_jjtoq")
shader_parameter/noise_texture = SubResource("NoiseTexture2D_vf7ls")
shader_parameter/gradient = SubResource("GradientTexture1D_fx0gv")
shader_parameter/layers = 8
shader_parameter/depth_amount = 1.34
shader_parameter/fade_amount = 1.08999997563632
[sub_resource type="SphereMesh" id="SphereMesh_w02y4"]
radius = 0.8
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ahe7j"]
shading_mode = 0
albedo_color = Color(0.10980392, 0.050980393, 0.12941177, 1)
[node name="Spawner" type="Node3D" unique_id=695896823]
script = ExtResource("1_y68vg")
duration = 1.0
spawn_rate = 200.0
[node name="SpawnPoint" type="Node3D" parent="." unique_id=949382199]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.1684067, 0, 0)
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=2140330107]
libraries/ = SubResource("AnimationLibrary_d6t07")
autoplay = &"Appear"
[node name="Aliens" type="Node" parent="." unique_id=1083817569]
unique_name_in_owner = true
[node name="MeshInstance3D2" type="MeshInstance3D" parent="." unique_id=1379665069]
transform = Transform3D(26.585, 0, 0, 0, 26.585, 0, 0, 0, 26.585, 0, 1.429512, 2.0852394)
mesh = SubResource("SphereMesh_d6t07")
surface_material_override/0 = SubResource("ShaderMaterial_yf5fn")
[node name="MeshInstance3D3" type="MeshInstance3D" parent="." unique_id=655614315]
transform = Transform3D(15.39, 0, 0, 0, -6.727183e-07, 15.39, 0, -15.39, -6.727183e-07, -0.12734604, 1.4227005, 3.4225216)
mesh = SubResource("SphereMesh_w02y4")
surface_material_override/0 = SubResource("StandardMaterial3D_ahe7j")