Compare commits

..

2 Commits

Author SHA1 Message Date
Segey Lapin
d9e55d7dcf Added combat event transmission 2021-12-29 01:40:52 +03:00
Segey Lapin
f22cc56075 Fixed FPS drops by disabling palace for now 2021-12-29 01:39:55 +03:00
19 changed files with 112798 additions and 148264 deletions

View File

@@ -39,20 +39,20 @@ var roommates = {}
func _ready(): func _ready():
var capsule_male = CapsuleShape.new() var capsule_male = CapsuleShape.new()
capsule_male.radius = 0.4 capsule_male.radius = 0.3
capsule_male.height = 1.12 capsule_male.height = 1.2
capsule_male.margin = 0.08 capsule_male.margin = 0.05
var capsule_female = CapsuleShape.new() var capsule_female = CapsuleShape.new()
capsule_female.radius = 0.35 capsule_female.radius = 0.2
capsule_female.height = 0.9 capsule_female.height = 1.1
capsule_female.margin = 0.08 capsule_female.margin = 0.05
CharacterSystemWorld.add_character_scene(female, {}, "female") CharacterSystemWorld.add_character_scene(female, {}, "female")
CharacterSystemWorld.add_character_scene(male, {}, "male") CharacterSystemWorld.add_character_scene(male, {}, "male")
for k in modules.keys(): for k in modules.keys():
CharacterSystemWorld.add_module(k, modules[k]) CharacterSystemWorld.add_module(k, modules[k])
CharacterSystemWorld.set_face_ctrl_scene(face_ctrl) CharacterSystemWorld.set_face_ctrl_scene(face_ctrl)
CharacterSystemWorld.add_character_shape(capsule_female, Transform(Basis().rotated(Vector3(1, 0, 0), -PI/2.0), Vector3(0, 0.805, 0)), "female") CharacterSystemWorld.add_character_shape(capsule_female, Transform(Basis().rotated(Vector3(1, 0, 0), -PI/2.0), Vector3(0, 0.751, 0)), "female")
CharacterSystemWorld.add_character_shape(capsule_male, Transform(Basis().rotated(Vector3(1, 0, 0), -PI/2.0), Vector3(0, 0.965, 0)), "male") CharacterSystemWorld.add_character_shape(capsule_male, Transform(Basis().rotated(Vector3(1, 0, 0), -PI/2.0), Vector3(0, 0.899, 0)), "male")
set_root_motion_mod(Transform()) set_root_motion_mod(Transform())
var fd = File.new() var fd = File.new()
fd.open("res://data/names.json", File.READ) fd.open("res://data/names.json", File.READ)

View File

@@ -40,7 +40,6 @@ func equip(obj, item_name):
print("EQUIP ", item_name, " OK", obj, r) print("EQUIP ", item_name, " OK", obj, r)
obj.set_meta("equipped", item_name) obj.set_meta("equipped", item_name)
c.set_meta("owner", obj.get_meta("owner")) c.set_meta("owner", obj.get_meta("owner"))
c.set_meta("item_name", item_name)
func register_pick_up(m, obj, item_name): func register_pick_up(m, obj, item_name):
var mdata = { var mdata = {
"method": "pick_up", "method": "pick_up",

View File

@@ -60,7 +60,6 @@ class Grabbing:
var cam_to = m.origin + Vector3.UP * 1.4 var cam_to = m.origin + Vector3.UP * 1.4
emit_signal("enable_cinematic_camera", cam_where, cam_to) emit_signal("enable_cinematic_camera", cam_where, cam_to)
func reset_character(b): func reset_character(b):
assert(b)
b.remove_meta("cmdqueue") b.remove_meta("cmdqueue")
b.remove_meta("cmdq_walk") b.remove_meta("cmdq_walk")
b.remove_meta("climb") b.remove_meta("climb")

View File

@@ -175,7 +175,7 @@ func setup_first_town(site):
palace_aabb = palace_aabb.grow(48) palace_aabb = palace_aabb.grow(48)
print(palace_aabb) print(palace_aabb)
aabbs.push_back(palace_aabb) aabbs.push_back(palace_aabb)
# stream_obj("palace", Transform(Basis(), center)) stream_obj("palace", Transform(Basis(), center))
for p in range(radial_points.size()): for p in range(radial_points.size()):
var ep = radial_points[p] var ep = radial_points[p]
@@ -278,7 +278,7 @@ func _ready():
# Traffic.set_deny_physics() # Traffic.set_deny_physics()
# Traffic.set_physics_distance(Vector3(30, -10, 40)) # Traffic.set_physics_distance(Vector3(30, -10, 40))
# Traffic.set_debug(true) # Traffic.set_debug(true)
Traffic.set_spawn_cooldown(10, 15) Traffic.set_spawn_cooldown(2, 5)
Traffic.set_default_speed(8.5) Traffic.set_default_speed(8.5)
Traffic.add_traffic_vehicle(car) Traffic.add_traffic_vehicle(car)
var water_mat = load("res://water/Water.material") var water_mat = load("res://water/Water.material")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=145 format=2] [gd_scene load_steps=143 format=2]
[ext_resource path="res://scenes/characters/vroid1-female.gltf" type="PackedScene" id=1] [ext_resource path="res://scenes/characters/vroid1-female.gltf" type="PackedScene" id=1]
[ext_resource path="res://scenes/hair/female-hair1.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/hair/female-hair1.tscn" type="PackedScene" id=2]
@@ -83,33 +83,6 @@ nodes/TimeScale/position = Vector2( 592, 184 )
nodes/output/position = Vector2( 860, 120 ) nodes/output/position = Vector2( 860, 120 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=152]
animation = "guard-melee-forward1"
[sub_resource type="AnimationNodeTimeScale" id=153]
[sub_resource type="AnimationNodeBlendTree" id=147]
nodes/Animation/node = SubResource( 152 )
nodes/Animation/position = Vector2( 194, 149 )
nodes/TimeScale/node = SubResource( 153 )
nodes/TimeScale/position = Vector2( 525, 150 )
nodes/output/position = Vector2( 780, 140 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=145]
animation = "guard-melee-backwards1"
[sub_resource type="AnimationNodeTimeScale" id=146]
[sub_resource type="AnimationNodeBlendTree" id=140]
graph_offset = Vector2( 0, -262 )
nodes/Animation/node = SubResource( 145 )
nodes/Animation/position = Vector2( 119, 108 )
nodes/TimeScale/node = SubResource( 146 )
nodes/TimeScale/position = Vector2( 520, 120 )
nodes/output/position = Vector2( 820, 160 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=19] [sub_resource type="AnimationNodeAnimation" id=19]
animation = "female-idle-to-kneel1" animation = "female-idle-to-kneel1"
@@ -153,7 +126,7 @@ nodes/TimeScale/position = Vector2( 580, 100 )
nodes/output/position = Vector2( 1120, 120 ) nodes/output/position = Vector2( 1120, 120 )
nodes/t1/node = SubResource( 26 ) nodes/t1/node = SubResource( 26 )
nodes/t1/position = Vector2( 880, 100 ) nodes/t1/position = Vector2( 880, 100 )
node_connections = [ "output", 0, "t1", "t1", 0, "TimeScale", "t1", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "t1", "TimeScale", 0, "Animation", "t1", 0, "TimeScale", "t1", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ]
[sub_resource type="AnimationNodeAnimation" id=28] [sub_resource type="AnimationNodeAnimation" id=28]
animation = "walk1p2" animation = "walk1p2"
@@ -173,7 +146,6 @@ input_1/name = "state 1"
input_1/auto_advance = true input_1/auto_advance = true
[sub_resource type="AnimationNodeBlendTree" id=33] [sub_resource type="AnimationNodeBlendTree" id=33]
graph_offset = Vector2( -264.489, -30 )
nodes/Animation/node = SubResource( 29 ) nodes/Animation/node = SubResource( 29 )
nodes/Animation/position = Vector2( 140, 100 ) nodes/Animation/position = Vector2( 140, 100 )
"nodes/Animation 2/node" = SubResource( 28 ) "nodes/Animation 2/node" = SubResource( 28 )
@@ -185,7 +157,7 @@ nodes/TimeScale/position = Vector2( 620, 40 )
nodes/Transition/node = SubResource( 32 ) nodes/Transition/node = SubResource( 32 )
nodes/Transition/position = Vector2( 905, 264 ) nodes/Transition/position = Vector2( 905, 264 )
nodes/output/position = Vector2( 1280, 120 ) nodes/output/position = Vector2( 1280, 120 )
node_connections = [ "output", 0, "Transition", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ]
[sub_resource type="AnimationNodeAnimation" id=34] [sub_resource type="AnimationNodeAnimation" id=34]
animation = "07_01-walk" animation = "07_01-walk"
@@ -213,16 +185,84 @@ nodes/TimeScale/position = Vector2( 580, 120 )
nodes/output/position = Vector2( 840, 140 ) nodes/output/position = Vector2( 840, 140 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=40]
animation = "walk1p2"
[sub_resource type="AnimationNodeAnimation" id=41]
animation = "walk1p1"
[sub_resource type="AnimationNodeTimeScale" id=42]
[sub_resource type="AnimationNodeTimeScale" id=43]
[sub_resource type="AnimationNodeTransition" id=44]
input_count = 2
input_0/name = "state 0"
input_0/auto_advance = true
input_1/name = "state 1"
input_1/auto_advance = true
[sub_resource type="AnimationNodeBlendTree" id=45]
graph_offset = Vector2( 0, -259 )
nodes/Animation/node = SubResource( 41 )
nodes/Animation/position = Vector2( 200, 80 )
"nodes/Animation 2/node" = SubResource( 40 )
"nodes/Animation 2/position" = Vector2( 200, 280 )
nodes/TimeScale/node = SubResource( 43 )
nodes/TimeScale/position = Vector2( 660, 60 )
"nodes/TimeScale 2/node" = SubResource( 42 )
"nodes/TimeScale 2/position" = Vector2( 580, 260 )
nodes/Transition/node = SubResource( 44 )
nodes/Transition/position = Vector2( 920, 120 )
nodes/output/position = Vector2( 1260, 160 )
node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ]
[sub_resource type="AnimationNodeAnimation" id=46]
animation = "walk1p2"
[sub_resource type="AnimationNodeAnimation" id=47]
animation = "walk1p1"
[sub_resource type="AnimationNodeTimeScale" id=48]
[sub_resource type="AnimationNodeTimeScale" id=49]
[sub_resource type="AnimationNodeTransition" id=50]
input_count = 2
xfade_time = 0.2
input_0/name = "state 0"
input_0/auto_advance = true
input_1/name = "state 1"
input_1/auto_advance = true
[sub_resource type="AnimationNodeBlendTree" id=51]
graph_offset = Vector2( 0, -294.25 )
nodes/Animation/node = SubResource( 47 )
nodes/Animation/position = Vector2( 208, 136 )
"nodes/Animation 2/node" = SubResource( 46 )
"nodes/Animation 2/position" = Vector2( 230, 287 )
nodes/TimeScale/node = SubResource( 49 )
nodes/TimeScale/position = Vector2( 660, 80 )
"nodes/TimeScale 2/node" = SubResource( 48 )
"nodes/TimeScale 2/position" = Vector2( 680, 260 )
nodes/Transition/node = SubResource( 50 )
nodes/Transition/position = Vector2( 1000, 140 )
nodes/output/position = Vector2( 1260, 140 )
node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ]
[sub_resource type="AnimationNodeBlendSpace2D" id=52] [sub_resource type="AnimationNodeBlendSpace2D" id=52]
blend_point_0/node = SubResource( 27 ) blend_point_0/node = SubResource( 27 )
blend_point_0/pos = Vector2( 0, 0 ) blend_point_0/pos = Vector2( 0, 0 )
blend_point_1/node = SubResource( 33 ) blend_point_1/node = SubResource( 33 )
blend_point_1/pos = Vector2( 0.1, 0 ) blend_point_1/pos = Vector2( 0.2, 0 )
blend_point_2/node = SubResource( 36 ) blend_point_2/node = SubResource( 36 )
blend_point_2/pos = Vector2( 0.2, -1 ) blend_point_2/pos = Vector2( 0.2, -1 )
blend_point_3/node = SubResource( 39 ) blend_point_3/node = SubResource( 39 )
blend_point_3/pos = Vector2( 0.2, 1 ) blend_point_3/pos = Vector2( 0.2, 1 )
blend_mode = 1 blend_point_4/node = SubResource( 45 )
blend_point_4/pos = Vector2( 0.6, 0 )
blend_point_5/node = SubResource( 51 )
blend_point_5/pos = Vector2( 0.4, 0 )
[sub_resource type="AnimationNodeBlendTree" id=53] [sub_resource type="AnimationNodeBlendTree" id=53]
graph_offset = Vector2( 0, -95 ) graph_offset = Vector2( 0, -95 )
@@ -262,7 +302,7 @@ nodes/TimeScale/position = Vector2( 640, 200 )
nodes/Transition/node = SubResource( 59 ) nodes/Transition/node = SubResource( 59 )
nodes/Transition/position = Vector2( 860, 220 ) nodes/Transition/position = Vector2( 860, 220 )
nodes/output/position = Vector2( 1080, 200 ) nodes/output/position = Vector2( 1080, 200 )
node_connections = [ "output", 0, "Transition", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ]
[sub_resource type="AnimationNodeAnimation" id=61] [sub_resource type="AnimationNodeAnimation" id=61]
animation = "female-pray-startled1" animation = "female-pray-startled1"
@@ -328,7 +368,7 @@ nodes/attack2/position = Vector2( 1140, 300 )
nodes/output/position = Vector2( 1580, 180 ) nodes/output/position = Vector2( 1580, 180 )
nodes/speed/node = SubResource( 74 ) nodes/speed/node = SubResource( 74 )
nodes/speed/position = Vector2( 540, 60 ) nodes/speed/position = Vector2( 540, 60 )
node_connections = [ "speed", 0, "Animation", "output", 0, "attack2", "TimeScale 2", 0, "Animation 3", "attack2", 0, "attack1", "attack2", 1, "TimeScale 2", "attack1", 0, "speed", "attack1", 1, "TimeScale", "TimeScale", 0, "Animation 2" ] node_connections = [ "speed", 0, "Animation", "output", 0, "attack2", "attack2", 0, "attack1", "attack2", 1, "TimeScale 2", "attack1", 0, "speed", "attack1", 1, "TimeScale", "TimeScale", 0, "Animation 2", "TimeScale 2", 0, "Animation 3" ]
[sub_resource type="AnimationNodeAnimation" id=76] [sub_resource type="AnimationNodeAnimation" id=76]
animation = "dagger-sacrifice-counter-p" animation = "dagger-sacrifice-counter-p"
@@ -526,30 +566,6 @@ switch_mode = 2
switch_mode = 2 switch_mode = 2
auto_advance = true auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=141]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=142]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=143]
[sub_resource type="AnimationNodeStateMachineTransition" id=144]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=148]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=149]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=150]
[sub_resource type="AnimationNodeStateMachineTransition" id=151]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachine" id=110] [sub_resource type="AnimationNodeStateMachine" id=110]
states/attack-melee1/node = SubResource( 135 ) states/attack-melee1/node = SubResource( 135 )
states/attack-melee1/position = Vector2( 1277, 411.193 ) states/attack-melee1/position = Vector2( 1277, 411.193 )
@@ -560,11 +576,7 @@ states/climb1a/position = Vector2( 947, 503.193 )
states/drive/node = SubResource( 15 ) states/drive/node = SubResource( 15 )
states/drive/position = Vector2( 868, 316.193 ) states/drive/position = Vector2( 868, 316.193 )
states/grabbed/node = SubResource( 18 ) states/grabbed/node = SubResource( 18 )
states/grabbed/position = Vector2( 1290, 90.193 ) states/grabbed/position = Vector2( 1277, 182.193 )
states/guard-front-melee1/node = SubResource( 147 )
states/guard-front-melee1/position = Vector2( 1477.6, 336.193 )
states/guard-melee1/node = SubResource( 140 )
states/guard-melee1/position = Vector2( 1200.6, 496.193 )
states/kneel/node = SubResource( 21 ) states/kneel/node = SubResource( 21 )
states/kneel/position = Vector2( 522, 84 ) states/kneel/position = Vector2( 522, 84 )
states/locomotion/node = SubResource( 53 ) states/locomotion/node = SubResource( 53 )
@@ -578,11 +590,11 @@ states/pray-startled/position = Vector2( 294, 316.193 )
states/pray-startled-walk/node = SubResource( 60 ) states/pray-startled-walk/node = SubResource( 60 )
states/pray-startled-walk/position = Vector2( 294, 514.193 ) states/pray-startled-walk/position = Vector2( 294, 514.193 )
states/sacrifice/node = SubResource( 75 ) states/sacrifice/node = SubResource( 75 )
states/sacrifice/position = Vector2( 1547, 101 ) states/sacrifice/position = Vector2( 1023, 135 )
states/sacrificed/node = SubResource( 78 ) states/sacrificed/node = SubResource( 78 )
states/sacrificed/position = Vector2( 1547, 180 ) states/sacrificed/position = Vector2( 1125, 283 )
states/sleeping/node = SubResource( 81 ) states/sleeping/node = SubResource( 81 )
states/sleeping/position = Vector2( 1045, 348.193 ) states/sleeping/position = Vector2( 1078, 411.193 )
states/stand-startled/node = SubResource( 84 ) states/stand-startled/node = SubResource( 84 )
states/stand-startled/position = Vector2( 717, 411.193 ) states/stand-startled/position = Vector2( 717, 411.193 )
states/start_walking/node = SubResource( 115 ) states/start_walking/node = SubResource( 115 )
@@ -595,9 +607,9 @@ states/turn_right/node = SubResource( 126 )
states/turn_right/position = Vector2( 1059, 620.193 ) states/turn_right/position = Vector2( 1059, 620.193 )
states/use_tap/node = SubResource( 85 ) states/use_tap/node = SubResource( 85 )
states/use_tap/position = Vector2( 283, 143.193 ) states/use_tap/position = Vector2( 283, 143.193 )
transitions = [ "locomotion", "passenger", SubResource( 86 ), "passenger", "locomotion", SubResource( 87 ), "passenger", "drive", SubResource( 88 ), "drive", "passenger", SubResource( 89 ), "drive", "locomotion", SubResource( 90 ), "locomotion", "drive", SubResource( 91 ), "sacrifice", "sacrificed", SubResource( 92 ), "sacrificed", "sacrifice", SubResource( 93 ), "locomotion", "kneel", SubResource( 94 ), "kneel", "pray", SubResource( 95 ), "pray", "locomotion", SubResource( 96 ), "pray", "pray-startled", SubResource( 97 ), "pray-startled", "pray-startled-walk", SubResource( 98 ), "sleeping", "locomotion", SubResource( 99 ), "pray-startled-walk", "stand-startled", SubResource( 100 ), "stand-startled", "locomotion", SubResource( 101 ), "locomotion", "grabbed", SubResource( 102 ), "grabbed", "locomotion", SubResource( 103 ), "locomotion", "climb1", SubResource( 104 ), "climb1", "locomotion", SubResource( 105 ), "locomotion", "climb1a", SubResource( 106 ), "climb1a", "locomotion", SubResource( 107 ), "use_tap", "locomotion", SubResource( 108 ), "locomotion", "use_tap", SubResource( 109 ), "locomotion", "start_walking", SubResource( 117 ), "start_walking", "locomotion", SubResource( 118 ), "locomotion", "stop_walking", SubResource( 119 ), "stop_walking", "locomotion", SubResource( 120 ), "locomotion", "tun_left", SubResource( 127 ), "tun_left", "locomotion", SubResource( 128 ), "locomotion", "turn_right", SubResource( 129 ), "turn_right", "locomotion", SubResource( 130 ), "locomotion", "attack-melee1", SubResource( 136 ), "attack-melee1", "locomotion", SubResource( 137 ), "attack-melee1", "guard-melee1", SubResource( 141 ), "guard-melee1", "attack-melee1", SubResource( 142 ), "locomotion", "guard-melee1", SubResource( 143 ), "guard-melee1", "locomotion", SubResource( 144 ), "attack-melee1", "guard-front-melee1", SubResource( 148 ), "guard-front-melee1", "attack-melee1", SubResource( 149 ), "locomotion", "guard-front-melee1", SubResource( 150 ), "guard-front-melee1", "locomotion", SubResource( 151 ) ] transitions = [ "locomotion", "passenger", SubResource( 86 ), "passenger", "locomotion", SubResource( 87 ), "passenger", "drive", SubResource( 88 ), "drive", "passenger", SubResource( 89 ), "drive", "locomotion", SubResource( 90 ), "locomotion", "drive", SubResource( 91 ), "sacrifice", "sacrificed", SubResource( 92 ), "sacrificed", "sacrifice", SubResource( 93 ), "locomotion", "kneel", SubResource( 94 ), "kneel", "pray", SubResource( 95 ), "pray", "locomotion", SubResource( 96 ), "pray", "pray-startled", SubResource( 97 ), "pray-startled", "pray-startled-walk", SubResource( 98 ), "sleeping", "locomotion", SubResource( 99 ), "pray-startled-walk", "stand-startled", SubResource( 100 ), "stand-startled", "locomotion", SubResource( 101 ), "locomotion", "grabbed", SubResource( 102 ), "grabbed", "locomotion", SubResource( 103 ), "locomotion", "climb1", SubResource( 104 ), "climb1", "locomotion", SubResource( 105 ), "locomotion", "climb1a", SubResource( 106 ), "climb1a", "locomotion", SubResource( 107 ), "use_tap", "locomotion", SubResource( 108 ), "locomotion", "use_tap", SubResource( 109 ), "locomotion", "start_walking", SubResource( 117 ), "start_walking", "locomotion", SubResource( 118 ), "locomotion", "stop_walking", SubResource( 119 ), "stop_walking", "locomotion", SubResource( 120 ), "locomotion", "tun_left", SubResource( 127 ), "tun_left", "locomotion", SubResource( 128 ), "locomotion", "turn_right", SubResource( 129 ), "turn_right", "locomotion", SubResource( 130 ), "locomotion", "attack-melee1", SubResource( 136 ), "attack-melee1", "locomotion", SubResource( 137 ) ]
start_node = "locomotion" start_node = "locomotion"
graph_offset = Vector2( 489.672, 57.1925 ) graph_offset = Vector2( 176.598, 15.1925 )
[sub_resource type="AnimationNodeBlendTree" id=111] [sub_resource type="AnimationNodeBlendTree" id=111]
graph_offset = Vector2( 445.846, -157.796 ) graph_offset = Vector2( 445.846, -157.796 )
@@ -620,19 +632,11 @@ node_connections = [ "output", 0, "blade_right", "all_scale", 0, "state", "blade
[node name="vroid1-female" instance=ExtResource( 1 )] [node name="vroid1-female" instance=ExtResource( 1 )]
[node name="Skeleton" parent="skeleton" index="0"]
bones/1/bound_children = [ NodePath("hips") ]
bones/25/bound_children = [ NodePath("chest") ]
bones/79/bound_children = [ NodePath("neck") ]
bones/80/bound_children = [ NodePath("head") ]
bones/99/bound_children = [ NodePath("wrist_l") ]
bones/101/bound_children = [ NodePath("wrist_r") ]
[node name="body" parent="skeleton/Skeleton" index="0"] [node name="body" parent="skeleton/Skeleton" index="0"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00418961, 0.00654769, 0.00506566 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00418961, 0.00654769, 0.00506566 )
[node name="head" type="BoneAttachment" parent="skeleton/Skeleton" index="2"] [node name="head" type="BoneAttachment" parent="skeleton/Skeleton" index="2"]
transform = Transform( 0.83427, 0.331644, -0.440515, -0.191809, 0.923568, 0.332049, 0.516932, -0.192513, 0.834056, -0.0308392, 1.3151, 0.0139266 ) transform = Transform( 0.988223, 0.148734, 0.0362569, -0.141467, 0.79667, 0.587692, 0.0585027, -0.585856, 0.808242, -0.0111943, 1.32085, -0.0280195 )
bone_name = "Head" bone_name = "Head"
[node name="marker_talk" type="Spatial" parent="skeleton/Skeleton/head" index="0"] [node name="marker_talk" type="Spatial" parent="skeleton/Skeleton/head" index="0"]
@@ -662,7 +666,7 @@ transform = Transform( 1, -1.24197e-11, 0, 1.06852e-11, 1, -5.82077e-11, 0, 0, 1
[node name="female-face1" parent="skeleton/Skeleton/head/face" index="0" instance=ExtResource( 3 )] [node name="female-face1" parent="skeleton/Skeleton/head/face" index="0" instance=ExtResource( 3 )]
[node name="hips" type="BoneAttachment" parent="skeleton/Skeleton" index="3"] [node name="hips" type="BoneAttachment" parent="skeleton/Skeleton" index="3"]
transform = Transform( 0.999052, 0.0440607, -0.00179843, 0.0440316, -0.998945, -0.014082, -0.00241711, 0.0139897, -0.999873, 0.000203862, 0.862223, -0.00645695 ) transform = Transform( 0.989795, 0.0136796, -0.14192, 0.00710856, -0.998924, -0.046698, -0.142409, 0.0452161, -0.988735, 0.000203863, 0.86329, -0.00645694 )
bone_name = "Hips" bone_name = "Hips"
[node name="marker_dagger_sacrifice" type="Spatial" parent="skeleton/Skeleton/hips" index="0"] [node name="marker_dagger_sacrifice" type="Spatial" parent="skeleton/Skeleton/hips" index="0"]
@@ -677,21 +681,21 @@ monitorable = false
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="wrist_r" type="BoneAttachment" parent="skeleton/Skeleton" index="4"] [node name="wrist_r" type="BoneAttachment" parent="skeleton/Skeleton" index="4"]
transform = Transform( -0.523493, 0.831405, 0.186331, 0.799005, 0.403087, 0.446219, 0.295882, 0.382472, -0.875311, 0.246516, 0.816854, 0.0530603 ) transform = Transform( -0.184609, 0.953624, -0.23774, 0.867928, 0.271679, 0.415801, 0.461107, -0.12958, -0.877832, 0.257193, 0.805181, -0.0805364 )
bone_name = "wrist_ik_R" bone_name = "wrist_ik_R"
[node name="weapon_right" type="Spatial" parent="skeleton/Skeleton/wrist_r" index="0"] [node name="weapon_right" type="Spatial" parent="skeleton/Skeleton/wrist_r" index="0"]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, -0.08, 0, -0.01 ) transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, -0.08, 0, -0.01 )
[node name="wrist_l" type="BoneAttachment" parent="skeleton/Skeleton" index="5"] [node name="wrist_l" type="BoneAttachment" parent="skeleton/Skeleton" index="5"]
transform = Transform( -0.108058, -0.685164, 0.720328, -0.790371, 0.498715, 0.355805, -0.603024, -0.530878, -0.595424, -0.214561, 0.852356, -0.138021 ) transform = Transform( -0.252208, -0.871285, 0.421014, -0.924053, 0.346005, 0.162504, -0.287261, -0.348054, -0.892379, -0.275192, 0.827823, -0.00582178 )
bone_name = "wrist_ik_L" bone_name = "wrist_ik_L"
[node name="weapon_left" type="Spatial" parent="skeleton/Skeleton/wrist_l" index="0"] [node name="weapon_left" type="Spatial" parent="skeleton/Skeleton/wrist_l" index="0"]
transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0.08, 0, -0.01 ) transform = Transform( 1, 0, 0, 0, -1.62921e-07, -1, 0, 1, -1.62921e-07, 0.08, 0, -0.01 )
[node name="chest" type="BoneAttachment" parent="skeleton/Skeleton" index="6"] [node name="chest" type="BoneAttachment" parent="skeleton/Skeleton" index="6"]
transform = Transform( 0.993031, -0.0677989, -0.096651, 0.0571863, 0.992449, -0.10864, 0.103279, 0.102345, 0.989339, -0.00688225, 1.02154, -0.0291024 ) transform = Transform( 0.982621, -0.0259787, 0.183851, 0.0189799, 0.999071, 0.0397199, -0.184712, -0.0355462, 0.982102, -0.00488846, 1.02193, -0.0338627 )
bone_name = "Chest" bone_name = "Chest"
[node name="chest_hurt" type="Area" parent="skeleton/Skeleton/chest" index="0"] [node name="chest_hurt" type="Area" parent="skeleton/Skeleton/chest" index="0"]
@@ -706,7 +710,7 @@ shape = SubResource( 3 )
[node name="MeshInstance" type="MeshInstance" parent="skeleton/Skeleton" index="7"] [node name="MeshInstance" type="MeshInstance" parent="skeleton/Skeleton" index="7"]
[node name="neck" type="BoneAttachment" parent="skeleton/Skeleton" index="8"] [node name="neck" type="BoneAttachment" parent="skeleton/Skeleton" index="8"]
transform = Transform( 0.930267, -0.237234, -0.27995, 0.246019, 0.96927, -0.00386425, 0.272244, -0.0652763, 0.959976, -0.0132515, 1.24324, 0.0187659 ) transform = Transform( 0.973501, -0.192912, 0.12289, 0.178008, 0.976401, 0.122607, -0.143648, -0.0974797, 0.984768, 0.0031075, 1.24847, -0.0207927 )
bone_name = "Neck" bone_name = "Neck"
[node name="marker_neck_grab" type="Position3D" parent="skeleton/Skeleton/neck" index="0"] [node name="marker_neck_grab" type="Position3D" parent="skeleton/Skeleton/neck" index="0"]
@@ -726,18 +730,22 @@ parameters/state/attack-melee1/attack1_speed/scale = 1.0
parameters/state/climb1/TimeScale/scale = 2.0 parameters/state/climb1/TimeScale/scale = 2.0
parameters/state/climb1a/TimeScale/scale = 2.0 parameters/state/climb1a/TimeScale/scale = 2.0
parameters/state/grabbed/TimeScale/scale = 1.0 parameters/state/grabbed/TimeScale/scale = 1.0
parameters/state/guard-front-melee1/TimeScale/scale = 1.0
parameters/state/guard-melee1/TimeScale/scale = 1.0
parameters/state/kneel/TimeScale/scale = 1.0 parameters/state/kneel/TimeScale/scale = 1.0
parameters/state/locomotion/loc/blend_position = Vector2( 0.00252736, 0.00604224 ) parameters/state/locomotion/loc/blend_position = Vector2( -0.00127554, 0.00220752 )
parameters/state/locomotion/loc/0/TimeScale/scale = 2.0 parameters/state/locomotion/loc/0/TimeScale/scale = 2.0
"parameters/state/locomotion/loc/0/TimeScale 2/scale" = 1.5 "parameters/state/locomotion/loc/0/TimeScale 2/scale" = 1.5
parameters/state/locomotion/loc/0/t1/current = 0 parameters/state/locomotion/loc/0/t1/current = 0
parameters/state/locomotion/loc/1/TimeScale/scale = 1.0 parameters/state/locomotion/loc/1/TimeScale/scale = 1.0
"parameters/state/locomotion/loc/1/TimeScale 2/scale" = 1.0 "parameters/state/locomotion/loc/1/TimeScale 2/scale" = 1.0
parameters/state/locomotion/loc/1/Transition/current = 1 parameters/state/locomotion/loc/1/Transition/current = 0
parameters/state/locomotion/loc/2/TimeScale/scale = 1.0 parameters/state/locomotion/loc/2/TimeScale/scale = 1.0
parameters/state/locomotion/loc/3/TimeScale/scale = 1.0 parameters/state/locomotion/loc/3/TimeScale/scale = 1.0
parameters/state/locomotion/loc/4/TimeScale/scale = 3.5
"parameters/state/locomotion/loc/4/TimeScale 2/scale" = 3.5
parameters/state/locomotion/loc/4/Transition/current = 0
parameters/state/locomotion/loc/5/TimeScale/scale = 1.5
"parameters/state/locomotion/loc/5/TimeScale 2/scale" = 1.5
parameters/state/locomotion/loc/5/Transition/current = 0
parameters/state/pray/TimeScale/scale = 1.0 parameters/state/pray/TimeScale/scale = 1.0
parameters/state/pray-startled/TimeScale/scale = 1.8 parameters/state/pray-startled/TimeScale/scale = 1.8
parameters/state/pray-startled-walk/TimeScale/scale = 1.3 parameters/state/pray-startled-walk/TimeScale/scale = 1.3

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=116 format=2] [gd_scene load_steps=103 format=2]
[ext_resource path="res://scenes/characters/vroid1-man.gltf" type="PackedScene" id=1] [ext_resource path="res://scenes/characters/vroid1-man.gltf" type="PackedScene" id=1]
[ext_resource path="res://scenes/hair/male-hair1.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/hair/male-hair1.tscn" type="PackedScene" id=2]
@@ -93,21 +93,6 @@ nodes/TimeScale/position = Vector2( 820, 100 )
nodes/output/position = Vector2( 1160, 140 ) nodes/output/position = Vector2( 1160, 140 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeBlendTree" id=157]
[sub_resource type="AnimationNodeAnimation" id=150]
animation = "giard-melee-backwards1"
[sub_resource type="AnimationNodeTimeScale" id=151]
[sub_resource type="AnimationNodeBlendTree" id=152]
nodes/Animation/node = SubResource( 150 )
nodes/Animation/position = Vector2( 242, 180 )
nodes/TimeScale/node = SubResource( 151 )
nodes/TimeScale/position = Vector2( 520, 180 )
nodes/output/position = Vector2( 800, 180 )
node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Animation" ]
[sub_resource type="AnimationNodeAnimation" id=17] [sub_resource type="AnimationNodeAnimation" id=17]
animation = "stand1-loop" animation = "stand1-loop"
@@ -290,7 +275,7 @@ nodes/TimeScale/position = Vector2( 780, 260 )
nodes/Transition/node = SubResource( 118 ) nodes/Transition/node = SubResource( 118 )
nodes/Transition/position = Vector2( 500, 280 ) nodes/Transition/position = Vector2( 500, 280 )
nodes/output/position = Vector2( 1000, 260 ) nodes/output/position = Vector2( 1000, 260 )
node_connections = [ "output", 0, "TimeScale", "Transition", 0, "Animation", "Transition", 1, "Animation 2", "TimeScale", 0, "Transition" ] node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Transition", "Transition", 0, "Animation", "Transition", 1, "Animation 2" ]
[sub_resource type="AnimationNodeAnimation" id=119] [sub_resource type="AnimationNodeAnimation" id=119]
animation = "turn-right" animation = "turn-right"
@@ -318,7 +303,7 @@ nodes/TimeScale/position = Vector2( 840, 260 )
nodes/Transition/node = SubResource( 120 ) nodes/Transition/node = SubResource( 120 )
nodes/Transition/position = Vector2( 560, 260 ) nodes/Transition/position = Vector2( 560, 260 )
nodes/output/position = Vector2( 1060, 260 ) nodes/output/position = Vector2( 1060, 260 )
node_connections = [ "output", 0, "TimeScale", "Transition", 0, "Animation", "Transition", 1, "Animation 2", "TimeScale", 0, "Transition" ] node_connections = [ "output", 0, "TimeScale", "TimeScale", 0, "Transition", "Transition", 0, "Animation", "Transition", 1, "Animation 2" ]
[sub_resource type="AnimationNodeAnimation" id=123] [sub_resource type="AnimationNodeAnimation" id=123]
animation = "dagger-sacrifice-counter-a" animation = "dagger-sacrifice-counter-a"
@@ -350,7 +335,7 @@ nodes/TimeScale/position = Vector2( 700, 140 )
nodes/Transition/node = SubResource( 125 ) nodes/Transition/node = SubResource( 125 )
nodes/Transition/position = Vector2( 940, 140 ) nodes/Transition/position = Vector2( 940, 140 )
nodes/output/position = Vector2( 1240, 140 ) nodes/output/position = Vector2( 1240, 140 )
node_connections = [ "output", 0, "Transition", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2", "TimeScale", 0, "Animation" ] node_connections = [ "output", 0, "Transition", "TimeScale", 0, "Animation", "Transition", 0, "TimeScale", "Transition", 1, "TimeScale 2", "TimeScale 2", 0, "Animation 2" ]
[sub_resource type="AnimationNodeStateMachineTransition" id=55] [sub_resource type="AnimationNodeStateMachineTransition" id=55]
@@ -419,51 +404,23 @@ xfade_time = 0.5
switch_mode = 2 switch_mode = 2
auto_advance = true auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=153]
switch_mode = 1
[sub_resource type="AnimationNodeStateMachineTransition" id=154]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=155]
[sub_resource type="AnimationNodeStateMachineTransition" id=156]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=158]
[sub_resource type="AnimationNodeStateMachineTransition" id=159]
switch_mode = 2
auto_advance = true
[sub_resource type="AnimationNodeStateMachineTransition" id=160]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id=161]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachine" id=70] [sub_resource type="AnimationNodeStateMachine" id=70]
states/attack-melee1/node = SubResource( 142 ) states/attack-melee1/node = SubResource( 142 )
states/attack-melee1/position = Vector2( 804.317, 380 ) states/attack-melee1/position = Vector2( 804.317, 380 )
states/climb1/node = SubResource( 7 ) states/climb1/node = SubResource( 7 )
states/climb1/position = Vector2( 359.444, 656 ) states/climb1/position = Vector2( 359.444, 656 )
states/climb1a/node = SubResource( 10 ) states/climb1a/node = SubResource( 10 )
states/climb1a/position = Vector2( 713.444, 92 ) states/climb1a/position = Vector2( 659.444, 154 )
states/drive/node = SubResource( 13 ) states/drive/node = SubResource( 13 )
states/drive/position = Vector2( 424, 557 ) states/drive/position = Vector2( 289, 430 )
states/grab/node = SubResource( 16 ) states/grab/node = SubResource( 16 )
states/grab/position = Vector2( 713.444, 145 ) states/grab/position = Vector2( 739.444, 243 )
states/guard-front-melee1/node = SubResource( 157 )
states/guard-front-melee1/position = Vector2( 835.317, 274 )
states/guard-melee1/node = SubResource( 152 )
states/guard-melee1/position = Vector2( 671.317, 463 )
states/locomotion/node = SubResource( 41 ) states/locomotion/node = SubResource( 41 )
states/locomotion/position = Vector2( 231, 174 ) states/locomotion/position = Vector2( 231, 174 )
states/passenger/node = SubResource( 44 ) states/passenger/node = SubResource( 44 )
states/passenger/position = Vector2( 458.444, 421 ) states/passenger/position = Vector2( 555.444, 339 )
states/sacrificed-a/node = SubResource( 48 ) states/sacrificed-a/node = SubResource( 48 )
states/sacrificed-a/position = Vector2( 625.444, 779 ) states/sacrificed-a/position = Vector2( 628.444, 464 )
states/sleeping/node = SubResource( 51 ) states/sleeping/node = SubResource( 51 )
states/sleeping/position = Vector2( -112.556, 339 ) states/sleeping/position = Vector2( -112.556, 339 )
states/start_walking/node = SubResource( 102 ) states/start_walking/node = SubResource( 102 )
@@ -476,7 +433,7 @@ states/turn_right/node = SubResource( 110 )
states/turn_right/position = Vector2( 177.444, 671 ) states/turn_right/position = Vector2( 177.444, 671 )
states/use_tap/node = SubResource( 54 ) states/use_tap/node = SubResource( 54 )
states/use_tap/position = Vector2( -138.556, 174 ) states/use_tap/position = Vector2( -138.556, 174 )
transitions = [ "locomotion", "drive", SubResource( 55 ), "drive", "locomotion", SubResource( 56 ), "locomotion", "passenger", SubResource( 57 ), "passenger", "locomotion", SubResource( 58 ), "drive", "passenger", SubResource( 59 ), "passenger", "drive", SubResource( 60 ), "sleeping", "locomotion", SubResource( 61 ), "locomotion", "grab", SubResource( 62 ), "grab", "locomotion", SubResource( 63 ), "locomotion", "climb1", SubResource( 64 ), "climb1", "locomotion", SubResource( 65 ), "locomotion", "climb1a", SubResource( 66 ), "climb1a", "locomotion", SubResource( 67 ), "locomotion", "use_tap", SubResource( 68 ), "use_tap", "locomotion", SubResource( 69 ), "locomotion", "stop_walking", SubResource( 100 ), "stop_walking", "locomotion", SubResource( 101 ), "locomotion", "start_walking", SubResource( 103 ), "start_walking", "locomotion", SubResource( 104 ), "locomotion", "turn_left", SubResource( 111 ), "turn_left", "locomotion", SubResource( 112 ), "locomotion", "turn_right", SubResource( 113 ), "turn_right", "locomotion", SubResource( 114 ), "locomotion", "attack-melee1", SubResource( 143 ), "attack-melee1", "locomotion", SubResource( 144 ), "attack-melee1", "guard-melee1", SubResource( 153 ), "guard-melee1", "attack-melee1", SubResource( 154 ), "locomotion", "guard-melee1", SubResource( 155 ), "guard-melee1", "locomotion", SubResource( 156 ), "locomotion", "guard-front-melee1", SubResource( 158 ), "guard-front-melee1", "locomotion", SubResource( 159 ), "guard-front-melee1", "attack-melee1", SubResource( 160 ), "attack-melee1", "guard-front-melee1", SubResource( 161 ) ] transitions = [ "locomotion", "drive", SubResource( 55 ), "drive", "locomotion", SubResource( 56 ), "locomotion", "passenger", SubResource( 57 ), "passenger", "locomotion", SubResource( 58 ), "drive", "passenger", SubResource( 59 ), "passenger", "drive", SubResource( 60 ), "sleeping", "locomotion", SubResource( 61 ), "locomotion", "grab", SubResource( 62 ), "grab", "locomotion", SubResource( 63 ), "locomotion", "climb1", SubResource( 64 ), "climb1", "locomotion", SubResource( 65 ), "locomotion", "climb1a", SubResource( 66 ), "climb1a", "locomotion", SubResource( 67 ), "locomotion", "use_tap", SubResource( 68 ), "use_tap", "locomotion", SubResource( 69 ), "locomotion", "stop_walking", SubResource( 100 ), "stop_walking", "locomotion", SubResource( 101 ), "locomotion", "start_walking", SubResource( 103 ), "start_walking", "locomotion", SubResource( 104 ), "locomotion", "turn_left", SubResource( 111 ), "turn_left", "locomotion", SubResource( 112 ), "locomotion", "turn_right", SubResource( 113 ), "turn_right", "locomotion", SubResource( 114 ), "locomotion", "attack-melee1", SubResource( 143 ), "attack-melee1", "locomotion", SubResource( 144 ) ]
start_node = "locomotion" start_node = "locomotion"
graph_offset = Vector2( -103.683, 58 ) graph_offset = Vector2( -103.683, 58 )
@@ -497,11 +454,6 @@ node_connections = [ "output", 0, "blade_right", "blade_left", 0, "state", "blad
[sub_resource type="AnimationNodeStateMachinePlayback" id=72] [sub_resource type="AnimationNodeStateMachinePlayback" id=72]
[sub_resource type="CapsuleShape" id=162]
margin = 0.08
radius = 0.4
height = 1.12
[node name="vroid1-man" instance=ExtResource( 1 )] [node name="vroid1-man" instance=ExtResource( 1 )]
[node name="Skeleton" parent="." index="0"] [node name="Skeleton" parent="." index="0"]
@@ -514,7 +466,7 @@ bones/94/bound_children = [ NodePath("wrist_r") ]
bones/96/bound_children = [ NodePath("wrist_l") ] bones/96/bound_children = [ NodePath("wrist_l") ]
[node name="wrist_r" type="BoneAttachment" parent="Skeleton" index="2"] [node name="wrist_r" type="BoneAttachment" parent="Skeleton" index="2"]
transform = Transform( 0.0279129, 0.998728, 0.041974, 0.0839921, -0.0441852, 0.995486, 0.996075, -0.0242614, -0.0851186, 0.24008, 1.0159, -0.0908556 ) transform = Transform( 0.0279129, 0.998728, 0.0419739, 0.0839921, -0.0441851, 0.995486, 0.996075, -0.0242615, -0.0851187, 0.24008, 1.0159, -0.0177416 )
bone_name = "wrist_ik_r" bone_name = "wrist_ik_r"
[node name="marker_wrist_r_grab" type="Position3D" parent="Skeleton/wrist_r" index="0"] [node name="marker_wrist_r_grab" type="Position3D" parent="Skeleton/wrist_r" index="0"]
@@ -525,7 +477,7 @@ visible = false
transform = Transform( -1.62921e-07, -1, 0, -1.62921e-07, 2.65431e-14, 1, -1, 1.62921e-07, -1.62921e-07, -0.0452205, -0.00161505, -0.0947611 ) transform = Transform( -1.62921e-07, -1, 0, -1.62921e-07, 2.65431e-14, 1, -1, 1.62921e-07, -1.62921e-07, -0.0452205, -0.00161505, -0.0947611 )
[node name="wrist_l" type="BoneAttachment" parent="Skeleton" index="3"] [node name="wrist_l" type="BoneAttachment" parent="Skeleton" index="3"]
transform = Transform( 0.531637, -0.84656, 0.0264325, -0.0845947, -0.0220212, 0.996172, -0.842737, -0.531838, -0.0833217, -0.202819, 1.03278, -0.0249881 ) transform = Transform( 0.531637, -0.84656, 0.0264325, -0.0845947, -0.0220212, 0.996172, -0.842737, -0.531838, -0.0833217, -0.202819, 1.01771, -0.0990905 )
bone_name = "wrist_ik_l" bone_name = "wrist_ik_l"
[node name="marker_wrist_l_grab" type="Position3D" parent="Skeleton/wrist_l" index="0"] [node name="marker_wrist_l_grab" type="Position3D" parent="Skeleton/wrist_l" index="0"]
@@ -536,7 +488,7 @@ visible = false
transform = Transform( -1.62921e-07, 1, 0, 1.62921e-07, 2.65431e-14, -1, -1, -1.62921e-07, -1.62921e-07, 0.04, -0.01, -0.089 ) transform = Transform( -1.62921e-07, 1, 0, 1.62921e-07, 2.65431e-14, -1, -1, -1.62921e-07, -1.62921e-07, 0.04, -0.01, -0.089 )
[node name="head" type="BoneAttachment" parent="Skeleton" index="4"] [node name="head" type="BoneAttachment" parent="Skeleton" index="4"]
transform = Transform( 0.994828, 0.00617403, -0.101387, 0.0314632, 0.930328, 0.365376, 0.0965788, -0.366676, 0.925322, -0.0326583, 1.69764, -0.00392299 ) transform = Transform( 0.992423, -0.0725141, 0.0991927, 0.0314417, 0.93028, 0.3655, -0.118781, -0.359611, 0.92551, -0.0334505, 1.69764, -0.0088316 )
bone_name = "J_Bip_C_Head" bone_name = "J_Bip_C_Head"
[node name="marker_talk" type="Position3D" parent="Skeleton/head" index="0"] [node name="marker_talk" type="Position3D" parent="Skeleton/head" index="0"]
@@ -563,7 +515,7 @@ transform = Transform( 0.967007, -0.0921614, 0.237496, 0.0940632, 0.995561, 0.00
shape = SubResource( 149 ) shape = SubResource( 149 )
[node name="hips" type="BoneAttachment" parent="Skeleton" index="5"] [node name="hips" type="BoneAttachment" parent="Skeleton" index="5"]
transform = Transform( 0.985395, -0.138022, 0.0997276, 0.150103, 0.98061, -0.125986, -0.0804051, 0.139115, 0.987006, 0.000514592, 1.10104, -0.0117666 ) transform = Transform( 0.98661, -0.156797, -0.0449004, 0.150109, 0.980609, -0.125986, 0.063784, 0.117559, 0.991015, 0.000514592, 1.10104, -0.0117666 )
bone_name = "J_Bip_C_Hips" bone_name = "J_Bip_C_Hips"
[node name="marker_hips_action" type="Position3D" parent="Skeleton/hips" index="0"] [node name="marker_hips_action" type="Position3D" parent="Skeleton/hips" index="0"]
@@ -579,7 +531,7 @@ monitorable = false
shape = SubResource( 148 ) shape = SubResource( 148 )
[node name="neck" type="BoneAttachment" parent="Skeleton" index="6"] [node name="neck" type="BoneAttachment" parent="Skeleton" index="6"]
transform = Transform( 0.996345, -0.0385984, 0.0762004, 0.02621, 0.987196, 0.157347, -0.0812981, -0.154775, 0.984599, -0.0288674, 1.60068, 0.0112781 ) transform = Transform( 0.997574, -0.0156814, -0.0678291, 0.0262169, 0.987195, 0.157347, 0.0644932, -0.158743, 0.985211, -0.0319104, 1.60068, 0.0067592 )
bone_name = "J_Bip_C_Neck" bone_name = "J_Bip_C_Neck"
[node name="marker_neck_grab" type="Position3D" parent="Skeleton/neck" index="0"] [node name="marker_neck_grab" type="Position3D" parent="Skeleton/neck" index="0"]
@@ -587,7 +539,7 @@ transform = Transform( 0.998758, -0.00781338, 0.0492147, 0.00787775, 0.999969, -
visible = false visible = false
[node name="penis_2" type="BoneAttachment" parent="Skeleton" index="7"] [node name="penis_2" type="BoneAttachment" parent="Skeleton" index="7"]
transform = Transform( 0.985395, 0.0857902, -0.147092, 0.150103, -0.845508, 0.51243, -0.0804058, -0.527025, -0.846038, 0.00954038, 0.991264, -0.106081 ) transform = Transform( 0.986609, 0.161544, -0.0224677, 0.15011, -0.845507, 0.51243, 0.0637833, -0.508941, -0.858435, 0.023164, 0.991264, -0.103765 )
bone_name = "penis2" bone_name = "penis2"
[node name="marker_penis_action" type="Position3D" parent="Skeleton/penis_2" index="0"] [node name="marker_penis_action" type="Position3D" parent="Skeleton/penis_2" index="0"]
@@ -595,7 +547,7 @@ transform = Transform( 0.998824, -0.0252848, -0.0413812, 0.0249792, 0.999657, -0
visible = false visible = false
[node name="chest" type="BoneAttachment" parent="Skeleton" index="8"] [node name="chest" type="BoneAttachment" parent="Skeleton" index="8"]
transform = Transform( 0.996345, -0.0216645, 0.0826291, 0.0262187, 0.998173, -0.0544353, -0.0812988, 0.0564028, 0.995092, -0.0233174, 1.33823, -0.00534375 ) transform = Transform( 0.997574, -0.0296453, -0.0629938, 0.0262256, 0.998173, -0.0544359, 0.0644925, 0.0526517, 0.996528, -0.0239998, 1.33823, -0.00887859 )
bone_name = "J_Bip_C_Chest" bone_name = "J_Bip_C_Chest"
[node name="chest_hurt" type="Area" parent="Skeleton/chest" index="0"] [node name="chest_hurt" type="Area" parent="Skeleton/chest" index="0"]
@@ -610,6 +562,7 @@ shape = SubResource( 147 )
tree_root = SubResource( 71 ) tree_root = SubResource( 71 )
anim_player = NodePath("../AnimationPlayer") anim_player = NodePath("../AnimationPlayer")
active = true active = true
process_mode = 0
root_motion_track = NodePath("Skeleton:Root") root_motion_track = NodePath("Skeleton:Root")
parameters/blade_left/blend_amount = 0.0 parameters/blade_left/blend_amount = 0.0
parameters/blade_right/blend_amount = 0.0 parameters/blade_right/blend_amount = 0.0
@@ -619,7 +572,6 @@ parameters/state/climb1/TimeScale/scale = 2.0
parameters/state/climb1a/TimeScale/scale = 2.0 parameters/state/climb1a/TimeScale/scale = 2.0
parameters/state/drive/TimeScale/scale = 1.0 parameters/state/drive/TimeScale/scale = 1.0
parameters/state/grab/TimeScale/scale = 1.0 parameters/state/grab/TimeScale/scale = 1.0
parameters/state/guard-melee1/TimeScale/scale = 1.0
parameters/state/locomotion/loc/blend_position = Vector2( -0.00293946, -0.0151844 ) parameters/state/locomotion/loc/blend_position = Vector2( -0.00293946, -0.0151844 )
parameters/state/locomotion/loc/0/TimeScale/scale = 1.0 parameters/state/locomotion/loc/0/TimeScale/scale = 1.0
parameters/state/locomotion/loc/1/TimeScale/scale = 2.0 parameters/state/locomotion/loc/1/TimeScale/scale = 2.0
@@ -639,7 +591,3 @@ parameters/state/turn_right/Transition/current = 0
parameters/state/use_tap/TimeScale/scale = 1.0 parameters/state/use_tap/TimeScale/scale = 1.0
"parameters/state/use_tap/TimeScale 2/scale" = 1.0 "parameters/state/use_tap/TimeScale 2/scale" = 1.0
parameters/state/use_tap/Transition/current = 1 parameters/state/use_tap/Transition/current = 1
[node name="CollisionShape" type="CollisionShape" parent="." index="4"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0.96478, 0 )
shape = SubResource( 162 )

View File

@@ -37,7 +37,6 @@ streaming="*res://autoload/streaming.tscn"
freezer="*res://autoload/freezer.gd" freezer="*res://autoload/freezer.gd"
scenario="*res://autoload/scenario.gd" scenario="*res://autoload/scenario.gd"
orchestration="*res://autoload/orchestration.tscn" orchestration="*res://autoload/orchestration.tscn"
combat="*res://autoload/combat.gd"
[debug] [debug]
@@ -95,21 +94,9 @@ attack={
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) "events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
] ]
} }
jump={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
]
}
[memory]
limits/multithreaded_server/rid_pool_prealloc=256
limits/message_queue/max_size_kb=6144
limits/command_queue/multithreading_queue_size_kb=512
[physics] [physics]
common/physics_jitter_fix=1.2
3d/physics_engine="Bullet" 3d/physics_engine="Bullet"
[rendering] [rendering]

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -4,17 +4,8 @@ var raycast_queue = []
var blood = preload("res://scenes/decals/blood.tscn") var blood = preload("res://scenes/decals/blood.tscn")
var blood_decal = preload("res://scenes/decals/blood1-decal.gltf") var blood_decal = preload("res://scenes/decals/blood1-decal.gltf")
var rnd var rnd
var initialized = false
func init(): func init():
assert(!initialized)
if initialized:
return
var root = get_character() var root = get_character()
if !root:
return
var cam = root.get_viewport().get_camera()
if !cam.has_meta("player"):
return
var queue = [root] var queue = [root]
var hurtboxes = [] var hurtboxes = []
assert(root.has_meta("skeleton")) assert(root.has_meta("skeleton"))
@@ -29,12 +20,15 @@ func init():
e.connect("area_entered", self, "area_hit", [e]) e.connect("area_entered", self, "area_hit", [e])
rnd = RandomNumberGenerator.new() rnd = RandomNumberGenerator.new()
rnd.randomize() rnd.randomize()
initialized = true
func area_hit(area, e): func area_hit(area, e):
var root = get_character() var root = get_character()
if area.is_in_group("weapon_hit"): if area.is_in_group("weapon_hit"):
var mo = area.get_meta("owner") var mo = area.get_meta("owner")
if mo == root: if mo == root:
# var cam = get_character().get_viewport().get_camera()
# var pl = cam.get_meta("player")
# print(mo.name, " ", root.name, " ", e.name)
# print(mo, " ", root, " ", " ", pl)
return return
print("HIT") print("HIT")
var bi = blood.instance() var bi = blood.instance()
@@ -55,49 +49,36 @@ func area_hit(area, e):
offt.y = 0 offt.y = 0
org += xoff + offt org += xoff + offt
raycast_queue.push_back(org) raycast_queue.push_back(org)
assert(area.has_meta("item_name"))
combat.emit_signal("event", "damage", [mo, area.get_meta("item_name")])
yield(root.get_tree().create_timer(8), "timeout") yield(root.get_tree().create_timer(8), "timeout")
# TODO: add delay # TODO: add delay
bi.queue_free() bi.queue_free()
func update_physics(delta): func update_physics(delta):
assert(initialized)
var root = get_character() var root = get_character()
if !root:
assert(!initialized)
return FAILED
var space_state: PhysicsDirectSpaceState = root.get_world().direct_space_state var space_state: PhysicsDirectSpaceState = root.get_world().direct_space_state
var offsets = [Vector3(0, -2, 0)] var offsets = [Vector3(0, -2, 0)]
var cam = root.get_viewport().get_camera() var cam = root.get_viewport().get_camera()
if !cam.has_meta("player"): if !cam.has_meta("player"):
assert(!initialized) return
return FAILED
var player = cam.get_meta("player") var player = cam.get_meta("player")
raycast_queue.clear() while raycast_queue.size() > 0:
# while raycast_queue.size() > 0: var item = raycast_queue.pop_front()
# var item = raycast_queue.pop_front() var a = item
# var a = item for boff in offsets:
# for boff in offsets: var b = a + boff
# var b = a + boff var result = {}
# var result = {} if root is PhysicsBody:
# if root is PhysicsBody: result = space_state.intersect_ray(a, b, [root, player])
# result = space_state.intersect_ray(a, b, [root, player]) else:
# else: result = space_state.intersect_ray(a, b)
# result = space_state.intersect_ray(a, b) if result.has("collider"):
# if result.has("collider"): var body = result.collider
# var body = result.collider var normal = result.normal
# var normal = result.normal var position = result.position
# var position = result.position var decal = blood_decal.instance()
# var decal = blood_decal.instance() decal.add_to_group("blood")
# decal.add_to_group("blood") body.add_child(decal)
# body.add_child(decal) decal.global_transform.origin = position
# decal.global_transform.origin = position var scale = 0.5 + rnd.randf() * 2.0
# var scale = 0.5 + rnd.randf() * 2.0 var rot = PI * 2.0 * rnd.randf()
# var rot = PI * 2.0 * rnd.randf() decal.global_transform.basis = Basis(normal).scaled(Vector3(scale, 1.0, scale)).rotated(normal, rot)
# decal.global_transform.basis = Basis(normal).scaled(Vector3(scale, 1.0, scale)).rotated(normal, rot)
return ERR_BUSY
func update(delta):
return ERR_BUSY

View File

@@ -35,12 +35,12 @@ func update_physics(delta):
if animtree: if animtree:
root_motion_track = animtree.root_motion_track root_motion_track = animtree.root_motion_track
else: else:
return FAILED return
if characters.handle_cmdq(root):
return
var skel = root.get_meta("skeleton") var skel = root.get_meta("skeleton")
if !skel: if !skel:
return FAILED return
if characters.handle_cmdq(root):
return ERR_BUSY
if root.has_meta("cmdqueue"): if root.has_meta("cmdqueue"):
var cmds = root.get_meta("cmdqueue") var cmds = root.get_meta("cmdqueue")
var cmd = cmds.pop_front() var cmd = cmds.pop_front()
@@ -256,7 +256,3 @@ func update_physics(delta):
root.set_meta("cmdqueue", cmds) root.set_meta("cmdqueue", cmds)
else: else:
root.remove_meta("cmdqueue") root.remove_meta("cmdqueue")
return ERR_BUSY
func update(delta):
return ERR_BUSY

View File

@@ -23,68 +23,15 @@ var material_female = preload("res://scenes/clothes/nun-clothes.material")
var material_male = preload("res://scenes/clothes/clothes-male.material") var material_male = preload("res://scenes/clothes/clothes-male.material")
var state = 0 var state = 0
var rnd: RandomNumberGenerator var health = 100.0
const attack_distance = 2.0 var stamina = 100.0
const guard_distance = 2.0
const engage_distance = 10.0
const flee_distance = 5.0
var blackboard = {
"stamina": 100.0,
"health": 100.0,
"melee_weapon_equipped": false,
"attack_cooldown": 0.0,
"guard_cooldown": 0.0,
"flee_cooldown": 0.0,
"guard": false,
"melee_damage": false,
"dot": 0.0
}
func look_at(ch):
var current = root.global_transform
var at = ch.global_transform.origin
at.y = current.origin.y
root.global_transform = current.looking_at(at, Vector3.UP)
func combat_event(ev, data):
var cam = get_character().get_viewport().get_camera()
var player
if cam:
player = cam.get_meta("player")
assert(player)
match ev:
"about_to_attack":
var who = data[0]
if who != root:
var where = who.global_transform.origin
var curpos = root.global_transform.origin
var dst = where.distance_squared_to(curpos)
if dst < guard_distance * guard_distance:
if who == player:
blackboard.guard = true
"damage":
var who = data[0]
var weapon = data[1]
if who != root:
var where = who.global_transform.origin
var curpos = root.global_transform.origin
var dst = where.distance_squared_to(curpos)
if dst < attack_distance * attack_distance:
if who == player:
blackboard.melee_damage = true
var initialized = false
func init(): func init():
assert(!initialized)
name = "bandit_ai" name = "bandit_ai"
root = get_character() root = get_character()
assert(root.has_meta("skeleton")) assert(root.has_meta("skeleton"))
rnd = RandomNumberGenerator.new() root.add_to_group("students")
rnd.randomize() root.add_to_group("student")
root.add_to_group("bandits")
root.add_to_group("bandit")
combat.connect("event", self, "combat_event")
var character_data = root.get_meta("character_data") var character_data = root.get_meta("character_data")
if character_data.sex == "female": if character_data.sex == "female":
@@ -100,395 +47,8 @@ func init():
h += garments_head_male h += garments_head_male
characters.call_deferred("setup_garments", root, g, h, material_male) characters.call_deferred("setup_garments", root, g, h, material_male)
state = 0 state = 0
for e in conf_behaviors.keys():
if !run_behaviors.has(e):
run_behaviors[e] = conf_behaviors[e].new()
initialized = true
var cooldown = 0.0 var cooldown = 0.0
class base_bhv:
var active = false
var finished = false
func run(delta: float, bb: Dictionary):
pass
func stop():
pass
func activate():
pass
class walkto extends base_bhv:
signal arrived(where)
var state = 0
var where: Vector3
var speed: = 0.0
var gap: = 0.0
var root
var timeout: = 0.0
var pdist = INF
var cost: = 0.0
func look_at(root):
var current = root.global_transform
var at = where
at.y = current.origin.y
root.global_transform = current.looking_at(at, Vector3.UP)
root.set_meta("orientation", Transform(root.global_transform.basis, Vector3()))
func run(delta: float, bb: Dictionary):
assert(active)
assert(root)
var gpos = root.global_transform.origin
var dst = gpos.distance_squared_to(where)
match state:
0:
look_at(root)
characters.animation_node_travel(root, "locomotion")
characters.set_walk_speed(root, speed, 0)
state = 1
1:
bb.stamina -= cost * delta
timeout -= delta
state = 2
2:
if dst < gap * gap:
emit_signal("arrived", gpos)
state = 10
elif timeout < 0.0:
root.global_transform.origin = where
emit_signal("arrived", gpos)
state = 20
elif dst > pdist && dst > gap * gap:
root.global_transform.origin = where
emit_signal("arrived", gpos)
state = 30
printerr("missed the target: ", sqrt(dst), gap)
elif dst < 3.0 * gap * gap && timeout > 0.0:
characters.set_walk_speed(root, 0.5 * speed, 0)
10:
finished = true
20:
finished = true
30:
finished = true
200:
timeout -= delta
if timeout < 0.0:
root.global_transform.origin = where
characters.set_walk_speed(root, 0, 0)
finished = true
state = 300
300:
printerr("should not be here: ", sqrt(dst), gap)
breakpoint
# print("walkto state: ", state)
pdist = dst
func start(root: Node, where: Vector3, speed: float, gap: float, cost: float, timeout: float):
assert(root)
assert(!active)
state = 0
self.root = root
self.where = where
self.gap = gap
self.timeout = timeout
self.speed = speed
self.cost = cost
active = true
func stop():
assert(active)
assert(root)
characters.set_walk_speed(root, 0, 0)
active = false
finished = false
state = 0
# print("walkto stopped")
class attack extends base_bhv:
var root
var anim
var event
var state = 0
func start(root: Node, anim: String, event: String):
self.root = root
self.anim = anim
self.event = event
active = true
func look_at(root, bb):
var current = root.global_transform
var at = bb.enemy_pos
at.y = current.origin.y
root.global_transform = current.looking_at(at, Vector3.UP)
root.set_meta("orientation", Transform(root.global_transform.basis, Vector3()))
func run(delta: float, bb: Dictionary):
assert(active)
assert(root)
# print("attack state: ", state, " ", active, " ", finished)
if finished:
return
# print("attack running")
bb.attack_cooldown -= delta
if bb.attack_cooldown > 0.0:
return
match state:
0:
combat.emit_signal("event", event, [root])
look_at(root, bb)
state = 1
1:
bb.stamina -= 0.5 * delta
bb.stamina -= 3500 * delta
characters.animation_node_travel(root, anim)
# print("attack: ", anim)
state = 2
2:
bb.stamina -= 5 * delta
bb.attack_cooldown = 1.8
finished = true
# print("attack ", anim, " ", event, " done")
func stop():
assert(active)
assert(root)
active = false
finished = false
state = 0
class take_weapon extends base_bhv:
var weapon
var root
func start(root: Node, weapon):
self.root = root
self.weapon = weapon
active = true
func activate():
pass
func run(delta: float, bb: Dictionary):
assert(active)
assert(root)
if finished:
return
if bb.melee_weapon_equipped:
return
var skel = root.get_meta("skeleton")
var wslot = skel.get_node("wrist_r/weapon_right")
wslot.set_meta("owner", root)
inventory.equip(wslot, weapon)
bb.melee_weapon_equipped = true
finished = true
func stop():
# can't re-run this one
assert(active)
assert(root)
finished = false
active = false
finished = false
class guard extends base_bhv:
var root
var anim1
var anim2
var state = 0
func start(root: Node, anim1, anim2: String):
self.root = root
self.anim1 = anim1
self.anim2 = anim2
active = true
func run(delta: float, bb: Dictionary):
assert(active)
assert(root)
# print("guard state: ", state, " ", finished)
if finished:
return
match state:
0:
# guard
var anim
if bb.dot < 0:
anim = anim1
else:
anim = anim2
characters.animation_node_travel(root, anim)
# print("guard playing animation ", anim)
state = 1
1:
state = 2
2:
bb.guard_cooldown = 1.5
finished = true
class get_damage extends base_bhv:
var root
var anim1
var anim2
var state = 0
var cost = 0.0
func start(root: Node, anim1, anim2: String, cost: float):
self.root = root
self.anim1 = anim1
self.anim2 = anim2
self.cost = cost
active = true
func run(delta: float, bb: Dictionary):
assert(active)
assert(root)
if finished:
return
match state:
0:
# guard
var anim
if bb.dot < 0:
anim = anim1
else:
anim = anim2
characters.animation_node_travel(root, anim)
if bb.stamina > 50.0:
bb.health -= cost
else:
bb.health -= 5.0 * cost
bb.stamina = 5.0
# print("guard playing animation ", anim)
state = 1
1:
state = 2
2:
bb.guard_cooldown = 1.5
finished = true
func stop():
assert(active)
assert(root)
active = false
finished = false
state = 0
# print("guard stopped")
class rest extends base_bhv:
var root
func start(root: Node):
self.root = root
active = true
func run(delta: float, bb: Dictionary):
assert(active)
assert(root)
if finished:
return
if bb.stamina < 100.0:
# print("rest: stamina: ", bb.stamina)
bb.stamina += 15500.0 * delta
else:
finished = true
func stop():
assert(active)
assert(root)
active = false
finished = false
#var walk_to: walkto
#var flee_to: walkto
#var melee_attack: attack
#var take_melee_weapon: take_weapon
#var guard_melee: guard
#var do_rest: rest
var conf_behaviors: = {
"take_melee_weapon": take_weapon,
"approach": walkto,
"flee": walkto,
"melee_attack": attack,
"guard": guard,
"rest": rest,
"get_melee_damage": get_damage
}
var pdst = INF
static func calc_utility(utility: String, bb: Dictionary):
match utility:
"take_melee_weapon":
if bb.health <= 0.0:
return 0.0
if bb.melee_weapon_equipped:
return 0.0
else:
if bb.enemy_distance < engage_distance * engage_distance:
return 110.0
"approach":
if bb.health <= 0.0:
return 0.0
if bb.enemy_distance < 1.6 * 1.6:
return 0.0
if bb.stamina > 50.0 && bb.enemy_distance < engage_distance * engage_distance:
return 10.0 + (bb.enemy_distance - 10.0) / 6.0
"melee_attack":
if bb.health <= 0.0:
return 0.0
if bb.melee_weapon_equipped:
if bb.attack_cooldown <= 0.0:
var d = attack_distance * attack_distance
if bb.stamina > 20.0 && bb.enemy_distance <= d:
return 50.0
"flee":
if bb.health <= 0.0:
return 0.0
if bb.flee_cooldown > 0.0:
return 0.0
if bb.stamina <= 50.0 && bb.stamina > 10.0 && bb.enemy_distance < flee_distance * flee_distance:
return 100.0 + clamp((100.0 - bb.stamina), 0, 90.0) * 2.0
if bb.stamina <= 10.0 && bb.enemy_distance <= flee_distance * flee_distance * 0.5:
return 250.0
if bb.stamina <= 50.0 && bb.enemy_distance < engage_distance * engage_distance:
if bb.randf < 0.3:
return 100.0
if bb.enemy_distance < 1.4 * 1.4:
return 150.0
if bb.health < 50 && bb.health > 15:
return 160
"guard":
if bb.health <= 0.0:
return 0.0
if bb.guard_cooldown > 0.0:
return 0.0
elif bb.guard:
bb.guard = false
return 300.0
# elif bb.enemy_distance < guard_distance * guard_distance * 0.3 && bb.stamina > 10.0:
# return 80
# elif bb.enemy_distance < attack_distance * attack_distance * 0.3:
# return 10.0
"rest":
if bb.stamina >= 100.0:
return 0.0
if bb.stamina <= 10.0 && bb.enemy_distance >= flee_distance * flee_distance:
return 100.0 + bb.enemy_distance / 10.0
if bb.health < 10:
return 2000
"get_melee_damage":
if bb.health <= 0.0:
return 0.0
if bb.melee_damage:
bb.melee_damage = false
print("DAMAGE2 ", bb.health)
return 1000
_:
assert(false)
return 0.0
var last_behavior
func select_behavior():
var best_behavior
var best_utility
best_behavior = "rest"
best_utility = 0.0
for e in conf_behaviors.keys():
var utility = calc_utility(e, blackboard)
if e == last_behavior:
utility *= 2.0
if best_utility < utility:
best_utility = utility
best_behavior = e
last_behavior = best_behavior
return best_behavior
var last_bhv
var last_running = []
var current_running = []
var run_behaviors = {}
func update_physics(delta): func update_physics(delta):
assert(initialized)
assert(root)
var cam = root.get_viewport().get_camera() var cam = root.get_viewport().get_camera()
if !cam: if !cam:
return return
@@ -497,94 +57,82 @@ func update_physics(delta):
var space: PhysicsDirectSpaceState = root.get_world().get_direct_space_state() var space: PhysicsDirectSpaceState = root.get_world().get_direct_space_state()
var o = root.global_transform.origin var o = root.global_transform.origin
var p = cam.get_meta("player").global_transform var p = cam.get_meta("player").global_transform
pdst = o.distance_squared_to(p.origin) var pdst = o.distance_squared_to(p.origin)
blackboard.enemy_distance = pdst var adest = o + (p.origin - o).normalized() * 3.0
blackboard.randf = rnd.randf() var fdest = o + (o - p.origin).normalized() * 3.0
blackboard.enemy_pos = p.origin var cmdq = []
blackboard.space = space if root.has_meta("cmdqueue"):
# var adest = o + (p.origin - o).normalized() * min(2.0, sqrt(pdst)) cmdq = root.get_meta("cmdqueue")
var adest = p.origin
var away = (o - p.origin).normalized()
var attack_xform = Transform(root.global_transform.basis, o + away * 1.5)
var fdest = o + away * 4.0
var enemy_dir: Vector3 = Transform(p.basis, Vector3()).xform(Vector3(0, 0, -1))
var root_dir: Vector3 = Transform(root.global_transform.basis, Vector3()).xform(Vector3(0, 0, -1))
var dot = root_dir.dot(enemy_dir)
blackboard.dot = dot
var prev_state = state
match state: match state:
0: 0:
last_running = current_running.duplicate() if stamina < 100.0:
current_running = [] stamina += delta
var bhv = select_behavior() if stamina > 50.0 && pdst < 100.0 && pdst > 8.0:
if last_bhv != bhv: var skel = root.get_meta("skeleton")
# print("behavior: ", bhv) var wslot = skel.get_node("wrist_r/weapon_right")
last_bhv = bhv wslot.set_meta("owner", root)
if !run_behaviors[bhv].active: inventory.equip(wslot, "s_dagger")
match bhv: # walk to enemy
"take_melee_weapon": state = 10
run_behaviors[bhv].start(root, "s_dagger") elif stamina > 50.0 && pdst <= 8.0:
"approach": # melee attack enemy
var dest = adest state = 20
if pdst > 25.0: elif stamina <= 50.0 && stamina > 10.0 && pdst < 50.0:
run_behaviors[bhv].start(root, dest, 0.5, 3.0, 4.0, 6.0) # flee away
else: state = 30
run_behaviors[bhv].start(root, dest, 0.2, 1.5, 2.0, 6.0) elif stamina <= 10.0 && pdst <= 16.0:
"melee_attack": # still flee away
run_behaviors[bhv].start(root, "attack-melee1", "about_to_attack") state = 30
"flee": elif stamina <= 10.0 && pdst > 16.0:
# walk away from enemy (player) # rest
var dest = fdest state = 40
run_behaviors[bhv].start(root, dest, 0.3, 1.5, 20.0, 6.0) 10:
"rest": # walk to enemy (player)
run_behaviors[bhv].start(root) stamina -= 4 * delta
"guard": var dest = adest
run_behaviors[bhv].start(root, "guard-melee1", "guard-front-melee1") cmdq.push_back(["walkto", dest, 1.5, 2])
"get_melee_damage": state = 11
run_behaviors[bhv].start(root, "guard-melee1", "guard-front-melee1", 10.0) 11:
_: # wait for start walking
assert(false) if root.has_meta("cmdq_walk"):
# print("adding behavior: ", bhv) characters.set_walk_speed(root, 0.5, 0)
current_running.push_back(run_behaviors[bhv]) state = 12
for e in current_running: 12:
if !e in last_running: # finished walking
if !e.active: stamina -= 4 * delta
e.activate() if !root.has_meta("cmdq_walk"):
e.run(delta, blackboard) state = 0
#FIXME: mess :( 20:
if e == run_behaviors["flee"]: # attack
blackboard.flee_cooldown = 2.0 + rnd.randf() * 3.0 stamina -= 3500 * delta
if e.finished && e.active: characters.animation_node_travel(root, "attack-melee1")
# print("in current run but finished") cooldown = 0.8
e.stop() state = 21
for e in last_running: 21:
if !e in current_running: cooldown -= delta
if e.active: stamina -= 5 * delta
# print("not in current run but was in last") if cooldown <= 0.0:
e.stop() state = 0
1: 30:
state = 2 # walk away from enemy (player)
2: stamina -= 15 * delta
state = 3 var dest = fdest
3: cmdq.push_back(["walkto", dest, 1.5, 2])
state = 0 state = 31
if blackboard.stamina < 100.0: 31:
blackboard.stamina += delta # wait for start fleeing
if blackboard.attack_cooldown > 0.0: if root.has_meta("cmdq_walk"):
blackboard.attack_cooldown -= delta characters.set_walk_speed(root, 0.65, 0)
if blackboard.guard_cooldown > 0.0: state = 32
blackboard.guard_cooldown -= delta 32:
if blackboard.flee_cooldown > 0.0: # finished fleeing
blackboard.flee_cooldown -= delta stamina -= 15 * delta
blackboard.stamina = clamp(blackboard.stamina, 0, 100.0) if !root.has_meta("cmdq_walk"):
blackboard.health = clamp(blackboard.health, 0, 100.0) state = 0
return ERR_BUSY 40:
func update(delta): stamina += 15500.0 * delta
return ERR_BUSY if stamina > 90.0:
state = 0
stamina = clamp(stamina, 0, 100.0)
root.set_meta("cmdqueue", cmdq)
##
# if prev_state != state:
# print("new state: ", state)
# print("running ", current_running.size(), " behaviors")

View File

@@ -37,8 +37,3 @@ func action(data):
# if data.action == "hips_action": # if data.action == "hips_action":
# print(data) # print(data)
# marker_hips_action(data) # marker_hips_action(data)
func update(delta):
return ERR_BUSY
func update_physics(delta):
return ERR_BUSY

View File

@@ -151,7 +151,6 @@ func update_physics(delta):
state = 0 state = 0
root.set_meta("cmdqueue", cmdq) root.set_meta("cmdqueue", cmdq)
oldx = p.origin oldx = p.origin
return ERR_BUSY
# print("state =", state) # print("state =", state)
# var px = p.origin # var px = p.origin
# px.y = root.global_transform.origin.y # px.y = root.global_transform.origin.y
@@ -226,5 +225,3 @@ func update_physics(delta):
## cmdq.push_back(["equip", "wrist_r/weapon_right", "s_dagger"]) ## cmdq.push_back(["equip", "wrist_r/weapon_right", "s_dagger"])
## other.set_meta("cmdqueue", cmdq) ## other.set_meta("cmdqueue", cmdq)
## group_manager.submit_player_npc_event_arot(root, "sacrificed-a", root, "sacrificed", root) ## group_manager.submit_player_npc_event_arot(root, "sacrificed-a", root, "sacrificed", root)
func update(delta):
return ERR_BUSY

View File

@@ -42,8 +42,3 @@ func init():
g += garments_male_main g += garments_male_main
h += garments_head_male h += garments_head_male
characters.call_deferred("setup_garments", root, g, h, material_male) characters.call_deferred("setup_garments", root, g, h, material_male)
func update(delta):
return ERR_BUSY
func update_physics(delta):
return ERR_BUSY

View File

@@ -81,8 +81,3 @@ func setup_garments():
# cmdq.push_back(["equip", "wrist_r/weapon_right", "s_dagger"]) # cmdq.push_back(["equip", "wrist_r/weapon_right", "s_dagger"])
# other.set_meta("cmdqueue", cmdq) # other.set_meta("cmdqueue", cmdq)
# group_manager.submit_player_npc_event_arot(root, "sacrificed-a", root, "sacrificed", root) # group_manager.submit_player_npc_event_arot(root, "sacrificed-a", root, "sacrificed", root)
func update_physics(delta):
return ERR_BUSY
func update(delta):
return ERR_BUSY

View File

@@ -15,21 +15,11 @@ func init():
assert(root.has_meta("skeleton")) assert(root.has_meta("skeleton"))
var attack = false var attack = false
var jump = false
var equipped = false var equipped = false
var vjump = Vector3()
func update(delta): func update(delta):
if !controls.is_gui: if Input.is_action_pressed("attack"):
if !attack: attack = true
if Input.is_action_just_pressed("attack"):
attack = true
if !jump:
if Input.is_action_just_pressed("jump"):
jump = true
vjump = Vector3.UP * 10.0
return ERR_BUSY
func update_physics(delta): func update_physics(delta):
var orientation: Transform var orientation: Transform
@@ -86,11 +76,6 @@ func update_physics(delta):
cmdq = root.get_meta("cmdqueue") cmdq = root.get_meta("cmdqueue")
cmdq.push_back(["climb", "1"]) cmdq.push_back(["climb", "1"])
root.set_meta("cmdqueue", cmdq) root.set_meta("cmdqueue", cmdq)
if jump:
root.move_and_slide(vjump, Vector3(0.0, 1.0, 0.0), true, 4, 0.785, false)
vjump *= (1.0 - delta)
if vjump.length_squared() <= 0.0:
jump = false
if attack: if attack:
if !equipped: if !equipped:
@@ -99,7 +84,6 @@ func update_physics(delta):
wslot.set_meta("owner", root) wslot.set_meta("owner", root)
inventory.equip(wslot, "s_dagger") inventory.equip(wslot, "s_dagger")
equipped = true equipped = true
combat.emit_signal("event", "about_to_attack", [root])
animtree["parameters/state/playback"].travel("attack-melee1") animtree["parameters/state/playback"].travel("attack-melee1")
attack = false attack = false
else: else:
@@ -137,5 +121,4 @@ func update_physics(delta):
vehicle.engine_force = 500 * xmotion.y vehicle.engine_force = 500 * xmotion.y
var accel = vehicle.angular_velocity * 350.0 * delta var accel = vehicle.angular_velocity * 350.0 * delta
vehicle.steering = -xmotion.x * 0.7 vehicle.steering = -xmotion.x * 0.7
return ERR_BUSY