├── icon.png.flags ├── icon.png ├── diagram_basic_bot.png ├── diagram_basic_guard.png ├── diagram_walker_core.png ├── samples ├── demo_2 │ ├── map.scn │ ├── Marble.tex │ ├── map.blend │ ├── map.blend1 │ └── demo_2.tscn ├── demo_3 │ ├── map.scn │ ├── Marble.tex │ ├── map.blend │ ├── map.blend1 │ └── demo_3.tscn ├── commons │ ├── textures │ │ ├── Marble.jpg │ │ ├── tile_metal.png │ │ ├── tile_stone.png │ │ └── tile_drywall.png │ ├── tileset │ │ ├── tileset.scn │ │ └── tileset.blend │ └── man │ │ ├── human_walk_0.scn │ │ └── puppet.gd ├── demo_5 │ ├── target.gd │ ├── bot.gd │ ├── target.tscn │ └── demo_5.tscn ├── README.md ├── demo_6 │ └── demo_6.tscn ├── demo_1 │ └── demo_1.tscn ├── demo_7 │ └── demo_7.tscn ├── demo_4 │ └── demo_4.tscn ├── demo_8 │ └── demo_8.tscn └── demo_9 │ ├── light_fps_controller.tscn │ └── demo_9.tscn ├── engine.cfg ├── addons └── eco.fps.walker │ ├── basic_bot.tscn │ ├── basic_guard.tscn │ ├── basic_bot.gd │ ├── basic_guard.gd │ ├── walker_core.tscn │ ├── fsm.gd │ └── walker_core.gd ├── LICENSE └── README.md /icon.png.flags: -------------------------------------------------------------------------------- 1 | gen_mipmaps=false 2 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/icon.png -------------------------------------------------------------------------------- /diagram_basic_bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/diagram_basic_bot.png -------------------------------------------------------------------------------- /diagram_basic_guard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/diagram_basic_guard.png -------------------------------------------------------------------------------- /diagram_walker_core.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/diagram_walker_core.png -------------------------------------------------------------------------------- /samples/demo_2/map.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/demo_2/map.scn -------------------------------------------------------------------------------- /samples/demo_3/map.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/demo_3/map.scn -------------------------------------------------------------------------------- /samples/demo_2/Marble.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/demo_2/Marble.tex -------------------------------------------------------------------------------- /samples/demo_2/map.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/demo_2/map.blend -------------------------------------------------------------------------------- /samples/demo_2/map.blend1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/demo_2/map.blend1 -------------------------------------------------------------------------------- /samples/demo_3/Marble.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/demo_3/Marble.tex -------------------------------------------------------------------------------- /samples/demo_3/map.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/demo_3/map.blend -------------------------------------------------------------------------------- /samples/demo_3/map.blend1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/demo_3/map.blend1 -------------------------------------------------------------------------------- /samples/commons/textures/Marble.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/commons/textures/Marble.jpg -------------------------------------------------------------------------------- /samples/commons/tileset/tileset.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/commons/tileset/tileset.scn -------------------------------------------------------------------------------- /samples/commons/man/human_walk_0.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/commons/man/human_walk_0.scn -------------------------------------------------------------------------------- /samples/commons/tileset/tileset.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/commons/tileset/tileset.blend -------------------------------------------------------------------------------- /samples/commons/textures/tile_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/commons/textures/tile_metal.png -------------------------------------------------------------------------------- /samples/commons/textures/tile_stone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/commons/textures/tile_stone.png -------------------------------------------------------------------------------- /samples/commons/textures/tile_drywall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokudomatic/eco-fps-walker/HEAD/samples/commons/textures/tile_drywall.png -------------------------------------------------------------------------------- /samples/demo_5/target.gd: -------------------------------------------------------------------------------- 1 | extends RigidBody 2 | 3 | # class member variables go here, for example: 4 | # var a = 2 5 | # var b = "textvar" 6 | 7 | func _ready(): 8 | # Called every time the node is added to the scene. 9 | # Initialization here 10 | pass 11 | 12 | func hit(): 13 | queue_free() -------------------------------------------------------------------------------- /engine.cfg: -------------------------------------------------------------------------------- 1 | [application] 2 | 3 | name="eco-fps-walker" 4 | icon="res://icon.png" 5 | 6 | [input] 7 | 8 | ui_left=[key(Left), jbutton(0, 14), key(A)] 9 | ui_right=[key(Right), jbutton(0, 15), key(D)] 10 | ui_up=[key(Up), jbutton(0, 12), key(W)] 11 | ui_down=[key(Down), jbutton(0, 13), key(S)] 12 | ui_jump=[key(E)] 13 | -------------------------------------------------------------------------------- /addons/eco.fps.walker/basic_bot.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=1] 2 | 3 | [ext_resource path="res://addons/eco.fps.walker/walker_core.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://addons/eco.fps.walker/basic_bot.gd" type="Script" id=2] 5 | 6 | [node name="npc" instance=ExtResource( 1 )] 7 | 8 | script/script = ExtResource( 2 ) 9 | 10 | 11 | -------------------------------------------------------------------------------- /samples/demo_5/bot.gd: -------------------------------------------------------------------------------- 1 | extends "res://addons/eco.fps.walker/basic_guard.gd" 2 | 3 | var attack_is_finished=false 4 | 5 | func _ready(): 6 | randomize() 7 | 8 | func _on_model_attack_ended(): 9 | attack_is_finished=true 10 | 11 | func fsm_attack_finished(): 12 | if attack_is_finished: 13 | attack_is_finished=false 14 | return true 15 | else: 16 | return false 17 | 18 | func _on_model_attack_hit(): 19 | get_target().hit() 20 | -------------------------------------------------------------------------------- /samples/commons/man/puppet.gd: -------------------------------------------------------------------------------- 1 | extends Spatial 2 | 3 | onready var anim=get_node("AnimationPlayer") 4 | onready var anim_tree=get_node("AnimationTreePlayer") 5 | 6 | signal attack_ended 7 | signal attack_hit 8 | 9 | func _ready(): 10 | anim_tree.set_active(true) 11 | 12 | func play_animation(name): 13 | if name=="attack": 14 | anim_tree.transition_node_set_current("transition",1) 15 | anim_tree.timeseek_node_seek("seek",0) 16 | else: 17 | anim_tree.transition_node_set_current("transition",0) 18 | 19 | func _on_npc_action_changed( name ): 20 | play_animation(name) 21 | 22 | func attack_finished(): 23 | emit_signal("attack_ended") 24 | 25 | func _on_npc_walk_speed_changed( speed ): 26 | var t=0 27 | if speed>0.1: 28 | t=1 29 | anim_tree.transition_node_set_current("walk",t) 30 | #anim_tree.blend2_node_set_amount("walk",speed) 31 | pass 32 | 33 | func touch(): 34 | emit_signal("attack_hit") -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 gokudomatic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | # Demos & Samples 2 | 3 | * Demo 1 : Simple case of a bot walking to a given target. 4 | * Demo 2 : Example of multiple bots walking through a map made with an external 3D editor. Also features the static walk speed property, with bots of different speeds. 5 | * Demo 3 : Same example as Demo 2 but with a Navigation node and a navmesh. Paths are now calculated with a path finding algorithm. 6 | * Demo 4 : Example of simple bot killing a target. 7 | * Demo 5 : Example of a guard bot scanning for a group of targets and kill each of them. Also features animated mesh for the bot. 8 | * Demo 6 : Demo of the difference between a bot with path finding and a bot without path finding. Usage of a gridmap/tileset with navmesh and collision. 9 | * Demo 7 : Demo of a bot going through a complicated path (gridmap) with path finding. The bot uses the dynamic speed feature. 10 | * Demo 8 : Example of a patroling bot. When it detects a target, it switch in attack mode until the target is destroyed. Then the bot returns to its patrol. 11 | * Demo 9 : Demo of a basic FPS game. A patroling bot like in Demo 8 but where the target is the player. Features also the target acquisition on sight (not through walls). 12 | -------------------------------------------------------------------------------- /addons/eco.fps.walker/basic_guard.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=1] 2 | 3 | [ext_resource path="res://addons/eco.fps.walker/basic_bot.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://addons/eco.fps.walker/basic_guard.gd" type="Script" id=2] 5 | 6 | [sub_resource type="CapsuleShape" id=1] 7 | 8 | radius = 0.8 9 | height = 1.0 10 | 11 | [sub_resource type="RayShape" id=2] 12 | 13 | length = 0.3 14 | 15 | [node name="npc" instance=ExtResource( 1 )] 16 | 17 | script/script = ExtResource( 2 ) 18 | target_group = null 19 | vision_angle = 0.53 20 | 21 | [node name="col1" parent="."] 22 | 23 | transform/local = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1.45, 0 ) 24 | shape = SubResource( 1 ) 25 | trigger = false 26 | _update_shape_index = 0 27 | script/script = null 28 | 29 | [node name="col2" parent="."] 30 | 31 | transform/local = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.3, 0 ) 32 | shape = SubResource( 2 ) 33 | trigger = false 34 | _update_shape_index = 1 35 | script/script = null 36 | 37 | [node name="leg_ray" parent="."] 38 | 39 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0 ) 40 | enabled = true 41 | cast_to = Vector3( 0, -0.4, 0 ) 42 | layer_mask = 1 43 | type_mask = 15 44 | script/script = null 45 | 46 | [node name="target_ray" parent="."] 47 | 48 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.89698, 0 ) 49 | enabled = true 50 | cast_to = Vector3( 0, 0, -100 ) 51 | layer_mask = 1 52 | type_mask = 15 53 | script/script = null 54 | 55 | [node name="ray_ground_right" parent="."] 56 | 57 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, -0.5 ) 58 | enabled = true 59 | cast_to = Vector3( 1.2, -4, -2 ) 60 | layer_mask = 1 61 | type_mask = 1 62 | script/script = null 63 | 64 | [node name="ray_ground_left" parent="."] 65 | 66 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, -0.5 ) 67 | enabled = true 68 | cast_to = Vector3( -1.2, -4, -2 ) 69 | layer_mask = 1 70 | type_mask = 1 71 | script/script = null 72 | 73 | 74 | -------------------------------------------------------------------------------- /addons/eco.fps.walker/basic_bot.gd: -------------------------------------------------------------------------------- 1 | extends "walker_core.gd" 2 | 3 | const TARGET_DISTANCE=2 4 | 5 | var alive=true 6 | var aiming_at_target=false 7 | var can_see_target=false 8 | const action_states=["sleep","move","turn","wait","attack"] 9 | 10 | func _ready(): 11 | current_action={ 12 | move=false, 13 | follow_target=false, 14 | attack=false 15 | } 16 | 17 | func _init_fsm(): 18 | fsm_action=preload("fsm.gd").new() 19 | 20 | _init_fsm_states() 21 | _init_fsm_move() 22 | _init_fsm_attack() 23 | 24 | fsm_action.set_state("decide") 25 | fsm_action.connect("state_changed",self,"_action_state_changed") 26 | 27 | func _init_fsm_states(): 28 | fsm_action.add_group("main",{move=false,attack=false,follow=false}) 29 | 30 | fsm_action.add_state("decide",null,"main") 31 | fsm_action.add_state("wait",{},"main") 32 | fsm_action.add_state("turn",{},"main") 33 | fsm_action.add_state("move",{move=true},"main") 34 | fsm_action.add_state("attack",{move=false,follow=true,attack=true}) 35 | fsm_action.add_state("sleep",{move=false,follow=false,attack=false}) 36 | 37 | func _init_fsm_move(): 38 | fsm_action.add_link("wait","decide","timeout",[0.2]) 39 | fsm_action.add_link("move","decide","timeout",[2]) 40 | fsm_action.add_link("turn","decide","timeout",[1]) 41 | fsm_action.add_link("sleep","decide","timeout",[5]) 42 | fsm_action.add_link("decide","sleep","condition",[self,"fsm_has_no_target",true]) 43 | fsm_action.add_link("decide","move","condition",[self,"fsm_has_no_target",false]) 44 | 45 | 46 | func _init_fsm_attack(): 47 | fsm_action.add_link("attack","decide","timeout",[10]) 48 | fsm_action.add_link("attack","decide","condition",[self,"fsm_attack_finished",true]) 49 | fsm_action.add_link("main","attack","condition",[self,"fsm_can_attack",true]) 50 | 51 | func _integrate_forces(state): 52 | if not alive: 53 | return 54 | 55 | can_see_target=get_target() and target_ray.is_colliding() and target_ray.get_collider()==get_target() 56 | 57 | ._integrate_forces(state) 58 | 59 | func fsm_can_attack(): 60 | return get_target() and can_see_target and get_global_transform().origin.distance_to(get_target().get_global_transform().origin)0 and candidate_dist>vision_range: 64 | continue 65 | 66 | # check if target is closer than actual one 67 | if target_dist!=null and candidate_dist>=target_dist: 68 | continue # if not, skip it 69 | 70 | # check if target is in sight 71 | var target_trans=trans.looking_at(candidate_origin,UP).orthonormalized() 72 | if (target_trans.basis.z-trans.basis.z).length()link.timeout 47 | else: 48 | condition=state_time>link.timeout 49 | found=true 50 | if condition and (link.type=="condition" or link.type=="timed condition") and link.condition_owner.has_method(link.condition_method): 51 | condition=condition and (link.condition_owner.callv(link.condition_method,link.condition_arguments)==link.condition_expected) 52 | found=true 53 | if condition and found: 54 | set_state(link.next_state) 55 | return 56 | 57 | func set_state(new_state): 58 | state_time=0 59 | var old_state=current_state 60 | 61 | current_state=new_state 62 | current_state_object=states[current_state] 63 | _rebuild_links() 64 | 65 | emit_signal("state_changed",old_state,new_state,get_groups_attributes()) 66 | 67 | func get_groups_attributes(): 68 | var attributes 69 | if current_state_object.parent!=null: 70 | attributes=get_group_attributes(current_state_object.parent) 71 | else: 72 | attributes={} 73 | if current_state_object.attributes!=null: 74 | for a in current_state_object.attributes.keys(): 75 | attributes[a]=current_state_object.attributes[a] 76 | return attributes 77 | 78 | func get_group_attributes(group_name): 79 | var attributes 80 | var g=groups[group_name] 81 | if g.parent!=null: 82 | attributes=get_group_attributes(g.parent) 83 | else: 84 | attributes={} 85 | if g.attributes!=null: 86 | for a in g.attributes.keys(): 87 | attributes[a]=g.attributes[a] 88 | return attributes 89 | 90 | func _rebuild_links(): 91 | links=[] 92 | if current_state_object.parent!=null: 93 | _fill_links(current_state_object.parent) 94 | if current_state_object.links!=null: 95 | for l in current_state_object.links: 96 | links.append(l) 97 | 98 | func _fill_links(group): 99 | if not groups.has(group): 100 | return 101 | 102 | var group_instance=groups[group] 103 | if group_instance.parent!=null: 104 | _fill_links(group_instance.parent) 105 | if group_instance.links!=null: 106 | for l in group_instance.links: 107 | links.append(l) 108 | 109 | func add_group(name,attributes=null,parent=null): 110 | var instance=Group.new() 111 | if attributes!=null: 112 | instance.attributes=attributes 113 | if parent!=null: 114 | instance.parent=parent 115 | groups[name]=instance 116 | 117 | func add_state(name,attributes=null,group=null): 118 | var instance=State.new() 119 | if attributes!=null: 120 | instance.attributes=attributes 121 | if group!=null: 122 | instance.parent=group 123 | states[name]=instance 124 | 125 | func add_link(state,next_state,type,params): 126 | if states.has(state): 127 | _add_link(states[state],next_state,type,params) 128 | elif groups.has(state): 129 | _add_link(groups[state],next_state,type,params) 130 | 131 | func _add_link(instance,next_state,type,params): 132 | var link=Link.new() 133 | link.next_state=next_state 134 | link.type=type 135 | if type=="condition": 136 | link.condition_owner=params[0] 137 | link.condition_method=params[1] 138 | if params.size()==3: 139 | link.condition_expected=params[2] 140 | elif params.size()==4: 141 | link.condition_arguments=params[2] 142 | link.condition_expected=params[3] 143 | elif type=="timeout": 144 | link.timeout=params[0] 145 | if params.size()==2: 146 | link.timer=params[1] 147 | elif type=="timed condition": 148 | link.timeout=params[0] 149 | link.condition_owner=params[1] 150 | link.condition_method=params[2] 151 | if params.size()==4: 152 | link.condition_expected=params[3] 153 | elif params.size()==5: 154 | if typeof(params[3])==TYPE_ARRAY: 155 | link.condition_arguments=params[3] 156 | link.condition_expected=params[4] 157 | else: 158 | link.condition_expected=params[4] 159 | link.timer=params[5] 160 | elif params.size()==6: 161 | link.condition_arguments=params[3] 162 | link.condition_expected=params[4] 163 | link.timer=params[5] 164 | 165 | if instance.links==null: 166 | instance.links=[] 167 | instance.links.append(link) 168 | 169 | func add_timer(name): 170 | timers[name]=0 171 | -------------------------------------------------------------------------------- /samples/demo_6/demo_6.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=1] 2 | 3 | [ext_resource path="res://addons/eco.fps.walker/walker_core.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://samples/commons/man/human_walk_0.scn" type="PackedScene" id=2] 5 | [ext_resource path="res://samples/commons/tileset/tileset.tres" type="MeshLibrary" id=3] 6 | 7 | [sub_resource type="Environment" id=1] 8 | 9 | ambient_light/enabled = true 10 | ambient_light/color = Color( 0.914062, 0.914062, 0.914062, 1 ) 11 | ambient_light/energy = 1.0 12 | fxaa/enabled = false 13 | background/mode = 1 14 | background/color = Color( 0, 0, 0, 1 ) 15 | background/energy = 1.0 16 | background/scale = 1.0 17 | background/glow = 0.0 18 | background/canvas_max_layer = null 19 | glow/enabled = false 20 | glow/blur_passes = 1 21 | glow/blur_scale = 1 22 | glow/blur_strength = 1 23 | glow/blur_blend_mode = null 24 | glow/bloom = 0.0 25 | glow/bloom_treshold = 0.5 26 | dof_blur/enabled = false 27 | dof_blur/blur_passes = 1 28 | dof_blur/begin = 100.0 29 | dof_blur/range = 10.0 30 | hdr/enabled = false 31 | hdr/tonemapper = 0 32 | hdr/exposure = 0.4 33 | hdr/white = 1.0 34 | hdr/glow_treshold = 0.95 35 | hdr/glow_scale = 0.2 36 | hdr/min_luminance = 0.4 37 | hdr/max_luminance = 8.0 38 | hdr/exposure_adj_speed = 0.5 39 | fog/enabled = false 40 | fog/begin = 100.0 41 | fog/begin_color = Color( 0, 0, 0, 1 ) 42 | fog/end_color = Color( 0, 0, 0, 1 ) 43 | fog/attenuation = 1.0 44 | fog/bg = true 45 | bcs/enabled = false 46 | bcs/brightness = 1.0 47 | bcs/contrast = 1.0 48 | bcs/saturation = 1.0 49 | srgb/enabled = false 50 | 51 | [sub_resource type="FixedMaterial" id=2] 52 | 53 | flags/visible = true 54 | flags/double_sided = false 55 | flags/invert_faces = false 56 | flags/unshaded = false 57 | flags/on_top = false 58 | flags/lightmap_on_uv2 = true 59 | flags/colarray_is_srgb = true 60 | params/blend_mode = 0 61 | params/depth_draw = 1 62 | params/line_width = 0.0 63 | fixed_flags/use_alpha = false 64 | fixed_flags/use_color_array = false 65 | fixed_flags/use_point_size = false 66 | fixed_flags/discard_alpha = false 67 | fixed_flags/use_xy_normalmap = false 68 | params/diffuse = Color( 0, 0.273438, 1, 1 ) 69 | params/specular = Color( 0, 0, 0, 1 ) 70 | params/emission = Color( 0, 0, 0, 1 ) 71 | params/specular_exp = 40 72 | params/detail_mix = 1.0 73 | params/normal_depth = 1 74 | params/shader = 0 75 | params/shader_param = 0.5 76 | params/glow = 0 77 | params/point_size = 1.0 78 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 79 | textures/diffuse_tc = 0 80 | textures/detail_tc = 0 81 | textures/specular_tc = 0 82 | textures/emission_tc = 0 83 | textures/specular_exp_tc = 0 84 | textures/glow_tc = 0 85 | textures/normal_tc = 0 86 | textures/shade_param_tc = 0 87 | 88 | [node name="world" type="Spatial"] 89 | 90 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 91 | 92 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."] 93 | 94 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 95 | environment = SubResource( 1 ) 96 | 97 | [node name="npc" parent="." instance=ExtResource( 1 )] 98 | 99 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.34753, 0 ) 100 | body_radius = 0.4 101 | leg_length = 0.1 102 | walk_speed = 6.0 103 | target = NodePath("../target") 104 | navigation = NodePath("../Navigation") 105 | 106 | [node name="model" parent="npc" instance=ExtResource( 2 )] 107 | 108 | [node name="npc1" parent="." instance=ExtResource( 1 )] 109 | 110 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.29408, 3.34753, 4.19591 ) 111 | body_radius = 0.4 112 | leg_length = 0.1 113 | walk_speed = 6.0 114 | target = NodePath("../target") 115 | 116 | [node name="model" parent="npc1" instance=ExtResource( 2 )] 117 | 118 | [node name="target" type="TestCube" parent="."] 119 | 120 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 121 | transform/local = Transform( 0.276706, 0, 0, 0, 0.276706, 0, 0, 0, 0.276706, 11.4789, 3.25519, 0 ) 122 | layers = 1 123 | geometry/visible = true 124 | geometry/material_override = SubResource( 2 ) 125 | geometry/cast_shadow = 1 126 | geometry/receive_shadows = true 127 | geometry/range_begin = 0.0 128 | geometry/range_end = 0.0 129 | geometry/extra_cull_margin = 0.0 130 | geometry/billboard = false 131 | geometry/billboard_y = false 132 | geometry/depth_scale = false 133 | geometry/visible_in_all_rooms = false 134 | geometry/use_baked_light = false 135 | geometry/baked_light_tex_id = 0 136 | 137 | [node name="Navigation" type="Navigation" parent="."] 138 | 139 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 140 | up_vector = Vector3( 0, 1, 0 ) 141 | 142 | [node name="GridMap" type="GridMap" parent="Navigation"] 143 | 144 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 145 | theme/theme = ExtResource( 3 ) 146 | theme/bake = false 147 | lighting/bake = false 148 | cell/size = 2.0 149 | cell/octant_size = 4 150 | cell/center_x = true 151 | cell/center_y = true 152 | cell/center_z = true 153 | cell/scale = 1.0 154 | data = { "cells":IntArray( 1, 1, 1441801, 5, 1, 1441801, 65533, 1, 1441801, 65535, 1, 1441801, 131079, 2, 7, 131081, 2, 7, 131083, 2, 7, 1, 3, 1441801, 5, 3, 1441801, 7, 3, 1441801, 9, 3, 9, 11, 3, 9, 65533, 3, 1441801, 65535, 3, 1441801, 131084, 3, 1441799, 131079, 4, 655367, 131081, 4, 655367, 11, 5, 9, 65535, 5, 1441801, 131082, 5, 1048583, 131084, 5, 1441799, 131079, 6, 7, 7, 7, 1441801, 11, 7, 9, 65535, 7, 1441801, 131078, 7, 1048583, 131080, 7, 1441799, 131082, 7, 1048583, 131084, 7, 1441799, 131081, 8, 7, 7, 9, 1441801, 9, 9, 9, 11, 9, 9, 65535, 9, 1441801, 131078, 9, 1048583, 131084, 9, 1441799, 131079, 10, 655367, 131083, 10, 655367, 9, 11, 9, 65535, 11, 1441801, 7, 13, 9, 9, 13, 9, 65535, 13, 9, 65539, 13, 9, 131073, 13, 655363, 131077, 13, 3, 1, 65535, 1441801, 5, 65535, 1441801, 65533, 65535, 1441801, 65535, 65535, 1441801 ) } 155 | __meta__ = { "_editor_clip_":0, "_editor_floor_":Vector3( 0, 2, 0 ) } 156 | 157 | [node name="Camera" type="Camera" parent="."] 158 | 159 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 160 | transform/local = Transform( -0.832512, 0.44308, -0.33257, 0, 0.6003, 0.799775, 0.554006, 0.665823, -0.499757, -6.35511, 42.1842, -8.90947 ) 161 | projection = 0 162 | fov = 60.0 163 | near = 0.1 164 | far = 100.0 165 | keep_aspect = 1 166 | current = false 167 | visible_layers = 1048575 168 | environment = null 169 | h_offset = 0.0 170 | v_offset = 0.0 171 | 172 | [connection signal="action_changed" from="npc" to="npc/model" method="_on_npc_action_changed"] 173 | 174 | [connection signal="walk_speed_changed" from="npc" to="npc/model" method="_on_npc_walk_speed_changed"] 175 | 176 | [connection signal="action_changed" from="npc1" to="npc1/model" method="_on_npc_action_changed"] 177 | 178 | [connection signal="walk_speed_changed" from="npc1" to="npc1/model" method="_on_npc_walk_speed_changed"] 179 | 180 | 181 | -------------------------------------------------------------------------------- /samples/demo_5/demo_5.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=1] 2 | 3 | [ext_resource path="res://samples/demo_5/target.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://addons/eco.fps.walker/basic_guard.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://samples/demo_5/bot.gd" type="Script" id=3] 6 | [ext_resource path="res://samples/commons/man/human_walk_0.scn" type="PackedScene" id=4] 7 | 8 | [sub_resource type="PlaneShape" id=1] 9 | 10 | plane = Plane( 0, 1, 0, 0 ) 11 | 12 | [sub_resource type="FixedMaterial" id=2] 13 | 14 | flags/visible = true 15 | flags/double_sided = false 16 | flags/invert_faces = false 17 | flags/unshaded = false 18 | flags/on_top = false 19 | flags/lightmap_on_uv2 = true 20 | flags/colarray_is_srgb = true 21 | params/blend_mode = 0 22 | params/depth_draw = 1 23 | params/line_width = 0.0 24 | fixed_flags/use_alpha = false 25 | fixed_flags/use_color_array = false 26 | fixed_flags/use_point_size = false 27 | fixed_flags/discard_alpha = false 28 | fixed_flags/use_xy_normalmap = false 29 | params/diffuse = Color( 0.242188, 0.0996525, 0.0501404, 1 ) 30 | params/specular = Color( 0, 0, 0, 1 ) 31 | params/emission = Color( 0, 0, 0, 1 ) 32 | params/specular_exp = 40 33 | params/detail_mix = 1.0 34 | params/normal_depth = 1 35 | params/shader = 0 36 | params/shader_param = 0.5 37 | params/glow = 0 38 | params/point_size = 1.0 39 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 40 | textures/diffuse_tc = 0 41 | textures/detail_tc = 0 42 | textures/specular_tc = 0 43 | textures/emission_tc = 0 44 | textures/specular_exp_tc = 0 45 | textures/glow_tc = 0 46 | textures/normal_tc = 0 47 | textures/shade_param_tc = 0 48 | 49 | [sub_resource type="Environment" id=3] 50 | 51 | ambient_light/enabled = true 52 | ambient_light/color = Color( 0.792969, 0.792969, 0.792969, 1 ) 53 | ambient_light/energy = 1.0 54 | fxaa/enabled = false 55 | background/mode = 2 56 | background/color = Color( 0.013855, 0.579853, 0.886719, 1 ) 57 | background/energy = 1.0 58 | background/scale = 1.0 59 | background/glow = 0.0 60 | background/canvas_max_layer = null 61 | glow/enabled = false 62 | glow/blur_passes = 1 63 | glow/blur_scale = 1 64 | glow/blur_strength = 1 65 | glow/blur_blend_mode = null 66 | glow/bloom = 0.0 67 | glow/bloom_treshold = 0.5 68 | dof_blur/enabled = false 69 | dof_blur/blur_passes = 1 70 | dof_blur/begin = 100.0 71 | dof_blur/range = 10.0 72 | hdr/enabled = false 73 | hdr/tonemapper = 0 74 | hdr/exposure = 0.4 75 | hdr/white = 1.0 76 | hdr/glow_treshold = 0.95 77 | hdr/glow_scale = 0.2 78 | hdr/min_luminance = 0.4 79 | hdr/max_luminance = 8.0 80 | hdr/exposure_adj_speed = 0.5 81 | fog/enabled = false 82 | fog/begin = 100.0 83 | fog/begin_color = Color( 0, 0, 0, 1 ) 84 | fog/end_color = Color( 0, 0, 0, 1 ) 85 | fog/attenuation = 1.0 86 | fog/bg = true 87 | bcs/enabled = false 88 | bcs/brightness = 1.0 89 | bcs/contrast = 1.0 90 | bcs/saturation = 1.0 91 | srgb/enabled = false 92 | 93 | [node name="world" type="Spatial"] 94 | 95 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 96 | 97 | [node name="ground" type="StaticBody" parent="."] 98 | 99 | editor/display_folded = true 100 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 101 | input/ray_pickable = true 102 | input/capture_on_drag = false 103 | shape_count = 2 104 | shapes/0/shape = SubResource( 1 ) 105 | shapes/0/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 106 | shapes/0/trigger = false 107 | shapes/1/shape = SubResource( 1 ) 108 | shapes/1/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 ) 109 | shapes/1/trigger = false 110 | collision/layers = 1 111 | collision/mask = 1 112 | friction = 1.0 113 | bounce = 0.0 114 | constant_linear_velocity = Vector3( 0, 0, 0 ) 115 | constant_angular_velocity = Vector3( 0, 0, 0 ) 116 | 117 | [node name="CollisionShape" type="CollisionShape" parent="ground"] 118 | 119 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 120 | shape = SubResource( 1 ) 121 | trigger = false 122 | _update_shape_index = 0 123 | 124 | [node name="CollisionShape1" type="CollisionShape" parent="ground"] 125 | 126 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 127 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 ) 128 | shape = SubResource( 1 ) 129 | trigger = false 130 | _update_shape_index = 1 131 | 132 | [node name="Quad" type="Quad" parent="ground"] 133 | 134 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 135 | layers = 1 136 | geometry/visible = true 137 | geometry/material_override = SubResource( 2 ) 138 | geometry/cast_shadow = 1 139 | geometry/receive_shadows = true 140 | geometry/range_begin = 0.0 141 | geometry/range_end = 0.0 142 | geometry/extra_cull_margin = 0.0 143 | geometry/billboard = false 144 | geometry/billboard_y = false 145 | geometry/depth_scale = false 146 | geometry/visible_in_all_rooms = false 147 | geometry/use_baked_light = false 148 | geometry/baked_light_tex_id = 0 149 | quad/axis = 1 150 | quad/size = Vector2( 100, 100 ) 151 | quad/offset = Vector2( 0, 0 ) 152 | quad/centered = true 153 | 154 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."] 155 | 156 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 157 | environment = SubResource( 3 ) 158 | 159 | [node name="Camera" type="Camera" parent="."] 160 | 161 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 162 | transform/local = Transform( -0.711649, 0.453625, -0.536452, 0, 0.763594, 0.645697, 0.702536, 0.459509, -0.543411, -9.26073, 19.6296, -16.4696 ) 163 | projection = 0 164 | fov = 60.0 165 | near = 0.1 166 | far = 100.0 167 | keep_aspect = 1 168 | current = false 169 | visible_layers = 1048575 170 | environment = null 171 | h_offset = 0.0 172 | v_offset = 0.0 173 | 174 | [node name="target" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 175 | 176 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, 10.0422, 0.462675, 0 ) 177 | 178 | [node name="target1" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 179 | 180 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, 14.3241, 0.436747, -5.86371 ) 181 | 182 | [node name="target2" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 183 | 184 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, -0.649592, 0.436747, -11.0633 ) 185 | 186 | [node name="target3" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 187 | 188 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, -0.649592, 0.436747, 7.65366 ) 189 | 190 | [node name="target4" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 191 | 192 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, 4.67643, 0.436747, -4.3103 ) 193 | 194 | [node name="target5" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 195 | 196 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, 13.9782, 0.436747, 8.26434 ) 197 | 198 | [node name="target6" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 199 | 200 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, 4.85284, 0.436747, 4.52446 ) 201 | 202 | [node name="target7" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 203 | 204 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, -5.08215, 0.436747, -4.39557 ) 205 | 206 | [node name="target8" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 207 | 208 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, -2.19856, 0.436747, 2.28468 ) 209 | 210 | [node name="target9" parent="." groups=[ "prey" ] instance=ExtResource( 1 )] 211 | 212 | transform/local = Transform( 0.181889, 0, 0, 0, 0.181889, 0, 0, 0, 0.181889, 8.69146, 0.436747, -8.51872 ) 213 | 214 | [node name="npc" parent="." instance=ExtResource( 2 )] 215 | 216 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.30941, 10.5199, -2.71927 ) 217 | script/script = ExtResource( 3 ) 218 | body_radius = 0.4 219 | leg_length = 0.2 220 | walk_speed = 6.0 221 | target_group = "prey" 222 | vision_range = 0 223 | 224 | [node name="model" parent="npc" instance=ExtResource( 4 )] 225 | 226 | [connection signal="action_changed" from="npc" to="npc/model" method="_on_npc_action_changed"] 227 | 228 | [connection signal="walk_speed_changed" from="npc" to="npc/model" method="_on_npc_walk_speed_changed"] 229 | 230 | [connection signal="attack_ended" from="npc/model" to="npc" method="_on_model_attack_ended"] 231 | 232 | [connection signal="attack_hit" from="npc/model" to="npc" method="_on_model_attack_hit"] 233 | 234 | 235 | -------------------------------------------------------------------------------- /samples/demo_3/demo_3.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=1] 2 | 3 | [ext_resource path="res://addons/eco.fps.walker/walker_core.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://samples/demo_2/map.scn" type="PackedScene" id=2] 5 | 6 | [sub_resource type="Environment" id=1] 7 | 8 | ambient_light/enabled = true 9 | ambient_light/color = Color( 1, 1, 1, 1 ) 10 | ambient_light/energy = 1.0 11 | fxaa/enabled = false 12 | background/mode = 1 13 | background/color = Color( 0, 0, 0, 1 ) 14 | background/energy = 1.0 15 | background/scale = 1.0 16 | background/glow = 0.0 17 | background/canvas_max_layer = null 18 | glow/enabled = false 19 | glow/blur_passes = 1 20 | glow/blur_scale = 1 21 | glow/blur_strength = 1 22 | glow/blur_blend_mode = null 23 | glow/bloom = 0.0 24 | glow/bloom_treshold = 0.5 25 | dof_blur/enabled = false 26 | dof_blur/blur_passes = 1 27 | dof_blur/begin = 100.0 28 | dof_blur/range = 10.0 29 | hdr/enabled = false 30 | hdr/tonemapper = 0 31 | hdr/exposure = 0.4 32 | hdr/white = 1.0 33 | hdr/glow_treshold = 0.95 34 | hdr/glow_scale = 0.2 35 | hdr/min_luminance = 0.4 36 | hdr/max_luminance = 8.0 37 | hdr/exposure_adj_speed = 0.5 38 | fog/enabled = false 39 | fog/begin = 100.0 40 | fog/begin_color = Color( 0, 0, 0, 1 ) 41 | fog/end_color = Color( 0, 0, 0, 1 ) 42 | fog/attenuation = 1.0 43 | fog/bg = true 44 | bcs/enabled = false 45 | bcs/brightness = 1.0 46 | bcs/contrast = 1.0 47 | bcs/saturation = 1.0 48 | srgb/enabled = false 49 | 50 | [sub_resource type="FixedMaterial" id=2] 51 | 52 | flags/visible = true 53 | flags/double_sided = false 54 | flags/invert_faces = false 55 | flags/unshaded = false 56 | flags/on_top = false 57 | flags/lightmap_on_uv2 = true 58 | flags/colarray_is_srgb = true 59 | params/blend_mode = 0 60 | params/depth_draw = 1 61 | params/line_width = 0.0 62 | fixed_flags/use_alpha = false 63 | fixed_flags/use_color_array = false 64 | fixed_flags/use_point_size = false 65 | fixed_flags/discard_alpha = false 66 | fixed_flags/use_xy_normalmap = false 67 | params/diffuse = Color( 0.03125, 0, 1, 1 ) 68 | params/specular = Color( 0, 0, 0, 1 ) 69 | params/emission = Color( 0, 0, 0, 1 ) 70 | params/specular_exp = 40 71 | params/detail_mix = 1.0 72 | params/normal_depth = 1 73 | params/shader = 0 74 | params/shader_param = 0.5 75 | params/glow = 0 76 | params/point_size = 1.0 77 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 78 | textures/diffuse_tc = 0 79 | textures/detail_tc = 0 80 | textures/specular_tc = 0 81 | textures/emission_tc = 0 82 | textures/specular_exp_tc = 0 83 | textures/glow_tc = 0 84 | textures/normal_tc = 0 85 | textures/shade_param_tc = 0 86 | 87 | [sub_resource type="FixedMaterial" id=3] 88 | 89 | flags/visible = true 90 | flags/double_sided = false 91 | flags/invert_faces = false 92 | flags/unshaded = false 93 | flags/on_top = false 94 | flags/lightmap_on_uv2 = true 95 | flags/colarray_is_srgb = true 96 | params/blend_mode = 0 97 | params/depth_draw = 1 98 | params/line_width = 1.875 99 | fixed_flags/use_alpha = false 100 | fixed_flags/use_color_array = false 101 | fixed_flags/use_point_size = false 102 | fixed_flags/discard_alpha = false 103 | fixed_flags/use_xy_normalmap = false 104 | params/diffuse = Color( 1, 0.00390625, 0.00390625, 1 ) 105 | params/specular = Color( 0, 0, 0, 1 ) 106 | params/emission = Color( 0, 0, 0, 1 ) 107 | params/specular_exp = 40 108 | params/detail_mix = 1.0 109 | params/normal_depth = 1 110 | params/shader = 0 111 | params/shader_param = 0.5 112 | params/glow = 0 113 | params/point_size = 1.0 114 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 115 | textures/diffuse_tc = 0 116 | textures/detail_tc = 0 117 | textures/specular_tc = 0 118 | textures/emission_tc = 0 119 | textures/specular_exp_tc = 0 120 | textures/glow_tc = 0 121 | textures/normal_tc = 0 122 | textures/shade_param_tc = 0 123 | 124 | [sub_resource type="FixedMaterial" id=4] 125 | 126 | flags/visible = true 127 | flags/double_sided = false 128 | flags/invert_faces = false 129 | flags/unshaded = false 130 | flags/on_top = false 131 | flags/lightmap_on_uv2 = true 132 | flags/colarray_is_srgb = true 133 | params/blend_mode = 0 134 | params/depth_draw = 1 135 | params/line_width = 0.0 136 | fixed_flags/use_alpha = false 137 | fixed_flags/use_color_array = false 138 | fixed_flags/use_point_size = false 139 | fixed_flags/discard_alpha = false 140 | fixed_flags/use_xy_normalmap = false 141 | params/diffuse = Color( 0.546875, 0.53077, 0.134583, 1 ) 142 | params/specular = Color( 0, 0, 0, 1 ) 143 | params/emission = Color( 0, 0, 0, 1 ) 144 | params/specular_exp = 40 145 | params/detail_mix = 1.0 146 | params/normal_depth = 1 147 | params/shader = 0 148 | params/shader_param = 0.5 149 | params/glow = 0 150 | params/point_size = 1.0 151 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 152 | textures/diffuse_tc = 0 153 | textures/detail_tc = 0 154 | textures/specular_tc = 0 155 | textures/emission_tc = 0 156 | textures/specular_exp_tc = 0 157 | textures/glow_tc = 0 158 | textures/normal_tc = 0 159 | textures/shade_param_tc = 0 160 | 161 | [sub_resource type="FixedMaterial" id=5] 162 | 163 | flags/visible = true 164 | flags/double_sided = false 165 | flags/invert_faces = false 166 | flags/unshaded = false 167 | flags/on_top = false 168 | flags/lightmap_on_uv2 = true 169 | flags/colarray_is_srgb = true 170 | params/blend_mode = 0 171 | params/depth_draw = 1 172 | params/line_width = 0.0 173 | fixed_flags/use_alpha = false 174 | fixed_flags/use_color_array = false 175 | fixed_flags/use_point_size = false 176 | fixed_flags/discard_alpha = false 177 | fixed_flags/use_xy_normalmap = false 178 | params/diffuse = Color( 0.0545194, 0.261719, 0.0184021, 1 ) 179 | params/specular = Color( 0, 0, 0, 1 ) 180 | params/emission = Color( 0, 0, 0, 1 ) 181 | params/specular_exp = 40 182 | params/detail_mix = 1.0 183 | params/normal_depth = 1 184 | params/shader = 0 185 | params/shader_param = 0.5 186 | params/glow = 0 187 | params/point_size = 1.0 188 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 189 | textures/diffuse_tc = 0 190 | textures/detail_tc = 0 191 | textures/specular_tc = 0 192 | textures/emission_tc = 0 193 | textures/specular_exp_tc = 0 194 | textures/glow_tc = 0 195 | textures/normal_tc = 0 196 | textures/shade_param_tc = 0 197 | 198 | [node name="Spatial" type="Spatial"] 199 | 200 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 201 | 202 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."] 203 | 204 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 205 | environment = SubResource( 1 ) 206 | 207 | [node name="npc" parent="." instance=ExtResource( 1 )] 208 | 209 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -7.12694, 3.76658, 8.85242 ) 210 | collision/mask = 2 211 | walk_speed = 4.0 212 | target = NodePath("../target") 213 | navigation = NodePath("../Navigation") 214 | 215 | [node name="Camera" type="Camera" parent="npc"] 216 | 217 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 218 | transform/local = Transform( 1, 0, 0, 0, 0.908574, 0.417724, 0, -0.417724, 0.908574, 0, 8.32907, 8.47772 ) 219 | projection = 0 220 | fov = 60.0 221 | near = 0.1 222 | far = 100.0 223 | keep_aspect = 1 224 | current = false 225 | visible_layers = 1048575 226 | environment = null 227 | h_offset = 0.0 228 | v_offset = 0.0 229 | 230 | [node name="TestCube" type="TestCube" parent="npc"] 231 | 232 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 233 | transform/local = Transform( 0.455835, 0, 0, 0, 0.455835, 0, 0, 0, 0.455835, 0, 0.778903, 0 ) 234 | layers = 1 235 | geometry/visible = true 236 | geometry/material_override = SubResource( 2 ) 237 | geometry/cast_shadow = 1 238 | geometry/receive_shadows = true 239 | geometry/range_begin = 0.0 240 | geometry/range_end = 0.0 241 | geometry/extra_cull_margin = 0.0 242 | geometry/billboard = false 243 | geometry/billboard_y = false 244 | geometry/depth_scale = false 245 | geometry/visible_in_all_rooms = false 246 | geometry/use_baked_light = false 247 | geometry/baked_light_tex_id = 0 248 | 249 | [node name="target" type="TestCube" parent="."] 250 | 251 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 252 | transform/local = Transform( 0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 12.4864, 23.2817, -159.6 ) 253 | layers = 1 254 | geometry/visible = true 255 | geometry/material_override = SubResource( 3 ) 256 | geometry/cast_shadow = 1 257 | geometry/receive_shadows = true 258 | geometry/range_begin = 0.0 259 | geometry/range_end = 0.0 260 | geometry/extra_cull_margin = 0.0 261 | geometry/billboard = false 262 | geometry/billboard_y = false 263 | geometry/depth_scale = false 264 | geometry/visible_in_all_rooms = false 265 | geometry/use_baked_light = false 266 | geometry/baked_light_tex_id = 0 267 | 268 | [node name="Navigation" type="Navigation" parent="."] 269 | 270 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 271 | up_vector = Vector3( 0, 1, 0 ) 272 | 273 | [node name="map" parent="Navigation" instance=ExtResource( 2 )] 274 | 275 | transform/local = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0 ) 276 | 277 | [node name="npc 2" parent="." instance=ExtResource( 1 )] 278 | 279 | transform/local = Transform( -0.99864, 0, 0.0521425, 0, 1, 0, -0.0521425, 0, -0.99864, 10.6866, 0.379697, 10.1786 ) 280 | collision/mask = 2 281 | walk_speed = 8.0 282 | turn_speed_deccel = 4.0 283 | target = NodePath("../target") 284 | navigation = NodePath("../Navigation") 285 | 286 | [node name="TestCube1" type="TestCube" parent="npc 2"] 287 | 288 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 289 | transform/local = Transform( 0.455835, 0, 1.86265e-09, 0, 0.455835, 0, -1.86265e-09, 0, 0.455835, 0, 0.77, 0 ) 290 | layers = 1 291 | geometry/visible = true 292 | geometry/material_override = SubResource( 4 ) 293 | geometry/cast_shadow = 1 294 | geometry/receive_shadows = true 295 | geometry/range_begin = 0.0 296 | geometry/range_end = 0.0 297 | geometry/extra_cull_margin = 0.0 298 | geometry/billboard = false 299 | geometry/billboard_y = false 300 | geometry/depth_scale = false 301 | geometry/visible_in_all_rooms = false 302 | geometry/use_baked_light = false 303 | geometry/baked_light_tex_id = 0 304 | 305 | [node name="npc3" parent="." instance=ExtResource( 1 )] 306 | 307 | transform/local = Transform( -0.99864, 0, 0.0521425, 0, 1, 0, -0.0521425, 0, -0.99864, -10.3337, 11.6214, -11.1812 ) 308 | collision/mask = 2 309 | target = NodePath("../target") 310 | navigation = NodePath("../Navigation") 311 | 312 | [node name="TestCube1" type="TestCube" parent="npc3"] 313 | 314 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 315 | transform/local = Transform( 0.455835, 0, 1.86265e-09, 0, 0.455835, 0, -1.86265e-09, 0, 0.455835, 0, 0.77, 0 ) 316 | layers = 1 317 | geometry/visible = true 318 | geometry/material_override = SubResource( 5 ) 319 | geometry/cast_shadow = 1 320 | geometry/receive_shadows = true 321 | geometry/range_begin = 0.0 322 | geometry/range_end = 0.0 323 | geometry/extra_cull_margin = 0.0 324 | geometry/billboard = false 325 | geometry/billboard_y = false 326 | geometry/depth_scale = false 327 | geometry/visible_in_all_rooms = false 328 | geometry/use_baked_light = false 329 | geometry/baked_light_tex_id = 0 330 | 331 | 332 | -------------------------------------------------------------------------------- /samples/demo_1/demo_1.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=1] 2 | 3 | [ext_resource path="res://addons/eco.fps.walker/walker_core.tscn" type="PackedScene" id=1] 4 | 5 | [sub_resource type="FixedMaterial" id=1] 6 | 7 | flags/visible = true 8 | flags/double_sided = false 9 | flags/invert_faces = false 10 | flags/unshaded = false 11 | flags/on_top = false 12 | flags/lightmap_on_uv2 = true 13 | flags/colarray_is_srgb = true 14 | params/blend_mode = 0 15 | params/depth_draw = 1 16 | params/line_width = 4.48416e-44 17 | fixed_flags/use_alpha = false 18 | fixed_flags/use_color_array = false 19 | fixed_flags/use_point_size = false 20 | fixed_flags/discard_alpha = false 21 | fixed_flags/use_xy_normalmap = false 22 | params/diffuse = Color( 0, 0, 0, 1 ) 23 | params/specular = Color( 1, 1, 1, 1 ) 24 | params/emission = Color( 0, 0, 0, 1 ) 25 | params/specular_exp = 40 26 | params/detail_mix = 1.0 27 | params/normal_depth = 1 28 | params/shader = 0 29 | params/shader_param = 0.5 30 | params/glow = 0 31 | params/point_size = 1.0 32 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 33 | textures/diffuse_tc = 0 34 | textures/detail_tc = 0 35 | textures/specular_tc = 0 36 | textures/emission_tc = 0 37 | textures/specular_exp_tc = 0 38 | textures/glow_tc = 0 39 | textures/normal_tc = 0 40 | textures/shade_param_tc = 0 41 | 42 | [sub_resource type="FixedMaterial" id=2] 43 | 44 | flags/visible = true 45 | flags/double_sided = false 46 | flags/invert_faces = false 47 | flags/unshaded = false 48 | flags/on_top = false 49 | flags/lightmap_on_uv2 = true 50 | flags/colarray_is_srgb = true 51 | params/blend_mode = 0 52 | params/depth_draw = 1 53 | params/line_width = 1.96182e-44 54 | fixed_flags/use_alpha = false 55 | fixed_flags/use_color_array = false 56 | fixed_flags/use_point_size = false 57 | fixed_flags/discard_alpha = false 58 | fixed_flags/use_xy_normalmap = false 59 | params/diffuse = Color( 0, 0, 0, 1 ) 60 | params/specular = Color( 1, 1, 1, 1 ) 61 | params/emission = Color( 0, 0, 0, 1 ) 62 | params/specular_exp = 40 63 | params/detail_mix = 1.0 64 | params/normal_depth = 1 65 | params/shader = 0 66 | params/shader_param = 0.5 67 | params/glow = 0 68 | params/point_size = 1.0 69 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 70 | textures/diffuse_tc = 0 71 | textures/detail_tc = 0 72 | textures/specular_tc = 0 73 | textures/emission_tc = 0 74 | textures/specular_exp_tc = 0 75 | textures/glow_tc = 0 76 | textures/normal_tc = 0 77 | textures/shade_param_tc = 0 78 | 79 | [sub_resource type="PlaneShape" id=3] 80 | 81 | plane = Plane( 0, 1, 0, 0 ) 82 | 83 | [sub_resource type="FixedMaterial" id=4] 84 | 85 | flags/visible = true 86 | flags/double_sided = false 87 | flags/invert_faces = false 88 | flags/unshaded = false 89 | flags/on_top = false 90 | flags/lightmap_on_uv2 = true 91 | flags/colarray_is_srgb = true 92 | params/blend_mode = 0 93 | params/depth_draw = 1 94 | params/line_width = 0.0 95 | fixed_flags/use_alpha = false 96 | fixed_flags/use_color_array = false 97 | fixed_flags/use_point_size = false 98 | fixed_flags/discard_alpha = false 99 | fixed_flags/use_xy_normalmap = false 100 | params/diffuse = Color( 0.289062, 0.18242, 0.111786, 1 ) 101 | params/specular = Color( 0, 0, 0, 1 ) 102 | params/emission = Color( 0, 0, 0, 1 ) 103 | params/specular_exp = 40 104 | params/detail_mix = 1.0 105 | params/normal_depth = 1 106 | params/shader = 0 107 | params/shader_param = 0.5 108 | params/glow = 0 109 | params/point_size = 1.0 110 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 111 | textures/diffuse_tc = 0 112 | textures/detail_tc = 0 113 | textures/specular_tc = 0 114 | textures/emission_tc = 0 115 | textures/specular_exp_tc = 0 116 | textures/glow_tc = 0 117 | textures/normal_tc = 0 118 | textures/shade_param_tc = 0 119 | 120 | [sub_resource type="Environment" id=5] 121 | 122 | ambient_light/enabled = true 123 | ambient_light/color = Color( 0.914062, 0.914062, 0.914062, 1 ) 124 | ambient_light/energy = 1.0 125 | fxaa/enabled = false 126 | background/mode = 2 127 | background/color = Color( 0.00418091, 0.0871458, 0.535156, 1 ) 128 | background/energy = 1.0 129 | background/scale = 1.0 130 | background/glow = 0.0 131 | background/canvas_max_layer = null 132 | glow/enabled = false 133 | glow/blur_passes = 1 134 | glow/blur_scale = 1 135 | glow/blur_strength = 1 136 | glow/blur_blend_mode = null 137 | glow/bloom = 0.0 138 | glow/bloom_treshold = 0.5 139 | dof_blur/enabled = false 140 | dof_blur/blur_passes = 1 141 | dof_blur/begin = 100.0 142 | dof_blur/range = 10.0 143 | hdr/enabled = false 144 | hdr/tonemapper = 0 145 | hdr/exposure = 0.4 146 | hdr/white = 1.0 147 | hdr/glow_treshold = 0.95 148 | hdr/glow_scale = 0.2 149 | hdr/min_luminance = 0.4 150 | hdr/max_luminance = 8.0 151 | hdr/exposure_adj_speed = 0.5 152 | fog/enabled = false 153 | fog/begin = 100.0 154 | fog/begin_color = Color( 0, 0, 0, 1 ) 155 | fog/end_color = Color( 0, 0, 0, 1 ) 156 | fog/attenuation = 1.0 157 | fog/bg = true 158 | bcs/enabled = false 159 | bcs/brightness = 1.0 160 | bcs/contrast = 1.0 161 | bcs/saturation = 1.0 162 | srgb/enabled = false 163 | 164 | [sub_resource type="FixedMaterial" id=6] 165 | 166 | flags/visible = true 167 | flags/double_sided = false 168 | flags/invert_faces = false 169 | flags/unshaded = false 170 | flags/on_top = false 171 | flags/lightmap_on_uv2 = true 172 | flags/colarray_is_srgb = true 173 | params/blend_mode = 0 174 | params/depth_draw = 1 175 | params/line_width = 0.0 176 | fixed_flags/use_alpha = false 177 | fixed_flags/use_color_array = false 178 | fixed_flags/use_point_size = false 179 | fixed_flags/discard_alpha = false 180 | fixed_flags/use_xy_normalmap = false 181 | params/diffuse = Color( 1, 0, 0, 1 ) 182 | params/specular = Color( 1, 1, 1, 1 ) 183 | params/emission = Color( 0, 0, 0, 1 ) 184 | params/specular_exp = 40 185 | params/detail_mix = 1.0 186 | params/normal_depth = 1 187 | params/shader = 0 188 | params/shader_param = 0.5 189 | params/glow = 0 190 | params/point_size = 1.0 191 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 192 | textures/diffuse_tc = 0 193 | textures/detail_tc = 0 194 | textures/specular_tc = 0 195 | textures/emission_tc = 0 196 | textures/specular_exp_tc = 0 197 | textures/glow_tc = 0 198 | textures/normal_tc = 0 199 | textures/shade_param_tc = 0 200 | 201 | [node name="world" type="Spatial"] 202 | 203 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 204 | 205 | [node name="npc" parent="." instance=ExtResource( 1 )] 206 | 207 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.27983, 0 ) 208 | max_speed_accel = 1.01 209 | turn_speed_deccel = 1 210 | target = NodePath("../target") 211 | 212 | [node name="TestCube" type="TestCube" parent="npc"] 213 | 214 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 215 | transform/local = Transform( 0.237504, 0, 0, 0, 0.237504, 0, 0, 0, 0.237504, 0, 0.445426, 0 ) 216 | layers = 1 217 | geometry/visible = true 218 | geometry/material_override = SubResource( 1 ) 219 | geometry/cast_shadow = 1 220 | geometry/receive_shadows = true 221 | geometry/range_begin = 0.0 222 | geometry/range_end = 0.0 223 | geometry/extra_cull_margin = 0.0 224 | geometry/billboard = false 225 | geometry/billboard_y = false 226 | geometry/depth_scale = false 227 | geometry/visible_in_all_rooms = false 228 | geometry/use_baked_light = false 229 | geometry/baked_light_tex_id = 0 230 | 231 | [node name="TestCube1" type="TestCube" parent="npc"] 232 | 233 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 234 | transform/local = Transform( 0.039546, 0, 0, 0, 0.039546, 0, 0, 0, 1, 0, 0.445426, -1.21137 ) 235 | layers = 1 236 | geometry/visible = true 237 | geometry/material_override = SubResource( 2 ) 238 | geometry/cast_shadow = 1 239 | geometry/receive_shadows = true 240 | geometry/range_begin = 0.0 241 | geometry/range_end = 0.0 242 | geometry/extra_cull_margin = 0.0 243 | geometry/billboard = false 244 | geometry/billboard_y = false 245 | geometry/depth_scale = false 246 | geometry/visible_in_all_rooms = false 247 | geometry/use_baked_light = false 248 | geometry/baked_light_tex_id = 0 249 | 250 | [node name="StaticBody" type="StaticBody" parent="."] 251 | 252 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 253 | input/ray_pickable = true 254 | input/capture_on_drag = false 255 | shape_count = 2 256 | shapes/0/shape = SubResource( 3 ) 257 | shapes/0/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 258 | shapes/0/trigger = false 259 | shapes/1/shape = SubResource( 3 ) 260 | shapes/1/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.1, 0 ) 261 | shapes/1/trigger = false 262 | collision/layers = 1 263 | collision/mask = 1 264 | friction = 1.0 265 | bounce = 0.0 266 | constant_linear_velocity = Vector3( 0, 0, 0 ) 267 | constant_angular_velocity = Vector3( 0, 0, 0 ) 268 | 269 | [node name="CollisionShape" type="CollisionShape" parent="StaticBody"] 270 | 271 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 272 | shape = SubResource( 3 ) 273 | trigger = false 274 | _update_shape_index = 0 275 | 276 | [node name="CollisionShape1" type="CollisionShape" parent="StaticBody"] 277 | 278 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 279 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.1, 0 ) 280 | shape = SubResource( 3 ) 281 | trigger = false 282 | _update_shape_index = 1 283 | 284 | [node name="Quad" type="Quad" parent="StaticBody"] 285 | 286 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 287 | layers = 1 288 | geometry/visible = true 289 | geometry/material_override = SubResource( 4 ) 290 | geometry/cast_shadow = 1 291 | geometry/receive_shadows = true 292 | geometry/range_begin = 0.0 293 | geometry/range_end = 0.0 294 | geometry/extra_cull_margin = 0.0 295 | geometry/billboard = false 296 | geometry/billboard_y = false 297 | geometry/depth_scale = false 298 | geometry/visible_in_all_rooms = false 299 | geometry/use_baked_light = false 300 | geometry/baked_light_tex_id = 0 301 | quad/axis = 1 302 | quad/size = Vector2( 100, 100 ) 303 | quad/offset = Vector2( 0, 0 ) 304 | quad/centered = true 305 | 306 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."] 307 | 308 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 309 | environment = SubResource( 5 ) 310 | 311 | [node name="Camera" type="Camera" parent="."] 312 | 313 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 314 | transform/local = Transform( 1, 0, 0, 0, 0.844581, 0.535428, 0, -0.535428, 0.844581, 0, 6.94647, 11.2051 ) 315 | projection = 0 316 | fov = 60.0 317 | near = 0.1 318 | far = 100.0 319 | keep_aspect = 1 320 | current = false 321 | visible_layers = 1048575 322 | environment = null 323 | h_offset = 0.0 324 | v_offset = 0.0 325 | 326 | [node name="target" type="TestCube" parent="."] 327 | 328 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 329 | transform/local = Transform( 0.154421, 0, 0, 0, 1, 0, 0, 0, 0.154421, -5.33547, 0.849218, 3.0288 ) 330 | layers = 1 331 | geometry/visible = true 332 | geometry/material_override = SubResource( 6 ) 333 | geometry/cast_shadow = 1 334 | geometry/receive_shadows = true 335 | geometry/range_begin = 0.0 336 | geometry/range_end = 0.0 337 | geometry/extra_cull_margin = 0.0 338 | geometry/billboard = false 339 | geometry/billboard_y = false 340 | geometry/depth_scale = false 341 | geometry/visible_in_all_rooms = false 342 | geometry/use_baked_light = false 343 | geometry/baked_light_tex_id = 0 344 | 345 | 346 | -------------------------------------------------------------------------------- /samples/demo_7/demo_7.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=1] 2 | 3 | [ext_resource path="res://addons/eco.fps.walker/walker_core.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://samples/commons/man/human_walk_0.scn" type="PackedScene" id=2] 5 | [ext_resource path="res://samples/commons/tileset/tileset.tres" type="MeshLibrary" id=3] 6 | 7 | [sub_resource type="Environment" id=1] 8 | 9 | ambient_light/enabled = true 10 | ambient_light/color = Color( 0.914062, 0.914062, 0.914062, 1 ) 11 | ambient_light/energy = 1.0 12 | fxaa/enabled = false 13 | background/mode = 1 14 | background/color = Color( 0, 0, 0, 1 ) 15 | background/energy = 1.0 16 | background/scale = 1.0 17 | background/glow = 0.0 18 | background/canvas_max_layer = null 19 | glow/enabled = false 20 | glow/blur_passes = 1 21 | glow/blur_scale = 1 22 | glow/blur_strength = 1 23 | glow/blur_blend_mode = null 24 | glow/bloom = 0.0 25 | glow/bloom_treshold = 0.5 26 | dof_blur/enabled = false 27 | dof_blur/blur_passes = 1 28 | dof_blur/begin = 100.0 29 | dof_blur/range = 10.0 30 | hdr/enabled = false 31 | hdr/tonemapper = 0 32 | hdr/exposure = 0.4 33 | hdr/white = 1.0 34 | hdr/glow_treshold = 0.95 35 | hdr/glow_scale = 0.2 36 | hdr/min_luminance = 0.4 37 | hdr/max_luminance = 8.0 38 | hdr/exposure_adj_speed = 0.5 39 | fog/enabled = false 40 | fog/begin = 100.0 41 | fog/begin_color = Color( 0, 0, 0, 1 ) 42 | fog/end_color = Color( 0, 0, 0, 1 ) 43 | fog/attenuation = 1.0 44 | fog/bg = true 45 | bcs/enabled = false 46 | bcs/brightness = 1.0 47 | bcs/contrast = 1.0 48 | bcs/saturation = 1.0 49 | srgb/enabled = false 50 | 51 | [sub_resource type="FixedMaterial" id=2] 52 | 53 | flags/visible = true 54 | flags/double_sided = false 55 | flags/invert_faces = false 56 | flags/unshaded = false 57 | flags/on_top = false 58 | flags/lightmap_on_uv2 = true 59 | flags/colarray_is_srgb = true 60 | params/blend_mode = 0 61 | params/depth_draw = 1 62 | params/line_width = 0.0 63 | fixed_flags/use_alpha = false 64 | fixed_flags/use_color_array = false 65 | fixed_flags/use_point_size = false 66 | fixed_flags/discard_alpha = false 67 | fixed_flags/use_xy_normalmap = false 68 | params/diffuse = Color( 0, 0.273438, 1, 1 ) 69 | params/specular = Color( 0, 0, 0, 1 ) 70 | params/emission = Color( 0, 0, 0, 1 ) 71 | params/specular_exp = 40 72 | params/detail_mix = 1.0 73 | params/normal_depth = 1 74 | params/shader = 0 75 | params/shader_param = 0.5 76 | params/glow = 0 77 | params/point_size = 1.0 78 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 79 | textures/diffuse_tc = 0 80 | textures/detail_tc = 0 81 | textures/specular_tc = 0 82 | textures/emission_tc = 0 83 | textures/specular_exp_tc = 0 84 | textures/glow_tc = 0 85 | textures/normal_tc = 0 86 | textures/shade_param_tc = 0 87 | 88 | [sub_resource type="FixedMaterial" id=3] 89 | 90 | flags/visible = true 91 | flags/double_sided = false 92 | flags/invert_faces = false 93 | flags/unshaded = false 94 | flags/on_top = false 95 | flags/lightmap_on_uv2 = true 96 | flags/colarray_is_srgb = true 97 | params/blend_mode = 0 98 | params/depth_draw = 1 99 | params/line_width = 0.0 100 | fixed_flags/use_alpha = false 101 | fixed_flags/use_color_array = false 102 | fixed_flags/use_point_size = false 103 | fixed_flags/discard_alpha = false 104 | fixed_flags/use_xy_normalmap = false 105 | params/diffuse = Color( 1, 0.820312, 0, 1 ) 106 | params/specular = Color( 0, 0, 0, 1 ) 107 | params/emission = Color( 0, 0, 0, 1 ) 108 | params/specular_exp = 40 109 | params/detail_mix = 1.0 110 | params/normal_depth = 1 111 | params/shader = 0 112 | params/shader_param = 0.5 113 | params/glow = 0 114 | params/point_size = 1.0 115 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 116 | textures/diffuse_tc = 0 117 | textures/detail_tc = 0 118 | textures/specular_tc = 0 119 | textures/emission_tc = 0 120 | textures/specular_exp_tc = 0 121 | textures/glow_tc = 0 122 | textures/normal_tc = 0 123 | textures/shade_param_tc = 0 124 | 125 | [sub_resource type="FixedMaterial" id=4] 126 | 127 | flags/visible = true 128 | flags/double_sided = false 129 | flags/invert_faces = false 130 | flags/unshaded = true 131 | flags/on_top = false 132 | flags/lightmap_on_uv2 = true 133 | flags/colarray_is_srgb = true 134 | params/blend_mode = 0 135 | params/depth_draw = 1 136 | params/line_width = 1.0 137 | fixed_flags/use_alpha = false 138 | fixed_flags/use_color_array = false 139 | fixed_flags/use_point_size = false 140 | fixed_flags/discard_alpha = false 141 | fixed_flags/use_xy_normalmap = false 142 | params/diffuse = Color( 1, 1, 1, 1 ) 143 | params/specular = Color( 0, 0, 0, 1 ) 144 | params/emission = Color( 0, 0, 0, 1 ) 145 | params/specular_exp = 40 146 | params/detail_mix = 1.0 147 | params/normal_depth = 1 148 | params/shader = 0 149 | params/shader_param = 0.5 150 | params/glow = 0 151 | params/point_size = 1.0 152 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 153 | textures/diffuse_tc = 0 154 | textures/detail_tc = 0 155 | textures/specular_tc = 0 156 | textures/emission_tc = 0 157 | textures/specular_exp_tc = 0 158 | textures/glow_tc = 0 159 | textures/normal_tc = 0 160 | textures/shade_param_tc = 0 161 | 162 | [node name="world" type="Spatial"] 163 | 164 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 165 | 166 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."] 167 | 168 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 169 | environment = SubResource( 1 ) 170 | 171 | [node name="npc" parent="." instance=ExtResource( 1 )] 172 | 173 | transform/local = Transform( -0.0580618, 0, 0.998313, 0, 1, 0, -0.998313, 0, -0.0580618, 28.3643, 28.0137, -45.4881 ) 174 | body_radius = 0.4 175 | walk_speed = 6.0 176 | dynamic_speed = true 177 | turn_speed_deccel = 3.0 178 | debug_mode = true 179 | debug_path = NodePath("../im") 180 | debug_wpt = NodePath("../wpt") 181 | target = NodePath("../target") 182 | navigation = NodePath("../Navigation") 183 | 184 | [node name="model" parent="npc" instance=ExtResource( 2 )] 185 | 186 | [node name="Camera" type="Camera" parent="npc"] 187 | 188 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 189 | transform/local = Transform( 1, 0, 0, 0, 0.887853, 0.460128, 0, -0.460128, 0.887853, 0, 5.99762, 5.05145 ) 190 | projection = 0 191 | fov = 60.0 192 | near = 0.1 193 | far = 100.0 194 | keep_aspect = 1 195 | current = false 196 | visible_layers = 1048575 197 | environment = null 198 | h_offset = 0.0 199 | v_offset = 0.0 200 | 201 | [node name="target" type="TestCube" parent="."] 202 | 203 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 204 | transform/local = Transform( 0.276706, 0, 0, 0, 0.276706, 0, 0, 0, 0.276706, -31.4777, 34.0002, 26.9416 ) 205 | layers = 1 206 | geometry/visible = true 207 | geometry/material_override = SubResource( 2 ) 208 | geometry/cast_shadow = 1 209 | geometry/receive_shadows = true 210 | geometry/range_begin = 0.0 211 | geometry/range_end = 0.0 212 | geometry/extra_cull_margin = 0.0 213 | geometry/billboard = false 214 | geometry/billboard_y = false 215 | geometry/depth_scale = false 216 | geometry/visible_in_all_rooms = false 217 | geometry/use_baked_light = false 218 | geometry/baked_light_tex_id = 0 219 | 220 | [node name="wpt" type="TestCube" parent="."] 221 | 222 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 223 | transform/local = Transform( 0.133751, 0, 0, 0, 0.133751, 0, 0, 0, 0.133751, 17.3796, 34.0002, 26.9416 ) 224 | layers = 1 225 | geometry/visible = true 226 | geometry/material_override = SubResource( 3 ) 227 | geometry/cast_shadow = 1 228 | geometry/receive_shadows = true 229 | geometry/range_begin = 0.0 230 | geometry/range_end = 0.0 231 | geometry/extra_cull_margin = 0.0 232 | geometry/billboard = false 233 | geometry/billboard_y = false 234 | geometry/depth_scale = false 235 | geometry/visible_in_all_rooms = false 236 | geometry/use_baked_light = false 237 | geometry/baked_light_tex_id = 0 238 | 239 | [node name="Navigation" type="Navigation" parent="."] 240 | 241 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 242 | up_vector = Vector3( 0, 1, 0 ) 243 | 244 | [node name="GridMap" type="GridMap" parent="Navigation"] 245 | 246 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 247 | theme/theme = ExtResource( 3 ) 248 | theme/bake = false 249 | lighting/bake = false 250 | cell/size = 2.0 251 | cell/octant_size = 4 252 | cell/center_x = true 253 | cell/center_y = true 254 | cell/center_z = true 255 | cell/scale = 1.0 256 | data = { "cells":IntArray( 1, 1, 1441801, 65533, 1, 1441801, 65535, 1, 1441801, 1, 3, 1441801, 65533, 3, 1441801, 65535, 3, 1441801, 65535, 5, 1441801, 65535, 7, 1441801, 65535, 9, 1441801, 65535, 11, 1441801, 393201, 11, 9, 393203, 11, 9, 524277, 11, 655363, 589815, 11, 655363, 655353, 11, 655363, 655361, 11, 9, 720891, 11, 655363, 720895, 11, 655369, 786429, 11, 655363, 1048559, 11, 9, 1048561, 11, 9, 1048563, 11, 9, 65535, 13, 9, 196605, 13, 3, 262139, 13, 3, 327673, 13, 3, 393201, 13, 9, 393203, 13, 9, 393207, 13, 3, 458741, 13, 3, 655361, 13, 9, 720895, 13, 655369, 851965, 13, 3, 917499, 13, 3, 983033, 13, 3, 1048559, 13, 9, 1048561, 13, 9, 1048563, 13, 9, 1048567, 13, 3, 1114101, 13, 3, 1048559, 15, 9, 1048561, 15, 9, 1048563, 15, 9, 1, 65509, 9, 3, 65509, 9, 5, 65509, 9, 7, 65509, 9, 9, 65509, 9, 11, 65509, 9, 13, 65509, 9, 15, 65509, 9, 17, 65509, 9, 19, 65509, 9, 21, 65509, 9, 65533, 65509, 9, 65535, 65509, 9, 262157, 65509, 1441801, 393227, 65509, 3, 458761, 65509, 3, 524291, 65509, 9, 524295, 65509, 3, 589829, 65509, 3, 21, 65511, 9, 65533, 65511, 9, 327693, 65511, 1441795, 524291, 65511, 9, 1, 65513, 9, 3, 65513, 9, 5, 65513, 9, 7, 65513, 9, 9, 65513, 9, 11, 65513, 9, 13, 65513, 9, 15, 65513, 9, 17, 65513, 9, 21, 65513, 9, 65533, 65513, 9, 262157, 65513, 1441795, 524291, 65513, 9, 655365, 65513, 655363, 720903, 65513, 655363, 786441, 65513, 655363, 786445, 65513, 655369, 851979, 65513, 655363, 1, 65515, 9, 17, 65515, 9, 21, 65515, 9, 65533, 65515, 9, 196621, 65515, 1441795, 1, 65517, 9, 5, 65517, 9, 7, 65517, 9, 9, 65517, 9, 17, 65517, 9, 21, 65517, 9, 65533, 65517, 9, 131085, 65517, 1441795, 1, 65519, 9, 5, 65519, 9, 9, 65519, 9, 11, 65519, 9, 13, 65519, 9, 17, 65519, 9, 21, 65519, 9, 65533, 65519, 9, 1, 65521, 9, 5, 65521, 9, 17, 65521, 9, 21, 65521, 9, 65533, 65521, 9, 1, 65523, 9, 5, 65523, 9, 7, 65523, 9, 9, 65523, 9, 11, 65523, 9, 13, 65523, 9, 15, 65523, 9, 17, 65523, 9, 21, 65523, 9, 65533, 65523, 9, 1, 65525, 9, 21, 65525, 9, 65533, 65525, 9, 1, 65527, 9, 3, 65527, 9, 5, 65527, 9, 7, 65527, 9, 9, 65527, 9, 11, 65527, 9, 13, 65527, 9, 15, 65527, 9, 17, 65527, 9, 21, 65527, 9, 65533, 65527, 9, 17, 65529, 9, 21, 65529, 9, 65533, 65529, 9, 1, 65531, 9, 3, 65531, 9, 5, 65531, 9, 7, 65531, 9, 9, 65531, 9, 11, 65531, 9, 13, 65531, 9, 15, 65531, 9, 17, 65531, 9, 21, 65531, 9, 65533, 65531, 9, 65535, 65531, 9, 21, 65533, 9, 1, 65535, 1441801, 3, 65535, 9, 5, 65535, 9, 7, 65535, 9, 9, 65535, 9, 11, 65535, 9, 13, 65535, 9, 15, 65535, 9, 17, 65535, 9, 19, 65535, 9, 21, 65535, 9, 65533, 65535, 1441801, 65535, 65535, 1441801 ) } 257 | __meta__ = { "_editor_clip_":0, "_editor_floor_":Vector3( 0, 12, 0 ) } 258 | 259 | [node name="im" type="ImmediateGeometry" parent="."] 260 | 261 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 262 | layers = 1 263 | geometry/visible = true 264 | geometry/material_override = SubResource( 4 ) 265 | geometry/cast_shadow = 1 266 | geometry/receive_shadows = true 267 | geometry/range_begin = 0.0 268 | geometry/range_end = 0.0 269 | geometry/extra_cull_margin = 0.0 270 | geometry/billboard = false 271 | geometry/billboard_y = false 272 | geometry/depth_scale = false 273 | geometry/visible_in_all_rooms = false 274 | geometry/use_baked_light = false 275 | geometry/baked_light_tex_id = 0 276 | 277 | [connection signal="action_changed" from="npc" to="npc/model" method="_on_npc_action_changed"] 278 | 279 | [connection signal="walk_speed_changed" from="npc" to="npc/model" method="_on_npc_walk_speed_changed"] 280 | 281 | 282 | -------------------------------------------------------------------------------- /samples/demo_4/demo_4.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=11 format=1] 2 | 3 | [ext_resource path="res://addons/eco.fps.walker/basic_bot.tscn" type="PackedScene" id=1] 4 | 5 | [sub_resource type="PlaneShape" id=1] 6 | 7 | plane = Plane( 0, 1, 0, 0 ) 8 | 9 | [sub_resource type="FixedMaterial" id=2] 10 | 11 | flags/visible = true 12 | flags/double_sided = false 13 | flags/invert_faces = false 14 | flags/unshaded = false 15 | flags/on_top = false 16 | flags/lightmap_on_uv2 = true 17 | flags/colarray_is_srgb = true 18 | params/blend_mode = 0 19 | params/depth_draw = 1 20 | params/line_width = 0.0 21 | fixed_flags/use_alpha = false 22 | fixed_flags/use_color_array = false 23 | fixed_flags/use_point_size = false 24 | fixed_flags/discard_alpha = false 25 | fixed_flags/use_xy_normalmap = false 26 | params/diffuse = Color( 0.289062, 0.18242, 0.111786, 1 ) 27 | params/specular = Color( 0, 0, 0, 1 ) 28 | params/emission = Color( 0, 0, 0, 1 ) 29 | params/specular_exp = 40 30 | params/detail_mix = 1.0 31 | params/normal_depth = 1 32 | params/shader = 0 33 | params/shader_param = 0.5 34 | params/glow = 0 35 | params/point_size = 1.0 36 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 37 | textures/diffuse_tc = 0 38 | textures/detail_tc = 0 39 | textures/specular_tc = 0 40 | textures/emission_tc = 0 41 | textures/specular_exp_tc = 0 42 | textures/glow_tc = 0 43 | textures/normal_tc = 0 44 | textures/shade_param_tc = 0 45 | 46 | [sub_resource type="Environment" id=3] 47 | 48 | ambient_light/enabled = true 49 | ambient_light/color = Color( 0.914062, 0.914062, 0.914062, 1 ) 50 | ambient_light/energy = 1.0 51 | fxaa/enabled = false 52 | background/mode = 2 53 | background/color = Color( 0.00418091, 0.0871458, 0.535156, 1 ) 54 | background/energy = 1.0 55 | background/scale = 1.0 56 | background/glow = 0.0 57 | background/canvas_max_layer = null 58 | glow/enabled = false 59 | glow/blur_passes = 1 60 | glow/blur_scale = 1 61 | glow/blur_strength = 1 62 | glow/blur_blend_mode = null 63 | glow/bloom = 0.0 64 | glow/bloom_treshold = 0.5 65 | dof_blur/enabled = false 66 | dof_blur/blur_passes = 1 67 | dof_blur/begin = 100.0 68 | dof_blur/range = 10.0 69 | hdr/enabled = false 70 | hdr/tonemapper = 0 71 | hdr/exposure = 0.4 72 | hdr/white = 1.0 73 | hdr/glow_treshold = 0.95 74 | hdr/glow_scale = 0.2 75 | hdr/min_luminance = 0.4 76 | hdr/max_luminance = 8.0 77 | hdr/exposure_adj_speed = 0.5 78 | fog/enabled = false 79 | fog/begin = 100.0 80 | fog/begin_color = Color( 0, 0, 0, 1 ) 81 | fog/end_color = Color( 0, 0, 0, 1 ) 82 | fog/attenuation = 1.0 83 | fog/bg = true 84 | bcs/enabled = false 85 | bcs/brightness = 1.0 86 | bcs/contrast = 1.0 87 | bcs/saturation = 1.0 88 | srgb/enabled = false 89 | 90 | [sub_resource type="GDScript" id=4] 91 | 92 | script/source = "extends \"res://addons/eco.fps.walker/basic_bot.gd\"\n\nfunc attack():\n\tif get_target():\n\t\tget_target().hit()" 93 | 94 | [sub_resource type="FixedMaterial" id=5] 95 | 96 | flags/visible = true 97 | flags/double_sided = false 98 | flags/invert_faces = false 99 | flags/unshaded = false 100 | flags/on_top = false 101 | flags/lightmap_on_uv2 = true 102 | flags/colarray_is_srgb = true 103 | params/blend_mode = 0 104 | params/depth_draw = 1 105 | params/line_width = 4.48416e-44 106 | fixed_flags/use_alpha = false 107 | fixed_flags/use_color_array = false 108 | fixed_flags/use_point_size = false 109 | fixed_flags/discard_alpha = false 110 | fixed_flags/use_xy_normalmap = false 111 | params/diffuse = Color( 0, 0, 0, 1 ) 112 | params/specular = Color( 1, 1, 1, 1 ) 113 | params/emission = Color( 0, 0, 0, 1 ) 114 | params/specular_exp = 40 115 | params/detail_mix = 1.0 116 | params/normal_depth = 1 117 | params/shader = 0 118 | params/shader_param = 0.5 119 | params/glow = 0 120 | params/point_size = 1.0 121 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 122 | textures/diffuse_tc = 0 123 | textures/detail_tc = 0 124 | textures/specular_tc = 0 125 | textures/emission_tc = 0 126 | textures/specular_exp_tc = 0 127 | textures/glow_tc = 0 128 | textures/normal_tc = 0 129 | textures/shade_param_tc = 0 130 | 131 | [sub_resource type="FixedMaterial" id=6] 132 | 133 | flags/visible = true 134 | flags/double_sided = false 135 | flags/invert_faces = false 136 | flags/unshaded = false 137 | flags/on_top = false 138 | flags/lightmap_on_uv2 = true 139 | flags/colarray_is_srgb = true 140 | params/blend_mode = 0 141 | params/depth_draw = 1 142 | params/line_width = 1.96182e-44 143 | fixed_flags/use_alpha = false 144 | fixed_flags/use_color_array = false 145 | fixed_flags/use_point_size = false 146 | fixed_flags/discard_alpha = false 147 | fixed_flags/use_xy_normalmap = false 148 | params/diffuse = Color( 0, 0, 0, 1 ) 149 | params/specular = Color( 1, 1, 1, 1 ) 150 | params/emission = Color( 0, 0, 0, 1 ) 151 | params/specular_exp = 40 152 | params/detail_mix = 1.0 153 | params/normal_depth = 1 154 | params/shader = 0 155 | params/shader_param = 0.5 156 | params/glow = 0 157 | params/point_size = 1.0 158 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 159 | textures/diffuse_tc = 0 160 | textures/detail_tc = 0 161 | textures/specular_tc = 0 162 | textures/emission_tc = 0 163 | textures/specular_exp_tc = 0 164 | textures/glow_tc = 0 165 | textures/normal_tc = 0 166 | textures/shade_param_tc = 0 167 | 168 | [sub_resource type="BoxShape" id=7] 169 | 170 | extents = Vector3( 0.154226, 0.150872, 0.157452 ) 171 | 172 | [sub_resource type="GDScript" id=8] 173 | 174 | script/source = "extends StaticBody\n\nfunc hit():\n\tqueue_free()" 175 | 176 | [sub_resource type="FixedMaterial" id=9] 177 | 178 | flags/visible = true 179 | flags/double_sided = false 180 | flags/invert_faces = false 181 | flags/unshaded = false 182 | flags/on_top = false 183 | flags/lightmap_on_uv2 = true 184 | flags/colarray_is_srgb = true 185 | params/blend_mode = 0 186 | params/depth_draw = 1 187 | params/line_width = 0.0 188 | fixed_flags/use_alpha = false 189 | fixed_flags/use_color_array = false 190 | fixed_flags/use_point_size = false 191 | fixed_flags/discard_alpha = false 192 | fixed_flags/use_xy_normalmap = false 193 | params/diffuse = Color( 1, 0, 0, 1 ) 194 | params/specular = Color( 1, 1, 1, 1 ) 195 | params/emission = Color( 0, 0, 0, 1 ) 196 | params/specular_exp = 40 197 | params/detail_mix = 1.0 198 | params/normal_depth = 1 199 | params/shader = 0 200 | params/shader_param = 0.5 201 | params/glow = 0 202 | params/point_size = 1.0 203 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 204 | textures/diffuse_tc = 0 205 | textures/detail_tc = 0 206 | textures/specular_tc = 0 207 | textures/emission_tc = 0 208 | textures/specular_exp_tc = 0 209 | textures/glow_tc = 0 210 | textures/normal_tc = 0 211 | textures/shade_param_tc = 0 212 | 213 | [node name="world" type="Spatial"] 214 | 215 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 216 | 217 | [node name="StaticBody" type="StaticBody" parent="."] 218 | 219 | editor/display_folded = true 220 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 221 | input/ray_pickable = true 222 | input/capture_on_drag = false 223 | shape_count = 1 224 | shapes/0/shape = SubResource( 1 ) 225 | shapes/0/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 226 | shapes/0/trigger = false 227 | collision/layers = 1 228 | collision/mask = 1 229 | friction = 1.0 230 | bounce = 0.0 231 | constant_linear_velocity = Vector3( 0, 0, 0 ) 232 | constant_angular_velocity = Vector3( 0, 0, 0 ) 233 | 234 | [node name="CollisionShape" type="CollisionShape" parent="StaticBody"] 235 | 236 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 237 | shape = SubResource( 1 ) 238 | trigger = false 239 | _update_shape_index = 0 240 | 241 | [node name="Quad" type="Quad" parent="StaticBody"] 242 | 243 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 244 | layers = 1 245 | geometry/visible = true 246 | geometry/material_override = SubResource( 2 ) 247 | geometry/cast_shadow = 1 248 | geometry/receive_shadows = true 249 | geometry/range_begin = 0.0 250 | geometry/range_end = 0.0 251 | geometry/extra_cull_margin = 0.0 252 | geometry/billboard = false 253 | geometry/billboard_y = false 254 | geometry/depth_scale = false 255 | geometry/visible_in_all_rooms = false 256 | geometry/use_baked_light = false 257 | geometry/baked_light_tex_id = 0 258 | quad/axis = 1 259 | quad/size = Vector2( 100, 100 ) 260 | quad/offset = Vector2( 0, 0 ) 261 | quad/centered = true 262 | 263 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."] 264 | 265 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 266 | environment = SubResource( 3 ) 267 | 268 | [node name="Camera" type="Camera" parent="."] 269 | 270 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 271 | transform/local = Transform( 1, 0, 0, 0, 0.844581, 0.535428, 0, -0.535428, 0.844581, 0, 6.94647, 11.2051 ) 272 | projection = 0 273 | fov = 60.0 274 | near = 0.1 275 | far = 100.0 276 | keep_aspect = 1 277 | current = false 278 | visible_layers = 1048575 279 | environment = null 280 | h_offset = 0.0 281 | v_offset = 0.0 282 | 283 | [node name="npc" parent="." groups=[ "enemy" ] instance=ExtResource( 1 )] 284 | 285 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 9.1525, 0 ) 286 | script/script = SubResource( 4 ) 287 | target = NodePath("../target") 288 | 289 | [node name="TestCube" type="TestCube" parent="npc"] 290 | 291 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 292 | transform/local = Transform( 0.237504, 0, 0, 0, 0.237504, 0, 0, 0, 0.237504, 0, 0.445426, 0 ) 293 | layers = 1 294 | geometry/visible = true 295 | geometry/material_override = SubResource( 5 ) 296 | geometry/cast_shadow = 1 297 | geometry/receive_shadows = true 298 | geometry/range_begin = 0.0 299 | geometry/range_end = 0.0 300 | geometry/extra_cull_margin = 0.0 301 | geometry/billboard = false 302 | geometry/billboard_y = false 303 | geometry/depth_scale = false 304 | geometry/visible_in_all_rooms = false 305 | geometry/use_baked_light = false 306 | geometry/baked_light_tex_id = 0 307 | 308 | [node name="TestCube1" type="TestCube" parent="npc"] 309 | 310 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 311 | transform/local = Transform( 0.039546, 0, 0, 0, 0.039546, 0, 0, 0, 1, 0, 0.445426, -1.21137 ) 312 | layers = 1 313 | geometry/visible = true 314 | geometry/material_override = SubResource( 6 ) 315 | geometry/cast_shadow = 1 316 | geometry/receive_shadows = true 317 | geometry/range_begin = 0.0 318 | geometry/range_end = 0.0 319 | geometry/extra_cull_margin = 0.0 320 | geometry/billboard = false 321 | geometry/billboard_y = false 322 | geometry/depth_scale = false 323 | geometry/visible_in_all_rooms = false 324 | geometry/use_baked_light = false 325 | geometry/baked_light_tex_id = 0 326 | 327 | [node name="target" type="StaticBody" parent="."] 328 | 329 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 330 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.63805, 0.404185, 4.10243 ) 331 | input/ray_pickable = true 332 | input/capture_on_drag = false 333 | shape_count = 1 334 | shapes/0/shape = SubResource( 7 ) 335 | shapes/0/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 336 | shapes/0/trigger = false 337 | collision/layers = 1 338 | collision/mask = 1 339 | friction = 1.0 340 | bounce = 0.0 341 | constant_linear_velocity = Vector3( 0, 0, 0 ) 342 | constant_angular_velocity = Vector3( 0, 0, 0 ) 343 | script/script = SubResource( 8 ) 344 | 345 | [node name="target1" type="TestCube" parent="target"] 346 | 347 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 348 | transform/local = Transform( 0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.15, 0, 0, 0 ) 349 | layers = 1 350 | geometry/visible = true 351 | geometry/material_override = SubResource( 9 ) 352 | geometry/cast_shadow = 1 353 | geometry/receive_shadows = true 354 | geometry/range_begin = 0.0 355 | geometry/range_end = 0.0 356 | geometry/extra_cull_margin = 0.0 357 | geometry/billboard = false 358 | geometry/billboard_y = false 359 | geometry/depth_scale = false 360 | geometry/visible_in_all_rooms = false 361 | geometry/use_baked_light = false 362 | geometry/baked_light_tex_id = 0 363 | 364 | [node name="CollisionShape" type="CollisionShape" parent="target"] 365 | 366 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 367 | shape = SubResource( 7 ) 368 | trigger = false 369 | _update_shape_index = 0 370 | 371 | 372 | -------------------------------------------------------------------------------- /samples/demo_8/demo_8.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=11 format=1] 2 | 3 | [ext_resource path="res://samples/commons/tileset/tileset.tres" type="MeshLibrary" id=1] 4 | [ext_resource path="res://addons/eco.fps.walker/basic_guard.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://samples/commons/man/human_walk_0.scn" type="PackedScene" id=3] 6 | 7 | [sub_resource type="Environment" id=1] 8 | 9 | ambient_light/enabled = true 10 | ambient_light/color = Color( 0.914062, 0.914062, 0.914062, 1 ) 11 | ambient_light/energy = 1.0 12 | fxaa/enabled = false 13 | background/mode = 1 14 | background/color = Color( 0, 0, 0, 1 ) 15 | background/energy = 1.0 16 | background/scale = 1.0 17 | background/glow = 0.0 18 | background/canvas_max_layer = null 19 | glow/enabled = false 20 | glow/blur_passes = 1 21 | glow/blur_scale = 1 22 | glow/blur_strength = 1 23 | glow/blur_blend_mode = null 24 | glow/bloom = 0.0 25 | glow/bloom_treshold = 0.5 26 | dof_blur/enabled = false 27 | dof_blur/blur_passes = 1 28 | dof_blur/begin = 100.0 29 | dof_blur/range = 10.0 30 | hdr/enabled = false 31 | hdr/tonemapper = 0 32 | hdr/exposure = 0.4 33 | hdr/white = 1.0 34 | hdr/glow_treshold = 0.95 35 | hdr/glow_scale = 0.2 36 | hdr/min_luminance = 0.4 37 | hdr/max_luminance = 8.0 38 | hdr/exposure_adj_speed = 0.5 39 | fog/enabled = false 40 | fog/begin = 100.0 41 | fog/begin_color = Color( 0, 0, 0, 1 ) 42 | fog/end_color = Color( 0, 0, 0, 1 ) 43 | fog/attenuation = 1.0 44 | fog/bg = true 45 | bcs/enabled = false 46 | bcs/brightness = 1.0 47 | bcs/contrast = 1.0 48 | bcs/saturation = 1.0 49 | srgb/enabled = false 50 | 51 | [sub_resource type="FixedMaterial" id=2] 52 | 53 | flags/visible = true 54 | flags/double_sided = false 55 | flags/invert_faces = false 56 | flags/unshaded = false 57 | flags/on_top = false 58 | flags/lightmap_on_uv2 = true 59 | flags/colarray_is_srgb = true 60 | params/blend_mode = 0 61 | params/depth_draw = 1 62 | params/line_width = 0.0 63 | fixed_flags/use_alpha = false 64 | fixed_flags/use_color_array = false 65 | fixed_flags/use_point_size = false 66 | fixed_flags/discard_alpha = false 67 | fixed_flags/use_xy_normalmap = false 68 | params/diffuse = Color( 1, 0.820312, 0, 1 ) 69 | params/specular = Color( 0, 0, 0, 1 ) 70 | params/emission = Color( 0, 0, 0, 1 ) 71 | params/specular_exp = 40 72 | params/detail_mix = 1.0 73 | params/normal_depth = 1 74 | params/shader = 0 75 | params/shader_param = 0.5 76 | params/glow = 0 77 | params/point_size = 1.0 78 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 79 | textures/diffuse_tc = 0 80 | textures/detail_tc = 0 81 | textures/specular_tc = 0 82 | textures/emission_tc = 0 83 | textures/specular_exp_tc = 0 84 | textures/glow_tc = 0 85 | textures/normal_tc = 0 86 | textures/shade_param_tc = 0 87 | 88 | [sub_resource type="FixedMaterial" id=3] 89 | 90 | flags/visible = true 91 | flags/double_sided = false 92 | flags/invert_faces = false 93 | flags/unshaded = true 94 | flags/on_top = false 95 | flags/lightmap_on_uv2 = true 96 | flags/colarray_is_srgb = true 97 | params/blend_mode = 0 98 | params/depth_draw = 1 99 | params/line_width = 1.0 100 | fixed_flags/use_alpha = false 101 | fixed_flags/use_color_array = false 102 | fixed_flags/use_point_size = false 103 | fixed_flags/discard_alpha = false 104 | fixed_flags/use_xy_normalmap = false 105 | params/diffuse = Color( 1, 1, 1, 1 ) 106 | params/specular = Color( 0, 0, 0, 1 ) 107 | params/emission = Color( 0, 0, 0, 1 ) 108 | params/specular_exp = 40 109 | params/detail_mix = 1.0 110 | params/normal_depth = 1 111 | params/shader = 0 112 | params/shader_param = 0.5 113 | params/glow = 0 114 | params/point_size = 1.0 115 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 116 | textures/diffuse_tc = 0 117 | textures/detail_tc = 0 118 | textures/specular_tc = 0 119 | textures/emission_tc = 0 120 | textures/specular_exp_tc = 0 121 | textures/glow_tc = 0 122 | textures/normal_tc = 0 123 | textures/shade_param_tc = 0 124 | 125 | [sub_resource type="GDScript" id=4] 126 | 127 | script/source = "extends \"res://addons/eco.fps.walker/basic_guard.gd\"\n\nconst tour=[Vector3(3,4,-1.5),Vector3(-25,4,-1.5),Vector3(-25,4,27),Vector3(3,4,27)]\n\nvar attack_is_finished=false\nvar tour_id=0\n\nfunc _init_fsm_move():\n\tfsm_action.add_link(\"wait\",\"decide\",\"timeout\",[0.2])\n\tfsm_action.add_link(\"move\",\"decide\",\"timeout\",[2])\n\tfsm_action.add_link(\"turn\",\"decide\",\"timeout\",[1])\n\tfsm_action.add_link(\"sleep\",\"decide\",\"timeout\",[3])\n\tfsm_action.add_link(\"decide\",\"move\",\"timeout\",[0.1])\n\tfsm_action.add_link(\"scan\",\"decide\",\"condition\",[self,\"fsm_has_no_target\",false])\n\tfsm_action.add_link(\"scan\",\"sleep\",\"timeout\",[1])\n\nfunc get_waypoint_no_target():\n\tvar tour_point=tour[tour_id]\n\tif tour_point.distance_to(get_global_transform().origin)=2): 322 | current_waypoint=navt.xform(current_path[1]) 323 | 324 | # check if doing U-Turn 325 | 326 | var wpt_dir=current_t.looking_at(current_waypoint,UP).basis.z 327 | var a=cur_dir.dot(wpt_dir) 328 | 329 | if not was_UTurn and cur_dir.dot(wpt_dir)<-0.4: 330 | was_UTurn=true 331 | 332 | current_waypoint=current_t.origin-cur_dir.rotated(UP,PI/16*-sign(current_t.basis.x.dot(wpt_dir)))*6 333 | else: 334 | was_UTurn=false 335 | 336 | if debug_mode and debug_path!=null: 337 | var im_node=get_node(debug_path) 338 | im_node.clear() 339 | im_node.begin(Mesh.PRIMITIVE_POINTS,null) 340 | im_node.add_vertex(begin) 341 | im_node.add_vertex(end) 342 | im_node.end() 343 | im_node.begin(Mesh.PRIMITIVE_LINE_STRIP,null) 344 | for x in current_path: 345 | im_node.add_vertex(x) 346 | im_node.end() 347 | 348 | 349 | waypoint_timeout=WAYPOINT_MAX_TIMEOUT 350 | # reset ground sensors 351 | old_sensor_status_r=false 352 | old_sensor_status_l=false 353 | 354 | func check_ground_sensor(sensor): 355 | if sensor.is_colliding(): 356 | var dot=abs(UP.dot(sensor.get_collision_normal())) 357 | var len=sensor.get_global_transform().origin.distance_to(sensor.get_collision_point()) 358 | return dot < 0.4 or (dot==1 and len>4) 359 | else: 360 | return true 361 | 362 | func _action_state_changed(state_from,state_to,params): 363 | if state_to=="move": 364 | calculate_destination() 365 | 366 | if action_states.has(state_to): 367 | current_action.move=params.move 368 | current_action.follow_target=params.follow 369 | 370 | emit_signal("action_changed",state_to) 371 | 372 | func get_target_offset(target): 373 | return Vector3(0,0,0) 374 | 375 | func fsm_has_no_target(): 376 | return !get_target() 377 | 378 | func fsm_is_near_target(): 379 | if !get_target(): 380 | return false 381 | else: 382 | return get_target().get_global_transform().origin.distance_to(get_global_transform().origin)0):\n\t\t\tmotion=move(motion)\n\t\t\tif (motion.length()<0.001):\n\t\t\t\tbreak\n\t\tattempts-=1\n\nfunc _walk(delta):\n\tif jump_timeout>0:\n\t\tjump_timeout-=delta\n\tvar aim = node_camera.get_global_transform().basis\n\tvar direction = Vector3()\n\tif Input.is_action_pressed(action_forward):\n\t\tdirection -= aim[2]\n\tif Input.is_action_pressed(action_backward):\n\t\tdirection += aim[2]\n\tif Input.is_action_pressed(action_left):\n\t\tdirection -= aim[0]\n\tif Input.is_action_pressed(action_right):\n\t\tdirection += aim[0]\n\tis_running=Input.is_action_pressed(\"ui_run\")\n\tvar crouch_mode=body_position==\"crouch\"\n\tvar is_crouch_pressed=Input.is_action_pressed(\"ui_crouch\")\n\tif is_crouching and (crouch_mode==is_crouch_pressed):\n\t\tstand()\n\telif not is_crouching and (crouch_mode!=is_crouch_pressed):\n\t\tcrouch()\n\tis_moving=(direction.length()>0)\n\tdirection.y=0\n\tdirection = direction.normalized()\n\tvar is_ray_colliding=node_ray.is_colliding()\n\tif !on_floor and jump_timeout<=0 and is_ray_colliding:\n\t\tset_translation(node_ray.get_collision_point())\n\t\ton_floor=true\n\telif on_floor and not is_ray_colliding:\n\t\ton_floor=false\n\tif on_floor:\n\t\tif step_timeout<=0:\n\t\t\tstep_timeout=1\n\t\telse:\n\t\t\tstep_timeout-=velocity.length()*footstep_factor\n\t\tvar n=node_ray.get_collision_normal()\n\t\tvelocity=velocity-velocity.dot(n)*n\n\t\tif is_moving and node_step_ray.is_colliding():\n\t\t\tvar step_normal=node_step_ray.get_collision_normal()\n\t\t\tif (rad2deg(acos(step_normal.dot(Vector3(0,1,0))))< MAX_SLOPE_ANGLE):\n\t\t\t\tvelocity.y=STAIR_JUMP_SPEED\n\t\t\t\tjump_timeout=STAIR_JUMP_TIMEOUT\n\t\tif (rad2deg(acos(n.dot(Vector3(0,1,0))))> MAX_SLOPE_ANGLE):\n\t\t\tvelocity.y+=delta*GRAVITY*GRAVITY_FACTOR\n\telse:\n\t\tvelocity.y+=delta*GRAVITY*GRAVITY_FACTOR\n\tvar target=direction*get_walk_speed(is_crouching,is_running)\n\tvar accel=DEACCEL\n\tif is_moving:\n\t\taccel=ACCEL\n\tvar hvel=velocity\n\thvel.y=0\n\thvel=hvel.linear_interpolate(target,accel*delta)\n\tvelocity.x=hvel.x\n\tvelocity.z=hvel.z\n\tvar motion=velocity*delta\n\tmotion=move(motion)\n\tvar original_vel=velocity\n\tif(motion.length()>0 and is_colliding()):\n\t\tvar n=get_collision_normal()\n\t\tmotion=n.slide(motion)\n\t\tvelocity=n.slide(velocity)\n\t\tif(original_vel.dot(velocity)>0):\n\t\t\tmotion=move(motion)\n\tif on_floor:\n\t\tvar floor_velocity=_get_floor_velocity(node_ray,delta)\n\t\tif floor_velocity.length()!=0:\n\t\t\tmove(floor_velocity*delta)\n\t\tif Input.is_action_pressed(action_jump) and body_position==\"stand\":\n\t\t\tvelocity.y=jump_strength\n\t\t\tjump_timeout=MAX_JUMP_TIMEOUT\n\t\t\ton_floor=false\n\tif is_moving:\n\t\tvar sensor_position=Vector3(direction.z,0,-direction.x)*STAIR_RAYCAST_DISTANCE\n\t\tsensor_position.y=STAIR_RAYCAST_HEIGHT\n\t\tnode_step_ray.set_translation(sensor_position)\n\nfunc _get_floor_velocity(ray,delta):\n\tvar floor_velocity=Vector3()\n\tvar object = ray.get_collider()\n\tif object extends RigidBody or object extends StaticBody:\n\t\tvar floor_angular_vel = Vector3()\n\t\tif object extends RigidBody:\n\t\t\tfloor_velocity = object.get_linear_velocity()\n\t\t\tfloor_angular_vel = object.get_angular_velocity()\n\t\telif object extends StaticBody:\n\t\t\tfloor_velocity = object.get_constant_linear_velocity()\n\t\t\tfloor_angular_vel = object.get_constant_angular_velocity()\n\t\tif(floor_angular_vel.length()>0):\n\t\t\tvar transform = Matrix3(Vector3(1, 0, 0), floor_angular_vel.x)\n\t\t\ttransform = transform.rotated(Vector3(0, 1, 0), floor_angular_vel.y)\n\t\t\ttransform = transform.rotated(Vector3(0, 0, 1), floor_angular_vel.z)\n\t\t\tvar point = ray.get_collision_point() - object.get_translation()\n\t\t\tfloor_velocity += transform.xform_inv(point) - point\n\t\t\tyaw = fmod(yaw + rad2deg(floor_angular_vel.y) * delta, 360)\n\t\t\tnode_yaw.set_rotation(Vector3(0, deg2rad(yaw), 0))\n\treturn floor_velocity\n\nfunc _on_ladders_body_enter( body ):\n\tif body==self:\n\t\tfly_mode=true\n\nfunc _on_ladders_body_exit( body ):\n\tif body==self:\n\t\tfly_mode=false\n\nfunc crouch():\n\tnode_body.get_shape().set_height(0.1)\n\tnode_body.get_shape().set_radius(0.1)\n\tnode_body.set_translation(Vector3(0,0.55,0))\n\tnode_camera.set_translation(Vector3(0,0.4,0))\n\tnode_leg.set_translation(Vector3(0,0,0.1))\n\tis_crouching=true\n\tnode_head_check.set_enable_monitoring(true)\n\t\nfunc stand():\n\tif node_head_check.get_overlapping_bodies().size()>0:\n\t\treturn\n\tnode_body.get_shape().set_height(0.8)\n\tnode_body.get_shape().set_radius(0.6)\n\tnode_body.set_translation(Vector3(0,1.4,0))\n\tnode_camera.set_translation(Vector3(0,1.7,0))\n\tnode_leg.set_translation(Vector3(0,0,1))\n\tis_crouching=false\n\tnode_head_check.set_enable_monitoring(false)\n\nfunc get_walk_speed(is_crouching,is_running):\n\tvar speed=walk_speed\n\tif is_crouching:\n\t\tspeed*=crouch_factor\n\tif is_running:\n\t\tspeed*=run_factor\n\treturn speed\n\nfunc _set_leg_length(value):\n\tleg_length=value\n\tif _is_loaded:\n\t\tnode_leg.get_shape().set_length(value)\n\t\tnode_ray.set_cast_to(Vector3(0,-value*2,0))\n\nfunc _set_body_radius(value):\n\tbody_radius=value\n\tif _is_loaded:\n\t\tnode_body.get_shape().set_radius(value)\n\nfunc _set_body_height(value):\n\tbody_height=value\n\tif _is_loaded:\n\t\tnode_body.get_shape().set_height(value)\n\nfunc _set_camera_height(value):\n\tcamera_height=value\n\tif _is_loaded:\n\t\tnode_camera.set_translation(Vector3(0,value,0))\n\nfunc _set_action_range(value):\n\taction_range=value\n\tif _is_loaded:\n\t\tnode_action_ray.set_cast_to(Vector3(0,0,-value))\n\nfunc _set_active(value):\n\tif value!=active:\n\t\tactive=value\n\t\tif active:\n\t\t\tInput.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)\n\t\telse:\n\t\t\tInput.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)\n\nfunc get_global_origin():\n\treturn node_action_ray.get_global_transform().origin" 11 | 12 | [sub_resource type="RayShape" id=3] 13 | 14 | length = 0.4 15 | 16 | [sub_resource type="SphereShape" id=4] 17 | 18 | radius = 0.1874 19 | 20 | [node name="actor" type="KinematicBody"] 21 | 22 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 23 | input/ray_pickable = true 24 | input/capture_on_drag = false 25 | shape_count = 1 26 | shapes/0/shape = SubResource( 1 ) 27 | shapes/0/transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1.4, 0 ) 28 | shapes/0/trigger = false 29 | collision/layers = 1 30 | collision/mask = 5 31 | collide_with/static = true 32 | collide_with/kinematic = true 33 | collide_with/rigid = true 34 | collide_with/character = true 35 | collision/margin = 0.001 36 | script/script = SubResource( 2 ) 37 | __meta__ = { "__editor_plugin_screen__":"3D" } 38 | active = true 39 | walk_speed = 15 40 | run_factor = 3 41 | crouch_factor = 0.2 42 | leg_length = 0.4 43 | body_radius = 0.6 44 | body_height = 0.8 45 | camera_height = 1.7 46 | action_range = 2 47 | action_forward = "ui_up" 48 | action_backward = "ui_down" 49 | action_left = "ui_left" 50 | action_right = "ui_right" 51 | action_action1 = "ui_action1" 52 | action_jump = "ui_jump" 53 | action_use = "ui_select" 54 | ACCEL = 2 55 | DEACCEL = 4 56 | FLY_SPEED = 100 57 | FLY_ACCEL = 4 58 | GRAVITY = -9.8 59 | MAX_JUMP_TIMEOUT = 0.2 60 | MAX_ATTACK_TIMEOUT = 0.2 61 | MAX_SLOPE_ANGLE = 40 62 | STAIR_RAYCAST_HEIGHT = 0.75 63 | STAIR_RAYCAST_DISTANCE = 0.58 64 | STAIR_JUMP_SPEED = 5 65 | STAIR_JUMP_TIMEOUT = 0.1 66 | footstep_factor = 0.004 67 | view_sensitivity = 0.3 68 | 69 | [node name="eco_body" type="CollisionShape" parent="."] 70 | 71 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 72 | transform/local = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1.4, 0 ) 73 | shape = SubResource( 1 ) 74 | trigger = false 75 | _update_shape_index = 0 76 | 77 | [node name="leg" type="CollisionShape" parent="eco_body"] 78 | 79 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 80 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 ) 81 | shape = SubResource( 3 ) 82 | trigger = false 83 | _update_shape_index = -1 84 | 85 | [node name="eco_yaw" type="Spatial" parent="."] 86 | 87 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 88 | 89 | [node name="camera" type="Camera" parent="eco_yaw"] 90 | 91 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 92 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.7, 0 ) 93 | projection = 0 94 | fov = 60.0 95 | near = 0.1 96 | far = 1000.0 97 | keep_aspect = 1 98 | current = true 99 | visible_layers = 1048575 100 | environment = null 101 | h_offset = 0.0 102 | v_offset = 0.0 103 | 104 | [node name="actionRay" type="RayCast" parent="eco_yaw/camera"] 105 | 106 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 107 | enabled = true 108 | cast_to = Vector3( 0, 0, -2 ) 109 | layer_mask = 1 110 | type_mask = 15 111 | 112 | [node name="eco_ray" type="RayCast" parent="."] 113 | 114 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 115 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.4, 0 ) 116 | enabled = true 117 | cast_to = Vector3( 0, -0.8, 0 ) 118 | layer_mask = 1 119 | type_mask = 15 120 | 121 | [node name="eco_stepRay" type="RayCast" parent="."] 122 | 123 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 124 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.75, -0.58 ) 125 | enabled = true 126 | cast_to = Vector3( 0, -0.5, 0 ) 127 | layer_mask = 1 128 | type_mask = 15 129 | 130 | [node name="head_check_area" type="Area" parent="."] 131 | 132 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 133 | transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.21862, 0 ) 134 | input/ray_pickable = false 135 | input/capture_on_drag = false 136 | shape_count = 1 137 | shapes/0/shape = SubResource( 4 ) 138 | shapes/0/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 139 | shapes/0/trigger = false 140 | space_override = 0 141 | gravity_point = false 142 | gravity_distance_scale = 0.0 143 | gravity_vec = Vector3( 0, -1, 0 ) 144 | gravity = 9.8 145 | linear_damp = 0.1 146 | angular_damp = 1.0 147 | priority = 0.0 148 | monitoring = false 149 | monitorable = false 150 | collision/layers = 1 151 | collision/mask = 1 152 | 153 | [node name="CollisionShape" type="CollisionShape" parent="head_check_area"] 154 | 155 | _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 156 | shape = SubResource( 4 ) 157 | trigger = false 158 | _update_shape_index = 0 159 | 160 | 161 | -------------------------------------------------------------------------------- /samples/demo_9/demo_9.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=11 format=1] 2 | 3 | [ext_resource path="res://samples/commons/tileset/tileset.tres" type="MeshLibrary" id=1] 4 | [ext_resource path="res://addons/eco.fps.walker/basic_guard.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://samples/commons/man/human_walk_0.scn" type="PackedScene" id=3] 6 | [ext_resource path="res://samples/demo_9/light_fps_controller.tscn" type="PackedScene" id=4] 7 | 8 | [sub_resource type="GDScript" id=1] 9 | 10 | script/source = "extends Spatial\n\nfunc _ready():\n\tset_process_input(true)\n\n# code for halting the demo when the user press ESC (ui_cancel)\nfunc _input(event):\n\tif Input.is_action_pressed(\"ui_cancel\"):\n\t\tget_tree().quit()" 11 | 12 | [sub_resource type="Environment" id=2] 13 | 14 | ambient_light/enabled = true 15 | ambient_light/color = Color( 0.914062, 0.914062, 0.914062, 1 ) 16 | ambient_light/energy = 1.0 17 | fxaa/enabled = false 18 | background/mode = 1 19 | background/color = Color( 0, 0, 0, 1 ) 20 | background/energy = 1.0 21 | background/scale = 1.0 22 | background/glow = 0.0 23 | background/canvas_max_layer = null 24 | glow/enabled = false 25 | glow/blur_passes = 1 26 | glow/blur_scale = 1 27 | glow/blur_strength = 1 28 | glow/blur_blend_mode = null 29 | glow/bloom = 0.0 30 | glow/bloom_treshold = 0.5 31 | dof_blur/enabled = false 32 | dof_blur/blur_passes = 1 33 | dof_blur/begin = 100.0 34 | dof_blur/range = 10.0 35 | hdr/enabled = false 36 | hdr/tonemapper = 0 37 | hdr/exposure = 0.4 38 | hdr/white = 1.0 39 | hdr/glow_treshold = 0.95 40 | hdr/glow_scale = 0.2 41 | hdr/min_luminance = 0.4 42 | hdr/max_luminance = 8.0 43 | hdr/exposure_adj_speed = 0.5 44 | fog/enabled = false 45 | fog/begin = 100.0 46 | fog/begin_color = Color( 0, 0, 0, 1 ) 47 | fog/end_color = Color( 0, 0, 0, 1 ) 48 | fog/attenuation = 1.0 49 | fog/bg = true 50 | bcs/enabled = false 51 | bcs/brightness = 1.0 52 | bcs/contrast = 1.0 53 | bcs/saturation = 1.0 54 | srgb/enabled = false 55 | 56 | [sub_resource type="FixedMaterial" id=3] 57 | 58 | flags/visible = true 59 | flags/double_sided = false 60 | flags/invert_faces = false 61 | flags/unshaded = false 62 | flags/on_top = false 63 | flags/lightmap_on_uv2 = true 64 | flags/colarray_is_srgb = true 65 | params/blend_mode = 0 66 | params/depth_draw = 1 67 | params/line_width = 0.0 68 | fixed_flags/use_alpha = false 69 | fixed_flags/use_color_array = false 70 | fixed_flags/use_point_size = false 71 | fixed_flags/discard_alpha = false 72 | fixed_flags/use_xy_normalmap = false 73 | params/diffuse = Color( 1, 0.820312, 0, 1 ) 74 | params/specular = Color( 0, 0, 0, 1 ) 75 | params/emission = Color( 0, 0, 0, 1 ) 76 | params/specular_exp = 40 77 | params/detail_mix = 1.0 78 | params/normal_depth = 1 79 | params/shader = 0 80 | params/shader_param = 0.5 81 | params/glow = 0 82 | params/point_size = 1.0 83 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 84 | textures/diffuse_tc = 0 85 | textures/detail_tc = 0 86 | textures/specular_tc = 0 87 | textures/emission_tc = 0 88 | textures/specular_exp_tc = 0 89 | textures/glow_tc = 0 90 | textures/normal_tc = 0 91 | textures/shade_param_tc = 0 92 | 93 | [sub_resource type="FixedMaterial" id=4] 94 | 95 | flags/visible = true 96 | flags/double_sided = false 97 | flags/invert_faces = false 98 | flags/unshaded = true 99 | flags/on_top = false 100 | flags/lightmap_on_uv2 = true 101 | flags/colarray_is_srgb = true 102 | params/blend_mode = 0 103 | params/depth_draw = 1 104 | params/line_width = 1.0 105 | fixed_flags/use_alpha = false 106 | fixed_flags/use_color_array = false 107 | fixed_flags/use_point_size = false 108 | fixed_flags/discard_alpha = false 109 | fixed_flags/use_xy_normalmap = false 110 | params/diffuse = Color( 1, 1, 1, 1 ) 111 | params/specular = Color( 0, 0, 0, 1 ) 112 | params/emission = Color( 0, 0, 0, 1 ) 113 | params/specular_exp = 40 114 | params/detail_mix = 1.0 115 | params/normal_depth = 1 116 | params/shader = 0 117 | params/shader_param = 0.5 118 | params/glow = 0 119 | params/point_size = 1.0 120 | uv_xform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) 121 | textures/diffuse_tc = 0 122 | textures/detail_tc = 0 123 | textures/specular_tc = 0 124 | textures/emission_tc = 0 125 | textures/specular_exp_tc = 0 126 | textures/glow_tc = 0 127 | textures/normal_tc = 0 128 | textures/shade_param_tc = 0 129 | 130 | [sub_resource type="GDScript" id=5] 131 | 132 | script/source = "extends \"res://addons/eco.fps.walker/basic_guard.gd\"\n\nconst tour=[Vector3(1,4,-7),Vector3(1,4,21),Vector3(29,4,21),Vector3(29,4,-7)]\n\nvar attack_is_finished=false\nvar tour_id=0\n\nfunc _init_fsm_move():\n\tfsm_action.add_link(\"wait\",\"decide\",\"timeout\",[0.2])\n\tfsm_action.add_link(\"move\",\"decide\",\"timeout\",[2])\n\tfsm_action.add_link(\"turn\",\"decide\",\"timeout\",[1])\n\tfsm_action.add_link(\"sleep\",\"decide\",\"timeout\",[3])\n\tfsm_action.add_link(\"decide\",\"move\",\"timeout\",[0.1])\n\tfsm_action.add_link(\"scan\",\"decide\",\"condition\",[self,\"fsm_has_no_target\",false])\n\tfsm_action.add_link(\"scan\",\"sleep\",\"timeout\",[1])\n\nfunc get_waypoint_no_target():\n\tvar tour_point=tour[tour_id]\n\tif tour_point.distance_to(get_global_transform().origin)