changement du scene manager, amélioration du cockpit et autres
* refonte du scene manager * refonte du audio manager * premier rework des plantes * nettoyage des dossiers/fichiers * renommage de planète en region * fix des run
BIN
stages/terrain/region/assets/sounds/alert.wav
Normal file
24
stages/terrain/region/assets/sounds/alert.wav.import
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://cjspglv6gidd7"
|
||||
path="res://.godot/imported/alert.wav-d6f6d417dbab2ed86fb9c828e1764c61.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/sounds/alert.wav"
|
||||
dest_files=["res://.godot/imported/alert.wav-d6f6d417dbab2ed86fb9c828e1764c61.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
BIN
stages/terrain/region/assets/sounds/quota_announcement.wav
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://c30s61i0j7l88"
|
||||
path="res://.godot/imported/quota_announcement.wav-b06177dc8ee27bb609c7b0a8b9812aa9.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/sounds/quota_announcement.wav"
|
||||
dest_files=["res://.godot/imported/quota_announcement.wav-b06177dc8ee27bb609c7b0a8b9812aa9.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
BIN
stages/terrain/region/assets/textures/blue_rect.png
Normal file
|
After Width: | Height: | Size: 264 B |
40
stages/terrain/region/assets/textures/blue_rect.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cd62k5urdpw3i"
|
||||
path="res://.godot/imported/blue_rect.png-6eb6bcb621810ab61b6d3aead70129b2.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/blue_rect.png"
|
||||
dest_files=["res://.godot/imported/blue_rect.png-6eb6bcb621810ab61b6d3aead70129b2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 46 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bnrjnvceprxfn"
|
||||
path="res://.godot/imported/garden_background_texture.png-002bbb09c02ebe4313ea8a293c00ef9e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/garden_background_texture.png"
|
||||
dest_files=["res://.godot/imported/garden_background_texture.png-002bbb09c02ebe4313ea8a293c00ef9e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 34 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bseoyd8mqjo7y"
|
||||
path="res://.godot/imported/garden_decontamined_background_texture.png-d2e9b3111739dbe0f3e878510238390a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/garden_decontamined_background_texture.png"
|
||||
dest_files=["res://.godot/imported/garden_decontamined_background_texture.png-d2e9b3111739dbe0f3e878510238390a.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 105 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ex35g5nvtsy0"
|
||||
path="res://.godot/imported/garden_decontamined_background_texture_old.png-951b3e125e8b7083a60c2b7435bce68a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/garden_decontamined_background_texture_old.png"
|
||||
dest_files=["res://.godot/imported/garden_decontamined_background_texture_old.png-951b3e125e8b7083a60c2b7435bce68a.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
stages/terrain/region/assets/textures/green_rect.png
Normal file
|
After Width: | Height: | Size: 264 B |
40
stages/terrain/region/assets/textures/green_rect.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bvangyp301tsp"
|
||||
path="res://.godot/imported/green_rect.png-5f705079cd8c03d8ad17266e7ce975db.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/green_rect.png"
|
||||
dest_files=["res://.godot/imported/green_rect.png-5f705079cd8c03d8ad17266e7ce975db.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
stages/terrain/region/assets/textures/green_tiles.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
40
stages/terrain/region/assets/textures/green_tiles.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://yl4dg6gerykb"
|
||||
path="res://.godot/imported/green_tiles.png-8b5f7bc46b5efa30092dac78c9cc56fc.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/green_tiles.png"
|
||||
dest_files=["res://.godot/imported/green_tiles.png-8b5f7bc46b5efa30092dac78c9cc56fc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 29 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://o43d0p2ojbbh"
|
||||
path="res://.godot/imported/moss_contamination_atlas_red.png-70e6e889f4d027e7e5a753054fb81f78.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_contamination_atlas_red.png"
|
||||
dest_files=["res://.godot/imported/moss_contamination_atlas_red.png-70e6e889f4d027e7e5a753054fb81f78.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 142 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dr72xhc07i56e"
|
||||
path="res://.godot/imported/moss_contamination_atlas_texture.png-80aa9a19eb65e2c40b783557f4f8a743.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_contamination_atlas_texture.png"
|
||||
dest_files=["res://.godot/imported/moss_contamination_atlas_texture.png-80aa9a19eb65e2c40b783557f4f8a743.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 60 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cquonnydto387"
|
||||
path="res://.godot/imported/moss_contamination_atlas_texture_2.png-d3b17c123dfe73058f82ef745ed7ae76.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_contamination_atlas_texture_2.png"
|
||||
dest_files=["res://.godot/imported/moss_contamination_atlas_texture_2.png-d3b17c123dfe73058f82ef745ed7ae76.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 29 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c07hqxv7mybw7"
|
||||
path="res://.godot/imported/moss_element_1.png-5689c80beabd4d37765ecc4aa128cd18.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_element_1.png"
|
||||
dest_files=["res://.godot/imported/moss_element_1.png-5689c80beabd4d37765ecc4aa128cd18.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://x68ggxb8jbid"
|
||||
path="res://.godot/imported/moss_element_2.png-0612506a49d7e87c3d31a8a0d4bbe052.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_element_2.png"
|
||||
dest_files=["res://.godot/imported/moss_element_2.png-0612506a49d7e87c3d31a8a0d4bbe052.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cb1k4g8fcsuke"
|
||||
path="res://.godot/imported/moss_element_3.png-590cfa4dea5af9388a3be231b1eb9e69.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_element_3.png"
|
||||
dest_files=["res://.godot/imported/moss_element_3.png-590cfa4dea5af9388a3be231b1eb9e69.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 581 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dsa7wbwjiebnw"
|
||||
path="res://.godot/imported/moss_ground_texture.png-db5ac5662696a68d00ce73febb556cc3.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_ground_texture.png"
|
||||
dest_files=["res://.godot/imported/moss_ground_texture.png-db5ac5662696a68d00ce73febb556cc3.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 212 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ch4rydip0nlt6"
|
||||
path="res://.godot/imported/moss_rock_atlas_texture.png-42db73700a39c396acd665f1acf7a968.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_rock_atlas_texture.png"
|
||||
dest_files=["res://.godot/imported/moss_rock_atlas_texture.png-42db73700a39c396acd665f1acf7a968.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
stages/terrain/region/assets/textures/red_rect.png
Normal file
|
After Width: | Height: | Size: 264 B |
40
stages/terrain/region/assets/textures/red_rect.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bi08trir23od2"
|
||||
path="res://.godot/imported/red_rect.png-37a9e533ba7e4668f9eb8a241791dccb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/red_rect.png"
|
||||
dest_files=["res://.godot/imported/red_rect.png-37a9e533ba7e4668f9eb8a241791dccb.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
stages/terrain/region/assets/textures/red_tiles.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
40
stages/terrain/region/assets/textures/red_tiles.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ddecvei4l62gn"
|
||||
path="res://.godot/imported/red_tiles.png-a93183162dddbf2e40094e4a73dd9c29.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/red_tiles.png"
|
||||
dest_files=["res://.godot/imported/red_tiles.png-a93183162dddbf2e40094e4a73dd9c29.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=false
|
||||
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
|
||||
|
After Width: | Height: | Size: 190 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://beqx4rmgthkql"
|
||||
path="res://.godot/imported/rock_background_texture.png-79a8569ff49f7d85f8b64d55ac1ce62d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/rock_background_texture.png"
|
||||
dest_files=["res://.godot/imported/rock_background_texture.png-79a8569ff49f7d85f8b64d55ac1ce62d.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
|
After Width: | Height: | Size: 315 KiB |
BIN
stages/terrain/region/assets/textures/rock_cristal_texture.png
Normal file
|
After Width: | Height: | Size: 204 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://02nuoqleo4yu"
|
||||
path="res://.godot/imported/rock_cristal_texture.png-c34612644dbfa24e49296bfe43df46c6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/rock_cristal_texture.png"
|
||||
dest_files=["res://.godot/imported/rock_cristal_texture.png-c34612644dbfa24e49296bfe43df46c6.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
BIN
stages/terrain/region/assets/textures/round_red_tiles.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bmdb63witojeg"
|
||||
path="res://.godot/imported/round_red_tiles.png-c254569faa1f0323275dcc266f2b4c86.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://stages/terrain/region/assets/textures/round_red_tiles.png"
|
||||
dest_files=["res://.godot/imported/round_red_tiles.png-c254569faa1f0323275dcc266f2b4c86.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
6
stages/terrain/region/moss_biome.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bnwq0xl7ak661"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1mp5sguc0b6u" path="res://stages/terrain/region/scripts/region.gd" id="1_ne67o"]
|
||||
|
||||
[node name="Planet" type="Node2D"]
|
||||
script = ExtResource("1_ne67o")
|
||||
43
stages/terrain/region/region.tscn
Normal file
@@ -0,0 +1,43 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://tsi5j1uxppa4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1mp5sguc0b6u" path="res://stages/terrain/region/scripts/region.gd" id="1_441sk"]
|
||||
[ext_resource type="PackedScene" uid="uid://dt6mptqg80dew" path="res://gui/game/tutorial/tutorial.tscn" id="2_2f6js"]
|
||||
[ext_resource type="PackedScene" uid="uid://yk78ubpu5ghq" path="res://gui/game/pass_day/pass_day.tscn" id="3_ktnx3"]
|
||||
[ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="4_qdnee"]
|
||||
[ext_resource type="PackedScene" uid="uid://bgvbgeq46wee2" path="res://entities/player/player.tscn" id="5_ovqi1"]
|
||||
[ext_resource type="PackedScene" uid="uid://cg1visg52i21a" path="res://entities/interactables/ladder/ladder.tscn" id="6_2w03p"]
|
||||
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/truck/recharge/truck_recharge.tscn" id="7_6d8m3"]
|
||||
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="8_fwgig"]
|
||||
|
||||
[node name="Region" type="Node2D" node_paths=PackedStringArray("entity_container")]
|
||||
script = ExtResource("1_441sk")
|
||||
first_loot_number = null
|
||||
loot_item_number = null
|
||||
entity_container = NodePath("Entities")
|
||||
|
||||
[node name="RegionGui" type="CanvasLayer" parent="."]
|
||||
layer = 2
|
||||
|
||||
[node name="Tutorial" parent="RegionGui" node_paths=PackedStringArray("player", "region") instance=ExtResource("2_2f6js")]
|
||||
player = NodePath("../../Entities/Player")
|
||||
region = NodePath("../..")
|
||||
|
||||
[node name="PassDay" parent="RegionGui" instance=ExtResource("3_ktnx3")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="GameGui" parent="." instance=ExtResource("4_qdnee")]
|
||||
|
||||
[node name="Entities" type="Node2D" parent="."]
|
||||
y_sort_enabled = true
|
||||
|
||||
[node name="TruckLadder" parent="Entities" instance=ExtResource("6_2w03p")]
|
||||
position = Vector2(51, -112)
|
||||
|
||||
[node name="Player" parent="Entities" instance=ExtResource("5_ovqi1")]
|
||||
z_index = 1
|
||||
|
||||
[node name="TruckRecharge" parent="Entities" instance=ExtResource("7_6d8m3")]
|
||||
position = Vector2(-50, -124)
|
||||
|
||||
[node name="Camera" parent="." node_paths=PackedStringArray("following") instance=ExtResource("8_fwgig")]
|
||||
following = NodePath("../Entities/Player")
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://b3vnia5tb6pil"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://q5isn3rwrir8" path="res://common/vfx/materials/shaders/texture_color_filter.gdshader" id="1_4m73r"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/region/assets/textures/garden_background_texture.png" id="2_4m73r"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_4m73r")
|
||||
shader_parameter/red_overlay_tex = ExtResource("2_4m73r")
|
||||
shader_parameter/scale = 0.006944444
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://85ap1buim1ha"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://q5isn3rwrir8" path="res://common/vfx/materials/shaders/texture_color_filter.gdshader" id="1_v8wor"]
|
||||
[ext_resource type="Texture2D" uid="uid://bseoyd8mqjo7y" path="res://stages/terrain/region/assets/textures/garden_decontamined_background_texture.png" id="2_v8wor"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_v8wor")
|
||||
shader_parameter/red_overlay_tex = ExtResource("2_v8wor")
|
||||
shader_parameter/scale = 0.003
|
||||
@@ -0,0 +1,23 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=6 format=3 uid="uid://bq3dmwkej5gmx"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://bglep64ppn74p" path="res://common/vfx/materials/shaders/textures_data_filter.gdshader" id="1_kujx0"]
|
||||
[ext_resource type="Texture2D" uid="uid://beqx4rmgthkql" path="res://stages/terrain/region/assets/textures/rock_background_texture.png" id="2_6cs2h"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/region/assets/textures/garden_background_texture.png" id="2_ydx6d"]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_kujx0"]
|
||||
noise_type = 0
|
||||
frequency = 0.02
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_ydx6d"]
|
||||
width = 20
|
||||
height = 20
|
||||
noise = SubResource("FastNoiseLite_kujx0")
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_kujx0")
|
||||
shader_parameter/data_texture = SubResource("NoiseTexture2D_ydx6d")
|
||||
shader_parameter/data_texture_size = Vector2(200, 200)
|
||||
shader_parameter/data_texture_threshold = 0.5
|
||||
shader_parameter/texture_0 = ExtResource("2_6cs2h")
|
||||
shader_parameter/texture_1 = ExtResource("2_ydx6d")
|
||||
shader_parameter/texture_scale = 5.0
|
||||
@@ -0,0 +1,20 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=6 format=3 uid="uid://ljvaj1vab53a"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://bglep64ppn74p" path="res://common/vfx/materials/shaders/textures_data_filter.gdshader" id="1_ye8oh"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/region/assets/textures/garden_background_texture.png" id="2_6hswu"]
|
||||
[ext_resource type="Texture2D" uid="uid://ex35g5nvtsy0" path="res://stages/terrain/region/assets/textures/garden_decontamined_background_texture_old.png" id="2_r7pv0"]
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_6hswu"]
|
||||
frequency = 0.0109
|
||||
|
||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_j3avn"]
|
||||
noise = SubResource("FastNoiseLite_6hswu")
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_ye8oh")
|
||||
shader_parameter/data_texture = SubResource("NoiseTexture2D_j3avn")
|
||||
shader_parameter/data_texture_size = Vector2(1000, 1000)
|
||||
shader_parameter/data_texture_threshold = 0.5
|
||||
shader_parameter/texture_0 = ExtResource("2_6hswu")
|
||||
shader_parameter/texture_1 = ExtResource("2_r7pv0")
|
||||
shader_parameter/texture_scale = 5.0
|
||||
@@ -0,0 +1,9 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://dpxu8yeee4qi1"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://q5isn3rwrir8" path="res://common/vfx/materials/shaders/texture_color_filter.gdshader" id="1_k4e5t"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/region/assets/textures/garden_background_texture.png" id="2_k4e5t"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_k4e5t")
|
||||
shader_parameter/red_overlay_tex = ExtResource("2_k4e5t")
|
||||
shader_parameter/scale = 0.005
|
||||
@@ -0,0 +1,11 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://d365ovfmi3d0s"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://q5isn3rwrir8" path="res://common/vfx/materials/shaders/texture_color_filter.gdshader" id="1_xr5ia"]
|
||||
[ext_resource type="Texture2D" uid="uid://beqx4rmgthkql" path="res://stages/terrain/region/assets/textures/rock_background_texture.png" id="2_ieaec"]
|
||||
[ext_resource type="Texture2D" uid="uid://02nuoqleo4yu" path="res://stages/terrain/region/assets/textures/rock_cristal_texture.png" id="2_sc014"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_xr5ia")
|
||||
shader_parameter/red_overlay_tex = ExtResource("2_ieaec")
|
||||
shader_parameter/green_overlay_tex = ExtResource("2_sc014")
|
||||
shader_parameter/scale = 0.006944444
|
||||
1160
stages/terrain/region/resources/moss_biome.tres
Normal file
164
stages/terrain/region/scripts/chunk.gd
Normal file
@@ -0,0 +1,164 @@
|
||||
@tool
|
||||
extends Node2D
|
||||
class_name Chunk
|
||||
|
||||
signal generated
|
||||
|
||||
var region : Region
|
||||
var region_seed : int
|
||||
var wall_threshold = 0.3
|
||||
var decontamination_threshold = 0.
|
||||
var cristal_threshold = 0.08
|
||||
var rock_noise_image : Noise = null
|
||||
var decontamination_noise_image : Noise = null
|
||||
|
||||
var is_generated : bool = false :
|
||||
set(v):
|
||||
is_generated = true
|
||||
if is_generated:
|
||||
generated.emit()
|
||||
var generation_finished : Array[String] = []
|
||||
|
||||
const GENERATION_NUMBER = 4
|
||||
|
||||
const NOISE_IMAGE_SIZE := 150
|
||||
|
||||
const ROCK_NOISE_FREQUENCY := 0.01
|
||||
const DECONTAMINATION_NOISE_FREQUENCY := 0.01
|
||||
|
||||
@export_tool_button("Update", "Callable") var update_action = func():
|
||||
region_seed = randi()
|
||||
generate()
|
||||
|
||||
var data : ChunkData
|
||||
|
||||
func _init(
|
||||
_data : ChunkData,
|
||||
_planet : Region = null,
|
||||
):
|
||||
region = _planet
|
||||
if region:
|
||||
region_seed = region.data.region_seed
|
||||
data = _data
|
||||
|
||||
func generate():
|
||||
rock_noise_image = generate_noise(region_seed + 1, ROCK_NOISE_FREQUENCY)
|
||||
decontamination_noise_image = generate_noise(region_seed + 2, DECONTAMINATION_NOISE_FREQUENCY)
|
||||
global_position = data.chunk_coord * (Region.CHUNK_TILE_SIZE * Region.TILE_SIZE)
|
||||
generate_rocks()
|
||||
generate_ground()
|
||||
generate_decontamination()
|
||||
|
||||
func finish_one_generation(generation_name : String):
|
||||
generation_finished.append(generation_name)
|
||||
if len(generation_finished) >= GENERATION_NUMBER:
|
||||
is_generated = true
|
||||
|
||||
func unload():
|
||||
for x in range(Region.CHUNK_TILE_SIZE):
|
||||
for y in range(Region.CHUNK_TILE_SIZE):
|
||||
var global_coord = Vector2i(x, y) + Region.CHUNK_TILE_SIZE * data.chunk_coord
|
||||
region.rock_layer.erase_cell(global_coord)
|
||||
region.ground_layer.erase_cell(global_coord)
|
||||
region.decontamination_layer.erase_cell(global_coord)
|
||||
|
||||
# Debug
|
||||
# func _draw():
|
||||
# draw_rect(
|
||||
# Rect2(Vector2.ZERO, Vector2.ONE * Region.CHUNK_TILE_SIZE * Region.TILE_SIZE),
|
||||
# Color.WHITE,
|
||||
# false,
|
||||
# 3
|
||||
# )
|
||||
|
||||
# for x in range(NOISE_IMAGE_SIZE):
|
||||
# for y in range(NOISE_IMAGE_SIZE):
|
||||
# var noise_value = rock_noise_image.get_noise_2d(
|
||||
# x,
|
||||
# y
|
||||
# )
|
||||
# draw_rect(
|
||||
# Rect2(Vector2i(x,y) * Region.CHUNK_SIZE / NOISE_IMAGE_SIZE, Vector2i.ONE * Region.CHUNK_SIZE / NOISE_IMAGE_SIZE),
|
||||
# Color.WHITE * ((noise_value+1)/2),
|
||||
# true,
|
||||
# )
|
||||
|
||||
func generate_noise(
|
||||
noise_seed : int,
|
||||
frequency := 0.01
|
||||
) -> Noise:
|
||||
var noise_image_size := NOISE_IMAGE_SIZE * Vector2i.ONE
|
||||
var noise: FastNoiseLite = FastNoiseLite.new()
|
||||
noise.seed = noise_seed
|
||||
noise.noise_type = FastNoiseLite.TYPE_SIMPLEX
|
||||
noise.frequency = 0.01
|
||||
noise.fractal_type = FastNoiseLite.FRACTAL_NONE
|
||||
noise.fractal_weighted_strength = 1.0
|
||||
noise.offset = Vector3(
|
||||
noise_image_size.x * data.chunk_coord.x,
|
||||
noise_image_size.y * data.chunk_coord.y,
|
||||
1
|
||||
)
|
||||
|
||||
return noise
|
||||
|
||||
func get_tile_value_from_noise(tile_position : Vector2i, noise : Noise) -> float:
|
||||
var val = noise.get_noise_2d(
|
||||
floori(float(tile_position.x * NOISE_IMAGE_SIZE) / Region.CHUNK_TILE_SIZE),
|
||||
floori(float(tile_position.y * NOISE_IMAGE_SIZE) / Region.CHUNK_TILE_SIZE)
|
||||
)
|
||||
return (val + 1)/2
|
||||
|
||||
func generate_rocks():
|
||||
var cristals : Array[Vector2i] = []
|
||||
var rocks : Array[Vector2i] = []
|
||||
for x in range(Region.CHUNK_TILE_SIZE):
|
||||
for y in range(Region.CHUNK_TILE_SIZE):
|
||||
var tile_type := get_generated_rock_type(Vector2i(x, y))
|
||||
var global_coord = Vector2i(x, y) + Region.CHUNK_TILE_SIZE * data.chunk_coord
|
||||
if tile_type == RockLayer.TileType.CRISTAL:
|
||||
cristals.append(global_coord)
|
||||
elif tile_type == RockLayer.TileType.ROCK:
|
||||
rocks.append(global_coord)
|
||||
|
||||
region.rock_layer.place_rocks(cristals, RockLayer.TileType.CRISTAL, func(): finish_one_generation("rock"))
|
||||
region.rock_layer.place_rocks(rocks, RockLayer.TileType.ROCK, func(): finish_one_generation("cristal"))
|
||||
|
||||
func get_generated_rock_type(coord : Vector2i) -> RockLayer.TileType:
|
||||
var tile_value : float = get_tile_value_from_noise(coord, rock_noise_image)
|
||||
var saved_diff := data.get_rock_tile_diff(coord)
|
||||
|
||||
if (
|
||||
(saved_diff == ChunkData.TileDiff.PRESENT or tile_value < wall_threshold)
|
||||
and saved_diff != ChunkData.TileDiff.ABSENT
|
||||
):
|
||||
return RockLayer.TileType.CRISTAL if tile_value < cristal_threshold else RockLayer.TileType.ROCK
|
||||
return RockLayer.TileType.EMPTY
|
||||
|
||||
func generate_ground():
|
||||
var coords : Array[Vector2i] = []
|
||||
for x in range(Region.CHUNK_TILE_SIZE):
|
||||
for y in range(Region.CHUNK_TILE_SIZE):
|
||||
coords.append(Vector2i(x,y) + Region.CHUNK_TILE_SIZE * data.chunk_coord)
|
||||
|
||||
region.ground_layer.place_ground(coords, func(): finish_one_generation("ground"))
|
||||
|
||||
func generate_decontamination():
|
||||
var decontamination_tiles : Array[Vector2i] = []
|
||||
for x in range(Region.CHUNK_TILE_SIZE):
|
||||
for y in range(Region.CHUNK_TILE_SIZE):
|
||||
var coord = Vector2i(x,y)
|
||||
var tile_value : float = get_tile_value_from_noise(coord, decontamination_noise_image)
|
||||
var saved_diff := data.get_decontamination_tile_diff(coord)
|
||||
if (
|
||||
(saved_diff == ChunkData.TileDiff.PRESENT or tile_value < decontamination_threshold)
|
||||
and saved_diff != ChunkData.TileDiff.ABSENT
|
||||
):
|
||||
decontamination_tiles.append(Vector2i(x,y) + Region.CHUNK_TILE_SIZE * data.chunk_coord)
|
||||
|
||||
region.decontamination_layer.place_decontaminations(
|
||||
decontamination_tiles,
|
||||
false,
|
||||
func():
|
||||
finish_one_generation("decontamination")
|
||||
)
|
||||
1
stages/terrain/region/scripts/chunk.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d2ixbaa2uqlv4
|
||||
62
stages/terrain/region/scripts/chunk_data.gd
Normal file
@@ -0,0 +1,62 @@
|
||||
extends Resource
|
||||
class_name ChunkData
|
||||
|
||||
enum TileDiff { NO_DIFF,PRESENT,ABSENT }
|
||||
|
||||
@export var chunk_coord : Vector2i
|
||||
@export var rock_tiles_diff : Dictionary[String, TileDiff]
|
||||
@export var decontamination_tiles_diff : Dictionary[String, TileDiff]
|
||||
|
||||
func _init(
|
||||
_chunk_coord : Vector2i
|
||||
):
|
||||
chunk_coord = _chunk_coord
|
||||
|
||||
#region ------------------ Generic Tile ------------------
|
||||
|
||||
func get_coord_key(coord : Vector2i) -> String:
|
||||
return "%d:%d" % [coord.x, coord.y]
|
||||
|
||||
func get_tile_diff(
|
||||
coord : Vector2i,
|
||||
tiles_diff : Dictionary[String, TileDiff]
|
||||
) -> TileDiff:
|
||||
if not has_diff(coord, tiles_diff):
|
||||
return TileDiff.NO_DIFF
|
||||
return tiles_diff[get_coord_key(coord)]
|
||||
|
||||
func update_tile_diff(
|
||||
coord : Vector2i,
|
||||
diff : TileDiff,
|
||||
tiles_diff : Dictionary[String, TileDiff]
|
||||
):
|
||||
tiles_diff[get_coord_key(coord)] = diff
|
||||
|
||||
func has_diff(
|
||||
coord : Vector2i,
|
||||
tiles_diff : Dictionary[String, TileDiff]
|
||||
):
|
||||
return tiles_diff.has(get_coord_key(coord))
|
||||
|
||||
#region ------------------ Rock ------------------
|
||||
|
||||
func get_rock_tile_diff(coord : Vector2i) -> TileDiff:
|
||||
return get_tile_diff(coord, rock_tiles_diff)
|
||||
|
||||
func update_rock_tile_diff(coord : Vector2i, diff : TileDiff):
|
||||
update_tile_diff(coord, diff, rock_tiles_diff)
|
||||
|
||||
func has_rock_tile_diff(coord : Vector2i):
|
||||
return has_diff(coord, rock_tiles_diff)
|
||||
|
||||
|
||||
#region ------------------ Decontamination ------------------
|
||||
|
||||
func get_decontamination_tile_diff(coord : Vector2i) -> TileDiff:
|
||||
return get_tile_diff(coord, decontamination_tiles_diff)
|
||||
|
||||
func update_decontamination_tile_diff(coord : Vector2i, diff : TileDiff):
|
||||
update_tile_diff(coord, diff, decontamination_tiles_diff)
|
||||
|
||||
func has_decontamination_tile_diff(coord : Vector2i):
|
||||
return has_diff(coord, decontamination_tiles_diff)
|
||||
1
stages/terrain/region/scripts/chunk_data.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://clqa88okc325t
|
||||
196
stages/terrain/region/scripts/region.gd
Normal file
@@ -0,0 +1,196 @@
|
||||
extends Terrain
|
||||
class_name Region
|
||||
|
||||
const MIN_PASS_DAY_ANIMATION_TIME : float = PassDay.TIME_MARGIN * 2
|
||||
|
||||
const TUTORIAL_SCENE : PackedScene = preload("res://gui/game/tutorial/tutorial.tscn")
|
||||
|
||||
const TILE_SET : TileSet = preload("res://stages/terrain/region/resources/moss_biome.tres")
|
||||
const TILE_SCALE = 1
|
||||
const TILE_SIZE : int = roundi(TILE_SET.tile_size.x * TILE_SCALE)
|
||||
const START_ROCK_HOLE_RADIUS = 5
|
||||
const START_DECONTAMINATION_HOLE_RADIUS = 3
|
||||
const CHUNK_TILE_SIZE : int = 20
|
||||
const CHUNK_SIZE = CHUNK_TILE_SIZE * TILE_SIZE
|
||||
const CHUNK_LOAD_DISTANCE : int = 1
|
||||
const CHUNK_UNLOAD_DISTANCE : int = 2
|
||||
|
||||
@export var first_loot_number : int = 3
|
||||
@export var loot_item_number : Array[int] = [1,2]
|
||||
|
||||
var is_generated : bool : get = check_is_generated
|
||||
var generated_value : float : get = get_generated_value
|
||||
|
||||
var data : RegionData
|
||||
|
||||
var in_passing_day_animation = false
|
||||
|
||||
var contamination_texture : ImageTexture
|
||||
var rock_layer : RockLayer
|
||||
var ground_layer : GroundLayer
|
||||
var decontamination_layer : DecontaminationLayer
|
||||
|
||||
var tile_set = Region.TILE_SET
|
||||
|
||||
var generated_chunks : Dictionary[String,Chunk] = {}
|
||||
var generation_semaphore: Semaphore
|
||||
|
||||
func _init():
|
||||
data = GameInfo.game_data.current_region_data
|
||||
|
||||
func _ready():
|
||||
generation_semaphore = Semaphore.new()
|
||||
generation_semaphore.post()
|
||||
|
||||
entity_container.position = TILE_SIZE * CHUNK_TILE_SIZE * Vector2.ONE / 2
|
||||
load_entities(data.entities_saved_data)
|
||||
|
||||
for e in entity_container.get_children():
|
||||
if e is Plant:
|
||||
data.add_plant_data(e.data)
|
||||
|
||||
generate_first_entities()
|
||||
|
||||
ground_layer = GroundLayer.new(self)
|
||||
add_child(ground_layer)
|
||||
rock_layer = RockLayer.new(self)
|
||||
add_child(rock_layer)
|
||||
decontamination_layer = DecontaminationLayer.new(self)
|
||||
add_child(decontamination_layer)
|
||||
|
||||
generate_near_chunks(player)
|
||||
|
||||
edit_map_origin()
|
||||
|
||||
func _process(_d):
|
||||
if player:
|
||||
generate_near_chunks(player)
|
||||
remove_far_chunks(player)
|
||||
|
||||
#region ------------------ Generation ------------------
|
||||
|
||||
func generate_first_entities():
|
||||
if not (Vector2i.ZERO in data.generated_chunk_entities):
|
||||
# Generate shovel
|
||||
drop_item(Shovel.new(), entity_container.global_position + Vector2(0, 100))
|
||||
|
||||
func get_chunk_key(coord) -> String:
|
||||
return "%d:%d" % [coord.x, coord.y]
|
||||
|
||||
func generate_near_chunks(p : Player):
|
||||
|
||||
var player_chunk_coord = Math.get_chunk_from_pos(p.global_position)
|
||||
|
||||
for x in range(-CHUNK_LOAD_DISTANCE, CHUNK_LOAD_DISTANCE+1):
|
||||
for y in range(-CHUNK_LOAD_DISTANCE, CHUNK_LOAD_DISTANCE+1):
|
||||
var coord : Vector2i = Vector2i(x,y) + player_chunk_coord
|
||||
if not generated_chunks.has(get_chunk_key(coord)):
|
||||
generate_chunk(coord)
|
||||
|
||||
func remove_far_chunks(p : Player):
|
||||
var player_chunk_coord = Vector2i(
|
||||
floor(p.global_position.x / (CHUNK_TILE_SIZE * TILE_SIZE)),
|
||||
floor(p.global_position.y / (CHUNK_TILE_SIZE * TILE_SIZE))
|
||||
)
|
||||
|
||||
for chunk in generated_chunks.values():
|
||||
var chunk_coord = chunk.data.chunk_coord
|
||||
if player_chunk_coord.distance_to(chunk_coord) > CHUNK_UNLOAD_DISTANCE:
|
||||
remove_chunk(chunk)
|
||||
|
||||
func generate_chunk(coord : Vector2i):
|
||||
var chunk_data := data.get_or_create_chunk_data(coord)
|
||||
|
||||
var chunk_key = get_chunk_key(coord)
|
||||
if not generated_chunks.has(chunk_key):
|
||||
var new_chunk = Chunk.new(
|
||||
chunk_data,
|
||||
self
|
||||
)
|
||||
generated_chunks[chunk_key] = new_chunk
|
||||
add_child(new_chunk)
|
||||
data.generated_chunk_entities.append(coord)
|
||||
new_chunk.generate()
|
||||
|
||||
func edit_map_origin():
|
||||
# Dig a hole in map origin
|
||||
var chunk_center = Vector2i.ONE * floori(CHUNK_TILE_SIZE/2.)
|
||||
var hole_tiles : Array[Vector2i] = []
|
||||
var decontamination_tiles : Array[Vector2i] = []
|
||||
for x in range(CHUNK_TILE_SIZE):
|
||||
for y in range(CHUNK_TILE_SIZE):
|
||||
var coord = Vector2i(x,y)
|
||||
if coord.distance_to(chunk_center) < START_ROCK_HOLE_RADIUS:
|
||||
hole_tiles.append(coord)
|
||||
if coord.distance_to(chunk_center) < START_DECONTAMINATION_HOLE_RADIUS:
|
||||
decontamination_tiles.append(coord)
|
||||
|
||||
rock_layer.remove_rocks(hole_tiles, true)
|
||||
decontamination_layer.place_decontaminations(decontamination_tiles, true)
|
||||
|
||||
func remove_chunk(chunk : Chunk):
|
||||
generated_chunks.erase(get_chunk_key(chunk.data.chunk_coord))
|
||||
chunk.unload()
|
||||
chunk.queue_free()
|
||||
|
||||
func check_is_generated() -> bool:
|
||||
if len(generated_chunks.keys()) == 0:
|
||||
return false
|
||||
return get_chunk_generation_count() == float(get_full_chunk_generation_count())
|
||||
|
||||
func get_generated_value():
|
||||
return get_chunk_generation_count() / float(get_full_chunk_generation_count())
|
||||
|
||||
func get_full_chunk_generation_count() -> int:
|
||||
return len(generated_chunks.keys()) * Chunk.GENERATION_NUMBER
|
||||
|
||||
func get_chunk_generation_count() -> int:
|
||||
var generation_count = 0
|
||||
|
||||
for key in generated_chunks.keys():
|
||||
generation_count += len(generated_chunks[key].generation_finished)
|
||||
|
||||
return generation_count
|
||||
|
||||
func save():
|
||||
data.entities_saved_data = save_entities()
|
||||
|
||||
#endregion
|
||||
|
||||
#region ------------------ Usage ------------------
|
||||
|
||||
func plant(
|
||||
plant_seed : Seed,
|
||||
plant_position : Vector2i
|
||||
) -> bool:
|
||||
var new_plant_data = PlantData.generate_from_seed(plant_seed, plant_position)
|
||||
data.add_plant_data(new_plant_data)
|
||||
var new_plant = Plant.new(new_plant_data)
|
||||
add_entity(new_plant, plant_position)
|
||||
return true
|
||||
|
||||
func pass_day():
|
||||
data.start_pass_day()
|
||||
%PassDay.pass_day_animation()
|
||||
for e : Node2D in entity_container.get_children():
|
||||
if e.has_method("_start_pass_day"):
|
||||
e._start_pass_day()
|
||||
if not %PassDay.is_animation_appeared:
|
||||
await %PassDay.animation_appeared
|
||||
|
||||
data.day += 1
|
||||
for e : Node2D in entity_container.get_children():
|
||||
if e.has_method("_pass_day"):
|
||||
e._pass_day()
|
||||
|
||||
data.proceed_pass_day()
|
||||
if not %PassDay.is_animation_disappeared:
|
||||
await %PassDay.animation_disappeared
|
||||
for e : Node2D in entity_container.get_children():
|
||||
if e.has_method("_end_pass_day"):
|
||||
e._end_pass_day()
|
||||
|
||||
data.end_pass_day()
|
||||
|
||||
save()
|
||||
#endregion
|
||||
1
stages/terrain/region/scripts/region.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d1mp5sguc0b6u
|
||||
128
stages/terrain/region/scripts/region_data.gd
Normal file
@@ -0,0 +1,128 @@
|
||||
extends Resource
|
||||
class_name RegionData
|
||||
|
||||
enum State {IN_PROGRESS,FAILED,SUCCEEDED}
|
||||
|
||||
signal plant_changing_score(p : PlantData, amount : int)
|
||||
signal updated(region_data : RegionData)
|
||||
|
||||
signal pass_day_started(region_data : RegionData)
|
||||
signal pass_day_proceeded(region_data : RegionData)
|
||||
signal pass_day_ended(region_data : RegionData)
|
||||
|
||||
const DEFAULT_START_CHARGE := 10
|
||||
const DEFAULT_OBJECTIVE := 10
|
||||
|
||||
@export var region_seed : int
|
||||
@export var region_name : String
|
||||
@export var day : int = 1
|
||||
@export var entities_saved_data : Array[EntityData] = []
|
||||
@export var score_by_plant : Dictionary[PlantData, int] = {}
|
||||
@export var generated_chunk_entities : Array[Vector2i]
|
||||
@export var tutorial_step : int = 0
|
||||
@export var tutorial = false
|
||||
|
||||
@export var chunks_data : Dictionary[String, ChunkData]
|
||||
|
||||
@export var charges : int :
|
||||
set(v):
|
||||
charges = v
|
||||
updated.emit(self)
|
||||
@export var objective : int :
|
||||
set(v):
|
||||
objective = v
|
||||
updated.emit(self)
|
||||
|
||||
|
||||
var in_passing_day_animation := false
|
||||
|
||||
func _init(
|
||||
parameter : RegionParameter = RegionParameter.new()
|
||||
):
|
||||
charges = parameter.charges
|
||||
objective = parameter.objective
|
||||
region_name = parameter.name
|
||||
region_seed = parameter.region_seed
|
||||
|
||||
tutorial = parameter.tutorial
|
||||
|
||||
#region ------------------ Chunks ------------------
|
||||
|
||||
func get_coord_id(coord):
|
||||
return "%d:%d" % [coord.x, coord.y]
|
||||
|
||||
func has_chunk_data(coord : Vector2i) -> bool:
|
||||
return chunks_data.has(get_coord_id(coord))
|
||||
|
||||
func add_chunk_data(coord : Vector2i, data : ChunkData):
|
||||
chunks_data[get_coord_id(coord)] = data
|
||||
|
||||
func get_chunk_data(coord : Vector2i) -> ChunkData:
|
||||
return chunks_data[get_coord_id(coord)]
|
||||
|
||||
func get_or_create_chunk_data(coord : Vector2i) -> ChunkData:
|
||||
if has_chunk_data(coord):
|
||||
return get_chunk_data(coord)
|
||||
else:
|
||||
var new_chunk_data = ChunkData.new(coord)
|
||||
add_chunk_data(coord, new_chunk_data)
|
||||
return new_chunk_data
|
||||
|
||||
#endregion
|
||||
|
||||
#region ------------------ Score ------------------
|
||||
|
||||
func get_score():
|
||||
var score = 0
|
||||
for plant_data in score_by_plant:
|
||||
score += score_by_plant[plant_data]
|
||||
return score
|
||||
|
||||
func is_objective_reached():
|
||||
return get_score() >= objective
|
||||
|
||||
func get_state() -> State:
|
||||
if get_score() >= objective:
|
||||
return State.SUCCEEDED
|
||||
elif charges <= 0:
|
||||
return State.FAILED
|
||||
else:
|
||||
return State.IN_PROGRESS
|
||||
#endregion
|
||||
|
||||
#region ------------------ Day ------------------
|
||||
|
||||
func start_pass_day():
|
||||
in_passing_day_animation = true
|
||||
pass_day_started.emit(self)
|
||||
|
||||
func proceed_pass_day():
|
||||
pass_day_proceeded.emit(self)
|
||||
|
||||
func end_pass_day():
|
||||
pass_day_ended.emit(self)
|
||||
in_passing_day_animation = false
|
||||
|
||||
#endregion
|
||||
|
||||
#region ------------------ Plants ------------------
|
||||
|
||||
func add_plant_data(plant_data : PlantData):
|
||||
score_by_plant[plant_data] = plant_data.get_score()
|
||||
plant_data.disappeared.connect(_on_plant_disappeared)
|
||||
plant_data.updated.connect(_on_plant_updated)
|
||||
|
||||
func _on_plant_updated(plant_data : PlantData):
|
||||
var old_plant_score = score_by_plant[plant_data]
|
||||
score_by_plant[plant_data] = plant_data.get_score()
|
||||
|
||||
if old_plant_score != score_by_plant[plant_data]:
|
||||
plant_changing_score.emit(plant_data, score_by_plant[plant_data] - old_plant_score)
|
||||
updated.emit(self)
|
||||
|
||||
func _on_plant_disappeared(plant_data : PlantData):
|
||||
plant_changing_score.emit(plant_data, - score_by_plant[plant_data])
|
||||
score_by_plant.erase(plant_data)
|
||||
updated.emit(self)
|
||||
|
||||
#endregion
|
||||
1
stages/terrain/region/scripts/region_data.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cx30nvq8b34lj
|
||||
21
stages/terrain/region/scripts/region_parameter.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
extends Resource
|
||||
class_name RegionParameter
|
||||
|
||||
@export var charges : int
|
||||
@export var objective : int
|
||||
@export var name : String
|
||||
@export var tutorial : bool
|
||||
@export var region_seed : int
|
||||
|
||||
func _init(
|
||||
_charges : int = 10,
|
||||
_objective : int = 10,
|
||||
_name = Random.generate_random_name(),
|
||||
_tutorial = false,
|
||||
_region_seed = randi(),
|
||||
):
|
||||
charges = _charges
|
||||
objective = _objective
|
||||
name = _name
|
||||
tutorial = _tutorial
|
||||
region_seed = _region_seed
|
||||
1
stages/terrain/region/scripts/region_parameter.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ddk7j5b8p51dk
|
||||
@@ -0,0 +1,32 @@
|
||||
@tool
|
||||
extends RegionLayer
|
||||
class_name DecontaminationLayer
|
||||
|
||||
const DECONTAMINATION_TILE_TERRAIN_SET : int = 0
|
||||
const DECONTAMINATION_TILE_TERRAIN : int = 0
|
||||
|
||||
func setup():
|
||||
z_index = -99
|
||||
|
||||
func place_decontamination(coord : Vector2i, save = false):
|
||||
place_decontaminations([coord], save)
|
||||
|
||||
func place_decontaminations(coords : Array[Vector2i], save := false, on_finished : Callable = (func(): pass)):
|
||||
async_place_terrain_cells(
|
||||
coords,
|
||||
DECONTAMINATION_TILE_TERRAIN_SET,
|
||||
DECONTAMINATION_TILE_TERRAIN,
|
||||
on_finished
|
||||
)
|
||||
if save:
|
||||
for coord in coords:
|
||||
var chunk_coord = Vector2i(
|
||||
floori(coord.x / float(Region.CHUNK_TILE_SIZE)),
|
||||
floori(coord.y / float(Region.CHUNK_TILE_SIZE)),
|
||||
)
|
||||
(region.data
|
||||
.get_chunk_data(chunk_coord)
|
||||
.update_decontamination_tile_diff(coord, ChunkData.TileDiff.PRESENT))
|
||||
|
||||
func is_decontamined(coord : Vector2i) -> bool:
|
||||
return has_cell(coord)
|
||||
@@ -0,0 +1 @@
|
||||
uid://2p41t6efxudd
|
||||
@@ -0,0 +1,19 @@
|
||||
@tool
|
||||
extends RegionLayer
|
||||
class_name GroundLayer
|
||||
|
||||
const MATERIAL : Material = preload("res://stages/terrain/region/resources/materials/moss_biome/ground_planet_tilemap.tres")
|
||||
const GROUND_TILE_TERRAIN_SET : int = 0
|
||||
const GROUND_TILE_TERRAIN : int = 3
|
||||
|
||||
func setup():
|
||||
material = MATERIAL
|
||||
z_index = -100
|
||||
|
||||
func place_ground(coords : Array[Vector2i], on_finished : Callable = (func(): pass)):
|
||||
async_place_terrain_cells(
|
||||
coords,
|
||||
GROUND_TILE_TERRAIN_SET,
|
||||
GROUND_TILE_TERRAIN,
|
||||
on_finished
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cui423qbula4a
|
||||
@@ -0,0 +1,71 @@
|
||||
@abstract
|
||||
extends TileMapLayer
|
||||
class_name RegionLayer
|
||||
|
||||
var threads : Array[Thread] = []
|
||||
var is_generated = false
|
||||
var region : Region
|
||||
|
||||
func _init(
|
||||
_planet : Region = null
|
||||
):
|
||||
region = _planet
|
||||
|
||||
func _ready():
|
||||
tile_set = region.tile_set
|
||||
scale = Vector2.ONE * Region.TILE_SCALE
|
||||
navigation_enabled = false
|
||||
setup()
|
||||
|
||||
func setup():
|
||||
pass
|
||||
|
||||
func get_all_neighbors_cell(coord : Vector2i) -> Array[Vector2i]:
|
||||
var neighbors : Array[Vector2i] = []
|
||||
for x in [-1, 0, 1]:
|
||||
for y in [-1, 0, 1]:
|
||||
var neighbor = Vector2i(
|
||||
coord.x + x,
|
||||
coord.y + y
|
||||
)
|
||||
if coord != neighbor:
|
||||
neighbors.append(neighbor)
|
||||
return neighbors
|
||||
|
||||
func has_cell(tile_position : Vector2i) -> bool:
|
||||
return get_cell_source_id(tile_position) != -1
|
||||
|
||||
func async_place_terrain_cells(
|
||||
coords : Array[Vector2i],
|
||||
tile_terrain_set : int = 0,
|
||||
tile_terrain : int = 0,
|
||||
on_finished : Callable = (func(): pass)
|
||||
):
|
||||
var thread = Thread.new()
|
||||
threads.append(thread)
|
||||
thread.start(
|
||||
func ():
|
||||
place_terrain_cells(
|
||||
coords,
|
||||
tile_terrain_set,
|
||||
tile_terrain
|
||||
)
|
||||
on_finished.call_deferred()
|
||||
)
|
||||
|
||||
func place_terrain_cells(
|
||||
coords : Array[Vector2i],
|
||||
tile_terrain_set : int = 0,
|
||||
tile_terrain : int = 0
|
||||
):
|
||||
region.generation_semaphore.wait()
|
||||
set_cells_terrain_connect(
|
||||
coords,
|
||||
tile_terrain_set,
|
||||
tile_terrain
|
||||
)
|
||||
region.generation_semaphore.post()
|
||||
|
||||
func _exit_tree():
|
||||
for t in threads:
|
||||
t.wait_to_finish()
|
||||
@@ -0,0 +1 @@
|
||||
uid://cyqmcmgeb76cp
|
||||
73
stages/terrain/region/scripts/tile_map_layers/rock_layer.gd
Normal file
@@ -0,0 +1,73 @@
|
||||
@tool
|
||||
extends RegionLayer
|
||||
class_name RockLayer
|
||||
|
||||
const MATERIAL : Material = preload("res://stages/terrain/region/resources/materials/rock_planet_tilemap.tres")
|
||||
const ROCK_TILE_TERRAIN_SET : int = 0
|
||||
const ROCK_TILE_TERRAIN : int = 1
|
||||
const CRISTAL_TILE_TERRAIN : int = 2
|
||||
|
||||
const CRISTAL_LOOT_CHANCE : float = 1
|
||||
|
||||
enum TileType { EMPTY,ROCK,CRISTAL }
|
||||
|
||||
func setup():
|
||||
material = MATERIAL
|
||||
z_index = 2
|
||||
|
||||
func place_rocks(coords : Array[Vector2i], type := TileType.ROCK,on_finished : Callable = (func(): pass)):
|
||||
if type != TileType.EMPTY:
|
||||
async_place_terrain_cells(
|
||||
coords,
|
||||
ROCK_TILE_TERRAIN_SET,
|
||||
ROCK_TILE_TERRAIN if type == TileType.ROCK else CRISTAL_TILE_TERRAIN,
|
||||
on_finished
|
||||
)
|
||||
|
||||
func remove_rocks(coords : Array[Vector2i], save = false,on_finished : Callable = (func(): pass)):
|
||||
async_place_terrain_cells(
|
||||
coords,
|
||||
ROCK_TILE_TERRAIN_SET,
|
||||
-1,
|
||||
on_finished
|
||||
)
|
||||
if save:
|
||||
for coord in coords:
|
||||
var chunk_coord = Vector2i(
|
||||
floori(coord.x / float(Region.CHUNK_TILE_SIZE)),
|
||||
floori(coord.y / float(Region.CHUNK_TILE_SIZE)),
|
||||
)
|
||||
var chunk_tile_coord : Vector2i = coord - chunk_coord * Region.CHUNK_TILE_SIZE
|
||||
(region.data
|
||||
.get_chunk_data(chunk_coord)
|
||||
.update_rock_tile_diff(chunk_tile_coord, ChunkData.TileDiff.ABSENT))
|
||||
|
||||
func dig_rocks(coords : Array[Vector2i]) -> bool:
|
||||
var has_rock = false
|
||||
|
||||
for coord in coords:
|
||||
if has_tile(coord):
|
||||
has_rock = true
|
||||
loot_rock(coord)
|
||||
|
||||
if has_rock:
|
||||
remove_rocks(coords, true)
|
||||
|
||||
return has_rock
|
||||
|
||||
func loot_rock(coord : Vector2i):
|
||||
if get_tile_type(coord) == TileType.CRISTAL and randf() < CRISTAL_LOOT_CHANCE:
|
||||
var loot = Seed.generate_random()
|
||||
region.drop_item(
|
||||
loot,
|
||||
coord * Region.TILE_SIZE + Vector2i.ONE * floori(Region.TILE_SIZE/2.),
|
||||
floor(Region.TILE_SIZE/2.)
|
||||
)
|
||||
|
||||
func has_tile(coord : Vector2i) -> bool:
|
||||
return has_cell(coord)
|
||||
|
||||
func get_tile_type(coord : Vector2i) -> TileType:
|
||||
if has_tile(coord):
|
||||
return TileType.CRISTAL if get_cell_tile_data(coord).terrain == CRISTAL_TILE_TERRAIN else TileType.ROCK
|
||||
return TileType.EMPTY
|
||||
@@ -0,0 +1 @@
|
||||
uid://cjys51dllryqk
|
||||