Working map generator

This commit is contained in:
2024-01-21 00:42:57 +01:00
parent cd80ab3357
commit 405b374b9a
17 changed files with 240 additions and 38 deletions

View File

@ -1,18 +1,16 @@
[gd_scene load_steps=5 format=3 uid="uid://c7cvc4y0kpl3g"]
[gd_scene load_steps=4 format=3 uid="uid://c7cvc4y0kpl3g"]
[ext_resource type="Script" path="res://scripts/v2/world.gd" id="1_cgytt"]
[ext_resource type="Script" path="res://scripts/v2/worldgen/standard_generator.gd" id="2_3jlht"]
[ext_resource type="Resource" uid="uid://din7qhqccs2nr" path="res://scenes/v2/worldgen/generator_instances/standard_gen.tres" id="2_ag01j"]
[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="3_5mj08"]
[sub_resource type="Resource" id="Resource_kbdfk"]
script = ExtResource("2_3jlht")
parts = Array[PackedScene]([])
[node name="World" type="Node2D" node_paths=PackedStringArray("map")]
script = ExtResource("1_cgytt")
generator = SubResource("Resource_kbdfk")
generator = ExtResource("2_ag01j")
map = NodePath("TileMap")
[node name="TileMap" type="TileMap" parent="."]
tile_set = ExtResource("3_5mj08")
format = 2
[node name="Camera2D" type="Camera2D" parent="."]

View File

@ -0,0 +1,16 @@
[gd_resource type="Resource" script_class="StandardWorldGenerator" load_steps=9 format=3 uid="uid://din7qhqccs2nr"]
[ext_resource type="Script" path="res://scripts/v2/worldgen/standard_generator.gd" id="1_dw1bv"]
[ext_resource type="PackedScene" uid="uid://csuo1u5ickjbt" path="res://scenes/v2/worldgen/roomsets/standard/blocking.tscn" id="1_oci60"]
[ext_resource type="PackedScene" uid="uid://c5ipf40bxdqc6" path="res://scenes/v2/worldgen/roomsets/standard/hallway.tscn" id="2_t3otv"]
[ext_resource type="PackedScene" uid="uid://c8vs23y1tdhx8" path="res://scenes/v2/worldgen/roomsets/standard/medium_room_up.tscn" id="3_xlr3c"]
[ext_resource type="PackedScene" uid="uid://7jnspqbabihc" path="res://scenes/v2/worldgen/roomsets/standard/medium_room_up_down.tscn" id="4_tc4ie"]
[ext_resource type="PackedScene" uid="uid://bc5n3rb5t8ua7" path="res://scenes/v2/worldgen/roomsets/standard/small_room_down_right.tscn" id="5_ft2s4"]
[ext_resource type="PackedScene" uid="uid://t511rr478gom" path="res://scenes/v2/worldgen/roomsets/standard/small_fork.tscn" id="6_ttx05"]
[ext_resource type="PackedScene" uid="uid://3vfg1g7uhjp2" path="res://scenes/v2/worldgen/roomsets/standard/spawn_room.tscn" id="7_pb65x"]
[resource]
script = ExtResource("1_dw1bv")
rooms = Array[PackedScene]([ExtResource("1_oci60"), ExtResource("2_t3otv"), ExtResource("3_xlr3c"), ExtResource("4_tc4ie"), ExtResource("5_ft2s4"), ExtResource("6_ttx05")])
max_room_path_length = 10
spawn_room = ExtResource("7_pb65x")

View File

@ -1,7 +1,10 @@
[gd_scene load_steps=2 format=3 uid="uid://csuo1u5ickjbt"]
[gd_scene load_steps=3 format=3 uid="uid://csuo1u5ickjbt"]
[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="1_kd8r8"]
[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_vckf1"]
[node name="TileMap" type="TileMap"]
tile_set = ExtResource("1_vckf1")
format = 2
layer_0/tile_data = PackedInt32Array(0, 0, 0, 1, 0, 0, 65537, 0, 0, 65536, 0, 0, 2, 0, 0, 65538, 0, 0, 131074, 0, 0, 131073, 0, 0, 131072, 0, 0, 196608, 0, 0, 262144, 0, 0, 262145, 0, 0, 262146, 0, 0, 262147, 0, 0, 262148, 0, 0, 262149, 0, 0, 196613, 0, 0, 131077, 0, 0, 65541, 0, 0, 5, 0, 0, 4, 0, 0, 3, 0, 0, 65539, 0, 0, 131075, 0, 0, 65540, 0, 0, 131076, 0, 0, 196611, 0, 0, 196610, 0, 0, 196609, 0, 0, 196612, 0, 0)
script = ExtResource("1_kd8r8")

View File

@ -0,0 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://c5ipf40bxdqc6"]
[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_mnkww"]
[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="2_4hex2"]
[node name="Hallway" type="TileMap"]
position = Vector2(-2, -52)
tile_set = ExtResource("1_mnkww")
format = 2
layer_0/tile_data = PackedInt32Array(0, 0, 0, 1, 0, 0, 2, 0, 0, 262144, 0, 0, 262145, 0, 0, 262146, 0, 0, 262147, 0, 0, 3, 0, 0, 4, 0, 0, 5, 0, 0, 262148, 0, 0, 262149, 0, 0, 262150, 0, 0, 262151, 0, 0, 262152, 0, 0, 262153, 0, 0, 262154, 0, 0, 6, 0, 0, 7, 0, 0, 8, 0, 0, 9, 0, 0, 10, 0, 0)
script = ExtResource("2_4hex2")
left = true
right = true

View File

@ -0,0 +1,11 @@
[gd_scene load_steps=3 format=3 uid="uid://c8vs23y1tdhx8"]
[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_ucjv8"]
[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="2_nekba"]
[node name="MediumRoomUp" type="TileMap"]
tile_set = ExtResource("1_ucjv8")
format = 2
layer_0/tile_data = PackedInt32Array(0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 5, 0, 0, 6, 0, 0, 10, 0, 0, 11, 0, 0, 12, 0, 0, 13, 0, 0, 14, 0, 0, 15, 0, 0, 16, 0, 0, 65536, 0, 0, 131072, 0, 0, 196608, 0, 0, 262144, 0, 0, 65552, 0, 0, 131088, 0, 0, 196624, 0, 0, 327680, 0, 0, 393216, 0, 0, 458752, 0, 0, 524288, 0, 0, 589824, 0, 0, 655360, 0, 0, 720896, 0, 0, 720897, 0, 0, 720898, 0, 0, 720899, 0, 0, 720900, 0, 0, 720901, 0, 0, 720902, 0, 0, 720909, 0, 0, 720910, 0, 0, 589840, 0, 0, 524304, 0, 0, 458768, 0, 0, 393232, 0, 0, 327696, 0, 0, 262160, 0, 0, 720912, 0, 0, 655376, 0, 0, 720911, 0, 0, 720907, 0, 0, 720906, 0, 0, 720905, 0, 0, 720904, 0, 0, 720903, 0, 0, 720908, 0, 0, 196614, 0, 0, 196615, 0, 0, 196616, 0, 0, 196617, 0, 0, 196618, 0, 0, 8, 1, 0, 65543, 1, 0, 65545, 1, 0, 196612, 0, 0, 196613, 0, 0, 393217, 0, 0, 393218, 0, 0, 393219, 0, 0, 393220, 0, 0, 393221, 0, 0, 393222, 0, 0, 393223, 0, 0, 393224, 0, 0, 196619, 0, 0, 196620, 0, 0, 262156, 0, 0, 327692, 0, 0, 393228, 0, 0, 458764, 0, 0, 589837, 1, 0, 589839, 1, 0, 524302, 1, 0, 458765, 1, 0, 458767, 1, 0, 393230, 1, 0, 327693, 1, 0, 327695, 1, 0, 262158, 1, 0, 196621, 1, 0, 196623, 1, 0, 458760, 0, 0, 458759, 0, 0, 458758, 0, 0, 458757, 0, 0, 458756, 0, 0, 458755, 0, 0, 458754, 0, 0, 458753, 0, 0)
script = ExtResource("2_nekba")
top = true

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://7jnspqbabihc"]
[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_0bmf2"]
[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="2_n0xwr"]
[node name="MediumRoomUpDown" type="TileMap"]
tile_set = ExtResource("1_0bmf2")
format = 2
layer_0/tile_data = PackedInt32Array(0, 0, 0, 65536, 0, 0, 131072, 0, 0, 196608, 0, 0, 262144, 0, 0, 327680, 0, 0, 393216, 0, 0, 458752, 0, 0, 524288, 0, 0, 589824, 0, 0, 655360, 0, 0, 720896, 0, 0, 1, 0, 0, 720897, 0, 0, 2, 0, 0, 720898, 0, 0, 3, 0, 0, 720899, 0, 0, 4, 0, 0, 720900, 0, 0, 5, 0, 0, 720901, 0, 0, 6, 0, 0, 720902, 0, 0, 10, 0, 0, 720906, 0, 0, 11, 0, 0, 720907, 0, 0, 720908, 0, 0, 720909, 0, 0, 720910, 0, 0, 720911, 0, 0, 196624, 0, 0, 262160, 0, 0, 327696, 0, 0, 393232, 0, 0, 458768, 0, 0, 524304, 0, 0, 589840, 0, 0, 655376, 0, 0, 720912, 0, 0, 720903, 1, 0, 720905, 1, 0, 8, 1, 0, 65543, 1, 0, 65545, 1, 0, 458759, 0, 0, 458758, 0, 0, 458760, 0, 0, 458761, 0, 0, 458757, 0, 0, 458756, 0, 0, 458762, 0, 0, 458763, 0, 0, 196612, 0, 0, 196613, 0, 0, 196614, 0, 0, 196615, 0, 0, 196616, 0, 0, 196617, 0, 0, 196618, 0, 0, 196619, 0, 0, 65546, 0, 0, 131082, 0, 0, 131083, 0, 0, 65547, 0, 0, 196620, 0, 0, 196621, 0, 0, 196622, 0, 0, 196623, 0, 0, 458764, 0, 0, 589837, 1, 0, 589839, 1, 0, 524302, 1, 0, 458765, 1, 0, 458767, 1, 0, 458755, 1, 0, 458753, 1, 0, 524290, 1, 0, 589825, 1, 0, 589827, 1, 0, 393218, 1, 0, 327681, 1, 0, 327683, 1, 0, 262146, 1, 0, 196609, 1, 0, 196611, 1, 0, 262156, 0, 0, 262157, 0, 0, 262158, 0, 0, 262159, 0, 0, 262148, 0, 0, 12, 0, 0, 13, 0, 0, 14, 0, 0, 15, 0, 0, 16, 0, 0, 65552, 0, 0, 131088, 0, 0, 131087, 0, 0, 131086, 0, 0, 131085, 0, 0, 131084, 0, 0, 65548, 0, 0, 65549, 0, 0, 65550, 0, 0, 65551, 0, 0)
script = ExtResource("2_n0xwr")
top = true
bottom = true

View File

@ -0,0 +1,14 @@
[gd_scene load_steps=3 format=3 uid="uid://t511rr478gom"]
[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_eu7wp"]
[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="2_lsa1k"]
[node name="SmallFork" type="TileMap"]
tile_set = ExtResource("1_eu7wp")
format = 2
layer_0/tile_data = PackedInt32Array(65536, 0, 0, 131072, 0, 0, 458752, 0, 0, 524288, 0, 0, 131073, 0, 0, 524289, 0, 0, 65538, 0, 0, 131074, 0, 0, 458754, 0, 0, 524290, 0, 0, 65542, 0, 0, 131078, 0, 0, 458758, 0, 0, 524294, 0, 0, 131079, 0, 0, 524295, 0, 0, 65544, 0, 0, 131080, 0, 0, 458760, 0, 0, 524296, 0, 0, 0, 0, 0, 393216, 0, 0, 1, 0, 0, 393217, 0, 0, 2, 0, 0, 393218, 0, 0, 393219, 1, 0, 524291, 1, 0, 458756, 1, 0, 393221, 1, 0, 524293, 1, 0, 6, 0, 0, 393222, 0, 0, 7, 0, 0, 393223, 0, 0, 8, 0, 0, 393224, 0, 0, 4, 1, 0, 65539, 1, 0, 65541, 1, 0, 131076, 1, 0, 196611, 1, 0, 196613, 1, 0, 262148, 1, 0)
script = ExtResource("2_lsa1k")
left = true
right = true
top = true
bottom = true

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://bc5n3rb5t8ua7"]
[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_mja1s"]
[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="2_0e88q"]
[node name="SmallRoom1" type="TileMap"]
tile_set = ExtResource("1_mja1s")
format = 2
layer_0/tile_data = PackedInt32Array(65536, 0, 0, 0, 0, 0, 131072, 0, 0, 393216, 0, 0, 458752, 0, 0, 524288, 0, 0, 524289, 0, 0, 524290, 0, 0, 524295, 0, 0, 524296, 0, 0, 524297, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 5, 0, 0, 6, 0, 0, 7, 0, 0, 8, 0, 0, 9, 0, 0, 524291, 0, 0, 524298, 0, 0, 458762, 0, 0, 393226, 0, 0, 327690, 0, 0, 262154, 0, 0, 196618, 0, 0, 131082, 0, 0, 65546, 0, 0, 10, 0, 0, 524292, 1, 0, 524294, 1, 0, 458755, 0, 0, 458754, 0, 0, 458753, 0, 0, 393217, 0, 0, 393218, 0, 0, 393219, 0, 0, 458759, 0, 0, 393223, 0, 0, 393224, 0, 0, 393225, 0, 0, 458761, 0, 0, 458760, 0, 0, 393222, 1, 0)
script = ExtResource("2_0e88q")
left = true
bottom = true

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://3vfg1g7uhjp2"]
[ext_resource type="TileSet" uid="uid://cluemfplimly4" path="res://assets/tiles.tres" id="1_bu30l"]
[ext_resource type="Script" path="res://scripts/v2/worldgen/standard/room.gd" id="2_n3iuk"]
[node name="SpawnRoom" type="TileMap"]
tile_set = ExtResource("1_bu30l")
format = 2
layer_0/tile_data = PackedInt32Array(65536, 0, 0, 0, 0, 0, 327680, 0, 0, 327681, 0, 0, 327682, 0, 0, 327683, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 327684, 0, 0, 327685, 0, 0, 5, 0, 0, 6, 0, 0, 65542, 0, 0, 327686, 0, 0, 262146, 0, 0, 262147, 0, 0, 262148, 0, 0, 393216, 0, 0, 393217, 0, 0, 393218, 0, 0, 393219, 0, 0, 393220, 0, 0, 393221, 0, 0, 393222, 0, 0)
script = ExtResource("2_n3iuk")
left = true
right = true