trees are now different sizes, fixed black lines between tiles

This commit is contained in:
leca 2024-06-07 03:28:38 +03:00
parent a761e412cf
commit 2092e3b0fa
8 changed files with 22 additions and 5 deletions

View File

@ -15,6 +15,7 @@ Things and ideas I'd like to implement
- Sea - Sea
- Desert - Desert
- Mountains - Mountains
- Daylight cycle
- Make a tutorial - Make a tutorial
- Add animals - Add animals
- Make humans and their belongings: - Make humans and their belongings:

View File

@ -6,3 +6,4 @@
resource_name = "Material" resource_name = "Material"
cull_mode = 2 cull_mode = 2
albedo_texture = ExtResource("1_exj7t") albedo_texture = ExtResource("1_exj7t")
texture_filter = 1

View File

@ -6,3 +6,7 @@
resource_name = "Material" resource_name = "Material"
cull_mode = 2 cull_mode = 2
albedo_texture = ExtResource("1_nijc4") albedo_texture = ExtResource("1_nijc4")
metallic_specular = 0.05
roughness = 0.39
texture_filter = 1
proximity_fade_distance = 17.0

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 590 KiB

After

Width:  |  Height:  |  Size: 589 KiB

View File

@ -86,3 +86,7 @@ ingame_menu={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null)
] ]
} }
[rendering]
anti_aliasing/quality/msaa_2d=3

View File

@ -25,21 +25,28 @@ var tile_materials = [ # must be in the same order as an enum above!
var maximum_decoration_objects = 0 var maximum_decoration_objects = 0
func generate_predictable_random(min, max, salt): func generate_predictable_random_int(min, max, salt):
seed((str(World.world_info.seed) + str(position) + str(salt)).hash()) seed((str(World.world_info.seed) + str(position) + str(salt)).hash())
return randi() % (max + 1) + min return randi() % (max + 1) + min
func generate_predictable_random_float(min, max, salt):
seed((str(World.world_info.seed) + str(position) + str(salt)).hash())
return clamp(randf(), min, max)
func generate_decoration_objects(): func generate_decoration_objects():
match tile_type: match tile_type:
TileType.Forest: TileType.Forest:
var key = TileType.keys()[tile_type] var key = TileType.keys()[tile_type]
maximum_decoration_objects = generate_predictable_random(decorations[key]["min"], decorations[key]["max"], ""); maximum_decoration_objects = generate_predictable_random_int(decorations[key]["min"], decorations[key]["max"], "");
for i in range(0, maximum_decoration_objects): for i in range(0, maximum_decoration_objects):
var decoration = decorations[TileType.keys()[tile_type]]["object"].instantiate() var decoration = decorations[TileType.keys()[tile_type]]["object"].instantiate()
var pos = Vector3(generate_predictable_random(0, 10, str(i) + "x") - 5, 0, generate_predictable_random(0, 10, str(i) + "z") - 5) var pos = Vector3(generate_predictable_random_int(0, 10, str(i) + "x") - 5, 0, generate_predictable_random_int(0, 10, str(i) + "z") - 5)
var y_rot = generate_predictable_random(0, 360, str(i) + "rot_y")
var scale = generate_predictable_random_float(0.05, 0.15, str(i) + "scale")
var y_rot = generate_predictable_random_int(0, 360, str(i) + "rot_y")
decoration.rotation.y = y_rot decoration.rotation.y = y_rot
decoration.position = pos decoration.position = pos
decoration.scale = Vector3(scale, scale, scale)
decoration.add_to_group("Decoration") decoration.add_to_group("Decoration")
add_child(decoration) add_child(decoration)
@ -71,8 +78,8 @@ func get_empty_dirs_around():
if !result_north: empty_tiles_around.push_back("north") if !result_north: empty_tiles_around.push_back("north")
if !result_south: empty_tiles_around.push_back("south") if !result_south: empty_tiles_around.push_back("south")
if !result_west: empty_tiles_around.push_back("west") if !result_west: empty_tiles_around.push_back("west")
if !result_east: empty_tiles_around.push_back("east")
if !result_east: empty_tiles_around.push_back("east")
return empty_tiles_around return empty_tiles_around
func save(): func save():