diff --git a/addons/SimpleDungeons/sample_dungeons/mansion/rooms/corridor.tscn b/addons/SimpleDungeons/sample_dungeons/mansion/rooms/corridor.tscn index ff904f91..19ff9301 100644 --- a/addons/SimpleDungeons/sample_dungeons/mansion/rooms/corridor.tscn +++ b/addons/SimpleDungeons/sample_dungeons/mansion/rooms/corridor.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=9 format=3 uid="uid://bn6lta2vs6qh8"] -[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_m0wvh"] +[ext_resource type="Script" uid="uid://ce73fuh74l81l" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_m0wvh"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8tlf5"] albedo_color = Color(0, 0, 0, 1) diff --git a/project.godot b/project.godot index fe76e6f5..3bad06a8 100644 --- a/project.godot +++ b/project.godot @@ -210,6 +210,11 @@ locale/translations_pot_files=PackedStringArray("res://src/dialog/Dialogue.dialo 3d_physics/layer_10="Minimap" 3d_physics/layer_11="ItemRescue" 3d_physics/layer_12="EnemyHitbox" +3d_physics/layer_32="Navigation" + +[navigation] + +3d/default_cell_height=1.0 [physics] diff --git a/src/boss/state/states/BossLogic.State.EngagePlayer.cs b/src/boss/state/states/BossLogic.State.EngagePlayer.cs index 8491cf48..fc0084f4 100644 --- a/src/boss/state/states/BossLogic.State.EngagePlayer.cs +++ b/src/boss/state/states/BossLogic.State.EngagePlayer.cs @@ -19,7 +19,6 @@ public partial class BossLogic var boss = Get(); var player = Get(); var delta = (float)input.Delta; - var playerPosition = new Vector3(player.CurrentPosition.X, boss.GlobalPosition.Y, player.CurrentPosition.Z); var targetDirection = boss.GlobalPosition - player.CurrentPosition; boss.GlobalRotation = new Vector3(boss.GlobalRotation.X, Mathf.LerpAngle(boss.GlobalRotation.Y, Mathf.Atan2(-targetDirection.X, -targetDirection.Z), delta * 3f), boss.GlobalRotation.Z); if (boss.GlobalPosition.DistanceTo(player.CurrentPosition) > 5.0f) diff --git a/src/boss/state/states/BossLogic.State.FollowPlayer.cs b/src/boss/state/states/BossLogic.State.FollowPlayer.cs index 53bfd198..fed46fec 100644 --- a/src/boss/state/states/BossLogic.State.FollowPlayer.cs +++ b/src/boss/state/states/BossLogic.State.FollowPlayer.cs @@ -11,11 +11,10 @@ public partial class BossLogic { public Transition On(in Input.PhysicsTick input) { - var delta = input.Delta; var enemy = Get(); var player = Get(); var target = player.CurrentPosition; - enemy.MoveToLocation(target, (float)delta); + enemy.SetTarget(target); return ToSelf(); } } diff --git a/src/enemy/Enemy.cs b/src/enemy/Enemy.cs index b16a9834..936fb646 100644 --- a/src/enemy/Enemy.cs +++ b/src/enemy/Enemy.cs @@ -2,6 +2,9 @@ using Chickensoft.AutoInject; using Chickensoft.Collections; using Chickensoft.Introspection; using Godot; +using System; +using System.Linq; +using System.Threading.Tasks; namespace GameJamDungeon; @@ -22,7 +25,7 @@ public partial class Enemy : RigidBody3D, IEnemy, IProvide [Dependency] IGameEventDepot GameEventDepot => this.DependOn(); - [Dependency] protected IPlayer Player => this.DependOn(); + [Dependency] protected IPlayer Player => this.DependOn(() => GetParent().GetChildren().OfType().Single()); #endregion #region Exports @@ -53,12 +56,51 @@ public partial class Enemy : RigidBody3D, IEnemy, IProvide private Vector3 _knockbackDirection = Vector3.Zero; + private Vector3 _currentTarget = Vector3.Zero; + + private Timer _thinkTimer; + public void Setup() { _enemyLogic = new EnemyLogic(); _enemyLogic.Set(_enemyStatResource); _enemyLogic.Set(this as IEnemy); _enemyLogic.Set(Player); + + NavAgent.VelocityComputed += NavAgent_VelocityComputed; + NavAgent.TargetReached += NavAgent_TargetReached; + + _thinkTimer = new Timer + { + WaitTime = 1f + }; + AddChild(_thinkTimer); + _thinkTimer.Timeout += NavAgent_TargetReached; + _thinkTimer.Start(); + } + + private void NavAgent_TargetReached() + { + NavAgent.TargetPosition = _currentTarget; + } + + private void NavAgent_VelocityComputed(Vector3 safeVelocity) + { + if (CurrentHP <= 0) + return; + + var lookDir = GlobalPosition - safeVelocity; + var leveledLookDir = new Vector3(lookDir.X, Position.Y, lookDir.Z); + if (leveledLookDir.DistanceTo(GlobalPosition) > 0.2f) + LookAt(new Vector3(lookDir.X, Position.Y, lookDir.Z), Vector3.Up); + + _knockbackStrength = _knockbackStrength * 0.9f; + MoveAndCollide(safeVelocity + (_knockbackDirection * _knockbackStrength)); + } + + public void SetTarget(Vector3 target) + { + Task.Delay(TimeSpan.FromSeconds(1.5)).ContinueWith(_ => _currentTarget = new Vector3(target.X, -1.75f, target.Z)); } public void TakeDamage(double damage, ElementType elementType, bool isCriticalHit = false, bool ignoreDefense = false, bool ignoreElementalResistance = false) @@ -80,26 +122,29 @@ public partial class Enemy : RigidBody3D, IEnemy, IProvide EnemyModelView.PlayHitAnimation(); _enemyLogic.Input(new EnemyLogic.Input.Alerted()); + + if (Player.EquippedWeapon.Value.WeaponTags.Contains(WeaponTag.SelfDamage)) + Player.Stats.SetCurrentHP(Player.Stats.CurrentHP.Value - 5); } } - public void MoveToLocation(Vector3 target, float delta) + public override void _PhysicsProcess(double delta) { - NavAgent.TargetPosition = target; - var targetPosition = NavAgent.GetNextPathPosition(); + if (CurrentHP <= 0) + return; - var velocity = (targetPosition - GlobalTransform.Origin).Normalized() * 2f * delta; - var lookAtDir = GlobalTransform.Origin - velocity; - var lookAtPosition = new Vector3(lookAtDir.X, GlobalPosition.Y, lookAtDir.Z); + var nextPathPosition = NavAgent.GetNextPathPosition(); + var movementDelta = 2f * (float)delta; - if (GlobalPosition.DistanceTo(target) > 1.0f && !velocity.IsEqualApprox(Vector3.Zero) && !Position.IsEqualApprox(lookAtPosition)) - LookAt(lookAtPosition + new Vector3(0.001f, 0.001f, 0.001f), Vector3.Up); + var newVelocity = GlobalPosition.DirectionTo(nextPathPosition) * movementDelta; + + if (NavAgent.AvoidanceEnabled) + NavAgent.Velocity = newVelocity; + else + NavAgent_VelocityComputed(newVelocity); var isWalking = _enemyLogic.Value is EnemyLogic.State.Patrolling or EnemyLogic.State.FollowPlayer; - EnemyModelView.RotateModel(GlobalTransform.Basis, -Player.CurrentBasis.Z, isWalking); - _knockbackStrength = _knockbackStrength * 0.9f; - MoveAndCollide(velocity + (_knockbackDirection * _knockbackStrength)); } public void Knockback(float impulse, Vector3 direction) diff --git a/src/enemy/IEnemy.cs b/src/enemy/IEnemy.cs index 0662fa9b..4bd88259 100644 --- a/src/enemy/IEnemy.cs +++ b/src/enemy/IEnemy.cs @@ -10,11 +10,11 @@ public interface IEnemy : IKillable public void Knockback(float impulse, Vector3 direction); - public void MoveToLocation(Vector3 target, float delta); - public double CurrentHP { get; } public void StartAttackTimer(); public void StopAttackTimer(); + + public void SetTarget(Vector3 target); } diff --git a/src/enemy/IKnockbackable.cs b/src/enemy/IKnockbackable.cs new file mode 100644 index 00000000..39015a65 --- /dev/null +++ b/src/enemy/IKnockbackable.cs @@ -0,0 +1,8 @@ +using Godot; + +namespace GameJamDungeon; + +public interface IKnockbackable +{ + public void Knockback(float impulse, Vector3 direction); +} diff --git a/src/enemy/IKnockbackable.cs.uid b/src/enemy/IKnockbackable.cs.uid new file mode 100644 index 00000000..eca59b3c --- /dev/null +++ b/src/enemy/IKnockbackable.cs.uid @@ -0,0 +1 @@ +uid://d7v2jmgpl6u8 diff --git a/src/enemy/enemy_types/1. sproingy/Sproingy.tscn b/src/enemy/enemy_types/1. sproingy/Sproingy.tscn index 87bb44bf..0b0a0ae9 100644 --- a/src/enemy/enemy_types/1. sproingy/Sproingy.tscn +++ b/src/enemy/enemy_types/1. sproingy/Sproingy.tscn @@ -23,7 +23,7 @@ DropsSoulGemChance = 0.75 metadata/_custom_type_script = ExtResource("2_oln85") [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"] -radius = 0.62699 +radius = 0.3 height = 2.02807 [sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"] @@ -40,6 +40,7 @@ collision_layer = 10 collision_mask = 11 axis_lock_linear_y = true axis_lock_angular_x = true +axis_lock_angular_z = true contact_monitor = true max_contacts_reported = 1 script = ExtResource("1_xsluo") @@ -52,11 +53,14 @@ shape = SubResource("CapsuleShape3D_cwfph") [node name="NavAgent" type="NavigationAgent3D" parent="."] unique_name_in_owner = true -path_max_distance = 3.01 -simplify_path = true avoidance_enabled = true -radius = 2.0 -debug_path_custom_color = Color(1, 0, 0, 1) +radius = 1.5 +neighbor_distance = 5.0 +time_horizon_obstacles = 1.0 +debug_enabled = true +debug_use_custom = true +debug_path_custom_color = Color(0.388717, 0.273656, 0.30701, 1) +debug_path_custom_point_size = 10.0 [node name="LineOfSight" type="Area3D" parent="."] unique_name_in_owner = true diff --git a/src/enemy/enemy_types/2. michael/Michael.tscn b/src/enemy/enemy_types/2. michael/Michael.tscn index 6f7fccf9..4db0e1ee 100644 --- a/src/enemy/enemy_types/2. michael/Michael.tscn +++ b/src/enemy/enemy_types/2. michael/Michael.tscn @@ -27,7 +27,7 @@ height = 5.0 radius = 1.0 [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_0h5s2"] -radius = 0.404629 +radius = 0.3 [sub_resource type="SphereShape3D" id="SphereShape3D_wrps7"] radius = 1.0 @@ -75,7 +75,10 @@ shape = SubResource("CapsuleShape3D_0h5s2") [node name="NavAgent" type="NavigationAgent3D" parent="."] unique_name_in_owner = true +path_postprocessing = 2 avoidance_enabled = true +radius = 5.0 +debug_enabled = true debug_path_custom_color = Color(1, 0, 0, 1) [node name="EnemyModelView" parent="." instance=ExtResource("3_wrps7")] diff --git a/src/enemy/state/states/EnemyLogic.State.FollowPlayer.cs b/src/enemy/state/states/EnemyLogic.State.FollowPlayer.cs index 0eeee090..5c37f69c 100644 --- a/src/enemy/state/states/EnemyLogic.State.FollowPlayer.cs +++ b/src/enemy/state/states/EnemyLogic.State.FollowPlayer.cs @@ -11,11 +11,10 @@ public partial class EnemyLogic { public Transition On(in Input.PhysicsTick input) { - var delta = input.Delta; var enemy = Get(); var player = Get(); var target = player.CurrentPosition; - enemy.MoveToLocation(target, (float)delta); + enemy.SetTarget(target); return ToSelf(); } diff --git a/src/enemy/state/states/EnemyLogic.State.Patrolling.cs b/src/enemy/state/states/EnemyLogic.State.Patrolling.cs index 39e689cd..6693a5c3 100644 --- a/src/enemy/state/states/EnemyLogic.State.Patrolling.cs +++ b/src/enemy/state/states/EnemyLogic.State.Patrolling.cs @@ -1,5 +1,6 @@ using Chickensoft.Introspection; using Godot; +using Org.BouncyCastle.Asn1.X509; namespace GameJamDungeon; @@ -16,7 +17,7 @@ public partial class EnemyLogic { var delta = input.Delta; var enemy = Get(); - enemy.MoveToLocation(_patrolTarget, (float)delta); + enemy.SetTarget(_patrolTarget); return ToSelf(); } diff --git a/src/game/Game.cs b/src/game/Game.cs index e3d722ff..cacb9ab0 100644 --- a/src/game/Game.cs +++ b/src/game/Game.cs @@ -111,7 +111,6 @@ public partial class Game : Node3D, IGame PauseMenu.TransitionCompleted += OnPauseMenuTransitioned; PauseMenu.UnpauseButtonPressed += PauseMenu_UnpauseButtonPressed; - Map.DungeonFinishedGenerating += Map_DungeonFinishedGenerating; InGameUI.InventoryMenu.ClosedMenu += InventoryMenu_CloseInventory; InGameUI.MinimapButtonReleased += Player_MinimapButtonReleased; @@ -274,7 +273,7 @@ public partial class Game : Node3D, IGame private void InventoryMenu_CloseInventory() => GameLogic.Input(new GameLogic.Input.CloseInventory()); - private void Map_DungeonFinishedGenerating() + public void NextFloorLoaded() { var transform = Map.GetPlayerSpawnPosition(); GameRepo.SetPlayerGlobalTransform(transform); diff --git a/src/game/Game.tscn b/src/game/Game.tscn index 75389c47..bf60aefe 100644 --- a/src/game/Game.tscn +++ b/src/game/Game.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=13 format=3 uid="uid://33ek675mfb5n"] +[gd_scene load_steps=14 format=3 uid="uid://33ek675mfb5n"] [ext_resource type="Script" uid="uid://chftlu4proh3d" path="res://src/game/Game.cs" id="1_ytcii"] [ext_resource type="Shader" uid="uid://dmjxo4k2rx1an" path="res://src/app/App.gdshader" id="2_6ifxs"] [ext_resource type="PackedScene" uid="uid://by67pn7fdsg1m" path="res://src/map/Map.tscn" id="3_d8awv"] [ext_resource type="PackedScene" uid="uid://cfecvvav8kkp6" path="res://src/player/Player.tscn" id="3_kk6ly"] +[ext_resource type="Resource" uid="uid://bpdbuf0k0exb5" path="res://src/items/weapons/resources/Sword Sword Odette.tres" id="4_6pp6l"] [ext_resource type="PackedScene" uid="uid://b1muxus5qdbeu" path="res://src/ui/in_game_ui/InGameUI.tscn" id="5_lxtnp"] [ext_resource type="PackedScene" uid="uid://b16ejcwanod72" path="res://src/audio/InGameAudio.tscn" id="6_qc71l"] [ext_resource type="Script" uid="uid://daphxl6vvsbjm" path="res://src/game/DialogueController.cs" id="10_58pbt"] @@ -48,7 +49,8 @@ process_mode = 1 [node name="Player" parent="SubViewportContainer/SubViewport/PauseContainer" instance=ExtResource("3_kk6ly")] unique_name_in_owner = true process_mode = 1 -transform = Transform3D(0.0141716, 0, 0.9999, 0, 1, 0, -0.9999, 0, 0.0141716, 0, -1.02535, -6.18796) +transform = Transform3D(0.0141716, 0, 0.9999, 0, 1, 0, -0.9999, 0, 0.0141716, 0, -2.25339, -6.18796) +_defaultWeapon = ExtResource("4_6pp6l") [node name="Map" parent="SubViewportContainer/SubViewport/PauseContainer" instance=ExtResource("3_d8awv")] unique_name_in_owner = true diff --git a/src/game/IGame.cs b/src/game/IGame.cs index 62ee2c72..ad305415 100644 --- a/src/game/IGame.cs +++ b/src/game/IGame.cs @@ -26,4 +26,6 @@ public interface IGame : IProvide, IProvide, IProvid public void AnnounceMessageOnMainScreen(string message); public void FloorExitReached(); + + public void NextFloorLoaded(); } diff --git a/src/map/Map.cs b/src/map/Map.cs index ab1f2e43..0169f799 100644 --- a/src/map/Map.cs +++ b/src/map/Map.cs @@ -9,9 +9,7 @@ namespace GameJamDungeon; public interface IMap : INode3D { - event Map.DungeonFinishedGeneratingEventHandler DungeonFinishedGenerating; - - public List Floors { get; } + public Godot.Collections.Array Floors { get; } public void SpawnNextFloor(); @@ -24,33 +22,37 @@ public partial class Map : Node3D, IMap { public override void _Notification(int what) => this.Notify(what); - [Signal] - public delegate void DungeonFinishedGeneratingEventHandler(); - [Dependency] - public IGameEventDepot GameEventDepot => this.DependOn(); + public IGame Game => this.DependOn(); - public List Floors { get; set; } = default!; - - [Node] public Floor0 Floor0 { get; set; } = default!; + [Export] + public Godot.Collections.Array Floors { get; set; } = default!; private IDungeonFloor _currentFloor; public void Setup() { - Floors = GetChildren().OfType().ToList(); - _currentFloor = Floors.ElementAt(0); + LoadFloor(); } public void SpawnNextFloor() { var oldFloor = _currentFloor; - Floors.Remove(oldFloor); oldFloor.CallDeferred(MethodName.QueueFree, []); - _currentFloor = Floors.ElementAt(0); + LoadFloor(); _currentFloor.InitializeDungeon(); - EmitSignal(SignalName.DungeonFinishedGenerating); + Game.NextFloorLoaded(); } public Transform3D GetPlayerSpawnPosition() => _currentFloor.GetPlayerSpawnPoint(); + + private void LoadFloor() + { + var currentFloorScene = Floors.First(); + var instantiator = new Instantiator(GetTree()); + var loadedScene = instantiator.LoadAndInstantiate(currentFloorScene.ResourcePath); + AddChild(loadedScene); + _currentFloor = (IDungeonFloor)loadedScene; + Floors.Remove(currentFloorScene); + } } diff --git a/src/map/Map.tscn b/src/map/Map.tscn index e3426f0f..40b70b30 100644 --- a/src/map/Map.tscn +++ b/src/map/Map.tscn @@ -1,75 +1,13 @@ -[gd_scene load_steps=22 format=3 uid="uid://by67pn7fdsg1m"] +[gd_scene load_steps=6 format=3 uid="uid://by67pn7fdsg1m"] [ext_resource type="Script" uid="uid://14e8mu48ed4" path="res://src/map/Map.cs" id="1_bw70o"] [ext_resource type="PackedScene" uid="uid://dl6h1djc27ddl" path="res://src/map/dungeon/floors/Floor00.tscn" id="2_0m8h8"] [ext_resource type="PackedScene" uid="uid://bc1sp6xwe0j65" path="res://src/map/dungeon/floors/Floor01.tscn" id="2_merfv"] [ext_resource type="PackedScene" uid="uid://dmiqwmivkjgmq" path="res://src/map/dungeon/floors/Floor02.tscn" id="4_8y0oy"] -[ext_resource type="PackedScene" uid="uid://bjqgl5u05ia04" path="res://src/map/dungeon/Teleport.tscn" id="5_jiohg"] [ext_resource type="PackedScene" uid="uid://dl1scvkp8r5sw" path="res://src/map/dungeon/floors/Floor03.tscn" id="5_uag72"] -[ext_resource type="PackedScene" uid="uid://cikq7vuorlpbl" path="res://src/map/dungeon/floors/Floor04.tscn" id="6_httk4"] -[ext_resource type="PackedScene" uid="uid://t7cac7801bnk" path="res://src/map/dungeon/floors/Floor05.tscn" id="7_ro62w"] -[ext_resource type="PackedScene" uid="uid://da107mywg18x1" path="res://src/map/dungeon/floors/Floor06.tscn" id="8_q7oan"] -[ext_resource type="PackedScene" uid="uid://cgtqjgh1f5fqi" path="res://src/map/dungeon/floors/Floor07.tscn" id="9_3vg2e"] -[ext_resource type="PackedScene" uid="uid://dg20ovvj2m2lp" path="res://src/map/dungeon/floors/Floor08.tscn" id="10_tx34j"] -[ext_resource type="PackedScene" uid="uid://b5jk743ng6fqg" path="res://src/map/dungeon/floors/Floor09.tscn" id="11_8npfy"] -[ext_resource type="PackedScene" uid="uid://dl2x3l7a3an65" path="res://src/map/dungeon/floors/Floor11.tscn" id="12_pids3"] -[ext_resource type="PackedScene" uid="uid://drvjw06wbi2qh" path="res://src/map/dungeon/floors/Floor12.tscn" id="13_u3fsa"] -[ext_resource type="PackedScene" uid="uid://fellg2owwe64" path="res://src/map/dungeon/floors/Floor13.tscn" id="14_io2ww"] -[ext_resource type="PackedScene" uid="uid://vhqwff12y7wn" path="res://src/map/dungeon/floors/Floor14.tscn" id="15_rb6u5"] -[ext_resource type="PackedScene" uid="uid://h8tc1uohuqx2" path="res://src/map/dungeon/floors/Floor15.tscn" id="16_31a0u"] -[ext_resource type="PackedScene" uid="uid://cyfp0p38w2yfr" path="res://src/map/dungeon/floors/Floor16.tscn" id="17_sbsee"] -[ext_resource type="PackedScene" uid="uid://dnrbqkv438tjx" path="res://src/map/dungeon/floors/Floor17.tscn" id="18_qamtw"] -[ext_resource type="PackedScene" uid="uid://cgoogenmugoti" path="res://src/map/dungeon/floors/Floor18.tscn" id="19_j54h1"] -[ext_resource type="PackedScene" uid="uid://33lvido1dkbu" path="res://src/map/dungeon/floors/Floor19.tscn" id="20_41t83"] [node name="Map" type="Node3D"] script = ExtResource("1_bw70o") +Floors = Array[PackedScene]([ExtResource("2_0m8h8"), ExtResource("2_merfv"), ExtResource("4_8y0oy"), ExtResource("5_uag72")]) [node name="WorldEnvironment" type="WorldEnvironment" parent="."] - -[node name="Floor0" parent="." instance=ExtResource("2_0m8h8")] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.77792, 1.78656, -5.13176) - -[node name="Floor1" parent="." instance=ExtResource("2_merfv")] -unique_name_in_owner = true - -[node name="Floor2" parent="." instance=ExtResource("4_8y0oy")] - -[node name="Floor3" parent="." instance=ExtResource("5_uag72")] - -[node name="Floor04" parent="." instance=ExtResource("6_httk4")] - -[node name="Floor05" parent="." instance=ExtResource("7_ro62w")] - -[node name="Floor06" parent="." instance=ExtResource("8_q7oan")] - -[node name="Floor07" parent="." instance=ExtResource("9_3vg2e")] - -[node name="Floor08" parent="." instance=ExtResource("10_tx34j")] - -[node name="Floor09" parent="." instance=ExtResource("11_8npfy")] - -[node name="Floor11" parent="." instance=ExtResource("12_pids3")] - -[node name="Floor12" parent="." instance=ExtResource("13_u3fsa")] - -[node name="Floor13" parent="." instance=ExtResource("14_io2ww")] - -[node name="Floor14" parent="." instance=ExtResource("15_rb6u5")] - -[node name="Floor15" parent="." instance=ExtResource("16_31a0u")] - -[node name="Floor16" parent="." instance=ExtResource("17_sbsee")] - -[node name="Floor17" parent="." instance=ExtResource("18_qamtw")] - -[node name="Floor18" parent="." instance=ExtResource("19_j54h1")] - -[node name="Floor19" parent="." instance=ExtResource("20_41t83")] - -[node name="Teleport" parent="." instance=ExtResource("5_jiohg")] -unique_name_in_owner = true -process_mode = 3 -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 900, 900, 900) -disable_mode = 2 diff --git a/src/map/dungeon/NavigationMesh.tres b/src/map/dungeon/NavigationMesh.tres new file mode 100644 index 00000000..eb9c326e --- /dev/null +++ b/src/map/dungeon/NavigationMesh.tres @@ -0,0 +1,8 @@ +[gd_resource type="NavigationMesh" format=3 uid="uid://d3n1gyxfjcm5u"] + +[resource] +vertices = PackedVector3Array(-39, -1.46346, -18.25, -29.25, -1.46346, -18, -29, -1.46346, -20.25, -28.25, -1.46346, -21, -26.25, -1.46346, -39, -39, -1.46346, -39, -26.25, -1.46346, -21, -13.5, -1.46346, -21, -13.5, -1.46346, -39, -11.5, -1.46346, -21, -10.75, -1.46346, -20.25, 39, -1.46346, -39, -10.75, -1.46346, -1, 39, -1.46346, -0.75, -25.25, -1.46346, -15.75, -26.5, -1.46346, -15, -26.5, -1.46346, -13, -21, -1.46346, -12, -18, -1.46346, -11.25, -18, -1.46346, -10, -13.25, -1.46346, -10, -13.25, -1.46346, -15, -14, -1.46346, -15, -14.75, -1.46346, -15.75, -18.75, -1.46346, -12, -14.5, -1.46346, -18.5, -25.25, -1.46346, -18.5, -39, -1.46346, -13.75, -29, -1.46346, -13.75, -29, -1.46346, -8.25, -28, -1.46346, -9, -28, -1.46346, -11, -29, -1.46346, -11.75, -39, -1.46346, -6.25, -29, -1.46346, -6.25, -27, -1.46346, -8.5, -26.75, -1.46346, -11.75, -26.5, -1.46346, -6.75, -21, -1.46346, -8, -22, -1.46346, -8.75, -22, -1.46346, -11.25, -26.5, -1.46346, -4.75, -25.25, -1.46346, -4, -18, -1.46346, -8.75, -14, -1.46346, -4.75, -13.25, -1.46346, -4.75, -18.75, -1.46346, -8, -14.75, -1.46346, -4, -25.5, -1.46346, -1.25, -14.5, -1.46346, -1.25, -29.25, -1.46346, -1.75, -39, -1.46346, -1.5, -29, -1.46346, 0.5, -28.25, -1.46346, 1.25, -39, -1.46346, 39, -12.75, -1.46346, 39, -13, -1.46346, 1.25, -11.5, -1.46346, 1.25, -10.75, -1.46346, 0.5, 39, -1.46346, 39) +polygons = [PackedInt32Array(2, 1, 0), PackedInt32Array(2, 0, 3), PackedInt32Array(3, 0, 5), PackedInt32Array(3, 5, 4), PackedInt32Array(4, 6, 3), PackedInt32Array(4, 8, 6), PackedInt32Array(6, 8, 7), PackedInt32Array(9, 7, 8), PackedInt32Array(9, 8, 10), PackedInt32Array(10, 8, 11), PackedInt32Array(12, 10, 13), PackedInt32Array(13, 10, 11), PackedInt32Array(15, 14, 16), PackedInt32Array(16, 14, 17), PackedInt32Array(20, 19, 18), PackedInt32Array(22, 21, 20), PackedInt32Array(18, 24, 20), PackedInt32Array(20, 24, 22), PackedInt32Array(22, 24, 23), PackedInt32Array(24, 17, 23), PackedInt32Array(23, 17, 25), PackedInt32Array(25, 17, 14), PackedInt32Array(25, 14, 26), PackedInt32Array(0, 1, 27), PackedInt32Array(27, 1, 28), PackedInt32Array(30, 29, 31), PackedInt32Array(31, 29, 32), PackedInt32Array(32, 29, 33), PackedInt32Array(32, 33, 27), PackedInt32Array(27, 28, 32), PackedInt32Array(29, 34, 33), PackedInt32Array(30, 31, 35), PackedInt32Array(35, 31, 36), PackedInt32Array(39, 38, 37), PackedInt32Array(36, 16, 35), PackedInt32Array(35, 16, 37), PackedInt32Array(37, 16, 39), PackedInt32Array(39, 16, 40), PackedInt32Array(16, 17, 40), PackedInt32Array(41, 37, 42), PackedInt32Array(42, 37, 38), PackedInt32Array(43, 19, 20), PackedInt32Array(20, 45, 44), PackedInt32Array(43, 20, 46), PackedInt32Array(46, 20, 44), PackedInt32Array(46, 44, 47), PackedInt32Array(46, 47, 38), PackedInt32Array(38, 47, 49), PackedInt32Array(38, 49, 42), PackedInt32Array(42, 49, 48), PackedInt32Array(51, 33, 50), PackedInt32Array(50, 33, 34), PackedInt32Array(52, 51, 50), PackedInt32Array(52, 53, 51), PackedInt32Array(51, 53, 54), PackedInt32Array(56, 55, 53), PackedInt32Array(53, 55, 54), PackedInt32Array(55, 56, 57), PackedInt32Array(57, 58, 55), PackedInt32Array(55, 58, 59), PackedInt32Array(59, 58, 13), PackedInt32Array(58, 12, 13)] +geometry_parsed_geometry_type = 1 +geometry_collision_mask = 2147483648 +agent_radius = 1.0 diff --git a/src/map/dungeon/code/BossFloor.cs b/src/map/dungeon/code/BossFloor.cs index eba796c9..0ca2858e 100644 --- a/src/map/dungeon/code/BossFloor.cs +++ b/src/map/dungeon/code/BossFloor.cs @@ -19,6 +19,4 @@ public partial class BossFloor : Node3D, IDungeonFloor } public Transform3D GetPlayerSpawnPoint() => BossRoom.PlayerSpawn.GlobalTransform; - - public Vector3 GetTeleportSpawnPoint() => BossRoom.TeleportSpawn.GlobalPosition; } diff --git a/src/map/dungeon/code/BossRoomA.cs b/src/map/dungeon/code/BossRoomA.cs index ed6dd412..f4048a48 100644 --- a/src/map/dungeon/code/BossRoomA.cs +++ b/src/map/dungeon/code/BossRoomA.cs @@ -11,8 +11,6 @@ public partial class BossRoomA : Node3D, IBossRoom [Node] public Marker3D PlayerSpawn { get; set; } = default!; - [Node] public Marker3D TeleportSpawn { get; set; } = default!; - [Node] public Node3D HorseHeadStatue { get; set; } = default!; [Node] public Node3D OxFaceStatue { get; set; } = default!; diff --git a/src/map/dungeon/code/DungeonFloor.cs b/src/map/dungeon/code/DungeonFloor.cs index 67f2b72c..d7110b1d 100644 --- a/src/map/dungeon/code/DungeonFloor.cs +++ b/src/map/dungeon/code/DungeonFloor.cs @@ -13,8 +13,6 @@ namespace GameJamDungeon [Node] public GodotObject DungeonGenerator { get; set; } = default!; - [Node] public NavigationRegion3D NavigationRegion3D { get; set; } = default!; - [Node] public EnemyDatabase EnemyDatabase { get; set; } = default!; private Transform3D _playerSpawnPoint; @@ -23,13 +21,12 @@ namespace GameJamDungeon public void InitializeDungeon() { - Rooms = new List(); - DungeonGenerator.Call("generate"); - NavigationRegion3D.BakeNavigationMesh(); + Rooms = []; Rooms = FindAllDungeonRooms([.. GetChildren()], Rooms); _playerSpawnPoint = RandomizePlayerSpawnPoint(); foreach (var room in Rooms) room.SpawnEnemies(EnemyDatabase); + DungeonGenerator.EmitSignal("done_generating"); } public Transform3D GetPlayerSpawnPoint() => _playerSpawnPoint; @@ -52,9 +49,14 @@ namespace GameJamDungeon return roomsFound; foreach (var node in nodesToSearch) + { if (node is MonsterRoom dungeonRoom) roomsFound.Add(dungeonRoom); + if (node.HasSignal("dungeon_done_generating")) + node.EmitSignal("dungeon_done_generating"); + } + return FindAllDungeonRooms(nodesToSearch.SelectMany(x => x.GetChildren()).ToList(), roomsFound); } } diff --git a/src/map/dungeon/floors/Floor01.tscn b/src/map/dungeon/floors/Floor01.tscn index d70de532..7346bc45 100644 --- a/src/map/dungeon/floors/Floor01.tscn +++ b/src/map/dungeon/floors/Floor01.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=11 format=3 uid="uid://bc1sp6xwe0j65"] +[gd_scene load_steps=14 format=3 uid="uid://bc1sp6xwe0j65"] [ext_resource type="Script" uid="uid://dwt6302nsf4vq" path="res://src/map/dungeon/code/DungeonFloor.cs" id="1_0ecnn"] [ext_resource type="Script" uid="uid://b1x125h0tya2w" path="res://addons/SimpleDungeons/DungeonGenerator3D.gd" id="2_cxmwa"] [ext_resource type="PackedScene" uid="uid://dpec2lbt83dhe" path="res://src/map/dungeon/scenes/Set A/03. Antechamber A.tscn" id="3_gkkr3"] +[ext_resource type="Script" uid="uid://ce73fuh74l81l" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="7_sdyti"] +[ext_resource type="Script" uid="uid://fk3jis6rsipv" path="res://src/map/dungeon/code/corridor.gd" id="8_1l8yt"] [ext_resource type="PackedScene" uid="uid://b82dx66mgs2d7" path="res://src/map/dungeon/scenes/Set A/08. BasinRoom.tscn" id="8_5rblf"] [ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="12_aw26s"] [ext_resource type="PackedScene" uid="uid://cihbmyo0ltq4m" path="res://src/map/dungeon/scenes/Set A/19. Floor Exit A.tscn" id="12_n02rw"] @@ -11,8 +13,15 @@ [ext_resource type="PackedScene" uid="uid://b0gwivt7cw7nd" path="res://src/enemy/enemy_types/2. michael/Michael.tscn" id="14_gkkr3"] [sub_resource type="NavigationMesh" id="NavigationMesh_4d8mx"] +vertices = PackedVector3Array(9.5, -0.58859, -3.5, 8.75, -0.58859, -3.25, 8.5, -0.58859, -2.5, 12.5, -0.58859, -2, 11.25, -0.58859, -3, 10.5, -0.58859, -3.5, 5.5, -0.58859, 0.5, 4.75, -0.58859, 0.75, 4.5, -0.58859, 1.5, 6.5, -0.58859, 2, 1.5, -0.58859, 4.5, 0.75, -0.58859, 4.75, 0.5, -0.58859, 5.5, 2.5, -0.58859, 6, -2.5, -0.58859, 36.5, -3.25, -0.58859, 36.75, -3.5, -0.58859, 37.5, -1.5, -0.58859, 38, 14.25, -0.58859, 6.5, 13, -0.58859, 6.75, 13, -0.58859, 7.25, 27.25, -0.58859, 7.25, 27.25, -0.58859, 6.75, 25.75, -0.58859, 6.5, 3.5, -0.58859, -5.5, 6.75, -0.58859, -5.5, 6.75, -0.58859, -19.5, 25.75, -0.58859, -10.25, 27.25, -0.58859, -10.5, 27.25, -0.58859, -11, 13.5, -0.58859, -11, 14.25, -0.58859, -10.5, 13.75, -0.58859, 1.75, 13, -0.58859, 2, 13, -0.58859, 3.75, 14.25, -0.58859, 4, -9, -0.58859, -33.25, -8.75, -0.58859, -34.75, -8.75, -0.58859, -39.5, -4, -0.58859, -35.75, -6.25, -0.58859, -35.75, -6.5, -0.58859, -34.75, -12.5, -0.58859, 37.5, -12.75, -0.58859, 34.75, -14.5, -0.58859, 35.25, -14.5, -0.58859, 38, -1.5, -0.58859, 7.25, -2.5, -0.58859, 5.5, 4, -0.58859, -24.25, 6.75, -0.58859, -24.25, 7, -0.58859, -25, -17, -0.58859, 35, -5.25, -0.58859, 3.25, 14.25, -0.58859, -7.75, 13.5, -0.58859, -7.5, 13.75, -0.58859, -3.25, 18.5, -0.58859, -3.25, -4.5, -0.58859, 2.5, -1.25, -0.58859, 2.5, -1.25, -0.58859, -0.75, -8.75, -0.58859, -19.75, -0.5, -0.58859, -1.5, 2.75, -0.58859, -1.5, 2.75, -0.58859, -4.75, -8.25, -0.58859, -19.25, 13.75, -0.58859, -1.25, 18.75, -0.58859, -0.5, -6.25, -0.58859, -30.25, -7.25, -0.58859, -30, -7.25, -0.58859, -24.25, -4, -0.58859, -24.25, -39.5, -0.58859, 39.5, -17.25, -0.58859, 39.5, -0.75, -0.58859, 6, 3.75, -0.58859, -36, 3.75, -0.58859, -39, -3.75, -0.58859, -39, 1.5, -0.58859, 1.5, 3.25, -0.58859, 2, 21.25, -0.58859, -3.5, 25.75, -0.58859, -7.75, -3.75, -0.58859, -20.75, 3.75, -0.58859, -20.75, -6.25, -0.58859, -33, 7.25, -0.58859, -26.75, 7, -0.58859, -35.75, 2.5, -0.58859, 3.25, 6.5, -0.58859, -0.75, 7.25, -0.58859, -2, 5.5, -0.58859, -2.5, -8.5, -0.58859, -30, -9.25, -0.58859, -30.25, -39.5, -0.58859, -39.5, 9.5, -0.58859, -24.75, 10.5, -0.58859, -26.5, 21.5, -0.58859, -0.75, 25.75, -0.58859, 4, 27.25, -0.58859, 3.75, 27.25, -0.58859, -7.5, -5.25, -0.58859, 34.5, 4.75, 6.66141, -39.5, 4.75, 6.66141, -36.75, 7.25, 6.66141, -36.75, 7.25, 6.66141, -39.5, 10.75, -0.58859, 1.75, 10.75, -0.58859, 0.75, 9.5, -0.58859, 0.75, 9.5, -0.58859, 4.5, 39.5, -0.58859, -39.5, 28.75, -0.58859, -12.25, 28.75, -0.58859, 8.5, 39.5, -0.58859, 39.5, 11.5, -0.58859, 2, 11.25, -0.58859, 6.5, 5.25, -0.58859, 8.75, 1.5, -0.58859, 8.75, 1.5, -0.58859, 39.5, 11.75, -0.58859, 8.75, 5.5, -0.58859, 4.75, 8.25, -0.58859, -39.25, 8.25, -0.58859, -29.5, 12.5, -0.58859, -29.5, 13.5, -0.58859, -28.75, 13.5, -0.58859, -12.5, -7.25, 6.66141, -39.25, -7.25, 6.66141, -36.75, -4.75, 6.66141, -36.75, -4.75, 6.66141, -39.25, -7, -0.58859, -39, -7, -0.58859, -38.25, -6.25, -0.58859, -38, -5, -0.58859, -39, -6.25, -0.58859, -37, -5, -0.58859, -37, 5, -0.58859, -39, 5, -0.58859, -37, 7, -0.58859, -37, 7, -0.58859, -39, -8, -0.58859, -32, -8, -0.58859, -31.5, -7.5, -0.58859, -31.5, -7.5, -0.58859, -32, 11.75, 2.41141, -28.5, 8.5, 2.16141, -28.5, 8.5, 2.16141, -27.5, 11.5, 2.41141, -27.25, 12.5, 2.41141, -28, 11.5, 2.41141, -12.25, 12.5, 2.41141, -12.5, 8.5, -0.58859, -28.25, 8.5, -0.58859, -27.75, 10.5, -0.58859, -27.75, 10.5, -0.58859, -28.25, 11.75, -0.58859, -26.5, 11.75, -0.58859, -25, 12.25, -0.58859, -25, 12.25, -0.58859, -26.5, -7.25, 6.66141, -23.25, -7.25, 6.66141, -20.75, -4.75, 6.66141, -20.75, -4.75, 6.66141, -23.25, 4.75, 6.66141, -23.25, 4.75, 6.66141, -20.75, 7.25, 6.66141, -20.75, 7.25, 6.66141, -23.25, 11.75, -0.58859, -23.25, 11.75, -0.58859, -21, 12.25, -0.58859, -21, 12.25, -0.58859, -23.25, -7, -0.58859, -23, -7, -0.58859, -21, -5, -0.58859, -21, -5, -0.58859, -23, 5, -0.58859, -23, 5, -0.58859, -21, 6.75, -0.58859, -21, 6.75, -0.58859, -23, -3.5, 2.16141, 4.75, -0.25, 2.16141, 4.5, -0.25, 2.16141, 4, -0.5, 2.16141, 3.5, -3.75, 2.16141, 3.5, -4.25, 2.16141, 4, 0.5, 2.16141, 3.75, 0.5, 2.16141, 0.75, -0.25, 2.16141, 0, 3.75, 2.16141, 0.5, 3.75, 2.16141, 0, 3.5, 2.16141, -0.5, 0.25, 2.16141, -0.5, 4.5, 2.16141, -0.25, 4.5, 2.16141, -3.25, 3.75, 2.16141, -4, 7.75, 2.16141, -3.5, 7.75, 2.16141, -4, 8.25, 2.16141, -19.5, 7.75, 2.16141, -19.25, 7.75, 2.16141, -4.75, 8.5, 2.16141, -4.25, -4.25, 2.16141, 35.25, -3.5, 2.16141, 35.75, 4.25, 2.16141, -4.5, -11.75, 2.16141, 35.5, -4.25, 2.16141, 36, -11.75, 2.16141, 36.5, -4.25, 2.16141, 36.5, 11.75, -0.58859, -19.25, 11.75, -0.58859, -17, 12.25, -0.58859, -17, 12.25, -0.58859, -19.25, 11.75, -0.58859, -15.25, 11.75, -0.58859, -13, 12.25, -0.58859, -13, 12.25, -0.58859, -15.25, 12.25, 6.41141, -9.75, 12.25, 6.41141, -8.5, 13.25, 6.41141, -8.5, 13.25, 6.41141, -9.75, 26.75, 6.41141, -9.5, 26.75, 6.41141, -8.5, 27.75, 6.41141, -8.5, 27.75, 6.41141, -9.5, 5.5, -0.58859, -4.25, 5.5, -0.58859, -3.75, 6.75, -0.58859, -3.75, 6.75, -0.58859, -4.25, 19.5, 6.41141, -2.5, 19.5, 6.41141, -1.5, 20.5, 6.41141, -1.5, 20.5, 6.41141, -2.5, 19.75, -0.58859, -2.25, 19.75, -0.58859, -1.75, 20.25, -0.58859, -1.75, 20.25, -0.58859, -2.25, 8.5, 2.41141, 0, 10.75, 2.16141, -0.25, 10.75, 2.16141, -1, 8, 2.16141, -1, 8, 2.41141, -0.25, 0.5, 2.41141, 8, 4.5, 2.41141, 7.75, 3.5, 2.41141, 6.75, 0, 2.16141, 7, 0, 2.41141, 7.75, 4, 2.16141, 3, 4, 2.41141, 3.75, 4.5, 2.41141, 4, 8.5, 2.41141, 3.75, 7.5, 2.41141, 2.75, 7.5, 2.41141, 0, -0.5, 2.41141, 8, -0.5, 2.41141, 38.75, 0.5, 2.41141, 39.75, -15.25, 2.16141, 39, -16.25, 2.16141, 39.75, 3.5, 2.41141, 4, -15.5, 2.16141, 36, -16.25, 2.16141, 36, 1.5, -0.58859, -0.25, 1.5, -0.58859, 0.25, 2.75, -0.58859, 0.25, 2.75, -0.58859, -0.25, 7.75, -0.58859, 0.75, 7.75, -0.58859, 2, 8.25, -0.58859, 2, 8.25, -0.58859, 0.75, -2.5, -0.58859, 3.75, -2.5, -0.58859, 4.25, -1.25, -0.58859, 4.25, -1.25, -0.58859, 3.75, 3.75, -0.58859, 4.75, 3.75, -0.58859, 6, 4.25, -0.58859, 6, 4.25, -0.58859, 4.75, 12.25, 6.41141, 4.75, 12.25, 6.41141, 5.75, 13.25, 6.41141, 5.75, 13.25, 6.41141, 4.75, 26.75, 6.41141, 4.75, 26.75, 6.41141, 5.75, 27.75, 6.41141, 5.75, 27.75, 6.41141, 4.75, -0.25, -0.58859, 8.75, -0.25, -0.58859, 11, 0.25, -0.58859, 11, 0.25, -0.58859, 8.75, -0.25, -0.58859, 12.75, -0.25, -0.58859, 15, 0.25, -0.58859, 15, 0.25, -0.58859, 12.75, -0.25, -0.58859, 16.75, -0.25, -0.58859, 19, 0.25, -0.58859, 19, 0.25, -0.58859, 16.75, -0.25, -0.58859, 20.75, -0.25, -0.58859, 23, 0.25, -0.58859, 23, 0.25, -0.58859, 20.75, -0.25, -0.58859, 24.75, -0.25, -0.58859, 27, 0.25, -0.58859, 27, 0.25, -0.58859, 24.75, -0.25, -0.58859, 28.75, -0.25, -0.58859, 31, 0.25, -0.58859, 31, 0.25, -0.58859, 28.75, -0.25, -0.58859, 32.75, -0.25, -0.58859, 35, 0.25, -0.58859, 35, 0.25, -0.58859, 32.75, -11.5, -0.58859, 35.75, -11.5, -0.58859, 36.25, -8.75, -0.58859, 36.25, -8.75, -0.58859, 35.75, -7.25, -0.58859, 35.75, -7.25, -0.58859, 36.25, -5.25, -0.58859, 36.25, -5.25, -0.58859, 35.75, -0.25, -0.58859, 36.75, -0.25, -0.58859, 38, 0.25, -0.58859, 38, 0.25, -0.58859, 36.75) +polygons = [PackedInt32Array(1, 0, 2), PackedInt32Array(2, 0, 5), PackedInt32Array(2, 5, 4), PackedInt32Array(2, 4, 3), PackedInt32Array(7, 6, 8), PackedInt32Array(8, 6, 9), PackedInt32Array(11, 10, 12), PackedInt32Array(12, 10, 13), PackedInt32Array(15, 14, 16), PackedInt32Array(16, 14, 17), PackedInt32Array(19, 18, 20), PackedInt32Array(20, 18, 23), PackedInt32Array(20, 23, 22), PackedInt32Array(20, 22, 21), PackedInt32Array(26, 25, 24), PackedInt32Array(28, 27, 29), PackedInt32Array(29, 27, 31), PackedInt32Array(29, 31, 30), PackedInt32Array(33, 32, 34), PackedInt32Array(34, 32, 35), PackedInt32Array(38, 37, 36), PackedInt32Array(41, 40, 39), PackedInt32Array(43, 42, 44), PackedInt32Array(44, 42, 45), PackedInt32Array(17, 14, 46), PackedInt32Array(46, 14, 47), PackedInt32Array(48, 50, 49), PackedInt32Array(44, 51, 43), PackedInt32Array(43, 51, 52), PackedInt32Array(54, 53, 55), PackedInt32Array(55, 53, 56), PackedInt32Array(58, 57, 59), PackedInt32Array(59, 57, 60), PackedInt32Array(62, 61, 63), PackedInt32Array(63, 61, 64), PackedInt32Array(64, 61, 60), PackedInt32Array(32, 65, 35), PackedInt32Array(35, 65, 66), PackedInt32Array(4, 55, 3), PackedInt32Array(3, 55, 65), PackedInt32Array(65, 55, 56), PackedInt32Array(65, 56, 66), PackedInt32Array(68, 67, 69), PackedInt32Array(69, 67, 70), PackedInt32Array(51, 72, 71), PackedInt32Array(47, 12, 73), PackedInt32Array(73, 12, 13), PackedInt32Array(73, 46, 47), PackedInt32Array(75, 74, 76), PackedInt32Array(76, 74, 39), PackedInt32Array(77, 8, 78), PackedInt32Array(78, 8, 9), PackedInt32Array(80, 79, 27), PackedInt32Array(27, 79, 56), PackedInt32Array(27, 56, 53), PackedInt32Array(27, 53, 31), PackedInt32Array(81, 70, 82), PackedInt32Array(82, 70, 48), PackedInt32Array(60, 61, 59), PackedInt32Array(67, 83, 70), PackedInt32Array(70, 83, 48), PackedInt32Array(48, 83, 50), PackedInt32Array(39, 74, 41), PackedInt32Array(41, 74, 85), PackedInt32Array(41, 85, 84), PackedInt32Array(78, 86, 77), PackedInt32Array(77, 86, 10), PackedInt32Array(88, 87, 89), PackedInt32Array(89, 87, 6), PackedInt32Array(90, 60, 91), PackedInt32Array(91, 60, 92), PackedInt32Array(16, 17, 42), PackedInt32Array(42, 17, 45), PackedInt32Array(0, 93, 5), PackedInt32Array(5, 93, 94), PackedInt32Array(51, 71, 52), PackedInt32Array(52, 71, 60), PackedInt32Array(60, 71, 92), PackedInt32Array(9, 6, 87), PackedInt32Array(80, 98, 79), PackedInt32Array(79, 98, 95), PackedInt32Array(95, 98, 96), PackedInt32Array(96, 98, 97), PackedInt32Array(84, 94, 93), PackedInt32Array(24, 63, 26), PackedInt32Array(26, 63, 64), PackedInt32Array(52, 99, 43), PackedInt32Array(89, 2, 88), PackedInt32Array(88, 2, 3), PackedInt32Array(13, 10, 86), PackedInt32Array(37, 41, 83), PackedInt32Array(83, 41, 84), PackedInt32Array(83, 84, 50), PackedInt32Array(50, 84, 93), PackedInt32Array(36, 91, 38), PackedInt32Array(38, 91, 92), PackedInt32Array(35, 66, 18), PackedInt32Array(18, 66, 95), PackedInt32Array(18, 95, 96), PackedInt32Array(18, 96, 23), PackedInt32Array(37, 83, 36), PackedInt32Array(52, 60, 57), PackedInt32Array(103, 102, 100), PackedInt32Array(100, 102, 101), PackedInt32Array(105, 104, 106), PackedInt32Array(106, 104, 107), PackedInt32Array(109, 108, 110), PackedInt32Array(110, 108, 111), PackedInt32Array(104, 112, 107), PackedInt32Array(107, 112, 113), PackedInt32Array(116, 115, 114), PackedInt32Array(113, 117, 107), PackedInt32Array(107, 117, 114), PackedInt32Array(114, 117, 116), PackedInt32Array(114, 118, 107), PackedInt32Array(117, 110, 116), PackedInt32Array(116, 110, 111), PackedInt32Array(121, 120, 119), PackedInt32Array(122, 121, 119), PackedInt32Array(109, 123, 122), PackedInt32Array(122, 119, 109), PackedInt32Array(109, 119, 108), PackedInt32Array(127, 126, 124), PackedInt32Array(124, 126, 125), PackedInt32Array(129, 128, 130), PackedInt32Array(130, 128, 131), PackedInt32Array(132, 130, 133), PackedInt32Array(133, 130, 131), PackedInt32Array(137, 136, 134), PackedInt32Array(134, 136, 135), PackedInt32Array(141, 140, 138), PackedInt32Array(138, 140, 139), PackedInt32Array(146, 145, 142), PackedInt32Array(142, 145, 144), PackedInt32Array(142, 144, 143), PackedInt32Array(147, 145, 148), PackedInt32Array(148, 145, 146), PackedInt32Array(152, 151, 149), PackedInt32Array(149, 151, 150), PackedInt32Array(156, 155, 153), PackedInt32Array(153, 155, 154), PackedInt32Array(160, 159, 157), PackedInt32Array(157, 159, 158), PackedInt32Array(164, 163, 161), PackedInt32Array(161, 163, 162), PackedInt32Array(168, 167, 165), PackedInt32Array(165, 167, 166), PackedInt32Array(172, 171, 169), PackedInt32Array(169, 171, 170), PackedInt32Array(176, 175, 173), PackedInt32Array(173, 175, 174), PackedInt32Array(179, 178, 180), PackedInt32Array(180, 178, 177), PackedInt32Array(180, 177, 181), PackedInt32Array(181, 177, 182), PackedInt32Array(179, 180, 183), PackedInt32Array(183, 180, 184), PackedInt32Array(184, 180, 185), PackedInt32Array(187, 186, 188), PackedInt32Array(188, 186, 184), PackedInt32Array(188, 184, 189), PackedInt32Array(189, 184, 185), PackedInt32Array(187, 188, 190), PackedInt32Array(190, 188, 191), PackedInt32Array(191, 188, 192), PackedInt32Array(194, 193, 191), PackedInt32Array(196, 195, 197), PackedInt32Array(197, 195, 198), PackedInt32Array(200, 199, 177), PackedInt32Array(177, 199, 182), PackedInt32Array(198, 194, 197), PackedInt32Array(197, 194, 191), PackedInt32Array(197, 191, 201), PackedInt32Array(201, 191, 192), PackedInt32Array(200, 203, 199), PackedInt32Array(199, 203, 202), PackedInt32Array(205, 204, 203), PackedInt32Array(203, 204, 202), PackedInt32Array(209, 208, 206), PackedInt32Array(206, 208, 207), PackedInt32Array(213, 212, 210), PackedInt32Array(210, 212, 211), PackedInt32Array(217, 216, 214), PackedInt32Array(214, 216, 215), PackedInt32Array(221, 220, 218), PackedInt32Array(218, 220, 219), PackedInt32Array(225, 224, 222), PackedInt32Array(222, 224, 223), PackedInt32Array(229, 228, 226), PackedInt32Array(226, 228, 227), PackedInt32Array(233, 232, 230), PackedInt32Array(230, 232, 231), PackedInt32Array(238, 237, 234), PackedInt32Array(234, 237, 235), PackedInt32Array(235, 237, 236), PackedInt32Array(243, 242, 239), PackedInt32Array(239, 242, 241), PackedInt32Array(239, 241, 240), PackedInt32Array(245, 244, 246), PackedInt32Array(246, 244, 248), PackedInt32Array(246, 248, 247), PackedInt32Array(238, 234, 249), PackedInt32Array(249, 234, 248), PackedInt32Array(248, 234, 247), PackedInt32Array(243, 239, 250), PackedInt32Array(250, 239, 251), PackedInt32Array(251, 239, 252), PackedInt32Array(253, 251, 254), PackedInt32Array(254, 251, 252), PackedInt32Array(245, 246, 255), PackedInt32Array(255, 246, 241), PackedInt32Array(241, 246, 240), PackedInt32Array(256, 253, 257), PackedInt32Array(257, 253, 254), PackedInt32Array(261, 260, 258), PackedInt32Array(258, 260, 259), PackedInt32Array(265, 264, 262), PackedInt32Array(262, 264, 263), PackedInt32Array(269, 268, 266), PackedInt32Array(266, 268, 267), PackedInt32Array(273, 272, 270), PackedInt32Array(270, 272, 271), PackedInt32Array(277, 276, 274), PackedInt32Array(274, 276, 275), PackedInt32Array(281, 280, 278), PackedInt32Array(278, 280, 279), PackedInt32Array(285, 284, 282), PackedInt32Array(282, 284, 283), PackedInt32Array(289, 288, 286), PackedInt32Array(286, 288, 287), PackedInt32Array(293, 292, 290), PackedInt32Array(290, 292, 291), PackedInt32Array(297, 296, 294), PackedInt32Array(294, 296, 295), PackedInt32Array(301, 300, 298), PackedInt32Array(298, 300, 299), PackedInt32Array(305, 304, 302), PackedInt32Array(302, 304, 303), PackedInt32Array(309, 308, 306), PackedInt32Array(306, 308, 307), PackedInt32Array(313, 312, 310), PackedInt32Array(310, 312, 311), PackedInt32Array(317, 316, 314), PackedInt32Array(314, 316, 315), PackedInt32Array(321, 320, 318), PackedInt32Array(318, 320, 319)] sample_partition_type = 2 -geometry_parsed_geometry_type = 0 +geometry_parsed_geometry_type = 1 +geometry_collision_mask = 2147483648 +agent_height = 2.0 + +[sub_resource type="BoxShape3D" id="BoxShape3D_xw4dv"] +size = Vector3(80, 1, 80) [node name="Floor01" type="Node3D"] script = ExtResource("1_0ecnn") @@ -24,15 +33,165 @@ navigation_mesh = SubResource("NavigationMesh_4d8mx") [node name="DungeonGenerator" type="Node3D" parent="NavigationRegion3D"] unique_name_in_owner = true script = ExtResource("2_cxmwa") -room_scenes = Array[PackedScene]([ExtResource("3_gkkr3"), ExtResource("8_5rblf"), ExtResource("12_n02rw")]) +room_scenes = Array[PackedScene]([ExtResource("8_5rblf"), ExtResource("3_gkkr3"), ExtResource("12_n02rw")]) corridor_room_scene = ExtResource("13_ofywd") dungeon_size = Vector3i(20, 1, 20) voxel_scale = Vector3(4, 4, 4) generate_on_ready = false heuristic_scale = 3.0 corridor_cost_multiplier = 0.1 +show_debug_in_editor = false hide_debug_visuals_for_all_generated_rooms = false +[node name="Floor Exit A_0" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("12_n02rw")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14, 0, 18) +script = ExtResource("7_sdyti") +size_in_voxels = Vector3i(5, 1, 9) +voxel_scale = Vector3(4, 4, 4) +min_count = 1 +max_count = 1 + +[node name="BasinRoom_1" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("8_5rblf")] +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 20, 0, -2) +script = ExtResource("7_sdyti") +size_in_voxels = Vector3i(5, 1, 4) +voxel_scale = Vector3(4, 4, 4) +min_count = 1 +max_count = 2 + +[node name="Antechamber A_2" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("3_gkkr3")] +transform = Transform3D(1.19249e-08, 0, -1, 0, 1, 0, 1, 0, 1.19249e-08, 0, 0, -30) +script = ExtResource("7_sdyti") +size_in_voxels = Vector3i(5, 1, 4) +voxel_scale = Vector3(4, 4, 4) +min_count = 1 +max_count = 2 + +[node name="Corridor_3" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14, 0, 38) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_4" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10, 0, 38) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_5" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, 38) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_6" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 38) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_7" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 34) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_8" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 30) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_9" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 26) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_10" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 22) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_11" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 18) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_12" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 14) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_13" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 10) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_14" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 6) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_15" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 6) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_16" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 2) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_17" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 2) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_18" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, -2) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_19" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0, -2) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_20" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0, -6) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_21" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0, -10) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_22" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0, -14) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_23" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0, -18) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_24" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0, -22) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="Corridor_25" type="Node3D" parent="NavigationRegion3D/DungeonGenerator" instance=ExtResource("13_ofywd")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 0, -26) +script = ExtResource("8_1l8yt") +voxel_scale = Vector3(4, 4, 4) + +[node name="RoomsContainer" type="Node3D" parent="NavigationRegion3D/DungeonGenerator"] + +[node name="StaticBody3D" type="StaticBody3D" parent="NavigationRegion3D"] +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/StaticBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.5, 0) +shape = SubResource("BoxShape3D_xw4dv") + [node name="EnemyDatabase" parent="." instance=ExtResource("12_aw26s")] unique_name_in_owner = true EnemyList = Array[PackedScene]([ExtResource("13_kwaga"), ExtResource("14_gkkr3")]) diff --git a/src/map/dungeon/scenes/Set A/03. Antechamber A.tscn b/src/map/dungeon/scenes/Set A/03. Antechamber A.tscn index a38f26cc..2dcb3c04 100644 --- a/src/map/dungeon/scenes/Set A/03. Antechamber A.tscn +++ b/src/map/dungeon/scenes/Set A/03. Antechamber A.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=58 format=4 uid="uid://dpec2lbt83dhe"] +[gd_scene load_steps=59 format=4 uid="uid://dpec2lbt83dhe"] [ext_resource type="Script" uid="uid://ce73fuh74l81l" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_ho6e8"] [ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_phhs1"] @@ -645,6 +645,9 @@ _surfaces = [{ blend_shape_mode = 0 shadow_mesh = SubResource("ArrayMesh_i3ffh") +[sub_resource type="BoxShape3D" id="BoxShape3D_phhs1"] +size = Vector3(2.12268, 5.82227, 1.63702) + [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_51rrf"] shading_mode = 0 albedo_texture = ExtResource("20_le1vp") @@ -679,6 +682,8 @@ script = ExtResource("2_phhs1") [node name="StaticBody3D" type="StaticBody3D" parent="Antechamber A"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.10505, -1.44377, 0.0953512) +collision_layer = 2147483649 +collision_mask = 2147483649 [node name="ROOM" type="MeshInstance3D" parent="Antechamber A/StaticBody3D"] transform = Transform3D(0.287429, 0, 0, 0, 0.287429, 0, 0, 0, 0.287429, 2.1526, 3.44987, -0.0743999) @@ -759,6 +764,19 @@ unique_name_in_owner = true unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.33663, -1.49877, 0.845012) +[node name="StaticBody3D2" type="StaticBody3D" parent="Antechamber A"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -87.0242) +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape3D7" type="CollisionShape3D" parent="Antechamber A/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.49594, -0.677457, 94.6461) +shape = SubResource("BoxShape3D_phhs1") + +[node name="CollisionShape3D8" type="CollisionShape3D" parent="Antechamber A/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.66204, -0.677457, 94.7863) +shape = SubResource("BoxShape3D_phhs1") + [node name="CSGBox3D" type="CSGBox3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0314088, 4.23029, -0.0385468) visible = false diff --git a/src/map/dungeon/scenes/Set A/08. BasinRoom.tscn b/src/map/dungeon/scenes/Set A/08. BasinRoom.tscn index fab34aac..33a7ac13 100644 --- a/src/map/dungeon/scenes/Set A/08. BasinRoom.tscn +++ b/src/map/dungeon/scenes/Set A/08. BasinRoom.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=65 format=4 uid="uid://b82dx66mgs2d7"] +[gd_scene load_steps=66 format=4 uid="uid://b82dx66mgs2d7"] [ext_resource type="Script" uid="uid://ce73fuh74l81l" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_0qew1"] [ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_pu81k"] @@ -700,6 +700,9 @@ _surfaces = [{ blend_shape_mode = 0 shadow_mesh = SubResource("ArrayMesh_jks6o") +[sub_resource type="BoxShape3D" id="BoxShape3D_pu81k"] +size = Vector3(2.12268, 5.82227, 1.63702) + [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_bnx07"] albedo_texture = ExtResource("3_xx585") texture_filter = 0 @@ -752,6 +755,8 @@ mesh = SubResource("ArrayMesh_sx1ls") skeleton = NodePath("") [node name="StaticBody3D" type="StaticBody3D" parent="BasinRoom/BASIN_ROOM_VER2"] +collision_layer = 2147483649 +collision_mask = 2147483649 [node name="ROOM_001" type="MeshInstance3D" parent="BasinRoom/BASIN_ROOM_VER2/StaticBody3D"] transform = Transform3D(0.35918, 0, 0, 0, 0.287429, 0, 0, 0, 0.287429, -3.6523, 13.6997, 102.523) @@ -829,9 +834,17 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.55, -2.55692, 0) [node name="ItemDatabase" parent="BasinRoom/BASIN_ROOM_VER2" instance=ExtResource("18_bwap2")] unique_name_in_owner = true -[node name="TeleportSpawn" type="Marker3D" parent="BasinRoom/BASIN_ROOM_VER2"] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.28791, 10.2563, 106.274) +[node name="StaticBody3D2" type="StaticBody3D" parent="BasinRoom/BASIN_ROOM_VER2"] +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape3D7" type="CollisionShape3D" parent="BasinRoom/BASIN_ROOM_VER2/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.86587, 12.1211, 94.6461) +shape = SubResource("BoxShape3D_pu81k") + +[node name="CollisionShape3D8" type="CollisionShape3D" parent="BasinRoom/BASIN_ROOM_VER2/StaticBody3D2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.03197, 12.1211, 94.7863) +shape = SubResource("BoxShape3D_pu81k") [node name="CSGBox3D" type="CSGBox3D" parent="BasinRoom"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0382157, 4.21368, -0.0118849) diff --git a/src/map/dungeon/scenes/Set A/18. Corridor A.tscn b/src/map/dungeon/scenes/Set A/18. Corridor A.tscn index 63e3a28c..12f9c49b 100644 --- a/src/map/dungeon/scenes/Set A/18. Corridor A.tscn +++ b/src/map/dungeon/scenes/Set A/18. Corridor A.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=37 format=4 uid="uid://bn4gslp2gk8ds"] +[gd_scene load_steps=38 format=4 uid="uid://bn4gslp2gk8ds"] [ext_resource type="Script" uid="uid://fk3jis6rsipv" path="res://src/map/dungeon/code/corridor.gd" id="1_lepkf"] [ext_resource type="Texture2D" uid="uid://crsw35eypj6ry" path="res://src/map/dungeon/models/Set A/18. Corridor A/18_A1_CORRIDOR_A_WALL TILE 1.jpg" id="2_jmyyj"] @@ -496,6 +496,9 @@ _surfaces = [{ blend_shape_mode = 0 shadow_mesh = SubResource("ArrayMesh_p4f4g") +[sub_resource type="BoxShape3D" id="BoxShape3D_gbjb2"] +size = Vector3(4.40063, 4, 1.67725) + [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_lepkf"] transparency = 1 albedo_color = Color(1, 1, 1, 0) @@ -732,6 +735,14 @@ transform = Transform3D(-2, 0, 1.74846e-07, 0, 0.10779, 0, -1.74846e-07, 0, -2, mesh = SubResource("ArrayMesh_ux4sw") skeleton = NodePath("") +[node name="StaticBody3D" type="StaticBody3D" parent="DOOR?_F_CUT"] +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="DOOR?_F_CUT/StaticBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0286865, 0, 0.463623) +shape = SubResource("BoxShape3D_gbjb2") + [node name="DOOR?_R_CUT" type="CSGBox3D" parent="."] transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -1.87415, -0.109414, -0.094615) use_collision = true @@ -743,6 +754,13 @@ transform = Transform3D(-8.74228e-08, 0, -2, 0, 0.10779, 0, 2, 0, -8.74228e-08, mesh = SubResource("ArrayMesh_tmqha") skeleton = NodePath("") +[node name="StaticBody3D" type="StaticBody3D" parent="DOOR?_R_CUT"] +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="DOOR?_R_CUT/StaticBody3D"] +shape = SubResource("BoxShape3D_gbjb2") + [node name="DOOR?_L_CUT" type="CSGBox3D" parent="."] transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 1.98471, -0.0715388, -0.0946158) use_collision = true @@ -754,6 +772,13 @@ transform = Transform3D(-8.74228e-08, 0, -2, 0, 0.10779, 0, 2, 0, -8.74228e-08, mesh = SubResource("ArrayMesh_o04ue") skeleton = NodePath("") +[node name="StaticBody3D" type="StaticBody3D" parent="DOOR?_L_CUT"] +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="DOOR?_L_CUT/StaticBody3D"] +shape = SubResource("BoxShape3D_gbjb2") + [node name="DOOR?_B_CUT" type="CSGBox3D" parent="."] transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.0339377, -0.127415, -2.00389) use_collision = true @@ -764,3 +789,10 @@ material = SubResource("StandardMaterial3D_4xu2u") transform = Transform3D(-2, 0, 1.74846e-07, 0, 0.10779, 0, -1.74846e-07, 0, -2, 0.00432197, 2.0282, -1.92743) mesh = SubResource("ArrayMesh_ue4n7") skeleton = NodePath("") + +[node name="StaticBody3D" type="StaticBody3D" parent="DOOR?_B_CUT"] +collision_layer = 2147483648 +collision_mask = 2147483648 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="DOOR?_B_CUT/StaticBody3D"] +shape = SubResource("BoxShape3D_gbjb2") diff --git a/src/test/NavigationTestScene.tscn b/src/test/NavigationTestScene.tscn new file mode 100644 index 00000000..a0eb5da1 --- /dev/null +++ b/src/test/NavigationTestScene.tscn @@ -0,0 +1,35 @@ +[gd_scene load_steps=5 format=3 uid="uid://010r1fbkbooa"] + +[ext_resource type="PackedScene" uid="uid://cfecvvav8kkp6" path="res://src/player/Player.tscn" id="1_7xhku"] +[ext_resource type="PackedScene" uid="uid://bksq62muhk3h5" path="res://src/enemy/enemy_types/1. sproingy/Sproingy.tscn" id="2_3keei"] + +[sub_resource type="NavigationMesh" id="NavigationMesh_3keei"] +vertices = PackedVector3Array(-2.96237, 1.33137, -10.8745, -1.71237, 1.33137, -10.8745, -1.71237, 1.33137, -22.6245, -5.46237, 1.33137, -9.12453, -21.7124, 1.33137, -6.12453, -6.46237, 1.33137, -6.12453, -21.7124, 1.33137, -22.6245, 3.03763, 1.33137, -7.62453, 3.28763, 1.33137, -6.12453, 10.0376, 1.33137, -6.12453, 1.53763, 1.33137, -9.87453, -0.462372, 1.33137, -10.8745, 10.0376, 1.33137, -22.6245, -1.71237, 1.33137, 9.37547, -1.71237, 1.33137, -1.37453, -2.71237, 1.33137, -1.37453, -5.46237, 1.33137, -3.12453, -21.7124, 1.33137, 9.37547, 1.53763, 1.33137, -2.37453, -0.462372, 1.33137, -1.37453, 10.0376, 1.33137, 9.37547) +polygons = [PackedInt32Array(2, 1, 0), PackedInt32Array(2, 0, 3), PackedInt32Array(3, 5, 2), PackedInt32Array(2, 5, 4), PackedInt32Array(2, 4, 6), PackedInt32Array(9, 8, 7), PackedInt32Array(9, 7, 10), PackedInt32Array(10, 11, 9), PackedInt32Array(9, 11, 2), PackedInt32Array(9, 2, 12), PackedInt32Array(11, 1, 2), PackedInt32Array(15, 14, 13), PackedInt32Array(16, 15, 13), PackedInt32Array(16, 13, 5), PackedInt32Array(5, 13, 4), PackedInt32Array(4, 13, 17), PackedInt32Array(18, 8, 9), PackedInt32Array(13, 14, 19), PackedInt32Array(18, 9, 19), PackedInt32Array(19, 9, 13), PackedInt32Array(13, 9, 20)] +cell_height = 0.5 +agent_radius = 3.0 + +[sub_resource type="CylinderShape3D" id="CylinderShape3D_3keei"] +height = 4.74658 +radius = 1.71777 + +[node name="Node3D" type="Node3D"] + +[node name="Player" parent="." instance=ExtResource("1_7xhku")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.791832, 0) + +[node name="Sproingy" parent="." instance=ExtResource("2_3keei")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.64783, -11.9575) + +[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."] +navigation_mesh = SubResource("NavigationMesh_3keei") + +[node name="CSGBox3D" type="CSGBox3D" parent="NavigationRegion3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.79317, 0, -6.66189) +size = Vector3(37.8384, 1, 37.9253) + +[node name="StaticBody3D" type="StaticBody3D" parent="NavigationRegion3D"] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/StaticBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.61432, 1.20466, -6.13947) +shape = SubResource("CylinderShape3D_3keei")