diff --git a/levels/ghost_ship/ghost_ship_level.tscn b/levels/ghost_ship/ghost_ship_level.tscn index 8505fb2..f34e0c7 100644 --- a/levels/ghost_ship/ghost_ship_level.tscn +++ b/levels/ghost_ship/ghost_ship_level.tscn @@ -84,11 +84,12 @@ [ext_resource type="PackedScene" uid="uid://ehf5sg3ahvbf" path="res://src/world/grunk_beast/grunk_beast.tscn" id="82_rigxx"] [sub_resource type="NavigationMesh" id="NavigationMesh_vt4uw"] -vertices = PackedVector3Array(-3.75, -2.00426, -89.75, -1.75, -2.00426, -89.75, -0.75, -2.50426, -90, 2.25, -2.50426, -94.75, 1, -2.50426, -96, -3.75, -2.50426, -96.75, -3.75, -2.50426, -91.15, -0.75, -2.50426, -87.5, 3.25, -2.50426, -87.5, 3.25, -2.50426, -89.5, 1, -2.50426, -96.75, 4, -2.50426, -89.75, 4, -2.50426, -95, -2.25, 0.495737, -96, -2.5, 0.495737, -96.75, -3.75, 0.495737, -96.75, -3.75, 0.495737, -95.25, 2.25, 0.495737, -96, 1.75, 0.495737, -95.25, 2.25, 0.495737, -94.75, 4, 0.495737, -96.75, 2.75, 0.495737, -96.75, 3.25, 0.495737, -86.25, 4, 0.495737, -86.5, 2.25, 0.495737, -83.75, 3.25, 0.495737, -83.5, 2.25, 0.495737, -82.25, 3.25, 0.495737, -81.5, -2, 0.495737, -82, -3.75, 0.495737, -80.25, -3.75, 0.245737, -82.9643, 1.75, 0.495737, -81.75, 4, 0.495737, -80, 4, 0.495737, -81.25, -3.75, -2.50426, -80.25, -1.75, -2.50426, -80, -1.5, -2.50426, -80.75, -0.75, -2.50426, -84.25, -3.75, -2.50426, -84, 3.25, -2.50426, -80.75, 3.5, -2.50426, -80.5, 3.5, -2.50426, -80, 4, -2.50426, -80, 4, -2.50426, -80.5, -0.75, 0.495737, -64.75, -0.75, 0.495737, -53.5, 1, 0.495737, -53.75, 1, 0.495737, -78.75, -0.75, 0.495737, -78.75, -0.75, 0.495737, -67.25, -1.25, 0.495737, -66.75, -12.75, 0.495737, -66.75, -12.75, 0.495737, -65, -19.5, 0.495737, -68, -19, 0.495737, -68.75, -20, 0.495737, -69, -21.75, 0.495737, -67.5, -20, 0.495737, -75.75, -27.75, 0.495737, -75.75, -25, 0.495737, -72.5, -22, 0.495737, -71, -24.75, 0.495737, -71, -27.75, 0.495737, -72.5, -16, 0.495737, -69, -17, 0.495737, -68.75, -16.5, 0.495737, -68, -14.25, 0.495737, -67.5, -10.75, 0.495737, -72.5, -8, 0.495737, -72.5, -8, 0.495737, -75.75, -13.75, 0.495737, -71, -15.75, 0.495737, -70.25, -15.75, 0.495737, -75.75, -11, 0.495737, -71, -27.75, 0.995737, -71.5, -27.75, 0.995737, -71, -26, 0.995737, -71, -26, 0.995737, -71.5, -10, 0.995737, -71.5, -10, 0.995737, -71, -8, 0.995737, -71, -8, 0.995737, -71.5, -21.75, 0.495737, -61.5, -20, 0.495737, -61.25, -19.75, 0.495737, -62, -18.75, 0.495737, -65.5, -19.5, 0.495737, -66.25, -16, 0.495737, -62, -15.75, 0.495737, -61.25, -14, 0.495737, -61.5, -16.5, 0.495737, -66.25, -17.25, 0.495737, -65.5, -18.5, 0.995737, -67.75, -18.5, 0.995737, -66.75, -17.5, 0.995737, -66.75, -17.5, 0.995737, -67.75, -35, 0.495737, -53.25, -35, 0.495737, -57, -36, 0.495737, -57.25, -36.75, 0.495737, -53.25, -34.75, 0.495737, -65, -36, 0.495737, -65.5, -36.75, 0.495737, -65.25, -36, 0.495737, -59.5, -35, 0.495737, -59.75, -23.25, 0.495737, -65.25, -23.25, 0.495737, -66.75, -36, 0.495737, -66.75, -22.25, 0.495737, -60.75, -24.75, 0.495737, -60.75, -25, 0.495737, -59.5, -27.75, 0.495737, -59.5, -27.75, 0.495737, -56, -20, 0.495737, -56, -13.75, 0.495737, -60.75, -10.75, 0.495737, -59.5, -11, 0.495737, -60.75, -8, 0.495737, -56, -8, 0.495737, -59.5, -15.75, 0.495737, -56, 1.25, 0.495737, -51.75, 1, 0.495737, -49.75, 3.75, 0.495737, -50, 3.75, 0.495737, -51.75, -0.75, 0.495737, -37.25, -1.25, 0.495737, -36.75, -1, 0.495737, -35, -0.75, 0.495737, -32.25, 1, 0.495737, -32.25, -6.75, 0.495737, -36.75, -6.75, 0.495737, -35, -24.25, 0.495737, -46.75, -27.75, 0.745737, -46.5, -28.75, 0.745737, -44.25, -24, 0.495737, -44, -24, 0.495737, -44.75, -28.75, 0.745737, -50.25, -24.25, 0.495737, -49.75, -23.25, 0.495737, -51.75, -32, 0.495737, -51.75, -32.25, 0.745737, -49.5, -34.5, 0.745737, -45.75, -31.75, 0.745737, -45.5, -23, 0.495737, -45, -37.25, 0.745737, -47.25, -34.75, 0.745737, -51.75, -38.75, 0.495737, -51.75, -38.5, 0.495737, -44, -37.25, 0.495737, -46.25, -31.75, 0.745737, -50.5, -35.75, 0.495737, -45.25, -31.75, 0.495737, -44, -15, 0.495737, -41.5, -15.75, 0.495737, -41, -13.5, 0.495737, -40, -13.5, 0.495737, -41, -14.75, 0.495737, -50, -13.75, 0.495737, -50.75, -14, 0.495737, -51.75, -21.75, 0.495737, -51.75, -21.75, 0.495737, -50, -10, 0.495737, -49.5, -8, 0.495737, -49.5, -8, 0.495737, -50.75, -10.75, 0.495737, -50.5, -12.25, 0.495737, -35, -8.25, 0.495737, -35.25, -8.25, 0.495737, -37.25, -9, 0.495737, -37.5, -11.25, 0.495737, -36.75, -12, 0.495737, -36, -14.75, 0.495737, -43.25, -12, 0.495737, -42, -11.5, 0.495737, -43.5, -9.5, 0.495737, -42.5, -9.5, 0.495737, -41.75, -9, 0.495737, -41, -8, 0.745737, -41, -13.25, 0.495737, -38, -15.75, 0.495737, -38.25, -15.75, 0.495737, -36.5, -12.75, 0.495737, -36.75, -10.25, 0.495737, -43.5, -9, 0.495737, -45, -12.5, 0.495737, -36.5, -10.5, 0.495737, -38, -10.5, 0.495737, -41.25, -9, 0.495737, -47.25, -11, 0.495737, -47.25, -11.75, 0.495737, -50.5, -12.5, 0.495737, -48.75, -12.5, 0.495737, -49.75, -8, 0.495737, -44.75, -33, 1.24574, -50.5, -33.25, 1.24574, -51.25, -33.75, 1.24574, -51.25, -35, 1.24574, -49, -34.75, 1.24574, -47.5, -30.75, 1.24574, -45, -30, 1.24574, -44.25, -28.75, 1.24574, -46.5, -29, 1.24574, -48, -27.75, 0.495737, -29, -27, 0.495737, -29, -26.75, 0.495737, -30, -27.75, 0.495737, -42.75, 0, 0.495737, -29.5, 1, 0.495737, -29.75, 1, 0.495737, -30.75, -25, 0.495737, -29, -19.75, 0.495737, -29.75, -20, 0.495737, -30.75, -25.75, 0.495737, -30.75, -25.5, 0.495737, -30, -0.75, 0.495737, -17.25, 1, 0.495737, -17.25, 1, 0.495737, -25, 0.25, 0.495737, -25.25, -17.25, 0.495737, -30.75, -18, 0.495737, -29.75, -1, 0.495737, -29, -26.25, 0.495737, -42.75, -10, 3.49574, -38, -11, 3.49574, -41, -14, 3.49574, -40, -14, 3.49574, -38, -13, 3.49574, -37, -11, 3.49574, -37, -13, 3.49574, -41, -10, 3.49574, -40, -3.25, 0.495737, -12.5, -3.75, 0.495737, -11.75, -3.25, 0.495737, -11.5, 3.25, 0.495737, -11.5, 4, 0.495737, -11.75, 4, 0.495737, -12.25, 3.25, 0.495737, -12.5, -3, 0.495737, -8.75, -1.25, 0.495737, -8.75, -3.75, 0.495737, -15.75, -3.75, 0.495737, -14.75, -3.25, 0.495737, -14.5, 3.25, 0.495737, -14.5, 4, 0.495737, -14.75, 4, 0.495737, -15.75, 2.5, 0.495737, -10.25, 3.25, 0.495737, -10.5, 1.25, 0.495737, -8.75, 2, 0.495737, -8.75, -0.75, 0.495737, -8, 0.75, 0.495737, -8) -polygons = [PackedInt32Array(0, 6, 1), PackedInt32Array(1, 6, 2), PackedInt32Array(2, 6, 3), PackedInt32Array(3, 6, 4), PackedInt32Array(4, 6, 5), PackedInt32Array(8, 7, 9), PackedInt32Array(9, 7, 2), PackedInt32Array(5, 10, 4), PackedInt32Array(9, 2, 11), PackedInt32Array(11, 2, 3), PackedInt32Array(11, 3, 12), PackedInt32Array(14, 13, 15), PackedInt32Array(15, 13, 16), PackedInt32Array(17, 19, 18), PackedInt32Array(21, 20, 17), PackedInt32Array(17, 20, 19), PackedInt32Array(19, 20, 23), PackedInt32Array(19, 23, 22), PackedInt32Array(25, 24, 22), PackedInt32Array(22, 24, 19), PackedInt32Array(17, 18, 13), PackedInt32Array(13, 18, 16), PackedInt32Array(24, 25, 26), PackedInt32Array(26, 25, 27), PackedInt32Array(29, 30, 28), PackedInt32Array(28, 30, 0), PackedInt32Array(28, 0, 1), PackedInt32Array(31, 26, 27), PackedInt32Array(33, 32, 27), PackedInt32Array(27, 32, 31), PackedInt32Array(31, 32, 28), PackedInt32Array(28, 32, 29), PackedInt32Array(35, 34, 36), PackedInt32Array(36, 34, 38), PackedInt32Array(36, 38, 37), PackedInt32Array(37, 7, 8), PackedInt32Array(36, 37, 39), PackedInt32Array(39, 37, 8), PackedInt32Array(43, 42, 40), PackedInt32Array(40, 42, 41), PackedInt32Array(46, 45, 44), PackedInt32Array(49, 48, 47), PackedInt32Array(51, 50, 52), PackedInt32Array(52, 50, 44), PackedInt32Array(44, 49, 46), PackedInt32Array(46, 49, 47), PackedInt32Array(44, 50, 49), PackedInt32Array(54, 53, 55), PackedInt32Array(55, 53, 56), PackedInt32Array(60, 59, 57), PackedInt32Array(57, 59, 58), PackedInt32Array(56, 60, 55), PackedInt32Array(55, 60, 57), PackedInt32Array(59, 60, 61), PackedInt32Array(59, 62, 58), PackedInt32Array(64, 63, 65), PackedInt32Array(65, 63, 66), PackedInt32Array(69, 68, 67), PackedInt32Array(71, 70, 63), PackedInt32Array(63, 70, 66), PackedInt32Array(70, 71, 67), PackedInt32Array(67, 71, 72), PackedInt32Array(67, 72, 69), PackedInt32Array(67, 73, 70), PackedInt32Array(77, 76, 74), PackedInt32Array(74, 76, 75), PackedInt32Array(81, 80, 78), PackedInt32Array(78, 80, 79), PackedInt32Array(83, 82, 84), PackedInt32Array(84, 82, 85), PackedInt32Array(85, 82, 86), PackedInt32Array(86, 82, 56), PackedInt32Array(89, 88, 87), PackedInt32Array(90, 65, 66), PackedInt32Array(56, 53, 86), PackedInt32Array(90, 66, 91), PackedInt32Array(91, 66, 87), PackedInt32Array(87, 66, 89), PackedInt32Array(85, 91, 84), PackedInt32Array(84, 91, 87), PackedInt32Array(95, 94, 92), PackedInt32Array(92, 94, 93), PackedInt32Array(97, 96, 98), PackedInt32Array(98, 96, 99), PackedInt32Array(101, 100, 102), PackedInt32Array(102, 100, 104), PackedInt32Array(102, 104, 103), PackedInt32Array(101, 107, 100), PackedInt32Array(100, 107, 105), PackedInt32Array(105, 107, 106), PackedInt32Array(98, 99, 103), PackedInt32Array(103, 99, 102), PackedInt32Array(83, 108, 82), PackedInt32Array(110, 109, 108), PackedInt32Array(112, 111, 110), PackedInt32Array(108, 83, 110), PackedInt32Array(110, 83, 113), PackedInt32Array(110, 113, 112), PackedInt32Array(88, 89, 114), PackedInt32Array(114, 116, 115), PackedInt32Array(115, 118, 117), PackedInt32Array(114, 115, 88), PackedInt32Array(88, 115, 119), PackedInt32Array(119, 115, 117), PackedInt32Array(46, 120, 45), PackedInt32Array(45, 120, 121), PackedInt32Array(123, 122, 120), PackedInt32Array(120, 122, 121), PackedInt32Array(126, 125, 124), PackedInt32Array(127, 126, 128), PackedInt32Array(128, 126, 124), PackedInt32Array(45, 121, 124), PackedInt32Array(124, 121, 128), PackedInt32Array(129, 125, 130), PackedInt32Array(130, 125, 126), PackedInt32Array(135, 134, 131), PackedInt32Array(131, 134, 132), PackedInt32Array(132, 134, 133), PackedInt32Array(137, 136, 138), PackedInt32Array(138, 136, 139), PackedInt32Array(141, 140, 142), PackedInt32Array(142, 140, 136), PackedInt32Array(135, 131, 143), PackedInt32Array(143, 131, 137), PackedInt32Array(143, 137, 138), PackedInt32Array(146, 145, 144), PackedInt32Array(148, 147, 144), PackedInt32Array(144, 147, 146), PackedInt32Array(140, 149, 136), PackedInt32Array(147, 148, 150), PackedInt32Array(142, 151, 141), PackedInt32Array(141, 151, 150), PackedInt32Array(150, 151, 147), PackedInt32Array(139, 136, 149), PackedInt32Array(155, 154, 152), PackedInt32Array(152, 154, 153), PackedInt32Array(157, 156, 158), PackedInt32Array(158, 156, 160), PackedInt32Array(158, 160, 159), PackedInt32Array(162, 161, 163), PackedInt32Array(163, 161, 164), PackedInt32Array(170, 169, 165), PackedInt32Array(165, 169, 168), PackedInt32Array(165, 168, 167), PackedInt32Array(165, 167, 166), PackedInt32Array(152, 171, 155), PackedInt32Array(155, 171, 172), PackedInt32Array(172, 171, 173), PackedInt32Array(175, 174, 176), PackedInt32Array(176, 174, 177), PackedInt32Array(179, 178, 180), PackedInt32Array(180, 178, 181), PackedInt32Array(183, 182, 173), PackedInt32Array(169, 184, 181), PackedInt32Array(181, 184, 180), PackedInt32Array(168, 169, 185), PackedInt32Array(169, 170, 184), PackedInt32Array(175, 176, 186), PackedInt32Array(186, 176, 185), PackedInt32Array(185, 176, 168), PackedInt32Array(188, 187, 183), PackedInt32Array(189, 157, 164), PackedInt32Array(164, 157, 163), PackedInt32Array(190, 188, 156), PackedInt32Array(156, 188, 183), PackedInt32Array(156, 183, 173), PackedInt32Array(156, 173, 171), PackedInt32Array(157, 189, 191), PackedInt32Array(191, 190, 157), PackedInt32Array(157, 190, 156), PackedInt32Array(183, 192, 182), PackedInt32Array(182, 192, 174), PackedInt32Array(174, 192, 177), PackedInt32Array(194, 193, 195), PackedInt32Array(195, 193, 196), PackedInt32Array(196, 193, 197), PackedInt32Array(199, 198, 200), PackedInt32Array(200, 198, 201), PackedInt32Array(203, 202, 204), PackedInt32Array(204, 202, 205), PackedInt32Array(208, 207, 206), PackedInt32Array(213, 212, 209), PackedInt32Array(209, 212, 211), PackedInt32Array(209, 211, 210), PackedInt32Array(216, 215, 217), PackedInt32Array(217, 215, 214), PackedInt32Array(206, 220, 208), PackedInt32Array(208, 220, 218), PackedInt32Array(218, 220, 219), PackedInt32Array(206, 217, 220), PackedInt32Array(220, 217, 214), PackedInt32Array(210, 219, 209), PackedInt32Array(209, 219, 220), PackedInt32Array(213, 204, 212), PackedInt32Array(221, 212, 205), PackedInt32Array(205, 212, 204), PackedInt32Array(227, 226, 222), PackedInt32Array(222, 226, 225), PackedInt32Array(222, 225, 224), PackedInt32Array(222, 224, 223), PackedInt32Array(224, 228, 223), PackedInt32Array(223, 229, 222), PackedInt32Array(232, 231, 230), PackedInt32Array(234, 233, 235), PackedInt32Array(235, 233, 236), PackedInt32Array(232, 230, 237), PackedInt32Array(237, 230, 238), PackedInt32Array(240, 239, 241), PackedInt32Array(241, 239, 242), PackedInt32Array(242, 239, 243), PackedInt32Array(243, 239, 244), PackedInt32Array(233, 246, 245), PackedInt32Array(245, 247, 238), PackedInt32Array(247, 245, 248), PackedInt32Array(249, 238, 250), PackedInt32Array(250, 238, 247), PackedInt32Array(236, 233, 245), PackedInt32Array(236, 245, 242), PackedInt32Array(242, 245, 238), PackedInt32Array(242, 238, 230), PackedInt32Array(242, 230, 241)] +vertices = PackedVector3Array(-3.5, -2.00426, -89.75, -2, -2.00426, -89.75, -1.75, -2.25426, -90.25, -0.5, -2.50426, -87.5, 3, -2.50426, -87.5, 3, -2.50426, -89.5, -0.5, -2.50426, -90, 2.25, -2.50426, -94.5, 0.75, -2.50426, -96.5, -3.5, -2.50426, -96.5, -3.5, -2.50426, -91.1, 3.75, -2.50426, -90, 3.75, -2.50426, -94.75, -2.75, 0.495737, -96.5, -3.5, 0.495737, -96.5, -3.5, 0.495737, -95.5, -2.25, 0.495737, -95.75, -1.75, 0.495737, -81.5, -2.25, 0.495737, -82, -3.5, 0.495737, -80.5, 3.75, 0.495737, -80.25, 3.75, 0.495737, -81, 3, 0.495737, -81.5, 1.75, 0.495737, -81.5, 3.75, 0.495737, -96.5, 2.75, 0.495737, -96.5, 2.25, 0.495737, -95.75, 2.5, 0.495737, -94.75, 1.75, 0.495737, -95.5, 2.5, 0.495737, -82.25, 3.75, 0.495737, -86.75, 3, 0.495737, -86.25, -3.5, 0.245737, -83.1429, -3.5, -2.50426, -80.5, -2, -2.50426, -80.25, -1.5, -2.50426, -81, -1, -2.50426, -83.75, -3.5, -2.50426, -83.75, -0.5, -2.50426, -84.25, 3, -2.50426, -81, 0.75, 0.495737, -77.5, 0.5, 0.495737, -78.5, -0.5, 0.495737, -78.5, -0.5, 0.495737, -67.25, -1.25, 0.495737, -66.5, -1, 0.495737, -65.25, -0.5, 0.495737, -64.75, -0.5, 0.495737, -53.5, 0.75, 0.495737, -53.75, -12.5, 0.495737, -66.5, -12.5, 0.495737, -65.25, -25, 0.495737, -72.75, -24.5, 0.495737, -71.25, -21.75, 0.495737, -71, -27.5, 0.495737, -75.5, -27.5, 0.495737, -72.75, -20.25, 0.495737, -71, -20.25, 0.495737, -75.5, -14, 0.495737, -71, -11.25, 0.495737, -71.25, -10.75, 0.495737, -72.75, -8.25, 0.495737, -72.75, -8.25, 0.495737, -75.5, -15.5, 0.495737, -75.5, -15.5, 0.495737, -71, -21.5, 0.495737, -61.5, -20.25, 0.495737, -61.25, -19.75, 0.495737, -62.25, -19.75, 0.495737, -66.25, -20.25, 0.495737, -69, -16, 0.495737, -62.25, -15.5, 0.495737, -61.25, -14.25, 0.495737, -61.5, -14.5, 0.495737, -67.75, -16.25, 0.495737, -66.25, -17.25, 0.495737, -65.25, -15.75, 0.495737, -69, -18.75, 0.495737, -65.25, -16.5, 0.495737, -68.5, -19.5, 0.495737, -68.5, -18.25, 0.995737, -67.5, -18.25, 0.995737, -66.75, -17.75, 0.995737, -66.75, -17.75, 0.995737, -67.5, -36.5, 0.495737, -53.5, -35.25, 0.495737, -53.5, -35.25, 0.495737, -56.75, -36.25, 0.495737, -57.25, -35.75, 0.495737, -65.5, -35.25, 0.495737, -64.75, -34.75, 0.495737, -65.25, -36.5, 0.495737, -65, -36.25, 0.495737, -59.5, -35.25, 0.495737, -60, -23.5, 0.495737, -65.5, -23.5, 0.495737, -66.5, -35.75, 0.495737, -66.5, -22.25, 0.495737, -60.5, -24.5, 0.495737, -60.5, -25, 0.495737, -59.25, -27.5, 0.495737, -59.25, -27.5, 0.495737, -56.25, -20.25, 0.495737, -56.25, -13.75, 0.495737, -60.5, -15.5, 0.495737, -56.25, -10.75, 0.495737, -59.25, -11.25, 0.495737, -60.5, -8.25, 0.495737, -56.25, -8.25, 0.495737, -59.25, 0.75, 0.495737, -52, -0.5, 0.495737, -34.75, -0.5, 0.495737, -32.5, 0.75, 0.495737, -32.5, 1.25, 0.495737, -50.25, 3.5, 0.495737, -50.25, 3.5, 0.495737, -51.5, 1.25, 0.495737, -51.5, -0.5, 0.495737, -37.25, -1.25, 0.495737, -36.5, 0.75, 0.495737, -49.75, -1, 0.495737, -35.25, -6.5, 0.495737, -36.5, -6.5, 0.495737, -35.25, -24.5, 0.495737, -46.25, -27.5, 0.745737, -46.25, -28.5, 0.745737, -44.5, -24.25, 0.495737, -44.25, -24.25, 0.495737, -44.75, -28.75, 0.495737, -50.5, -24.5, 0.495737, -50.25, -23.5, 0.495737, -51.5, -31.5, 0.495737, -51.5, -24, 0.495737, -49.75, -24, 0.495737, -46.75, -23.25, 0.495737, -45.25, -31.5, 0.745737, -50.5, -37.5, 0.745737, -47.25, -35, 0.745737, -51.5, -38.5, 0.495737, -51.5, -38.25, 0.495737, -44.25, -37.5, 0.495737, -46.25, -35.75, 0.495737, -45, -35, 0.495737, -45, -32, 0.495737, -44.25, -33.75, 0.495737, -46.5, -32, 0.495737, -45.5, -13.5, 0.495737, -37.75, -14.5, 0.495737, -37.75, -14.5, 0.495737, -36.75, -13.25, 0.495737, -36.25, -12.75, 0.495737, -36.5, -15, 0.495737, -50.5, -14.5, 0.495737, -50, -14.25, 0.495737, -51.5, -9.25, 0.495737, -41.75, -10.25, 0.495737, -41, -9.25, 0.495737, -41, -13.25, 0.495737, -35.25, -11.25, 0.495737, -36.5, -9.75, 0.495737, -49, -8.25, 0.495737, -49, -8.25, 0.495737, -50.5, -10.75, 0.495737, -50.25, -8.5, 0.495737, -35.5, -8.5, 0.495737, -37, -9.25, 0.495737, -37.5, -10.5, 0.495737, -37.25, -9.25, 0.495737, -44.5, -9.25, 0.495737, -46.25, -11, 0.495737, -46.25, -11.5, 0.495737, -43.75, -10.25, 0.495737, -43.75, -9.25, 0.495737, -42.5, -8.25, 0.495737, -44, -12.75, 0.495737, -48, -13.75, 0.495737, -50.5, -14.5, 0.495737, -43.25, -11.75, 0.495737, -50.25, -12.75, 0.495737, -49.25, -15, 0.495737, -41, -14, 0.495737, -40.25, -21.5, 0.495737, -51.5, -21.5, 0.495737, -50.25, -8.25, 0.495737, -41.25, -34, 1.24574, -50.25, -33.75, 1.24574, -49.75, -33.25, 1.24574, -50.5, -33.5, 1.24574, -51, -34.75, 1.24574, -49, -34.5, 1.24574, -48.5, -34, 1.24574, -49.25, -34.25, 1.24574, -49.75, -30, 1.24574, -45.75, -29.75, 1.24574, -45.25, -29.25, 1.24574, -46, -29.5, 1.24574, -46.5, -0.25, 0.495737, -29.5, 0.75, 0.495737, -30, 0.75, 0.495737, -30.5, -17, 0.495737, -30.5, -18, 0.495737, -29.5, -1, 0.495737, -29.25, -26.25, 0.495737, -41.25, -26.5, 0.495737, -42.5, -27.5, 0.495737, -42.5, -27.5, 0.495737, -29.25, -26.75, 0.495737, -30.25, -26.25, 0.495737, -31, -19.75, 0.495737, -29.5, -20.25, 0.495737, -30.5, -25.75, 0.495737, -30.5, -25.5, 0.495737, -30.25, -0.5, 0.495737, -17.5, 0.75, 0.495737, -17.5, 0.75, 0.495737, -24.75, 0, 0.495737, -25.25, -24.75, 0.495737, -29.25, -0.5, 0.495737, -28.75, -10.25, 3.49574, -38, -11, 3.49574, -40.75, -13.75, 3.49574, -40, -13.75, 3.49574, -38, -13, 3.49574, -37.25, -11, 3.49574, -37.25, -13, 3.49574, -40.75, -10.25, 3.49574, -40, -3, 0.495737, -12.5, -3.5, 0.495737, -12.25, -3, 0.495737, -11.5, -1.25, 0.495737, -9, -3.5, 0.495737, -15.5, -3.5, 0.495737, -14.75, -3, 0.495737, -14.5, 3, 0.495737, -14.5, 3.75, 0.495737, -15, 3.75, 0.495737, -15.5, -3, 0.495737, -9.25, -0.75, 0.495737, -8.25, 0.75, 0.495737, -8.25, 2.25, 0.495737, -9.5, 2.25, 0.495737, -10.25, 3.5, 0.495737, -11.75, 3, 0.495737, -12.5) +polygons = [PackedInt32Array(0, 2, 1), PackedInt32Array(4, 3, 5), PackedInt32Array(5, 3, 6), PackedInt32Array(0, 10, 2), PackedInt32Array(2, 10, 9), PackedInt32Array(2, 9, 8), PackedInt32Array(2, 8, 7), PackedInt32Array(5, 6, 11), PackedInt32Array(11, 6, 2), PackedInt32Array(11, 2, 7), PackedInt32Array(11, 7, 12), PackedInt32Array(14, 13, 15), PackedInt32Array(15, 13, 16), PackedInt32Array(19, 18, 17), PackedInt32Array(21, 20, 22), PackedInt32Array(22, 20, 23), PackedInt32Array(23, 20, 19), PackedInt32Array(25, 24, 26), PackedInt32Array(26, 24, 27), PackedInt32Array(26, 28, 16), PackedInt32Array(16, 28, 15), PackedInt32Array(22, 23, 29), PackedInt32Array(27, 28, 26), PackedInt32Array(31, 27, 30), PackedInt32Array(30, 27, 24), PackedInt32Array(23, 19, 17), PackedInt32Array(19, 32, 18), PackedInt32Array(18, 32, 0), PackedInt32Array(18, 0, 1), PackedInt32Array(22, 29, 31), PackedInt32Array(31, 29, 27), PackedInt32Array(34, 33, 35), PackedInt32Array(35, 33, 37), PackedInt32Array(35, 37, 36), PackedInt32Array(3, 4, 38), PackedInt32Array(38, 4, 39), PackedInt32Array(36, 38, 35), PackedInt32Array(35, 38, 39), PackedInt32Array(41, 40, 42), PackedInt32Array(42, 40, 43), PackedInt32Array(45, 44, 46), PackedInt32Array(46, 44, 43), PackedInt32Array(48, 47, 46), PackedInt32Array(49, 44, 50), PackedInt32Array(50, 44, 45), PackedInt32Array(43, 40, 46), PackedInt32Array(46, 40, 48), PackedInt32Array(53, 52, 51), PackedInt32Array(51, 55, 54), PackedInt32Array(53, 51, 56), PackedInt32Array(56, 51, 57), PackedInt32Array(57, 51, 54), PackedInt32Array(60, 59, 58), PackedInt32Array(62, 61, 60), PackedInt32Array(58, 64, 60), PackedInt32Array(60, 64, 63), PackedInt32Array(60, 63, 62), PackedInt32Array(66, 65, 67), PackedInt32Array(67, 65, 68), PackedInt32Array(68, 65, 69), PackedInt32Array(69, 65, 53), PackedInt32Array(71, 70, 72), PackedInt32Array(72, 70, 75), PackedInt32Array(72, 75, 74), PackedInt32Array(72, 74, 73), PackedInt32Array(53, 56, 69), PackedInt32Array(64, 58, 76), PackedInt32Array(76, 58, 73), PackedInt32Array(77, 75, 67), PackedInt32Array(67, 75, 70), PackedInt32Array(76, 73, 78), PackedInt32Array(78, 73, 74), PackedInt32Array(68, 77, 67), PackedInt32Array(69, 79, 68), PackedInt32Array(83, 82, 80), PackedInt32Array(80, 82, 81), PackedInt32Array(85, 84, 86), PackedInt32Array(86, 84, 87), PackedInt32Array(90, 89, 88), PackedInt32Array(88, 89, 91), PackedInt32Array(91, 89, 93), PackedInt32Array(91, 93, 92), PackedInt32Array(87, 84, 92), PackedInt32Array(92, 84, 91), PackedInt32Array(88, 96, 90), PackedInt32Array(90, 96, 94), PackedInt32Array(94, 96, 95), PackedInt32Array(97, 65, 66), PackedInt32Array(99, 98, 97), PackedInt32Array(101, 100, 99), PackedInt32Array(97, 66, 99), PackedInt32Array(99, 66, 102), PackedInt32Array(99, 102, 101), PackedInt32Array(72, 103, 71), PackedInt32Array(71, 103, 104), PackedInt32Array(103, 106, 105), PackedInt32Array(105, 108, 107), PackedInt32Array(103, 105, 104), PackedInt32Array(104, 105, 107), PackedInt32Array(47, 48, 109), PackedInt32Array(112, 111, 110), PackedInt32Array(116, 115, 113), PackedInt32Array(113, 115, 114), PackedInt32Array(118, 117, 110), PackedInt32Array(110, 117, 112), PackedInt32Array(113, 119, 116), PackedInt32Array(116, 119, 109), PackedInt32Array(118, 110, 120), PackedInt32Array(47, 109, 119), PackedInt32Array(121, 118, 122), PackedInt32Array(122, 118, 120), PackedInt32Array(47, 119, 117), PackedInt32Array(117, 119, 112), PackedInt32Array(127, 126, 123), PackedInt32Array(123, 126, 124), PackedInt32Array(124, 126, 125), PackedInt32Array(129, 128, 130), PackedInt32Array(130, 128, 131), PackedInt32Array(133, 132, 134), PackedInt32Array(134, 132, 130), PackedInt32Array(133, 134, 123), PackedInt32Array(123, 134, 127), PackedInt32Array(128, 135, 131), PackedInt32Array(138, 137, 136), PackedInt32Array(140, 139, 136), PackedInt32Array(136, 139, 138), PackedInt32Array(130, 132, 129), PackedInt32Array(139, 140, 141), PackedInt32Array(141, 142, 139), PackedInt32Array(139, 142, 143), PackedInt32Array(144, 135, 145), PackedInt32Array(145, 135, 128), PackedInt32Array(145, 143, 144), PackedInt32Array(144, 143, 142), PackedInt32Array(147, 146, 148), PackedInt32Array(148, 146, 149), PackedInt32Array(149, 146, 150), PackedInt32Array(153, 152, 151), PackedInt32Array(156, 155, 154), PackedInt32Array(149, 150, 157), PackedInt32Array(157, 150, 158), PackedInt32Array(160, 159, 161), PackedInt32Array(161, 159, 162), PackedInt32Array(164, 163, 165), PackedInt32Array(165, 163, 158), PackedInt32Array(158, 163, 157), PackedInt32Array(156, 165, 155), PackedInt32Array(155, 165, 166), PackedInt32Array(171, 170, 167), PackedInt32Array(167, 170, 169), PackedInt32Array(167, 169, 168), PackedInt32Array(173, 154, 172), PackedInt32Array(167, 173, 171), PackedInt32Array(171, 173, 172), PackedInt32Array(153, 175, 152), PackedInt32Array(152, 175, 174), PackedInt32Array(152, 174, 170), PackedInt32Array(152, 170, 176), PackedInt32Array(165, 158, 166), PackedInt32Array(177, 175, 162), PackedInt32Array(162, 175, 161), PackedInt32Array(170, 174, 169), PackedInt32Array(175, 177, 178), PackedInt32Array(175, 178, 174), PackedInt32Array(179, 176, 180), PackedInt32Array(180, 176, 170), PackedInt32Array(182, 181, 151), PackedInt32Array(151, 181, 153), PackedInt32Array(156, 154, 183), PackedInt32Array(183, 154, 173), PackedInt32Array(187, 186, 184), PackedInt32Array(184, 186, 185), PackedInt32Array(191, 190, 188), PackedInt32Array(188, 190, 189), PackedInt32Array(195, 194, 192), PackedInt32Array(192, 194, 193), PackedInt32Array(197, 196, 198), PackedInt32Array(198, 196, 201), PackedInt32Array(198, 201, 199), PackedInt32Array(199, 201, 200), PackedInt32Array(203, 202, 204), PackedInt32Array(204, 202, 207), PackedInt32Array(204, 207, 206), PackedInt32Array(204, 206, 205), PackedInt32Array(210, 209, 211), PackedInt32Array(211, 209, 208), PackedInt32Array(213, 212, 214), PackedInt32Array(214, 212, 215), PackedInt32Array(208, 200, 216), PackedInt32Array(216, 200, 201), PackedInt32Array(196, 215, 217), PackedInt32Array(217, 215, 212), PackedInt32Array(216, 211, 208), PackedInt32Array(196, 217, 201), PackedInt32Array(211, 206, 210), PackedInt32Array(210, 206, 207), PackedInt32Array(223, 222, 218), PackedInt32Array(218, 222, 221), PackedInt32Array(218, 221, 220), PackedInt32Array(218, 220, 219), PackedInt32Array(220, 224, 219), PackedInt32Array(219, 225, 218), PackedInt32Array(227, 226, 228), PackedInt32Array(228, 226, 229), PackedInt32Array(231, 230, 232), PackedInt32Array(232, 230, 233), PackedInt32Array(233, 230, 234), PackedInt32Array(234, 230, 235), PackedInt32Array(229, 236, 228), PackedInt32Array(237, 229, 238), PackedInt32Array(238, 229, 239), PackedInt32Array(239, 229, 240), PackedInt32Array(242, 241, 240), PackedInt32Array(242, 240, 233), PackedInt32Array(233, 240, 229), PackedInt32Array(233, 229, 226), PackedInt32Array(233, 226, 232)] geometry_parsed_geometry_type = 1 geometry_collision_mask = 4278190081 agent_height = 2.0 +agent_radius = 0.75 [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_yvipw"] data = PackedVector3Array(4.5, 0, 4.5, -4.5, 0, 4.5, 4.5, 0, -4.5, 4.5, 0, -4.5, -4.5, 0, 4.5, -4.5, 0, -4.5) @@ -3872,7 +3873,7 @@ collision_layer = 5 shape = SubResource("ConcavePolygonShape3D_54end") [node name="Desk" type="MeshInstance3D" parent="BeastNav/Medbay/Props"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0.4, -9.3) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0.4, -8.7) mesh = SubResource("BoxMesh_ncghj") [node name="Desk2" type="MeshInstance3D" parent="BeastNav/Medbay/Props/Desk"] @@ -3899,7 +3900,7 @@ transform = Transform3D(0.00523592, -0.866025, 0.499973, -0.999945, -4.2222e-08, skeleton = NodePath("") [node name="MedCart3" parent="BeastNav/Medbay/Props" instance=ExtResource("70_wqqoq")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.3, 0.5, 3.8) +transform = Transform3D(0.996195, 0, -0.0871557, 0, 1, 0, 0.0871557, 0, 0.996195, -3.9, 0.5, 3.8) skeleton = NodePath("") [node name="MedCart4" parent="BeastNav/Medbay/Props" instance=ExtResource("70_wqqoq")] @@ -3907,7 +3908,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4, 0.5, 3.8) skeleton = NodePath("") [node name="MedCart5" parent="BeastNav/Medbay/Props" instance=ExtResource("70_wqqoq")] -transform = Transform3D(0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, 0.965926, -1.2, 0.5, 3.8) +transform = Transform3D(0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, 0.965926, -3.9, 0.5, 2) skeleton = NodePath("") [node name="MonitorCart" type="MeshInstance3D" parent="BeastNav/Medbay/Props"] @@ -3929,7 +3930,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.85, 0) mesh = SubResource("PrismMesh_8r2kq") [node name="MonitorCart2" type="MeshInstance3D" parent="BeastNav/Medbay/Props"] -transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 3.9, 0.6, -8.1) +transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 3.9, 0.6, -7.5) mesh = SubResource("BoxMesh_ii88q") [node name="StaticBody3D" type="StaticBody3D" parent="BeastNav/Medbay/Props/MonitorCart2" groups=["PlasticMaterial"]] @@ -3947,7 +3948,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.85, 0) mesh = SubResource("PrismMesh_8r2kq") [node name="MonitorCart3" type="MeshInstance3D" parent="BeastNav/Medbay/Props"] -transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 3.9, 0.6, -6.9) +transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 3.9, 0.6, -6.3) mesh = SubResource("BoxMesh_ii88q") [node name="StaticBody3D" type="StaticBody3D" parent="BeastNav/Medbay/Props/MonitorCart3" groups=["PlasticMaterial"]] @@ -5036,8 +5037,6 @@ metadata/_custom_type_script = "uid://cvx514gdjd5ev" [node name="CargoBay" type="Node3D" parent="BeastNav"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12, -12, -60) -[node name="NavigationLink3D" type="NavigationLink3D" parent="BeastNav"] - [node name="GrunkBeast" parent="." instance=ExtResource("82_rigxx")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, -30) diff --git a/levels/grunkbeast_test/grunkbeast_test.gd b/levels/grunkbeast_test/procedural_grunkbeast_test.gd similarity index 100% rename from levels/grunkbeast_test/grunkbeast_test.gd rename to levels/grunkbeast_test/procedural_grunkbeast_test.gd diff --git a/levels/grunkbeast_test/grunkbeast_test.gd.uid b/levels/grunkbeast_test/procedural_grunkbeast_test.gd.uid similarity index 100% rename from levels/grunkbeast_test/grunkbeast_test.gd.uid rename to levels/grunkbeast_test/procedural_grunkbeast_test.gd.uid diff --git a/levels/grunkbeast_test/grunkbeast_test.tscn b/levels/grunkbeast_test/procedural_grunkbeast_test.tscn similarity index 87% rename from levels/grunkbeast_test/grunkbeast_test.tscn rename to levels/grunkbeast_test/procedural_grunkbeast_test.tscn index 06d3efe..fba5372 100644 --- a/levels/grunkbeast_test/grunkbeast_test.tscn +++ b/levels/grunkbeast_test/procedural_grunkbeast_test.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=12 format=3 uid="uid://cbxlfnlmgdvsq"] -[ext_resource type="PackedScene" uid="uid://d2664rpg4losx" path="res://src/world/procedural_grunk_beast/procedural_grunk_beast.tscn" id="1_6yv42"] -[ext_resource type="Script" uid="uid://bukihqt1lybnx" path="res://src/util/frame_skipper.gd" id="1_eco5q"] -[ext_resource type="Script" uid="uid://b1tbovuphat7d" path="res://levels/grunkbeast_test/grunkbeast_test.gd" id="1_ovhaj"] -[ext_resource type="Script" uid="uid://cpt8dy0csa3eu" path="res://levels/grunkbeast_test/fixed_camera.gd" id="2_77sam"] +[ext_resource type="Script" uid="uid://b1tbovuphat7d" path="res://levels/grunkbeast_test/procedural_grunkbeast_test.gd" id="1_ixhpa"] +[ext_resource type="Script" uid="uid://bukihqt1lybnx" path="res://src/util/frame_skipper.gd" id="2_82w0n"] +[ext_resource type="PackedScene" uid="uid://d2664rpg4losx" path="res://src/world/procedural_grunk_beast/procedural_grunk_beast.tscn" id="3_b4iwh"] +[ext_resource type="Script" uid="uid://cpt8dy0csa3eu" path="res://levels/grunkbeast_test/fixed_camera.gd" id="4_32imj"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_goufh"] @@ -28,8 +28,8 @@ height = 1.0 height = 1.0 radius = 2.0 -[node name="GrunkbeastTest" type="Node3D"] -script = ExtResource("1_ovhaj") +[node name="ProceduralGrunkbeastTest" type="Node3D"] +script = ExtResource("1_ixhpa") [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] transform = Transform3D(0.866025, -0.156955, -0.474726, 0.5, 0.271854, 0.82225, 0, -0.949453, 0.31391, 0, 0, 0) @@ -56,15 +56,15 @@ mesh = SubResource("CylinderMesh_4n07c") shape = SubResource("CylinderShape3D_6yv42") [node name="FrameSkipper" type="Node" parent="."] -script = ExtResource("1_eco5q") +script = ExtResource("2_82w0n") frame_skip = 3 -[node name="GrunkBeast" parent="FrameSkipper" instance=ExtResource("1_6yv42")] +[node name="GrunkBeast" parent="FrameSkipper" instance=ExtResource("3_b4iwh")] unique_name_in_owner = true move_speed = 8.0 step_time = 0.06 [node name="Camera3D" type="Camera3D" parent="." node_paths=PackedStringArray("target")] transform = Transform3D(0.252101, -0.522855, 0.81429, 0, 0.841469, 0.540306, -0.967701, -0.136212, 0.212135, 6.63551, 7.43415, 1.1904) -script = ExtResource("2_77sam") +script = ExtResource("4_32imj") target = NodePath("../FrameSkipper/GrunkBeast") diff --git a/levels/pathing_test/pathing_test.tscn b/levels/pathing_test/pathing_test.tscn index 46a060d..099307a 100644 --- a/levels/pathing_test/pathing_test.tscn +++ b/levels/pathing_test/pathing_test.tscn @@ -37,11 +37,12 @@ background_mode = 2 sky = SubResource("Sky_pka60") [sub_resource type="NavigationMesh" id="NavigationMesh_gyhlh"] -vertices = PackedVector3Array(-26.25, 0.519, -29.25, -26.5, 0.519, -30.75, -27.5, 0.519, -30.75, -27.5, 0.519, -17.25, -26.75, 0.519, -18.25, -26.25, 0.519, -19, -0.25, 0.519, -17.5, 0.75, 0.519, -18, 0.75, 0.519, -19.75, -0.75, 0.519, -19, -1.25, 0.519, -18.5, -1, 0.519, -17.25, -3.25, 0.519, -24.25, -3.25, 0.519, -20.25, -1.25, 0.519, -20.25, 1.75, 0.519, -20.25, 1.75, 0.519, -24.25, -25.75, 0.519, -18.5, -25.25, 0.519, -18.25, -19.75, 0.519, -17.5, -24.75, 0.519, -17.25, -18, 0.519, -17.5, -0.5, 0.519, -16.75, -20.25, 0.519, -18.5, -0.5, 0.519, -6, 0.75, 0.519, -6, 0.75, 0.519, -12.75, 0, 0.519, -13.25, -17, 0.519, -18.5, -24.25, 0.519, -24.25, -24.25, 0.519, -20.25, 2.5, 0.519, -19.75, 24.25, 0.519, -24.25, 2.5, 0.519, -5.75, 24.25, 0.519, -5.5, -2.25, 0.519, -4.25, -2.25, 0.519, -15.5, -24.25, 0.519, -15.5, -1.5, 0.519, -3.75, -24.25, 0.519, 24.25, -1.5, 0.519, 24.25, 0.75, 0.519, -4.25, -0.5, 0.519, -4.25, 1.75, 0.519, -3.75, 1.75, 0.519, 24.25, 2.5, 0.519, -4.25, 24.25, 0.519, 24.25) +vertices = PackedVector3Array(-26.25, 0.499, -29.25, -26.5, 0.499, -30.75, -27.5, 0.499, -30.75, -27.5, 0.499, -17.25, -26.75, 0.499, -18.25, -26.25, 0.499, -19, -0.25, 0.499, -17.5, 0.75, 0.499, -18, 0.75, 0.499, -19.75, -0.75, 0.499, -19, -1.25, 0.499, -18.5, -1, 0.499, -17.25, -3.25, 0.499, -24.25, -3.25, 0.499, -20.25, -1.25, 0.499, -20.25, 1.75, 0.499, -20.25, 1.75, 0.499, -24.25, -25.75, 0.499, -18.5, -25.5, 0.499, -18.25, -19.75, 0.499, -17.5, -24.75, 0.499, -17.25, -18, 0.499, -17.5, -0.5, 0.499, -16.75, -20.25, 0.499, -18.5, -0.5, 0.499, -6, 0.75, 0.499, -6, 0.75, 0.499, -12.75, 0, 0.499, -13.25, -17, 0.499, -18.5, -24.25, 0.499, -24.25, -24.25, 0.499, -20.25, 2.5, 0.499, -19.75, 24.25, 0.499, -24.25, 2.5, 0.499, -5.75, 24.25, 0.499, -5.5, -2.25, 0.499, -4.25, -2.25, 0.499, -15.5, -24.25, 0.499, -15.5, -1.5, 0.499, -3.75, -24.25, 0.499, 24.25, -1.5, 0.499, 24.25, 0.75, 0.499, -4.25, -0.5, 0.499, -4.25, 1.75, 0.499, -3.75, 1.75, 0.499, 24.25, 2.5, 0.499, -4.25, 24.25, 0.499, 24.25) polygons = [PackedInt32Array(4, 3, 5), PackedInt32Array(5, 3, 0), PackedInt32Array(0, 3, 1), PackedInt32Array(1, 3, 2), PackedInt32Array(11, 10, 6), PackedInt32Array(6, 10, 9), PackedInt32Array(6, 9, 7), PackedInt32Array(7, 9, 8), PackedInt32Array(14, 13, 12), PackedInt32Array(8, 14, 15), PackedInt32Array(15, 14, 16), PackedInt32Array(16, 14, 12), PackedInt32Array(18, 4, 17), PackedInt32Array(20, 18, 19), PackedInt32Array(8, 9, 14), PackedInt32Array(19, 21, 20), PackedInt32Array(20, 21, 11), PackedInt32Array(6, 22, 11), PackedInt32Array(17, 23, 18), PackedInt32Array(18, 23, 19), PackedInt32Array(25, 24, 26), PackedInt32Array(26, 24, 27), PackedInt32Array(10, 11, 28), PackedInt32Array(28, 11, 21), PackedInt32Array(6, 27, 22), PackedInt32Array(22, 27, 24), PackedInt32Array(17, 4, 5), PackedInt32Array(30, 29, 13), PackedInt32Array(13, 29, 12), PackedInt32Array(15, 16, 31), PackedInt32Array(31, 16, 32), PackedInt32Array(33, 31, 34), PackedInt32Array(34, 31, 32), PackedInt32Array(37, 36, 35), PackedInt32Array(35, 38, 37), PackedInt32Array(37, 38, 40), PackedInt32Array(37, 40, 39), PackedInt32Array(42, 24, 41), PackedInt32Array(41, 24, 25), PackedInt32Array(41, 43, 42), PackedInt32Array(42, 43, 38), PackedInt32Array(38, 43, 44), PackedInt32Array(38, 44, 40), PackedInt32Array(45, 33, 34), PackedInt32Array(45, 34, 43), PackedInt32Array(43, 34, 44), PackedInt32Array(44, 34, 46)] geometry_parsed_geometry_type = 1 geometry_collision_mask = 4278190081 agent_height = 2.0 +agent_radius = 0.75 [sub_resource type="PlaneMesh" id="PlaneMesh_nwuu1"] size = Vector2(50, 50) @@ -335,6 +336,7 @@ navigation_mesh = SubResource("NavigationMesh_gyhlh") [node name="WorldFloor" type="StaticBody3D" parent="NavigationRegion3D" groups=["PlasticMaterial"]] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.001, 0) +collision_layer = 5 [node name="MeshInstance3D" type="MeshInstance3D" parent="NavigationRegion3D/WorldFloor"] mesh = SubResource("PlaneMesh_nwuu1") diff --git a/project.godot b/project.godot index 3997925..11d90c8 100644 --- a/project.godot +++ b/project.godot @@ -63,8 +63,9 @@ folder_colors={ "res://levels/": "blue", "res://levels/ghost_ship/": "purple", "res://src/": "green", -"res://src/ui/": "yellow", -"res://src/world/": "teal" +"res://src/ui/": "orange", +"res://src/world/": "teal", +"res://src/world/grunk_beast/behaviors/": "yellow" } [game] diff --git a/src/world/grunk_beast/behaviors/actions/blackboard_copy.gd b/src/world/grunk_beast/behaviors/actions/blackboard_copy.gd new file mode 100644 index 0000000..166b902 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/blackboard_copy.gd @@ -0,0 +1,14 @@ +@tool +class_name BlackboardCopy extends ActionLeaf +## Copy a value from one blackboard key to another. + +## Source blackboard key. +@export var source_key: String + +## Destination blackboard key. +@export var destination_key: String + + +func tick(_actor: Node, blackboard: Blackboard) -> int: + blackboard.set_value(destination_key, blackboard.get_value(source_key)) + return SUCCESS diff --git a/src/world/grunk_beast/behaviors/actions/blackboard_copy.gd.uid b/src/world/grunk_beast/behaviors/actions/blackboard_copy.gd.uid new file mode 100644 index 0000000..02628de --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/blackboard_copy.gd.uid @@ -0,0 +1 @@ +uid://wfd5nbethyw6 diff --git a/src/world/grunk_beast/behaviors/actions/blackboard_erase_safe.gd b/src/world/grunk_beast/behaviors/actions/blackboard_erase_safe.gd new file mode 100644 index 0000000..0f53d71 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/blackboard_erase_safe.gd @@ -0,0 +1,14 @@ +@tool +class_name BlackboardEraseSafe extends ActionLeaf +## Erases the specified key from the blackboard. +## +## Unlike Beehave's builtin BlackboardEraseAction, this version will succeed silently if +## the given key is not defined. + +## Expression representing a blackboard key. +@export var key := "" + + +func tick(_actor: Node, blackboard: Blackboard) -> int: + blackboard.erase_value(key) + return SUCCESS diff --git a/src/world/grunk_beast/behaviors/actions/blackboard_erase_safe.gd.uid b/src/world/grunk_beast/behaviors/actions/blackboard_erase_safe.gd.uid new file mode 100644 index 0000000..f975719 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/blackboard_erase_safe.gd.uid @@ -0,0 +1 @@ +uid://demv7xh27ouvr diff --git a/src/world/grunk_beast/behaviors/actions/grab_target.gd b/src/world/grunk_beast/behaviors/actions/grab_target.gd new file mode 100644 index 0000000..9109366 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/grab_target.gd @@ -0,0 +1,20 @@ +@tool +class_name GrabTarget extends ActionLeaf +## Grab the given target!! +## +## Returns FAILURE if there is no valid key at the given target. + +## Blackboard key of the grab target. +@export var blackboard_key := "target" + + +func tick(_actor: Node, blackboard: Blackboard) -> int: + @warning_ignore("unsafe_cast") + var target := blackboard.get_value(blackboard_key) as Node3D + if not is_instance_valid(target): + return FAILURE + + # TODO + print_debug("GET FUCKIGN GRABBED IDIOT!! ", target) + + return SUCCESS diff --git a/src/world/grunk_beast/behaviors/actions/grab_target.gd.uid b/src/world/grunk_beast/behaviors/actions/grab_target.gd.uid new file mode 100644 index 0000000..d83f498 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/grab_target.gd.uid @@ -0,0 +1 @@ +uid://b0xue7ao0gjqo diff --git a/src/world/grunk_beast/behaviors/actions/pick_random_from_group.gd b/src/world/grunk_beast/behaviors/actions/pick_random_from_group.gd new file mode 100644 index 0000000..7716dc0 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/pick_random_from_group.gd @@ -0,0 +1,19 @@ +@tool +class_name PickRandomFromGroup extends ActionLeaf +## Picks a random node in the given group and stores it in the blackboard. +## +## Returns FAILURE if there are no nodes in the given group. + +## Blackboard key under which the node will be stored. +@export var blackboard_key := "target" + +## Name of the group to pick from. +@export var group: String + + +func tick(actor: Node, blackboard: Blackboard) -> int: + var nodes: Array[Node] = actor.get_tree().get_nodes_in_group(group) + if not nodes: + return FAILURE + blackboard.set_value(blackboard_key, nodes.pick_random()) + return SUCCESS diff --git a/src/world/grunk_beast/behaviors/actions/pick_random_from_group.gd.uid b/src/world/grunk_beast/behaviors/actions/pick_random_from_group.gd.uid new file mode 100644 index 0000000..1656157 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/pick_random_from_group.gd.uid @@ -0,0 +1 @@ +uid://cg55nu4y0a5ud diff --git a/src/world/grunk_beast/behaviors/actions/pursue_target.gd b/src/world/grunk_beast/behaviors/actions/pursue_target.gd new file mode 100644 index 0000000..0b249a2 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/pursue_target.gd @@ -0,0 +1,20 @@ +@tool +class_name PursueTarget extends ActionLeaf +## Wait until the navigation target is reached (or cannot navigate further) +## +## This action will update the target's position each tick, allowing for tracking moving targets. +## Returns FAILURE if there isn't a Node3D at the given blackboard key. + +@export var blackboard_key := "target" + +@onready var nav_agent: NavigationAgent3D = %NavAgent + + +func tick(_actor: Node, blackboard: Blackboard) -> int: + @warning_ignore("unsafe_cast") + var target := blackboard.get_value(blackboard_key) as Node3D + if not is_instance_valid(target): + return FAILURE + nav_agent.target_position = target.global_position + + return SUCCESS if nav_agent.is_navigation_finished() else RUNNING diff --git a/src/world/grunk_beast/behaviors/actions/pursue_target.gd.uid b/src/world/grunk_beast/behaviors/actions/pursue_target.gd.uid new file mode 100644 index 0000000..4287c7c --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/pursue_target.gd.uid @@ -0,0 +1 @@ +uid://bkdwuqv4tudka diff --git a/src/world/grunk_beast/behaviors/actions/set_nav_target.gd b/src/world/grunk_beast/behaviors/actions/set_nav_target.gd new file mode 100644 index 0000000..7353ae2 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/set_nav_target.gd @@ -0,0 +1,26 @@ +@tool +class_name SetNavTarget extends ActionLeaf +## Set the nav agent target position to the global position at the given blackboard key. +## +## The target value may be a Vector3 position in space, +## or a Node3D, in which case the global position of the node will be used as the target position. +## +## Returns failure if there is no valid target under the given blackboard key. + +## Blackboard key of the Node3D to set as a target +@export var blackboard_key := "target" + +@onready var nav_agent: NavigationAgent3D = %NavAgent + + +func tick(_actor: Node, blackboard: Blackboard) -> int: + var value: Variant = blackboard.get_value(blackboard_key) + if value is Vector3: + @warning_ignore("unsafe_cast") + nav_agent.target_position = value as Vector3 + elif value is Node3D and is_instance_valid(value): + @warning_ignore("unsafe_cast") + nav_agent.target_position = (value as Node3D).global_position + else: + return FAILURE + return SUCCESS diff --git a/src/world/grunk_beast/behaviors/actions/set_nav_target.gd.uid b/src/world/grunk_beast/behaviors/actions/set_nav_target.gd.uid new file mode 100644 index 0000000..d256cd1 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/set_nav_target.gd.uid @@ -0,0 +1 @@ +uid://u1ntpwjwjqhj diff --git a/src/world/grunk_beast/behaviors/actions/set_target_from_area.gd b/src/world/grunk_beast/behaviors/actions/set_target_from_area.gd new file mode 100644 index 0000000..d2ec595 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/set_target_from_area.gd @@ -0,0 +1,21 @@ +@tool +class_name SetTargetFromArea extends ActionLeaf +## Store the first node in the given area on the blackboard. +## +## Returns FAILURE if there is no such node overlapping the given area. +## NOTE: You probably should only use this with areas masked to only have one possible body. + +## Key to store the target under. +@export var blackboard_key := "target" + +## Area to get target from. +@export var area: Area3D + + +func tick(_actor: Node, blackboard: Blackboard) -> int: + var bodies := area.get_overlapping_bodies() + if not bodies: + return FAILURE + + blackboard.set_value(blackboard_key, bodies[0]) + return SUCCESS diff --git a/src/world/grunk_beast/behaviors/actions/set_target_from_area.gd.uid b/src/world/grunk_beast/behaviors/actions/set_target_from_area.gd.uid new file mode 100644 index 0000000..0e5e6ef --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/set_target_from_area.gd.uid @@ -0,0 +1 @@ +uid://b34l3v4sr8rmq diff --git a/src/world/grunk_beast/behaviors/actions/start_timer.gd b/src/world/grunk_beast/behaviors/actions/start_timer.gd new file mode 100644 index 0000000..d0e6dfa --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/start_timer.gd @@ -0,0 +1,18 @@ +@tool +class_name StartTimer extends ActionLeaf +## Start the given timer. +## If `seconds > 0`, start the timer with that duration, otherwise use the default. + +## Timer to start. +@export var timer: Timer + +## Number of seconds to set the timer for. If <0, use the default. +@export var seconds := -1.0 + + +func tick(_actor: Node, _blackboard: Blackboard) -> int: + if seconds > 0: + timer.start(seconds) + else: + timer.start() + return SUCCESS diff --git a/src/world/grunk_beast/behaviors/actions/start_timer.gd.uid b/src/world/grunk_beast/behaviors/actions/start_timer.gd.uid new file mode 100644 index 0000000..bb5186d --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/start_timer.gd.uid @@ -0,0 +1 @@ +uid://ykfqlqp7e8og diff --git a/src/world/grunk_beast/behaviors/actions/travel_to_destination.gd b/src/world/grunk_beast/behaviors/actions/travel_to_destination.gd new file mode 100644 index 0000000..b4d743c --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/travel_to_destination.gd @@ -0,0 +1,9 @@ +@tool +class_name TravelToDestination extends ActionLeaf +## Wait until the navigation target is reached (or cannot navigate further) + +@onready var nav_agent: NavigationAgent3D = %NavAgent + + +func tick(_actor: Node, _blackboard: Blackboard) -> int: + return SUCCESS if nav_agent.is_navigation_finished() else RUNNING diff --git a/src/world/grunk_beast/behaviors/actions/travel_to_destination.gd.uid b/src/world/grunk_beast/behaviors/actions/travel_to_destination.gd.uid new file mode 100644 index 0000000..49d91f5 --- /dev/null +++ b/src/world/grunk_beast/behaviors/actions/travel_to_destination.gd.uid @@ -0,0 +1 @@ +uid://om57w2acvgb7 diff --git a/src/world/grunk_beast/behaviors/conditions/area_has_bodies.gd b/src/world/grunk_beast/behaviors/conditions/area_has_bodies.gd new file mode 100644 index 0000000..494aa55 --- /dev/null +++ b/src/world/grunk_beast/behaviors/conditions/area_has_bodies.gd @@ -0,0 +1,11 @@ +@tool +class_name AreaHasBodies extends ConditionLeaf +## Does the given Area3D have any overlapping bodies? + +## Area3D to check for overlapping bodies. +@export var area: Area3D + + +func tick(_actor: Node, _blackboard: Blackboard) -> int: + area.get_overlapping_bodies() + return SUCCESS if area.has_overlapping_bodies() else FAILURE diff --git a/src/world/grunk_beast/behaviors/conditions/area_has_bodies.gd.uid b/src/world/grunk_beast/behaviors/conditions/area_has_bodies.gd.uid new file mode 100644 index 0000000..e297e33 --- /dev/null +++ b/src/world/grunk_beast/behaviors/conditions/area_has_bodies.gd.uid @@ -0,0 +1 @@ +uid://ulw86qyy1knh diff --git a/src/world/grunk_beast/behaviors/conditions/body_in_area.gd b/src/world/grunk_beast/behaviors/conditions/body_in_area.gd new file mode 100644 index 0000000..bbb9261 --- /dev/null +++ b/src/world/grunk_beast/behaviors/conditions/body_in_area.gd @@ -0,0 +1,16 @@ +@tool +class_name BodyInArea extends ConditionLeaf +## Is the body at the given blackboard key in the given area? +## +## Returns FAILURE if there is no Node3D at the given blackboard key. + +## Blackboard key of the body to check. +@export var blackboard_key := "target" +## Area3D to check for the target body. +@export var area: Area3D + + +func tick(_actor: Node, blackboard: Blackboard) -> int: + @warning_ignore("unsafe_cast") + var body := blackboard.get_value(blackboard_key) as Node3D + return SUCCESS if is_instance_valid(body) and body in area.get_overlapping_bodies() else FAILURE diff --git a/src/world/grunk_beast/behaviors/conditions/body_in_area.gd.uid b/src/world/grunk_beast/behaviors/conditions/body_in_area.gd.uid new file mode 100644 index 0000000..b303b5e --- /dev/null +++ b/src/world/grunk_beast/behaviors/conditions/body_in_area.gd.uid @@ -0,0 +1 @@ +uid://7k5hor1omsxc diff --git a/src/world/grunk_beast/behaviors/conditions/target_reached.gd b/src/world/grunk_beast/behaviors/conditions/target_reached.gd new file mode 100644 index 0000000..e465278 --- /dev/null +++ b/src/world/grunk_beast/behaviors/conditions/target_reached.gd @@ -0,0 +1,9 @@ +@tool +class_name TargetReached extends ConditionLeaf +## Has the nav agent reached its current target? + +@onready var nav_agent: NavigationAgent3D = %NavAgent + + +func tick(_actor: Node, _blackboard: Blackboard) -> int: + return SUCCESS if nav_agent.is_target_reached() else FAILURE diff --git a/src/world/grunk_beast/behaviors/conditions/target_reached.gd.uid b/src/world/grunk_beast/behaviors/conditions/target_reached.gd.uid new file mode 100644 index 0000000..c6629a4 --- /dev/null +++ b/src/world/grunk_beast/behaviors/conditions/target_reached.gd.uid @@ -0,0 +1 @@ +uid://bnd8y8fkvg082 diff --git a/src/world/grunk_beast/behaviors/conditions/timer_running.gd b/src/world/grunk_beast/behaviors/conditions/timer_running.gd new file mode 100644 index 0000000..e96788b --- /dev/null +++ b/src/world/grunk_beast/behaviors/conditions/timer_running.gd @@ -0,0 +1,10 @@ +@tool +class_name TimerRunning extends ConditionLeaf +## Is the given timer currently running? + +## Timer to check. +@export var timer: Timer + + +func tick(_actor: Node, _blackboard: Blackboard) -> int: + return FAILURE if timer.is_stopped() else SUCCESS diff --git a/src/world/grunk_beast/behaviors/conditions/timer_running.gd.uid b/src/world/grunk_beast/behaviors/conditions/timer_running.gd.uid new file mode 100644 index 0000000..18113f3 --- /dev/null +++ b/src/world/grunk_beast/behaviors/conditions/timer_running.gd.uid @@ -0,0 +1 @@ +uid://h0cp58nswpml diff --git a/src/world/grunk_beast/behaviors/decorators/random_delay.gd b/src/world/grunk_beast/behaviors/decorators/random_delay.gd new file mode 100644 index 0000000..14f0524 --- /dev/null +++ b/src/world/grunk_beast/behaviors/decorators/random_delay.gd @@ -0,0 +1,31 @@ +@tool +class_name RandomDelay extends DelayDecorator +## DelayDecorator which randomizes the wait time to a normal random sample each time it's run. + +## Mean wait time, in seconds. +@export var mean_time := 1.0: + set(value): + mean_time = value + randomize_wait_time() + +## Standard deviation of wait time, in seconds. +@export var st_dev_time := 0.1: + set(value): + st_dev_time = value + randomize_wait_time() + + +func _ready() -> void: + randomize_wait_time() + + +func randomize_wait_time() -> void: + wait_time = maxf(0.0, randfn(mean_time, st_dev_time)) + + +func tick(actor: Node, blackboard: Blackboard) -> int: + var total_time: float = blackboard.get_value(cache_key, 0.0, str(actor.get_instance_id())) + if total_time == 0.0: + randomize_wait_time() + + return super.tick(actor, blackboard) diff --git a/src/world/grunk_beast/behaviors/decorators/random_delay.gd.uid b/src/world/grunk_beast/behaviors/decorators/random_delay.gd.uid new file mode 100644 index 0000000..5753cd9 --- /dev/null +++ b/src/world/grunk_beast/behaviors/decorators/random_delay.gd.uid @@ -0,0 +1 @@ +uid://beyk2xtbjrsg4 diff --git a/src/world/grunk_beast/grunk_beast.gd b/src/world/grunk_beast/grunk_beast.gd index 363e6ca..b9c542f 100644 --- a/src/world/grunk_beast/grunk_beast.gd +++ b/src/world/grunk_beast/grunk_beast.gd @@ -2,25 +2,12 @@ class_name GrunkBeast extends CharacterBody3D ## Grunk beast controller #region Constants -signal state_changed(new_state: State) - -enum State { - UNKNOWN, - LURKING, - STALKING, - PURSUIT, -} - -const LURK_POINT_GROUP := "LurkPoint" -const STALKING_SOUND_LIMIT := 14.0 -const IDLE_EPSILON := 0.001 +const STALKING_SOUND_LIMIT := 20.0 #endregion #region Exported Properties -@export var lurk_spontaneity := 0.02 @export var base_speed := 60.0 @export var pursuit_speed := 180.0 -@export var initial_state := State.LURKING #endregion #region Member Variables @@ -29,29 +16,52 @@ var gravity: Vector3 = ( * ProjectSettings.get_setting("physics/3d/default_gravity_vector") ) -var state: State: - set(value): - if state != value: - _on_state_change(value) - state = value - var pathfinding := true @onready var nav_agent: NavigationAgent3D = %NavAgent -@onready var stalking_timeout: Timer = %StalkingTimeout -@onready var idle_timer: Timer = %IdleTimer +@onready var nav_probe: NavigationAgent3D = %NavProbe +@onready var stalking_timer: Timer = %StalkingTimer + +@onready var blackboard: Blackboard = %Blackboard + #endregion #region Character Controller +func is_pursuing() -> bool: + return blackboard.has_value("pursuit_target") + + +func is_stalking() -> bool: + return false # TODO + + func get_speed() -> float: - match state: - State.PURSUIT: - return pursuit_speed + if is_pursuing(): + return pursuit_speed return base_speed +func path_shorter_than(target: Vector3, limit: float) -> bool: + var limit_sq := limit * limit + var length_sq := 0.0 + var last_pos := global_position + + nav_probe.target_position = target + + for waypoint: Vector3 in nav_probe.get_current_navigation_path().slice( + nav_probe.get_current_navigation_path_index() + ): + # Using distance squared to save a sqrt instruction + length_sq += last_pos.distance_squared_to(waypoint) + if length_sq > limit_sq: + return false + last_pos = waypoint + + return true + + func _physics_process(delta: float) -> void: var motion := Vector3.ZERO @@ -66,114 +76,13 @@ func _physics_process(delta: float) -> void: if not is_on_floor(): velocity += gravity * delta - if velocity.length_squared() > IDLE_EPSILON: - idle_timer.start() - move_and_slide() -#endregion - -#region State Machine - - -func _ready() -> void: - state = initial_state - - -func _current_path_shorter_than(limit: float) -> bool: - var limit_sq := limit * limit - var length_sq := 0.0 - var last_pos := global_position - - for waypoint: Vector3 in nav_agent.get_current_navigation_path().slice( - nav_agent.get_current_navigation_path_index() - ): - # Using distance squared to save a sqrt instruction - length_sq += last_pos.distance_squared_to(waypoint) - if length_sq > limit_sq: - return false - last_pos = waypoint - - return true - - -func _set_new_lurk_point() -> void: - @warning_ignore("unsafe_cast") - var next_lurk_point := get_tree().get_nodes_in_group(LURK_POINT_GROUP).pick_random() as Node3D - if next_lurk_point: - nav_agent.target_position = next_lurk_point.global_position - else: - push_warning(self, " tried to lurk, but couldn't find a lurk point!") - - -## Lurking routine -func lurk() -> void: - if nav_agent.is_target_reached() or randf() < lurk_spontaneity: - _set_new_lurk_point() - - -## Stalking routine -func stalk() -> void: - pass - - -## Pursuit routine -func pursue() -> void: - if Player.instance: - nav_agent.target_position = Player.instance.global_position - - -func _on_state_change(new_state: State) -> void: - match new_state: - State.LURKING: - _set_new_lurk_point() - State.STALKING: - stalking_timeout.start() - - state_changed.emit(new_state) - - -func update_behavior() -> void: - match state: - State.UNKNOWN: - state = State.LURKING - update_behavior() - State.LURKING: - lurk() - State.STALKING: - stalk() - State.PURSUIT: - pursue() - - func on_sound_detected(source: Vector3) -> void: - var prev_target := nav_agent.target_position - nav_agent.target_position = source # Check that the source isn't too far away, e.g. a sound from another room - if _current_path_shorter_than(STALKING_SOUND_LIMIT): - # First detection switches to stalking, second switches to pursuit - if state == State.STALKING: - state = State.PURSUIT - else: - state = State.STALKING - else: - nav_agent.target_position = prev_target - - -func on_player_entered_grabbing_range(_body: Node3D) -> void: - print_debug("GET GRABBED, IDIOT!") - - -func on_player_left_pursuit_range(_body: Node3D) -> void: - state = State.STALKING - - -func on_stalking_timeout_timeout() -> void: - state = State.LURKING - - -func on_stalking_idle_timer_timeout() -> void: - pass # Replace with function body. + if path_shorter_than(source, STALKING_SOUND_LIMIT): + blackboard.set_value("stalking_target", source) + stalking_timer.start() #endregion diff --git a/src/world/grunk_beast/grunk_beast.tscn b/src/world/grunk_beast/grunk_beast.tscn index c09831f..ae618a0 100644 --- a/src/world/grunk_beast/grunk_beast.tscn +++ b/src/world/grunk_beast/grunk_beast.tscn @@ -1,10 +1,30 @@ -[gd_scene load_steps=16 format=3 uid="uid://ehf5sg3ahvbf"] +[gd_scene load_steps=37 format=3 uid="uid://ehf5sg3ahvbf"] [ext_resource type="Script" uid="uid://gwwmqwixqqr5" path="res://src/world/grunk_beast/grunk_beast.gd" id="2_qqnhb"] [ext_resource type="Shader" uid="uid://ckxc0ngd37rtk" path="res://src/shaders/gunk.gdshader" id="4_0gxpq"] [ext_resource type="Script" uid="uid://cfsiyhhrcua6o" path="res://src/world/game_sound/game_sound_listener.gd" id="5_3gbao"] [ext_resource type="Texture2D" uid="uid://cm1jrvx7ftx4c" path="res://assets/black.png" id="5_xuag8"] +[ext_resource type="Script" uid="uid://bb0t2ovl7wifo" path="res://addons/beehave/nodes/beehave_tree.gd" id="6_d4ex2"] [ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="6_mbqcc"] +[ext_resource type="Script" uid="uid://dme5f24l0edsf" path="res://addons/beehave/blackboard.gd" id="7_cn3ok"] +[ext_resource type="Script" uid="uid://cw22yurt5l74k" path="res://addons/beehave/nodes/composites/selector_reactive.gd" id="7_vvw1q"] +[ext_resource type="Script" uid="uid://cg016dbe7gs1x" path="res://addons/beehave/nodes/composites/sequence.gd" id="8_0gxpq"] +[ext_resource type="Script" uid="uid://7k5hor1omsxc" path="res://src/world/grunk_beast/behaviors/conditions/body_in_area.gd" id="9_xuag8"] +[ext_resource type="Script" uid="uid://u1ntpwjwjqhj" path="res://src/world/grunk_beast/behaviors/actions/set_nav_target.gd" id="10_kjykp"] +[ext_resource type="Script" uid="uid://2qri6rrfv8ui" path="res://addons/beehave/nodes/decorators/cooldown.gd" id="10_ntlom"] +[ext_resource type="Script" uid="uid://beyk2xtbjrsg4" path="res://src/world/grunk_beast/behaviors/decorators/random_delay.gd" id="11_mbqcc"] +[ext_resource type="Script" uid="uid://b0xue7ao0gjqo" path="res://src/world/grunk_beast/behaviors/actions/grab_target.gd" id="11_nq7ke"] +[ext_resource type="Script" uid="uid://8hn4kne15ac5" path="res://addons/beehave/nodes/composites/selector.gd" id="12_dkcdj"] +[ext_resource type="Script" uid="uid://cg55nu4y0a5ud" path="res://src/world/grunk_beast/behaviors/actions/pick_random_from_group.gd" id="12_ml8dd"] +[ext_resource type="Script" uid="uid://dcojdhvj8qcw0" path="res://addons/beehave/nodes/composites/sequence_reactive.gd" id="12_xde72"] +[ext_resource type="Script" uid="uid://b34l3v4sr8rmq" path="res://src/world/grunk_beast/behaviors/actions/set_target_from_area.gd" id="13_x8l6r"] +[ext_resource type="Script" uid="uid://om57w2acvgb7" path="res://src/world/grunk_beast/behaviors/actions/travel_to_destination.gd" id="14_4y64f"] +[ext_resource type="Script" uid="uid://bkdwuqv4tudka" path="res://src/world/grunk_beast/behaviors/actions/pursue_target.gd" id="14_x8l6r"] +[ext_resource type="Script" uid="uid://demv7xh27ouvr" path="res://src/world/grunk_beast/behaviors/actions/blackboard_erase_safe.gd" id="15_4b27i"] +[ext_resource type="Script" uid="uid://dwfdg523bk776" path="res://addons/beehave/nodes/decorators/failer.gd" id="15_oons1"] +[ext_resource type="Script" uid="uid://wfd5nbethyw6" path="res://src/world/grunk_beast/behaviors/actions/blackboard_copy.gd" id="15_umoec"] +[ext_resource type="Script" uid="uid://ykfqlqp7e8og" path="res://src/world/grunk_beast/behaviors/actions/start_timer.gd" id="16_asd50"] +[ext_resource type="Script" uid="uid://h0cp58nswpml" path="res://src/world/grunk_beast/behaviors/conditions/timer_running.gd" id="16_oons1"] [sub_resource type="NoiseTexture3D" id="NoiseTexture3D_faau1"] width = 256 @@ -62,10 +82,10 @@ radial_segments = 7 rings = 1 [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_faau1"] -radius = 0.45 +radius = 0.4 [sub_resource type="SphereShape3D" id="SphereShape3D_wffas"] -radius = 7.0 +radius = 16.0 [sub_resource type="SphereShape3D" id="SphereShape3D_3gbao"] radius = 1.4 @@ -73,7 +93,11 @@ radius = 1.4 [sub_resource type="SphereShape3D" id="SphereShape3D_d4ex2"] radius = 20.0 +[sub_resource type="SphereShape3D" id="SphereShape3D_oons1"] +radius = 3.0 + [node name="GrunkBeast" type="CharacterBody3D"] +collision_layer = 36 script = ExtResource("2_qqnhb") [node name="MeshInstance3D" type="MeshInstance3D" parent="."] @@ -90,19 +114,13 @@ shape = SubResource("CapsuleShape3D_faau1") [node name="NavAgent" type="NavigationAgent3D" parent="."] unique_name_in_owner = true +path_desired_distance = 0.75 +avoidance_enabled = true +debug_enabled = true -[node name="IdleTimer" type="Timer" parent="."] +[node name="NavProbe" type="NavigationAgent3D" parent="."] unique_name_in_owner = true -wait_time = 1.2 -one_shot = true - -[node name="StalkingTimeout" type="Timer" parent="."] -unique_name_in_owner = true -wait_time = 25.0 -one_shot = true - -[node name="BehaviorUpdateTimer" type="Timer" parent="."] -autostart = true +path_desired_distance = 0.75 [node name="GameSoundListener" type="StaticBody3D" parent="."] collision_layer = 16 @@ -120,15 +138,167 @@ collision_mask = 8 [node name="CollisionShape3D" type="CollisionShape3D" parent="GrabbingRange"] shape = SubResource("SphereShape3D_3gbao") -[node name="PursuitLimit" type="Area3D" parent="."] +[node name="PursuitRange" type="Area3D" parent="."] collision_layer = 0 collision_mask = 8 -[node name="CollisionShape3D" type="CollisionShape3D" parent="PursuitLimit"] +[node name="CollisionShape3D" type="CollisionShape3D" parent="PursuitRange"] shape = SubResource("SphereShape3D_d4ex2") -[connection signal="timeout" from="StalkingTimeout" to="." method="on_stalking_timeout_timeout"] -[connection signal="timeout" from="BehaviorUpdateTimer" to="." method="update_behavior"] +[node name="AggroRange" type="Area3D" parent="."] +collision_layer = 0 +collision_mask = 8 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="AggroRange"] +shape = SubResource("SphereShape3D_oons1") + +[node name="SniffRange" type="Area3D" parent="."] +collision_layer = 0 +collision_mask = 8 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="SniffRange"] +shape = SubResource("SphereShape3D_wffas") + +[node name="StalkingTimer" type="Timer" parent="."] +unique_name_in_owner = true +wait_time = 25.0 +one_shot = true + +[node name="GrunkBeastBehavior" type="Node" parent="." node_paths=PackedStringArray("blackboard", "actor")] +script = ExtResource("6_d4ex2") +blackboard = NodePath("../Blackboard") +actor = NodePath("..") +metadata/_custom_type_script = "uid://bb0t2ovl7wifo" + +[node name="StateSelector" type="Node" parent="GrunkBeastBehavior"] +script = ExtResource("7_vvw1q") +metadata/_custom_type_script = "uid://cw22yurt5l74k" + +[node name="GrabSequence" type="Node" parent="GrunkBeastBehavior/StateSelector"] +script = ExtResource("8_0gxpq") +metadata/_custom_type_script = "uid://cg016dbe7gs1x" + +[node name="IsTargetInGrabbingRange" type="Node" parent="GrunkBeastBehavior/StateSelector/GrabSequence" node_paths=PackedStringArray("area")] +script = ExtResource("9_xuag8") +blackboard_key = "pursuit_target" +area = NodePath("../../../../GrabbingRange") +metadata/_custom_type_script = "uid://7k5hor1omsxc" + +[node name="GrabCooldown" type="Node" parent="GrunkBeastBehavior/StateSelector/GrabSequence"] +script = ExtResource("10_ntlom") +wait_time = 2.0 +metadata/_custom_type_script = "uid://2qri6rrfv8ui" + +[node name="GrabTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/GrabSequence/GrabCooldown"] +script = ExtResource("11_nq7ke") +blackboard_key = "pursuit_target" +metadata/_custom_type_script = "uid://b0xue7ao0gjqo" + +[node name="PursuitSequence" type="Node" parent="GrunkBeastBehavior/StateSelector"] +script = ExtResource("12_xde72") +metadata/_custom_type_script = "uid://dcojdhvj8qcw0" + +[node name="TargetSelector" type="Node" parent="GrunkBeastBehavior/StateSelector/PursuitSequence"] +script = ExtResource("12_dkcdj") +metadata/_custom_type_script = "uid://8hn4kne15ac5" + +[node name="TargetInPursuitRange" type="Node" parent="GrunkBeastBehavior/StateSelector/PursuitSequence/TargetSelector" node_paths=PackedStringArray("area")] +script = ExtResource("9_xuag8") +blackboard_key = "pursuit_target" +area = NodePath("../../../../../PursuitRange") +metadata/_custom_type_script = "uid://7k5hor1omsxc" + +[node name="GetTargetFromAggroRange" type="Node" parent="GrunkBeastBehavior/StateSelector/PursuitSequence/TargetSelector" node_paths=PackedStringArray("area")] +script = ExtResource("13_x8l6r") +blackboard_key = "pursuit_target" +area = NodePath("../../../../../AggroRange") +metadata/_custom_type_script = "uid://b34l3v4sr8rmq" + +[node name="UpdateStalkingTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/PursuitSequence"] +script = ExtResource("15_umoec") +source_key = "pursuit_target" +destination_key = "stalking_target" +metadata/_custom_type_script = "uid://wfd5nbethyw6" + +[node name="RestartStalkingTimer" type="Node" parent="GrunkBeastBehavior/StateSelector/PursuitSequence" node_paths=PackedStringArray("timer")] +script = ExtResource("16_asd50") +timer = NodePath("../../../../StalkingTimer") +metadata/_custom_type_script = "uid://ykfqlqp7e8og" + +[node name="PursueTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/PursuitSequence"] +script = ExtResource("14_x8l6r") +blackboard_key = "pursuit_target" +metadata/_custom_type_script = "uid://bkdwuqv4tudka" + +[node name="AlwaysFailDecorator" type="Node" parent="GrunkBeastBehavior/StateSelector"] +script = ExtResource("15_oons1") +metadata/_custom_type_script = "uid://dwfdg523bk776" + +[node name="ErasePursuitTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/AlwaysFailDecorator"] +script = ExtResource("15_4b27i") +key = "pursuit_target" +metadata/_custom_type_script = "uid://demv7xh27ouvr" + +[node name="StalkingSequence" type="Node" parent="GrunkBeastBehavior/StateSelector"] +script = ExtResource("12_xde72") +metadata/_custom_type_script = "uid://dcojdhvj8qcw0" + +[node name="StalkingTimerRunning" type="Node" parent="GrunkBeastBehavior/StateSelector/StalkingSequence" node_paths=PackedStringArray("timer")] +script = ExtResource("16_oons1") +timer = NodePath("../../../../StalkingTimer") +metadata/_custom_type_script = "uid://h0cp58nswpml" + +[node name="SetNavTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/StalkingSequence"] +script = ExtResource("10_kjykp") +blackboard_key = "stalking_target" +metadata/_custom_type_script = "uid://u1ntpwjwjqhj" + +[node name="TravelToDestination" type="Node" parent="GrunkBeastBehavior/StateSelector/StalkingSequence"] +script = ExtResource("14_4y64f") +metadata/_custom_type_script = "uid://om57w2acvgb7" + +[node name="SelectorReactiveComposite" type="Node" parent="GrunkBeastBehavior/StateSelector/StalkingSequence"] +script = ExtResource("7_vvw1q") +metadata/_custom_type_script = "uid://cw22yurt5l74k" + +[node name="AlwaysFailDecorator2" type="Node" parent="GrunkBeastBehavior/StateSelector"] +script = ExtResource("15_oons1") +metadata/_custom_type_script = "uid://dwfdg523bk776" + +[node name="EraseStalkingTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/AlwaysFailDecorator2"] +script = ExtResource("15_4b27i") +key = "stalking_target" +metadata/_custom_type_script = "uid://demv7xh27ouvr" + +[node name="LurkSequence" type="Node" parent="GrunkBeastBehavior/StateSelector"] +script = ExtResource("8_0gxpq") +metadata/_custom_type_script = "uid://cg016dbe7gs1x" + +[node name="RandomDelay" type="Node" parent="GrunkBeastBehavior/StateSelector/LurkSequence"] +script = ExtResource("11_mbqcc") +mean_time = 5.0 +st_dev_time = 1.0 +wait_time = 4.6164 +metadata/_custom_type_script = "uid://beyk2xtbjrsg4" + +[node name="PickRandomLurkTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/LurkSequence/RandomDelay"] +script = ExtResource("12_ml8dd") +blackboard_key = "lurk_target" +group = "LurkPoint" +metadata/_custom_type_script = "uid://cg55nu4y0a5ud" + +[node name="SetNavTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/LurkSequence"] +script = ExtResource("10_kjykp") +blackboard_key = "lurk_target" +metadata/_custom_type_script = "uid://u1ntpwjwjqhj" + +[node name="TravelToDestination" type="Node" parent="GrunkBeastBehavior/StateSelector/LurkSequence"] +script = ExtResource("14_4y64f") +metadata/_custom_type_script = "uid://om57w2acvgb7" + +[node name="Blackboard" type="Node" parent="."] +unique_name_in_owner = true +script = ExtResource("7_cn3ok") +metadata/_custom_type_script = "uid://dme5f24l0edsf" + [connection signal="sound_detected" from="GameSoundListener" to="." method="on_sound_detected"] -[connection signal="body_entered" from="GrabbingRange" to="." method="on_player_entered_grabbing_range"] -[connection signal="body_exited" from="PursuitLimit" to="." method="on_player_left_pursuit_range"]