├── .github └── workflows │ └── required.yml ├── .gitignore ├── .import ├── icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.stex ├── icon.png-487276ed1e3a0c39cad0279d744ee560.md5 └── icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.stex ├── Autoload └── Autoload.gd ├── AutomaticBugs ├── BasicData.gd ├── FunctionExecutor.gd ├── FunctionExecutor.tscn ├── ParseArgumentType.gd └── ValueCreator.gd ├── CreatingAllThings ├── CreatingAllThings.gd └── CreatingAllThings.tscn ├── Environment.tres ├── LICENSE ├── Nodes ├── Nodes.gd └── Nodes.tscn ├── Physics ├── 2D │ ├── Area2D.gd │ ├── Area2D.tscn │ ├── KinematicBody2D.gd │ ├── KinematicBody2D.tscn │ ├── Physics2D.gd │ ├── Physics2D.tscn │ ├── RigidBody2D.gd │ ├── RigidBody2D.tscn │ ├── StaticBody2D.gd │ └── StaticBody2D.tscn └── 3D │ ├── Physics3D.tscn │ ├── RigidBody3D.gd │ ├── RigidBody3D.tscn │ └── StaticArena.gd ├── README.md ├── ReparentingDeleting ├── ReparentingDeleting.gd └── ReparentingDeleting.tscn ├── Start.gd ├── Start.tscn ├── export_presets.cfg ├── icon.png ├── icon.png.import ├── misc ├── check_ci_log.py └── ci │ └── sources.list └── project.godot /.github/workflows/required.yml: -------------------------------------------------------------------------------- 1 | name: 🐧 Required Build 2 | on: 3 | push: 4 | pull_request: 5 | schedule: 6 | - cron: '0 0 * * *' 7 | 8 | jobs: 9 | linux-sanitizer: 10 | runs-on: "ubuntu-20.04" 11 | name: Editor and exported project with sanitizers (target=debug/release, tools=yes/no, debug_symbols=yes, use_ubsan=yes, use_asan=yes) 12 | 13 | steps: 14 | - uses: actions/checkout@v3 15 | 16 | # Azure repositories are not reliable, we need to prevent azure giving us packages. 17 | - name: Make apt sources.list use the default Ubuntu repositories 18 | run: | 19 | sudo rm -f /etc/apt/sources.list.d/* 20 | sudo cp -f misc/ci/sources.list /etc/apt/sources.list 21 | sudo apt-get update 22 | 23 | # Install all packages (except scons) 24 | - name: Configure dependencies 25 | run: | 26 | sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \ 27 | libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm \ 28 | xvfb wget2 unzip python scons git 29 | 30 | - name: Download Godot(GIT) 31 | run: | 32 | git clone https://github.com/godotengine/godot.git 33 | cd godot 34 | git checkout 3.x 35 | cd ../ 36 | 37 | - name: Compile Godot 38 | run: | 39 | cd godot 40 | scons -j2 use_asan=yes use_ubsan=yes linker=gold 41 | cp bin/godot.x11.tools.64s ../ 42 | cd ../ 43 | rm -rf godot 44 | 45 | - name: Open and close editor 46 | run: | 47 | DRI_PRIME=0 xvfb-run ./godot.x11.tools.64s --audio-driver Dummy -e -q --path $(pwd) 2>&1 | tee sanitizers_log.txt || true 48 | misc/check_ci_log.py sanitizers_log.txt 49 | 50 | - name: Test project 51 | run: | 52 | DRI_PRIME=0 xvfb-run ./godot.x11.tools.64s 180 --audio-driver Dummy --video-driver GLES3 --path $(pwd) 2>&1 | tee sanitizers_log.txt || true 53 | misc/check_ci_log.py sanitizers_log.txt 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *~ 3 | #.import/ 4 | logs/ 5 | .~lock.*# 6 | .mono/ 7 | *.zip 8 | TEMP/ 9 | #export_presets.cfg 10 | logs/ 11 | .godot/ 12 | .godot/imported/ 13 | .godot/editor 14 | shader_cache/ 15 | .import/ 16 | -------------------------------------------------------------------------------- /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godotengine/regression-test-project/75f80398d7680ef39e9e9d89c2d5ec328cfda8aa/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.stex -------------------------------------------------------------------------------- /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5: -------------------------------------------------------------------------------- 1 | source_md5="d98fe5b307b619f42f0bd920ee4f170d" 2 | dest_md5="d07f6dc66eca2ede4e35cb8bd212f64f" 3 | 4 | -------------------------------------------------------------------------------- /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godotengine/regression-test-project/75f80398d7680ef39e9e9d89c2d5ec328cfda8aa/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.stex -------------------------------------------------------------------------------- /Autoload/Autoload.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | const screen_size = Vector2(1024, 600) 4 | 5 | var start_time: int 6 | var last_time: int 7 | 8 | const PRINT_TIME_EVERY_MILISECONDS: int = 5000 9 | var time_to_print_next_time: int = PRINT_TIME_EVERY_MILISECONDS 10 | 11 | var time_to_show: int = 25 * 1000 # How long test works in miliseconds 12 | 13 | var time_for_each_step: int = -1 14 | 15 | var can_be_closed: bool = true 16 | 17 | # Each scene runs alone 18 | const alone_steps: Array = [ 19 | "res://CreatingAllThings/CreatingAllThings.tscn", 20 | "res://Nodes/Nodes.tscn", 21 | "res://Physics/2D/Physics2D.tscn", 22 | "res://Physics/3D/Physics3D.tscn", 23 | # "res://ReparentingDeleting/ReparentingDeleting.tscn", Not always reproducible 24 | "res://AutomaticBugs/FunctionExecutor.tscn", # Only need to run once 25 | ] 26 | 27 | var time_object: Object 28 | 29 | 30 | func _init(): 31 | # Workaround for Time/OS breaking change - https://github.com/godotengine/godot/pull/54056 32 | if ClassDB.class_exists("_Time"): 33 | time_object = ClassDB.instance("_Time") 34 | elif ClassDB.class_exists("Time"): 35 | time_object = ClassDB.instance("Time") 36 | else: 37 | time_object = ClassDB.instance("_OS") 38 | 39 | start_time = time_object.get_ticks_msec() 40 | 41 | # In case when user doesn't provide time 42 | time_for_each_step = time_to_show / (alone_steps.size()) 43 | 44 | for argument in OS.get_cmdline_args(): 45 | if argument.is_valid_float(): # Ignore all non numeric arguments 46 | time_to_show = int(argument.to_float() * 1000) 47 | time_for_each_step = time_to_show / (alone_steps.size()) 48 | print("Time set to: " + str(time_to_show / 1000.0) + " seconds with " + str(alone_steps.size()) + " steps, each step will take " + str(time_for_each_step / 1000.0) + " seconds.") 49 | break # We only need to take first numeric argument 50 | 51 | 52 | func _process(delta: float) -> void: 53 | var current_run_time: int = time_object.get_ticks_msec() - start_time 54 | 55 | # While loop instead simple if, because will allow to properly flush results under heavy operations(e.g. Thread sanitizer) 56 | while current_run_time > time_to_print_next_time: 57 | print("Test is running now " + str(int(time_to_print_next_time / 1000)) + " seconds") 58 | time_to_print_next_time += PRINT_TIME_EVERY_MILISECONDS 59 | 60 | if current_run_time > time_to_show && can_be_closed: 61 | print("######################## Ending test ########################") 62 | get_tree().quit() 63 | 64 | 65 | func _exit_tree() -> void: 66 | time_object.free() 67 | -------------------------------------------------------------------------------- /AutomaticBugs/BasicData.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | ### Contains info about disabled classes and allows to take info about allowed methods 4 | 5 | # Globablly disabled functions for all classes 6 | var function_exceptions: Array = [ 7 | # They exists without assigment like Class.method, because they may be a parent of other objects and children also should have disabled child.method, its children also etc. which is too much to do 8 | "get_packet", # TODO 9 | "_gui_input", # TODO probably missing cherrypick #GH 47636 10 | "_input", 11 | "_unhandled_input", 12 | "_unhandled_key_input", 13 | "connect_to_signal", # Should be chrrypicked 14 | "_editor_settings_changed", # GH 45979 15 | "generate", #GH 46001 16 | "_proximity_group_broadcast", #GH 46002 17 | "_direct_state_changed", #GH 46003 18 | "create_from", #GH 46004 19 | "create_from_blend_shape", #GH 46004 20 | "append_from", #GH 46004 21 | "_set_tile_data", #GH 46015 22 | "get", #GH 46019 23 | "instance_has", #GH 46020 24 | "get_var", #GH 46096 25 | "set_script", #GH 46120 26 | "getvar", #GH 46019 27 | "get_available_chars", #GH 46118 28 | "open_midi_inputs", #GH 46183 29 | "open_inputs", #GH 86713 30 | "set_icon", #GH 46189 31 | "get_latin_keyboard_variant", #GH TODO Memory Leak 32 | "set_editor_hint", #GH 46252 33 | "get_item_at_position", #TODO hard to find 34 | "set_probe_data", #GH 46570 35 | "_range_click_timeout", #GH 46648 36 | "get_indexed", #GH 46019 37 | "add_vertex", #GH 47066 38 | "create_client", # TODO, strange memory leak 39 | "create_shape_owner", #47135 40 | "shape_owner_get_owner", #47135 41 | "get_bind_bone", #GH 47358 42 | "get_bind_name", #GH 47358 43 | "get_bind_pose", #GH 47358 44 | # Not worth using 45 | "propagate_notification", 46 | "notification", 47 | # TODO Adds big spam when i>100 - look for possiblity to 48 | "add_sphere", 49 | "_update_inputs", # Cause big spam with add_input 50 | # Spam when i~1000 - change to specific 51 | "update_bitmask_region", 52 | "set_enabled_inputs", 53 | # Slow Function 54 | "_update_sky", 55 | # Undo/Redo function which doesn't provide enough information about types of objects, probably due vararg(variable size argument) 56 | "add_do_method", 57 | "add_undo_method", 58 | # Do not save files and create files and folders 59 | "pck_start", 60 | "save", 61 | "save_png", 62 | "save_to_wav", 63 | "save_to_file", 64 | "make_dir", 65 | "make_dir_recursive", 66 | "save_encrypted", 67 | "save_encrypted_pass", 68 | "save_exr", 69 | "dump_resources_to_file", 70 | "dump_memory_to_file", 71 | # This also allow to save files 72 | "open", 73 | "open_encrypted", 74 | "open_encrypted_with_pass", 75 | "open_compressed", 76 | # Do not warp mouse 77 | "warp_mouse", 78 | "warp_mouse_position", 79 | # OS 80 | "kill", 81 | "shell_open", 82 | "execute", 83 | "delay_usec", 84 | "delay_msec", 85 | "alert", # Stupid alert window opens 86 | # Godot Freeze 87 | "wait_to_finish", 88 | "accept_stream", 89 | "connect_to_stream", 90 | "discover", 91 | "wait", 92 | "debug_bake", 93 | "bake", 94 | "_create", # TODO Check 95 | "set_gizmo", # Stupid function, needs as parameter an object which can't be instanced # TODO, create issue to hide it 96 | # Spams Output 97 | "print_tree", 98 | "print_stray_nodes", 99 | "print_tree_pretty", 100 | "print_all_textures_by_size", 101 | "print_all_resources", 102 | "print_resources_in_use", 103 | # Do not call other functions 104 | "_call_function", 105 | "call", 106 | "call_deferred", 107 | "callv", 108 | # Looks like a bug in FuncRef, probably but not needed, because it call other functions 109 | "call_func", 110 | # Too dangerous, because add, mix and remove randomly nodes and objects 111 | "replace_by", 112 | "create_instance", 113 | "set_owner", 114 | "set_root_node", 115 | "instance", 116 | "init_ref", 117 | "reference", 118 | "unreference", 119 | "new", 120 | "duplicate", 121 | "queue_free", 122 | "free", 123 | "remove_and_skip", 124 | "remove_child", 125 | "move_child", 126 | "raise", 127 | "add_child", 128 | "add_child_below_node", 129 | "add_sibling", 130 | # Convert GLTF data to nodes, these are expected to allocate memory. 131 | "to_node", 132 | "to_node_0d", 133 | "to_node_3d", 134 | ] 135 | 136 | # Globally disabled classes which causes bugs or are very hard to use properly 137 | var disabled_classes: Array = [ 138 | "ProjectSettings", # Don't mess with project settings, because they can broke entire your workflow 139 | "EditorSettings", # Also don't mess with editor settings 140 | "_OS", # This may sometimes crash compositor, but it should be tested manually sometimes 141 | "GDScript", # Broke scripts 142 | # This classes have problems with static/non static methods 143 | "PhysicsDirectSpaceState", 144 | "Physics2DDirectSpaceState", 145 | "PhysicsDirectBodyState", 146 | "Physics2DDirectBodyState", 147 | "BulletPhysicsDirectSpaceState", 148 | "InputDefault", 149 | "IP_Unix", 150 | "JNISingleton", 151 | 152 | # Backported Navigation changes also backport bugged classes 153 | "NavigationAgent2D", 154 | "NavigationAgent", 155 | 156 | # Only one class - JavaClass returns Null when using JavaClass.new().get_class() 157 | "JavaClass", 158 | # Just don't use these because they are not normal things 159 | "_Thread", 160 | "_Semaphore", 161 | "_Mutex", 162 | ] 163 | 164 | 165 | # Checks if function can be executed 166 | # Looks at its arguments and checks if are recognized and supported 167 | func check_if_is_allowed(method_data: Dictionary) -> bool: 168 | # Function is virtual or vararg, so we just skip it 169 | if method_data["flags"] == method_data["flags"] | METHOD_FLAG_VIRTUAL: 170 | return false 171 | if method_data["flags"] == method_data["flags"] | 128: # VARARG TODO, Godot issue, add missing flag binding 172 | return false 173 | 174 | for arg in method_data["args"]: 175 | var name_of_class: String = arg["class_name"] 176 | if name_of_class.empty(): 177 | continue 178 | if name_of_class in disabled_classes: 179 | return false 180 | 181 | if !ClassDB.class_exists(name_of_class): 182 | return false 183 | 184 | if !ClassDB.is_parent_class(name_of_class, "Node") && !ClassDB.is_parent_class(name_of_class, "Reference"): 185 | return false 186 | 187 | if name_of_class.find("Editor") != -1 || name_of_class.find("SkinReference") != -1: 188 | return false 189 | 190 | # In case of adding new type, this prevents from crashing due not recognizing this type 191 | # In case of removing/rename type, just comment e.g. TYPE_ARRAY and all occurencies on e.g. switch statement with it 192 | var t: int = arg["type"] 193 | if !( 194 | t == TYPE_NIL 195 | || t == TYPE_AABB 196 | || t == TYPE_ARRAY 197 | || t == TYPE_BASIS 198 | || t == TYPE_BOOL 199 | || t == TYPE_COLOR 200 | || t == TYPE_COLOR_ARRAY 201 | || t == TYPE_DICTIONARY 202 | || t == TYPE_INT 203 | || t == TYPE_INT_ARRAY 204 | || t == TYPE_NODE_PATH 205 | || t == TYPE_OBJECT 206 | || t == TYPE_PLANE 207 | || t == TYPE_QUAT 208 | || t == TYPE_RAW_ARRAY 209 | || t == TYPE_REAL 210 | || t == TYPE_REAL_ARRAY 211 | || t == TYPE_RECT2 212 | || t == TYPE_RID 213 | || t == TYPE_STRING 214 | || t == TYPE_TRANSFORM 215 | || t == TYPE_TRANSFORM2D 216 | || t == TYPE_VECTOR2 217 | || t == TYPE_VECTOR2_ARRAY 218 | || t == TYPE_VECTOR3 219 | || t == TYPE_VECTOR3_ARRAY 220 | ): 221 | print("----------------------------------------------------------- TODO - MISSING TYPE, ADD SUPPORT IT") # Add assert here to get info which type is missing 222 | return false 223 | 224 | return true 225 | 226 | 227 | # Removes disabled methods from classes 228 | func remove_disabled_methods(method_list: Array, exceptions: Array) -> void: 229 | for exception in exceptions: 230 | var index: int = -1 231 | for method_index in range(method_list.size()): 232 | if method_list[method_index]["name"] == exception: 233 | index = method_index 234 | break 235 | if index != -1: 236 | method_list.remove(index) 237 | 238 | 239 | # Return all available classes which can be used 240 | func get_list_of_available_classes(must_be_instantable: bool = true) -> Array: 241 | var full_class_list: Array = Array(ClassDB.get_class_list()) 242 | var classes: Array = [] 243 | full_class_list.sort() 244 | var c = 0 245 | for name_of_class in full_class_list: 246 | if name_of_class in disabled_classes: 247 | continue 248 | 249 | #This is only for RegressionTestProject, because it needs for now clear visual info what is going on screen, but some nodes broke view 250 | if !ClassDB.is_parent_class(name_of_class, "Node") && !ClassDB.is_parent_class(name_of_class, "Reference"): 251 | continue 252 | # Don't test Servers objects like TranslationServer 253 | if name_of_class.find("Server") != -1: 254 | continue 255 | # Don't test Editor nodes 256 | if name_of_class.find("Editor") != -1: 257 | continue 258 | 259 | if !must_be_instantable || ClassDB.can_instance(name_of_class): 260 | classes.push_back(name_of_class) 261 | c += 1 262 | 263 | print(str(c) + " choosen classes from all " + str(full_class_list.size()) + " classes.") 264 | return classes 265 | -------------------------------------------------------------------------------- /AutomaticBugs/FunctionExecutor.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | ### Script: 4 | ### - takes all available classes 5 | ### - checks if method is allowed 6 | ### - checks each argument if is allowed(in case e.g. adding new, to prevent crashes due not recognizing types) 7 | ### - print info if needed to console 8 | ### - execute function with parameters 9 | ### - removes all objects/nodes to prevent memory leak 10 | 11 | var debug_print: bool = true 12 | var add_to_tree: bool = false # Adds nodes to tree, freeze godot when removing a lot of nodes 13 | var use_parent_methods: bool = false # Allows Node2D use Node methods etc. - it is a little slow option which rarely shows 14 | var use_always_new_object: bool = true # Don't allow to "remeber" other function effects 15 | var exiting: bool = false 16 | 17 | 18 | func _ready() -> void: 19 | ValueCreator.number = 100 20 | 21 | tests_all_functions() 22 | 23 | 24 | # Test all functions 25 | func tests_all_functions() -> void: 26 | for name_of_class in BasicData.get_list_of_available_classes(): 27 | if debug_print: 28 | print("\n#################### " + name_of_class + " ####################") 29 | 30 | var object: Object = ClassDB.instance(name_of_class) 31 | assert(object != null, "Object must be instantable") 32 | if add_to_tree: 33 | if object is Node: 34 | add_child(object) 35 | var method_list: Array = ClassDB.class_get_method_list(name_of_class, !use_parent_methods) 36 | 37 | # Removes excluded methods 38 | BasicData.remove_disabled_methods(method_list, BasicData.function_exceptions) 39 | 40 | for method_data in method_list: 41 | if !BasicData.check_if_is_allowed(method_data): 42 | continue 43 | 44 | var arguments: Array = ParseArgumentType.parse_and_return_objects(method_data, name_of_class, debug_print) 45 | 46 | if debug_print: 47 | var to_print: String = "GDSCRIPT CODE: " 48 | if ( 49 | ClassDB.is_parent_class(name_of_class, "Object") 50 | && !ClassDB.is_parent_class(name_of_class, "Node") 51 | && !ClassDB.is_parent_class(name_of_class, "Reference") 52 | && !ClassDB.class_has_method(name_of_class, "new") 53 | ): 54 | to_print += 'ClassDB.instance("' + name_of_class + '").' + method_data["name"] + "(" 55 | else: 56 | to_print += name_of_class.trim_prefix("_") + ".new()." + method_data["name"] + "(" 57 | 58 | for i in arguments.size(): 59 | to_print += ParseArgumentType.return_gdscript_code_which_run_this_object(arguments[i]) 60 | if i != arguments.size() - 1: 61 | to_print += ", " 62 | to_print += ")" 63 | print(to_print) 64 | 65 | object.callv(method_data["name"], arguments) 66 | 67 | for argument in arguments: 68 | if argument is Node: 69 | argument.queue_free() 70 | elif argument is Object && !(argument is Reference): 71 | argument.free() 72 | 73 | if use_always_new_object: 74 | if object is Node: 75 | object.queue_free() 76 | elif object is Object && !(object is Reference): 77 | object.free() 78 | 79 | object = ClassDB.instance(name_of_class) 80 | if add_to_tree: 81 | if object is Node: 82 | add_child(object) 83 | 84 | if object is Node: 85 | object.queue_free() 86 | elif object is Object && !(object is Reference): 87 | object.free() 88 | -------------------------------------------------------------------------------- /AutomaticBugs/FunctionExecutor.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://AutomaticBugs/FunctionExecutor.gd" type="Script" id=1] 4 | 5 | [node name="FunctionExecutor" type="Node"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /AutomaticBugs/ParseArgumentType.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | 4 | func parse_and_return_objects(method_data: Dictionary, name_of_class: String, debug_print: bool = false) -> Array: 5 | var arguments_array: Array = [] 6 | 7 | for argument in method_data["args"]: 8 | match argument.type: 9 | TYPE_NIL: # Looks that this means VARIANT not null 10 | arguments_array.push_back(false) 11 | TYPE_AABB: 12 | arguments_array.push_back(ValueCreator.get_aabb()) 13 | TYPE_ARRAY: 14 | arguments_array.push_back(ValueCreator.get_array()) 15 | TYPE_BASIS: 16 | arguments_array.push_back(ValueCreator.get_basis()) 17 | TYPE_BOOL: 18 | arguments_array.push_back(ValueCreator.get_bool()) 19 | TYPE_COLOR: 20 | arguments_array.push_back(ValueCreator.get_color()) 21 | TYPE_COLOR_ARRAY: 22 | arguments_array.push_back(ValueCreator.get_pool_color_array()) 23 | TYPE_DICTIONARY: 24 | arguments_array.push_back(ValueCreator.get_dictionary()) 25 | TYPE_INT: 26 | arguments_array.push_back(ValueCreator.get_int()) 27 | TYPE_INT_ARRAY: 28 | arguments_array.push_back(ValueCreator.get_pool_int_array()) 29 | TYPE_NODE_PATH: 30 | arguments_array.push_back(ValueCreator.get_nodepath()) 31 | TYPE_OBJECT: 32 | var obj: Object = ValueCreator.get_object(argument["class_name"]) 33 | arguments_array.push_back(obj) 34 | assert(obj != null, "Failed to create an object of type " + argument["class_name"]) 35 | TYPE_PLANE: 36 | arguments_array.push_back(ValueCreator.get_plane()) 37 | TYPE_QUAT: 38 | arguments_array.push_back(ValueCreator.get_quat()) 39 | TYPE_RAW_ARRAY: 40 | arguments_array.push_back(ValueCreator.get_pool_byte_array()) 41 | TYPE_REAL: 42 | arguments_array.push_back(ValueCreator.get_float()) 43 | TYPE_REAL_ARRAY: 44 | arguments_array.push_back(ValueCreator.get_pool_real_array()) 45 | TYPE_RECT2: 46 | arguments_array.push_back(ValueCreator.get_rect2()) 47 | TYPE_RID: 48 | arguments_array.push_back(RID()) 49 | TYPE_STRING: 50 | arguments_array.push_back(ValueCreator.get_string()) 51 | TYPE_STRING_ARRAY: 52 | arguments_array.push_back(ValueCreator.get_pool_string_array()) 53 | TYPE_TRANSFORM: 54 | arguments_array.push_back(ValueCreator.get_transform()) 55 | TYPE_TRANSFORM2D: 56 | arguments_array.push_back(ValueCreator.get_transform2D()) 57 | TYPE_VECTOR2: 58 | arguments_array.push_back(ValueCreator.get_vector2()) 59 | TYPE_VECTOR2_ARRAY: 60 | arguments_array.push_back(ValueCreator.get_pool_vector2_array()) 61 | TYPE_VECTOR3: 62 | arguments_array.push_back(ValueCreator.get_vector3()) 63 | TYPE_VECTOR3_ARRAY: 64 | arguments_array.push_back(ValueCreator.get_pool_vector3_array()) 65 | _: 66 | assert(false, "Missing type, needs to be added to project") 67 | 68 | if debug_print: 69 | print("\n" + name_of_class + "." + method_data["name"] + " --- executing with " + str(arguments_array.size()) + " parameters " + str(arguments_array)) 70 | return arguments_array 71 | 72 | 73 | func return_gdscript_code_which_run_this_object(data) -> String: 74 | if data == null: 75 | return "null" 76 | 77 | var return_string: String = "" 78 | 79 | match typeof(data): 80 | TYPE_NIL: # Looks that this means VARIANT not null 81 | assert("false", "This is even possible?") 82 | TYPE_AABB: 83 | return_string = "AABB(" 84 | return_string += return_gdscript_code_which_run_this_object(data.position) 85 | return_string += ", " 86 | return_string += return_gdscript_code_which_run_this_object(data.size) 87 | return_string += ")" 88 | TYPE_ARRAY: 89 | return_string = "Array([" 90 | for i in data.size(): 91 | return_string += return_gdscript_code_which_run_this_object(data[i]) 92 | if i != data.size() - 1: 93 | return_string += ", " 94 | return_string += "])" 95 | TYPE_BASIS: 96 | return_string = "Basis(" 97 | return_string += return_gdscript_code_which_run_this_object(data.x) 98 | return_string += ", " 99 | return_string += return_gdscript_code_which_run_this_object(data.y) 100 | return_string += ", " 101 | return_string += return_gdscript_code_which_run_this_object(data.z) 102 | return_string += ")" 103 | TYPE_BOOL: 104 | if data == true: 105 | return_string = "true" 106 | else: 107 | return_string = "false" 108 | TYPE_COLOR: 109 | return_string = "Color(" 110 | return_string += return_gdscript_code_which_run_this_object(data.r) 111 | return_string += ", " 112 | return_string += return_gdscript_code_which_run_this_object(data.g) 113 | return_string += ", " 114 | return_string += return_gdscript_code_which_run_this_object(data.b) 115 | return_string += ", " 116 | return_string += return_gdscript_code_which_run_this_object(data.a) 117 | return_string += ")" 118 | TYPE_COLOR_ARRAY: 119 | return_string = "PoolColorArray([" 120 | for i in data.size(): 121 | return_string += return_gdscript_code_which_run_this_object(data[i]) 122 | if i != data.size() - 1: 123 | return_string += ", " 124 | return_string += "])" 125 | TYPE_DICTIONARY: 126 | return_string = "{" 127 | for i in data.size(): 128 | return_string += return_gdscript_code_which_run_this_object(data.keys()[i]) 129 | return_string += " : " 130 | return_string += return_gdscript_code_which_run_this_object(data.values()[i]) 131 | if i != data.size() - 1: 132 | return_string += ", " 133 | return_string += "}" 134 | TYPE_INT: 135 | return_string = str(data) 136 | TYPE_INT_ARRAY: 137 | return_string = "PoolIntArray([" 138 | for i in data.size(): 139 | return_string += return_gdscript_code_which_run_this_object(data[i]) 140 | if i != data.size() - 1: 141 | return_string += ", " 142 | return_string += "])" 143 | TYPE_NODE_PATH: 144 | return_string = "NodePath(" 145 | return_string += return_gdscript_code_which_run_this_object(str(data)) 146 | return_string += ")" 147 | TYPE_OBJECT: 148 | if data == null: 149 | return_string = "null" 150 | else: 151 | var name_of_class: String = data.get_class() 152 | if ( 153 | ClassDB.is_parent_class(name_of_class, "Object") 154 | && !ClassDB.is_parent_class(name_of_class, "Node") 155 | && !ClassDB.is_parent_class(name_of_class, "Reference") 156 | && !ClassDB.class_has_method(name_of_class, "new") 157 | ): 158 | return_string += 'ClassDB.instance("' + name_of_class + '")' 159 | else: 160 | return_string = name_of_class.trim_prefix("_") 161 | return_string += ".new()" 162 | 163 | TYPE_PLANE: 164 | return_string = "Plane(" 165 | return_string += return_gdscript_code_which_run_this_object(data.x) 166 | return_string += ", " 167 | return_string += return_gdscript_code_which_run_this_object(data.y) 168 | return_string += ", " 169 | return_string += return_gdscript_code_which_run_this_object(data.z) 170 | return_string += ", " 171 | return_string += return_gdscript_code_which_run_this_object(data.d) 172 | return_string += ")" 173 | TYPE_QUAT: 174 | return_string = "Quat(" 175 | return_string += return_gdscript_code_which_run_this_object(data.x) 176 | return_string += ", " 177 | return_string += return_gdscript_code_which_run_this_object(data.y) 178 | return_string += ", " 179 | return_string += return_gdscript_code_which_run_this_object(data.z) 180 | return_string += ", " 181 | return_string += return_gdscript_code_which_run_this_object(data.w) 182 | return_string += ")" 183 | TYPE_RAW_ARRAY: 184 | return_string = "PoolByteArray([" 185 | for i in data.size(): 186 | return_string += return_gdscript_code_which_run_this_object(data[i]) 187 | if i != data.size() - 1: 188 | return_string += ", " 189 | return_string += "])" 190 | TYPE_REAL: 191 | return_string = str(data) 192 | TYPE_REAL_ARRAY: 193 | return_string = "PoolRealArray([" 194 | for i in data.size(): 195 | return_string += return_gdscript_code_which_run_this_object(data[i]) 196 | if i != data.size() - 1: 197 | return_string += ", " 198 | return_string += "])" 199 | TYPE_RECT2: 200 | return_string = "Rect2(" 201 | return_string += return_gdscript_code_which_run_this_object(data.position) 202 | return_string += ", " 203 | return_string += return_gdscript_code_which_run_this_object(data.size) 204 | return_string += ")" 205 | TYPE_RID: 206 | return_string = "RID()" 207 | TYPE_STRING: 208 | return_string = '"' + data + '"' 209 | TYPE_STRING_ARRAY: 210 | return_string = "PoolStringArray([" 211 | for i in data.size(): 212 | return_string += return_gdscript_code_which_run_this_object(data[i]) 213 | if i != data.size() - 1: 214 | return_string += ", " 215 | return_string += "])" 216 | TYPE_TRANSFORM: 217 | return_string = "Transform(" 218 | return_string += return_gdscript_code_which_run_this_object(data.basis) 219 | return_string += ", " 220 | return_string += return_gdscript_code_which_run_this_object(data.origin) 221 | return_string += ")" 222 | TYPE_TRANSFORM2D: 223 | return_string = "Transform2D(" 224 | return_string += return_gdscript_code_which_run_this_object(data.x) 225 | return_string += ", " 226 | return_string += return_gdscript_code_which_run_this_object(data.y) 227 | return_string += ", " 228 | return_string += return_gdscript_code_which_run_this_object(data.origin) 229 | return_string += ")" 230 | TYPE_VECTOR2: 231 | return_string = "Vector2(" 232 | return_string += return_gdscript_code_which_run_this_object(data.x) 233 | return_string += ", " 234 | return_string += return_gdscript_code_which_run_this_object(data.y) 235 | return_string += ")" 236 | TYPE_VECTOR2_ARRAY: 237 | return_string = "PoolVector2Array([" 238 | for i in data.size(): 239 | return_string += return_gdscript_code_which_run_this_object(data[i]) 240 | if i != data.size() - 1: 241 | return_string += ", " 242 | return_string += "])" 243 | TYPE_VECTOR3: 244 | return_string = "Vector3(" 245 | return_string += return_gdscript_code_which_run_this_object(data.x) 246 | return_string += ", " 247 | return_string += return_gdscript_code_which_run_this_object(data.y) 248 | return_string += ", " 249 | return_string += return_gdscript_code_which_run_this_object(data.z) 250 | return_string += ")" 251 | TYPE_VECTOR3_ARRAY: 252 | return_string = "PoolVector3Array([" 253 | for i in data.size(): 254 | return_string += return_gdscript_code_which_run_this_object(data[i]) 255 | if i != data.size() - 1: 256 | return_string += ", " 257 | return_string += "])" 258 | _: 259 | assert(false, "Missing type, needs to be added to project") 260 | 261 | return return_string 262 | -------------------------------------------------------------------------------- /AutomaticBugs/ValueCreator.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | # Creates random or not objects, variables etc. 4 | 5 | var number: float = 0.0 6 | var max_array_size: int = 15 7 | 8 | 9 | func _ready() -> void: 10 | randomize() 11 | 12 | 13 | func get_int() -> int: 14 | return int(number) 15 | 16 | 17 | func get_int_string() -> String: 18 | return str(int(number)) 19 | 20 | 21 | func get_float() -> float: 22 | return number 23 | 24 | 25 | func get_float_string() -> String: 26 | return str(number) 27 | 28 | 29 | func get_bool() -> bool: 30 | return bool() 31 | 32 | 33 | func get_bool_string() -> String: 34 | return str(bool()) 35 | 36 | 37 | func get_vector2() -> Vector2: 38 | return Vector2(get_float(), get_float()) 39 | 40 | 41 | func get_vector3() -> Vector3: 42 | return Vector3(get_float(), get_float(), get_float()) 43 | 44 | 45 | func get_aabb() -> AABB: 46 | return AABB(get_vector3(), get_vector3()) 47 | 48 | 49 | func get_transform() -> Transform: 50 | return Transform(get_vector3(), get_vector3(), get_vector3(), get_vector3()) 51 | 52 | 53 | func get_transform2D() -> Transform2D: 54 | return Transform2D(get_vector2(), get_vector2(), get_vector2()) 55 | 56 | 57 | func get_plane() -> Plane: 58 | return Plane(get_vector3(), get_vector3(), get_vector3()) 59 | 60 | 61 | func get_quat() -> Quat: 62 | return Quat(get_vector3()) 63 | 64 | 65 | func get_basis() -> Basis: 66 | return Basis(get_vector3()) 67 | 68 | 69 | func get_rect2() -> Rect2: 70 | return Rect2(get_vector2(), get_vector2()) 71 | 72 | 73 | func get_color() -> Color: 74 | return Color(get_float(), get_float(), get_float()) 75 | 76 | 77 | func get_string() -> String: 78 | return String() 79 | 80 | 81 | func get_nodepath() -> NodePath: 82 | return NodePath(get_string()) 83 | 84 | 85 | func get_array() -> Array: 86 | return Array([]) 87 | 88 | 89 | func get_dictionary() -> Dictionary: 90 | return Dictionary({}) 91 | 92 | 93 | func get_pool_string_array() -> PoolStringArray: 94 | var array: Array = [] 95 | for _i in range(int(min(max_array_size, number))): 96 | array.append(get_string()) 97 | return PoolStringArray(array) 98 | 99 | 100 | func get_pool_int_array() -> PoolIntArray: 101 | var array: Array = [] 102 | for _i in range(int(min(max_array_size, number))): 103 | array.append(get_int()) 104 | return PoolIntArray(array) 105 | 106 | 107 | func get_pool_byte_array() -> PoolByteArray: 108 | var array: Array = [] 109 | for _i in range(int(min(max_array_size, number))): 110 | array.append(get_int()) 111 | return PoolByteArray(array) 112 | 113 | 114 | func get_pool_real_array() -> PoolRealArray: 115 | var array: Array = [] 116 | for _i in range(int(min(max_array_size, number))): 117 | array.append(get_float()) 118 | return PoolRealArray(array) 119 | 120 | 121 | func get_pool_vector2_array() -> PoolVector2Array: 122 | var array: Array = [] 123 | for _i in range(int(min(max_array_size, number))): 124 | array.append(get_vector2()) 125 | return PoolVector2Array(array) 126 | 127 | 128 | func get_pool_vector3_array() -> PoolVector3Array: 129 | var array: Array = [] 130 | for _i in range(int(min(max_array_size, number))): 131 | array.append(get_vector3()) 132 | return PoolVector3Array(array) 133 | 134 | 135 | func get_pool_color_array() -> PoolColorArray: 136 | var array: Array = [] 137 | for _i in range(int(min(max_array_size, number))): 138 | array.append(get_color()) 139 | return PoolColorArray(array) 140 | 141 | 142 | func get_object(object_name: String) -> Object: 143 | assert(ClassDB.class_exists(object_name), "Class " + object_name + " doesn't exists.") 144 | # if object_name == "PhysicsDirectSpaceState" || object_name == "Physics2DDirectSpaceState": 145 | # return BoxShape.new() 146 | 147 | var a = 0 148 | if ClassDB.can_instance(object_name): # E.g. Texture is not instantable or shouldn't be, but LargeTexture is 149 | return ClassDB.instance(object_name) 150 | else: 151 | # Checking for children of non instantable object 152 | var list_of_class = ClassDB.get_inheriters_from_class(object_name) 153 | assert(list_of_class.size() > 0, "Cannot find proper instantable child for " + object_name) # Number of inherited class of non instantable class must be greater than 0, otherwise this function would be useless 154 | for i in list_of_class: 155 | if ClassDB.can_instance(i) && (ClassDB.is_parent_class(i, "Node") || ClassDB.is_parent_class(i, "Reference")): 156 | return ClassDB.instance(i) 157 | assert(false, "Cannot find proper instantable child for " + object_name) 158 | return BoxShape.new() 159 | -------------------------------------------------------------------------------- /CreatingAllThings/CreatingAllThings.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | var available_classes: Array = [] 4 | var exeptions: Array = ["SceneTree", "EditorSettings", "ProjectSettings"] 5 | 6 | 7 | func _ready(): 8 | var cl: Array = Array(ClassDB.get_class_list()) 9 | cl.sort() 10 | for name_of_class in cl: 11 | # Repeat 3 times, to be sure that code don't crash in unreleated function 12 | for _i in range(3): 13 | if !ClassDB.can_instance(name_of_class): 14 | continue 15 | if name_of_class in exeptions: 16 | continue 17 | if name_of_class.to_lower().find("server") != -1: 18 | continue 19 | 20 | print("########### " + name_of_class) 21 | print('GDSCRIPT CODE: var thing = ClassDB.instance("' + name_of_class + '")') 22 | print("GDSCRIPT CODE: str(" + name_of_class + ")") 23 | 24 | var thing = ClassDB.instance(name_of_class) 25 | str(thing) 26 | 27 | if thing is Node: 28 | print("GDSCRIPT CODE: thing.queue_free()") 29 | thing.queue_free() 30 | elif thing is Object && !(thing is Reference): 31 | print("GDSCRIPT CODE: thing.free()") 32 | thing.free() 33 | -------------------------------------------------------------------------------- /CreatingAllThings/CreatingAllThings.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://CreatingAllThings/CreatingAllThings.gd" type="Script" id=1] 4 | 5 | [node name="CreatingAllThings" type="Node2D"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /Environment.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" format=2] 2 | 3 | [resource] 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Rafał Mikrut 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 | -------------------------------------------------------------------------------- /Nodes/Nodes.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | # This script adds nodes to scene tree and removes them after certain amount 4 | # of time 5 | 6 | # Counters which are used to delete and adds nodes in loop 7 | var TIME_TO_DELETE: float = 3.0 8 | var time_to_delete: float = TIME_TO_DELETE 9 | 10 | # List of disabled classes 11 | var disabled_classes: Array = [] 12 | # List of all collected nodes which 13 | var classes: Array = [] 14 | 15 | var debug_enabled: bool = false 16 | 17 | 18 | # Collects all classes which will be used 19 | func collect() -> void: 20 | for name_of_class in ClassDB.get_class_list(): 21 | if name_of_class in disabled_classes: 22 | continue 23 | if !ClassDB.can_instance(name_of_class): 24 | continue 25 | 26 | if ClassDB.is_parent_class(name_of_class, "Control"): 27 | classes.append(name_of_class) 28 | continue 29 | if ClassDB.is_parent_class(name_of_class, "Spatial"): 30 | classes.append(name_of_class) 31 | continue 32 | if ClassDB.is_parent_class(name_of_class, "Node2D"): 33 | classes.append(name_of_class) 34 | continue 35 | if ClassDB.get_parent_class(name_of_class) == "Node": 36 | classes.append(name_of_class) 37 | continue 38 | 39 | classes.sort() 40 | if debug_enabled: 41 | var to_print: String = "DEBUG: List of classes used in Nodes scene:\n" 42 | to_print += "DEBUG: [" 43 | for index in range(classes.size()): 44 | to_print += '"' + classes[index] + '"' 45 | if index != classes.size() - 1: 46 | to_print += ", " 47 | print(to_print) 48 | 49 | 50 | # Adds nodes to scenes 51 | func populate() -> void: 52 | for _i in range(2): # Number of created instances of object 53 | for name_of_class in classes: 54 | add_child(ClassDB.instance(name_of_class)) 55 | 56 | 57 | # Populate nodes at start 58 | func _ready() -> void: 59 | collect() 60 | populate() 61 | 62 | 63 | func _process(delta: float) -> void: 64 | # Moves nodes a little 65 | for i in get_children(): 66 | if i is Control: 67 | i._set_size(Vector2(200 * randf() - 100, 200 * randf() - 100)) 68 | if i is Node2D: 69 | i.set_position(Vector2(1000 * randf() - 500, 1000 * randf() - 500)) 70 | if i is Spatial: 71 | if i.get_name() != "Camera": 72 | i.set_scale(Vector3(delta + 1, delta + 1, delta + 1)) 73 | i.set_translation(Vector3(10 * randf(), 10 * randf(), 10 * randf())) 74 | 75 | time_to_delete -= delta 76 | # Delete and adds later nodes 77 | if time_to_delete < 0: 78 | if debug_enabled: 79 | print("DEBUG: Deleting nodes") 80 | time_to_delete += TIME_TO_DELETE 81 | 82 | for i in get_children(): 83 | i.queue_free() 84 | 85 | if debug_enabled: 86 | print("DEBUG: Adding nodes") 87 | populate() 88 | -------------------------------------------------------------------------------- /Nodes/Nodes.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Nodes/Nodes.gd" type="Script" id=1] 4 | 5 | [node name="Nodes" type="Node"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /Physics/2D/Area2D.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | var move_vector: Vector2 = Vector2(1, 1) 4 | var speed: float = 1000.0 5 | 6 | 7 | func _ready(): 8 | pass 9 | 10 | 11 | func _process(delta): 12 | position += Vector2(move_vector.x * delta * speed, move_vector.y * delta * speed) 13 | 14 | if position.y > Autoload.screen_size.y: 15 | move_vector.y = -1 16 | elif position.y < 0: 17 | move_vector.y = 1 18 | elif position.x > Autoload.screen_size.x: 19 | move_vector.x = -1 20 | elif position.x < 0: 21 | move_vector.x = 1 22 | 23 | 24 | func _on_Area2D_area_entered(area): 25 | move_vector = -move_vector 26 | 27 | 28 | func _on_Area2D_body_entered(body): 29 | move_vector = Vector2(move_vector.x, -move_vector.y) 30 | -------------------------------------------------------------------------------- /Physics/2D/Area2D.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://icon.png" type="Texture" id=1] 4 | [ext_resource path="res://Physics/2D/Area2D.gd" type="Script" id=2] 5 | 6 | [node name="Area2D" type="Area2D"] 7 | script = ExtResource( 2 ) 8 | 9 | [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] 10 | polygon = PoolVector2Array( 4.018, -13.1782, -15.9057, 3.23778, 1.63277, 17.5492, 19.3115, 2.39594 ) 11 | 12 | [node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="."] 13 | polygon = PoolVector2Array( -4.58427, -16.8342, -20.5974, -4.94143, -8.23639, 16.784, 20.4187, 13.5065 ) 14 | 15 | [node name="Sprite" type="Sprite" parent="."] 16 | texture = ExtResource( 1 ) 17 | 18 | [connection signal="area_entered" from="." to="." method="_on_Area2D_area_entered"] 19 | [connection signal="body_entered" from="." to="." method="_on_Area2D_body_entered"] 20 | -------------------------------------------------------------------------------- /Physics/2D/KinematicBody2D.gd: -------------------------------------------------------------------------------- 1 | extends KinematicBody2D 2 | 3 | var move_vector: Vector2 = Vector2(1, 1) 4 | var speed: float = 1000.0 5 | 6 | 7 | func _ready(): 8 | pass 9 | 10 | 11 | func _process(delta): 12 | position += Vector2(move_vector.x * delta * speed, move_vector.y * delta * speed) 13 | 14 | if position.y > Autoload.screen_size.y: 15 | move_vector.y = -1 16 | elif position.y < 0: 17 | move_vector.y = 1 18 | elif position.x > Autoload.screen_size.x: 19 | move_vector.x = -1 20 | elif position.x < 0: 21 | move_vector.x = 1 22 | -------------------------------------------------------------------------------- /Physics/2D/KinematicBody2D.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://icon.png" type="Texture" id=1] 4 | [ext_resource path="res://Physics/2D/KinematicBody2D.gd" type="Script" id=2] 5 | 6 | [node name="KinematicBody2D" type="KinematicBody2D"] 7 | script = ExtResource( 2 ) 8 | 9 | [node name="Sprite" type="Sprite" parent="."] 10 | modulate = Color( 0.74902, 0.133333, 0.133333, 1 ) 11 | rotation = 4.45932 12 | texture = ExtResource( 1 ) 13 | 14 | [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] 15 | polygon = PoolVector2Array( -10.6781, -7.48182, -12.4953, 17.1263, 15.2543, 6.19464, 4.32263, -14.4073 ) 16 | -------------------------------------------------------------------------------- /Physics/2D/Physics2D.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | 4 | func _physics_process(delta): 5 | pass 6 | -------------------------------------------------------------------------------- /Physics/2D/Physics2D.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=2] 2 | 3 | [ext_resource path="res://Physics/2D/Physics2D.gd" type="Script" id=1] 4 | [ext_resource path="res://Physics/2D/Area2D.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://Physics/2D/KinematicBody2D.tscn" type="PackedScene" id=3] 6 | [ext_resource path="res://Physics/2D/StaticBody2D.tscn" type="PackedScene" id=4] 7 | [ext_resource path="res://Physics/2D/RigidBody2D.tscn" type="PackedScene" id=5] 8 | 9 | [sub_resource type="RectangleShape2D" id=1] 10 | extents = Vector2( 552.521, 10.3948 ) 11 | 12 | [node name="Physics2D" type="Node2D"] 13 | script = ExtResource( 1 ) 14 | 15 | [node name="Area2D" type="Node2D" parent="."] 16 | 17 | [node name="Area2D" parent="Area2D" instance=ExtResource( 2 )] 18 | position = Vector2( 166.677, 52.3842 ) 19 | 20 | [node name="Area2D2" parent="Area2D" instance=ExtResource( 2 )] 21 | position = Vector2( 209.537, 193.663 ) 22 | 23 | [node name="Area2D3" parent="Area2D" instance=ExtResource( 2 )] 24 | position = Vector2( 450.822, 122.23 ) 25 | 26 | [node name="Area2D4" parent="Area2D" instance=ExtResource( 2 )] 27 | position = Vector2( 336.529, 293.669 ) 28 | 29 | [node name="Area2D5" parent="Area2D" instance=ExtResource( 2 )] 30 | position = Vector2( 555.59, 42.8598 ) 31 | 32 | [node name="Area2D6" parent="Area2D" instance=ExtResource( 2 )] 33 | position = Vector2( 598.45, 184.139 ) 34 | 35 | [node name="Area2D7" parent="Area2D" instance=ExtResource( 2 )] 36 | position = Vector2( 839.735, 112.705 ) 37 | 38 | [node name="Area2D8" parent="Area2D" instance=ExtResource( 2 )] 39 | position = Vector2( 725.442, 284.145 ) 40 | 41 | [node name="Area2D10" parent="Area2D" instance=ExtResource( 2 )] 42 | position = Vector2( 420.661, 330.179 ) 43 | 44 | [node name="Area2D12" parent="Area2D" instance=ExtResource( 2 )] 45 | position = Vector2( 547.653, 430.186 ) 46 | 47 | [node name="Area2D14" parent="Area2D" instance=ExtResource( 2 )] 48 | position = Vector2( 122.23, 457.171 ) 49 | 50 | [node name="Area2D16" parent="Area2D" instance=ExtResource( 2 )] 51 | position = Vector2( 249.222, 557.178 ) 52 | 53 | [node name="Area2D18" parent="Area2D" instance=ExtResource( 2 )] 54 | position = Vector2( 660.359, 444.472 ) 55 | 56 | [node name="Area2D19" parent="Area2D" instance=ExtResource( 2 )] 57 | position = Vector2( 901.644, 373.039 ) 58 | 59 | [node name="Area2D20" parent="Area2D" instance=ExtResource( 2 )] 60 | position = Vector2( 787.351, 544.478 ) 61 | 62 | [node name="Area2D9" parent="Area2D" instance=ExtResource( 2 )] 63 | position = Vector2( 660.036, 115.278 ) 64 | 65 | [node name="Area2D11" parent="Area2D" instance=ExtResource( 2 )] 66 | position = Vector2( 355.255, 161.312 ) 67 | 68 | [node name="Area2D13" parent="Area2D" instance=ExtResource( 2 )] 69 | position = Vector2( 482.247, 261.319 ) 70 | 71 | [node name="Area2D15" parent="Area2D" instance=ExtResource( 2 )] 72 | position = Vector2( 56.8237, 288.304 ) 73 | 74 | [node name="Area2D17" parent="Area2D" instance=ExtResource( 2 )] 75 | position = Vector2( 183.816, 388.311 ) 76 | 77 | [node name="Area2D21" parent="Area2D" instance=ExtResource( 2 )] 78 | position = Vector2( 594.953, 275.605 ) 79 | 80 | [node name="Area2D22" parent="Area2D" instance=ExtResource( 2 )] 81 | position = Vector2( 836.238, 204.172 ) 82 | 83 | [node name="Area2D23" parent="Area2D" instance=ExtResource( 2 )] 84 | position = Vector2( 721.945, 375.611 ) 85 | 86 | [node name="Area2D24" parent="Area2D" instance=ExtResource( 2 )] 87 | position = Vector2( 696.901, 221.117 ) 88 | 89 | [node name="Area2D25" parent="Area2D" instance=ExtResource( 2 )] 90 | position = Vector2( 392.12, 267.151 ) 91 | 92 | [node name="Area2D26" parent="Area2D" instance=ExtResource( 2 )] 93 | position = Vector2( 519.112, 367.158 ) 94 | 95 | [node name="Area2D27" parent="Area2D" instance=ExtResource( 2 )] 96 | position = Vector2( 93.689, 394.143 ) 97 | 98 | [node name="Area2D28" parent="Area2D" instance=ExtResource( 2 )] 99 | position = Vector2( 220.681, 494.15 ) 100 | 101 | [node name="Area2D29" parent="Area2D" instance=ExtResource( 2 )] 102 | position = Vector2( 631.818, 381.444 ) 103 | 104 | [node name="Area2D30" parent="Area2D" instance=ExtResource( 2 )] 105 | position = Vector2( 873.103, 310.011 ) 106 | 107 | [node name="Area2D31" parent="Area2D" instance=ExtResource( 2 )] 108 | position = Vector2( 758.81, 481.45 ) 109 | 110 | [node name="Area2D32" parent="Area2D" instance=ExtResource( 2 )] 111 | position = Vector2( 639.819, 9.43819 ) 112 | 113 | [node name="Area2D33" parent="Area2D" instance=ExtResource( 2 )] 114 | position = Vector2( 335.038, 55.4722 ) 115 | 116 | [node name="Area2D34" parent="Area2D" instance=ExtResource( 2 )] 117 | position = Vector2( 462.03, 155.479 ) 118 | 119 | [node name="Area2D35" parent="Area2D" instance=ExtResource( 2 )] 120 | position = Vector2( 36.6071, 182.464 ) 121 | 122 | [node name="Area2D36" parent="Area2D" instance=ExtResource( 2 )] 123 | position = Vector2( 163.599, 282.471 ) 124 | 125 | [node name="Area2D37" parent="Area2D" instance=ExtResource( 2 )] 126 | position = Vector2( 574.736, 169.765 ) 127 | 128 | [node name="Area2D38" parent="Area2D" instance=ExtResource( 2 )] 129 | position = Vector2( 816.021, 98.3322 ) 130 | 131 | [node name="Area2D39" parent="Area2D" instance=ExtResource( 2 )] 132 | position = Vector2( 701.728, 269.771 ) 133 | 134 | [node name="KinematicBody2D" type="Node2D" parent="."] 135 | 136 | [node name="KinematicBody2D" parent="KinematicBody2D" instance=ExtResource( 3 )] 137 | position = Vector2( 90.4819, 302.4 ) 138 | 139 | [node name="KinematicBody2D2" parent="KinematicBody2D" instance=ExtResource( 3 )] 140 | position = Vector2( 380.142, 465.25 ) 141 | 142 | [node name="KinematicBody2D3" parent="KinematicBody2D" instance=ExtResource( 3 )] 143 | position = Vector2( 333.423, 131.54 ) 144 | 145 | [node name="KinematicBody2D4" parent="KinematicBody2D" instance=ExtResource( 3 )] 146 | position = Vector2( 509.622, 242.332 ) 147 | 148 | [node name="KinematicBody2D5" parent="KinematicBody2D" instance=ExtResource( 3 )] 149 | position = Vector2( 914.078, 76.812 ) 150 | 151 | [node name="KinematicBody2D6" parent="KinematicBody2D" instance=ExtResource( 3 )] 152 | position = Vector2( 251.025, 329.752 ) 153 | 154 | [node name="KinematicBody2D7" parent="KinematicBody2D" instance=ExtResource( 3 )] 155 | position = Vector2( 540.685, 492.602 ) 156 | 157 | [node name="KinematicBody2D8" parent="KinematicBody2D" instance=ExtResource( 3 )] 158 | position = Vector2( 493.966, 158.892 ) 159 | 160 | [node name="KinematicBody2D9" parent="KinematicBody2D" instance=ExtResource( 3 )] 161 | position = Vector2( 670.165, 269.684 ) 162 | 163 | [node name="KinematicBody2D10" parent="KinematicBody2D" instance=ExtResource( 3 )] 164 | position = Vector2( 926.288, 135.628 ) 165 | 166 | [node name="StaticBody2D" type="Node2D" parent="."] 167 | position = Vector2( 73.6327, 117.071 ) 168 | 169 | [node name="StaticBody2D" parent="StaticBody2D" instance=ExtResource( 4 )] 170 | 171 | [node name="StaticBody2D2" parent="StaticBody2D" instance=ExtResource( 4 )] 172 | position = Vector2( 171.12, 267.286 ) 173 | 174 | [node name="StaticBody2D3" parent="StaticBody2D" instance=ExtResource( 4 )] 175 | position = Vector2( 618.011, -2.82837 ) 176 | 177 | [node name="StaticBody2D4" parent="StaticBody2D" instance=ExtResource( 4 )] 178 | position = Vector2( 793.374, 120.208 ) 179 | 180 | [node name="StaticBody2D6" parent="StaticBody2D" instance=ExtResource( 4 )] 181 | position = Vector2( 68.974, 216.436 ) 182 | 183 | [node name="StaticBody2D7" parent="StaticBody2D" instance=ExtResource( 4 )] 184 | position = Vector2( 246.087, 431.281 ) 185 | 186 | [node name="StaticBody2D8" parent="StaticBody2D" instance=ExtResource( 4 )] 187 | position = Vector2( 686.985, 213.607 ) 188 | 189 | [node name="StaticBody2D9" parent="StaticBody2D" instance=ExtResource( 4 )] 190 | position = Vector2( 862.348, 336.644 ) 191 | 192 | [node name="StaticBody2D5" parent="StaticBody2D" instance=ExtResource( 4 )] 193 | position = Vector2( 704.278, 296.985 ) 194 | 195 | [node name="RigidBody2D" type="Node2D" parent="."] 196 | 197 | [node name="RigidBody2D" parent="RigidBody2D" instance=ExtResource( 5 )] 198 | position = Vector2( 178.191, 120.915 ) 199 | 200 | [node name="RigidBody2D2" parent="RigidBody2D" instance=ExtResource( 5 )] 201 | position = Vector2( 192.874, 313.132 ) 202 | 203 | [node name="RigidBody2D3" parent="RigidBody2D" instance=ExtResource( 5 )] 204 | position = Vector2( 386.426, 210.35 ) 205 | 206 | [node name="RigidBody2D4" parent="RigidBody2D" instance=ExtResource( 5 )] 207 | position = Vector2( 374.412, 43.4946 ) 208 | 209 | [node name="RigidBody2D5" parent="RigidBody2D" instance=ExtResource( 5 )] 210 | position = Vector2( 609.344, 331.82 ) 211 | 212 | [node name="RigidBody2D6" parent="RigidBody2D" instance=ExtResource( 5 )] 213 | position = Vector2( 756.177, 187.657 ) 214 | 215 | [node name="RigidBody2D7" parent="RigidBody2D" instance=ExtResource( 5 )] 216 | position = Vector2( 754.842, 43.4946 ) 217 | 218 | [node name="RigidBody2D8" parent="RigidBody2D" instance=ExtResource( 5 )] 219 | position = Vector2( 490.543, 544.06 ) 220 | 221 | [node name="RigidBody2D9" parent="RigidBody2D" instance=ExtResource( 5 )] 222 | position = Vector2( 490.543, 544.06 ) 223 | 224 | [node name="RigidBody2D10" parent="RigidBody2D" instance=ExtResource( 5 )] 225 | position = Vector2( 282.873, 201.928 ) 226 | 227 | [node name="RigidBody2D11" parent="RigidBody2D" instance=ExtResource( 5 )] 228 | position = Vector2( 281.538, 57.7651 ) 229 | 230 | [node name="RigidBody2D12" parent="RigidBody2D" instance=ExtResource( 5 )] 231 | position = Vector2( 45.7064, 532.859 ) 232 | 233 | [node name="RigidBody2D13" parent="RigidBody2D" instance=ExtResource( 5 )] 234 | position = Vector2( 45.7064, 532.859 ) 235 | 236 | [node name="Barriers" type="Node2D" parent="."] 237 | 238 | [node name="Corner" type="StaticBody2D" parent="Barriers"] 239 | 240 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Barriers/Corner"] 241 | position = Vector2( 7.93701, 317.48 ) 242 | rotation = 1.5708 243 | shape = SubResource( 1 ) 244 | 245 | [node name="Corner2" type="StaticBody2D" parent="Barriers"] 246 | 247 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Barriers/Corner2"] 248 | position = Vector2( 1017.52, 365.102 ) 249 | rotation = 1.5708 250 | shape = SubResource( 1 ) 251 | 252 | [node name="Corner3" type="StaticBody2D" parent="Barriers"] 253 | 254 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Barriers/Corner3"] 255 | position = Vector2( 503.206, -19.0488 ) 256 | shape = SubResource( 1 ) 257 | 258 | [node name="Corner4" type="StaticBody2D" parent="Barriers"] 259 | 260 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Barriers/Corner4"] 261 | position = Vector2( 492.094, 576.227 ) 262 | shape = SubResource( 1 ) 263 | -------------------------------------------------------------------------------- /Physics/2D/RigidBody2D.gd: -------------------------------------------------------------------------------- 1 | extends RigidBody2D 2 | 3 | var move_vector: Vector2 = Vector2(1, 1) 4 | var speed: float = 1000.0 5 | 6 | 7 | func _ready(): 8 | pass 9 | 10 | 11 | func _process(delta): 12 | #position += Vector2(move_vector.x * delta * speed,move_vector.y * delta * speed) 13 | 14 | if position.y > Autoload.screen_size.y: 15 | move_vector.y = -1 16 | elif position.y < 0: 17 | move_vector.y = 1 18 | elif position.x > Autoload.screen_size.x: 19 | move_vector.x = -1 20 | elif position.x < 0: 21 | move_vector.x = 1 22 | apply_impulse(move_vector, Vector2(0, 1)) 23 | -------------------------------------------------------------------------------- /Physics/2D/RigidBody2D.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Physics/2D/RigidBody2D.gd" type="Script" id=1] 4 | [ext_resource path="res://icon.png" type="Texture" id=2] 5 | 6 | [node name="RigidBody2D" type="RigidBody2D"] 7 | gravity_scale = 0.1 8 | script = ExtResource( 1 ) 9 | 10 | [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] 11 | polygon = PoolVector2Array( -2.29324, -15.2017, -12.0322, 4.46353, 8.38219, 7.64743 ) 12 | 13 | [node name="Sprite" type="Sprite" parent="."] 14 | modulate = Color( 0.47451, 0, 0.427451, 1 ) 15 | rotation = 0.792379 16 | texture = ExtResource( 2 ) 17 | -------------------------------------------------------------------------------- /Physics/2D/StaticBody2D.gd: -------------------------------------------------------------------------------- 1 | extends StaticBody2D 2 | 3 | var move_vector: Vector2 = Vector2(1, 1) 4 | var speed: float = 1000.0 5 | 6 | 7 | func _ready(): 8 | pass 9 | 10 | 11 | func _process(delta): 12 | position += Vector2(move_vector.x * delta * speed, move_vector.y * delta * speed) 13 | 14 | if position.y > Autoload.screen_size.y: 15 | move_vector.y = -1 16 | elif position.y < 0: 17 | move_vector.y = 1 18 | elif position.x > Autoload.screen_size.x: 19 | move_vector.x = -1 20 | elif position.x < 0: 21 | move_vector.x = 1 22 | -------------------------------------------------------------------------------- /Physics/2D/StaticBody2D.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://icon.png" type="Texture" id=1] 4 | [ext_resource path="res://Physics/2D/StaticBody2D.gd" type="Script" id=2] 5 | 6 | [node name="StaticBody2D" type="StaticBody2D"] 7 | script = ExtResource( 2 ) 8 | 9 | [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."] 10 | polygon = PoolVector2Array( -0.566719, -5.64549, -7.24092, 1.19557, -2.06841, 8.20348, 5.60692, 5.20009, 4.10522, -5.14492 ) 11 | 12 | [node name="Sprite" type="Sprite" parent="."] 13 | modulate = Color( 0, 1, 1, 0.584314 ) 14 | rotation = 0.270526 15 | texture = ExtResource( 1 ) 16 | -------------------------------------------------------------------------------- /Physics/3D/Physics3D.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=11 format=2] 2 | 3 | [ext_resource path="res://icon.png" type="Texture" id=1] 4 | [ext_resource path="res://Physics/3D/StaticArena.gd" type="Script" id=2] 5 | [ext_resource path="res://Physics/3D/RigidBody3D.tscn" type="PackedScene" id=3] 6 | 7 | [sub_resource type="PhysicsMaterial" id=1] 8 | friction = 0.89 9 | rough = true 10 | 11 | [sub_resource type="SpatialMaterial" id=2] 12 | albedo_color = Color( 1, 1, 1, 0.521569 ) 13 | albedo_texture = ExtResource( 1 ) 14 | metallic = 1.0 15 | metallic_specular = 0.86 16 | metallic_texture = ExtResource( 1 ) 17 | 18 | [sub_resource type="BoxShape" id=3] 19 | extents = Vector3( 50, 2, 50 ) 20 | 21 | [sub_resource type="SpatialMaterial" id=4] 22 | params_diffuse_mode = 1 23 | albedo_texture = ExtResource( 1 ) 24 | metallic = 0.8 25 | 26 | [sub_resource type="BoxShape" id=5] 27 | extents = Vector3( 50, 20, 5 ) 28 | 29 | [sub_resource type="BoxShape" id=6] 30 | extents = Vector3( 11.8794, 1.37845, 22.281 ) 31 | 32 | [sub_resource type="BoxShape" id=7] 33 | extents = Vector3( 11.8794, 1.37845, 22.281 ) 34 | 35 | [node name="Physics3D" type="Spatial"] 36 | 37 | [node name="DirectionalLight" type="DirectionalLight" parent="."] 38 | transform = Transform( 1, 0, 0, 0, -0.959707, 0.281002, 0, -0.281002, -0.959707, 0, 35.3705, 0 ) 39 | light_energy = 1.45 40 | 41 | [node name="StaticArena" type="Spatial" parent="."] 42 | script = ExtResource( 2 ) 43 | 44 | [node name="StaticBody" type="StaticBody" parent="StaticArena"] 45 | collision_layer = 2147483651 46 | collision_mask = 279045 47 | physics_material_override = SubResource( 1 ) 48 | 49 | [node name="CSGBox" type="CSGBox" parent="StaticArena/StaticBody"] 50 | width = 100.0 51 | height = 4.32824 52 | depth = 100.0 53 | material = SubResource( 2 ) 54 | 55 | [node name="CollisionShape" type="CollisionShape" parent="StaticArena/StaticBody"] 56 | shape = SubResource( 3 ) 57 | 58 | [node name="StaticBody2" type="StaticBody" parent="StaticArena"] 59 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 18.1689, 1.64214 ) 60 | collision_layer = 2147483651 61 | collision_mask = 279045 62 | physics_material_override = SubResource( 1 ) 63 | 64 | [node name="CSGBox" type="CSGBox" parent="StaticArena/StaticBody2"] 65 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -46.5124 ) 66 | width = 100.0 67 | height = 40.0 68 | depth = 10.0 69 | material = SubResource( 4 ) 70 | 71 | [node name="CollisionShape" type="CollisionShape" parent="StaticArena/StaticBody2"] 72 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -46.709 ) 73 | shape = SubResource( 5 ) 74 | 75 | [node name="StaticBody3" type="StaticBody" parent="StaticArena"] 76 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 18.1689, 91.732 ) 77 | collision_layer = 2147483651 78 | collision_mask = 279045 79 | physics_material_override = SubResource( 1 ) 80 | 81 | [node name="CSGBox" type="CSGBox" parent="StaticArena/StaticBody3"] 82 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -46.5124 ) 83 | width = 100.0 84 | height = 40.0 85 | depth = 10.0 86 | material = SubResource( 4 ) 87 | 88 | [node name="CollisionShape" type="CollisionShape" parent="StaticArena/StaticBody3"] 89 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -46.709 ) 90 | shape = SubResource( 5 ) 91 | 92 | [node name="StaticBody4" type="StaticBody" parent="StaticArena"] 93 | transform = Transform( -1.62921e-07, 0, -1, 0, 1, 0, 1, 0, -1.62921e-07, -1.90218, 18.1689, 0.572887 ) 94 | collision_layer = 2147483651 95 | collision_mask = 279045 96 | physics_material_override = SubResource( 1 ) 97 | 98 | [node name="CSGBox" type="CSGBox" parent="StaticArena/StaticBody4"] 99 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.13509, -46.5124 ) 100 | width = 100.0 101 | height = 40.0 102 | depth = 10.0 103 | material = SubResource( 4 ) 104 | 105 | [node name="CollisionShape" type="CollisionShape" parent="StaticArena/StaticBody4"] 106 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -46.709 ) 107 | shape = SubResource( 5 ) 108 | 109 | [node name="StaticBody5" type="StaticBody" parent="StaticArena"] 110 | transform = Transform( -1.62921e-07, 0, -1, 0, 1, 0, 1, 0, -1.62921e-07, -92.1931, 18.8845, 0.814518 ) 111 | collision_layer = 2147483651 112 | collision_mask = 279045 113 | physics_material_override = SubResource( 1 ) 114 | 115 | [node name="CSGBox" type="CSGBox" parent="StaticArena/StaticBody5"] 116 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -46.5124 ) 117 | width = 100.0 118 | height = 40.0 119 | depth = 10.0 120 | material = SubResource( 4 ) 121 | 122 | [node name="CollisionShape" type="CollisionShape" parent="StaticArena/StaticBody5"] 123 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -46.709 ) 124 | shape = SubResource( 5 ) 125 | 126 | [node name="StaticBody6" type="StaticBody" parent="StaticArena"] 127 | transform = Transform( 0.998532, 0.013617, -0.0524264, 0, 0.967885, 0.251394, 0.054166, -0.251025, 0.966464, -16.8315, 7.76313, 0 ) 128 | 129 | [node name="CollisionShape" type="CollisionShape" parent="StaticArena/StaticBody6"] 130 | shape = SubResource( 6 ) 131 | 132 | [node name="CSGBox" type="CSGBox" parent="StaticArena/StaticBody6"] 133 | width = 23.9394 134 | depth = 44.6359 135 | 136 | [node name="StaticBody7" type="StaticBody" parent="StaticArena"] 137 | transform = Transform( -0.638995, 0.193375, -0.744507, 0, 0.967885, 0.251394, 0.769211, 0.16064, -0.618474, 10.0702, 7.03413, 0 ) 138 | 139 | [node name="CollisionShape" type="CollisionShape" parent="StaticArena/StaticBody7"] 140 | transform = Transform( 1, -9.31323e-10, 0, 0, 1, 1.49012e-08, 3.72529e-09, 1.49012e-08, 1, 0, 0, 0 ) 141 | shape = SubResource( 7 ) 142 | 143 | [node name="CSGBox" type="CSGBox" parent="StaticArena/StaticBody7"] 144 | width = 23.9394 145 | depth = 44.6359 146 | 147 | [node name="StaticBody8" type="StaticBody" parent="StaticArena"] 148 | transform = Transform( -0.314953, 0.2386, -0.918626, 0, 0.967885, 0.251394, 0.949107, 0.0791774, -0.304838, 10.0702, 7.03413, 24.278 ) 149 | 150 | [node name="CollisionShape" type="CollisionShape" parent="StaticArena/StaticBody8"] 151 | transform = Transform( 1, -9.31323e-10, 0, 0, 1, 1.49012e-08, 3.72529e-09, 1.49012e-08, 1, 0, 0, 0 ) 152 | shape = SubResource( 7 ) 153 | 154 | [node name="CSGBox" type="CSGBox" parent="StaticArena/StaticBody8"] 155 | width = 23.9394 156 | depth = 44.6359 157 | 158 | [node name="StaticBody9" type="StaticBody" parent="StaticArena"] 159 | transform = Transform( 0.289683, -0.599318, 0.746259, -0.123608, -0.796586, -0.591753, 0.949107, 0.0791774, -0.304838, 10.0702, 0.940654, -25.555 ) 160 | 161 | [node name="CollisionShape" type="CollisionShape" parent="StaticArena/StaticBody9"] 162 | transform = Transform( 1, 7.45058e-09, 0, 1.49012e-08, 1, 4.84288e-08, 0, -3.1665e-08, 1, 0, 0, 0 ) 163 | shape = SubResource( 7 ) 164 | 165 | [node name="CSGBox" type="CSGBox" parent="StaticArena/StaticBody9"] 166 | width = 23.9394 167 | depth = 44.6359 168 | 169 | [node name="Objects" type="Spatial" parent="."] 170 | 171 | [node name="RigidBody" parent="Objects" instance=ExtResource( 3 )] 172 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -8.50424, 17.1047, 14.7363 ) 173 | 174 | [node name="RigidBody2" parent="Objects" instance=ExtResource( 3 )] 175 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.7864, 12.6031, 19.1751 ) 176 | 177 | [node name="RigidBody3" parent="Objects" instance=ExtResource( 3 )] 178 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -16.9896, 10.6319, 28.8764 ) 179 | 180 | [node name="RigidBody4" parent="Objects" instance=ExtResource( 3 )] 181 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -26.0866, 12.6031, -18.3703 ) 182 | 183 | [node name="RigidBody5" parent="Objects" instance=ExtResource( 3 )] 184 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 22.2505, 12.6031, -20.7732 ) 185 | 186 | [node name="RigidBody6" parent="Objects" instance=ExtResource( 3 )] 187 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 24.085, 12.6031, 8.2937 ) 188 | 189 | [node name="RigidBody7" parent="Objects" instance=ExtResource( 3 )] 190 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 18.9278, 12.6031, 23.4173 ) 191 | 192 | [node name="RigidBody8" parent="Objects" instance=ExtResource( 3 )] 193 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3.85186, 24.8548, -9.87658 ) 194 | 195 | [node name="Camera" type="Camera" parent="."] 196 | transform = Transform( 0.922114, 0.23703, -0.305815, 0.0163102, 0.765871, 0.642787, 0.386575, -0.597711, 0.702354, -25.392, 55.117, 39.851 ) 197 | current = true 198 | far = 200.0 199 | 200 | [node name="Joints" type="Spatial" parent="."] 201 | 202 | [node name="Cone" type="Spatial" parent="Joints"] 203 | 204 | [node name="RigidBody2" parent="Joints/Cone" instance=ExtResource( 3 )] 205 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -23.2888, 6.73046, 77.026 ) 206 | gravity_scale = -3.0 207 | 208 | [node name="RigidBody" parent="Joints/Cone" instance=ExtResource( 3 )] 209 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -23.2888, 15.3482, 19.1751 ) 210 | 211 | [node name="ConeTwistJoint" type="ConeTwistJoint" parent="Joints/Cone"] 212 | nodes/node_a = NodePath("../RigidBody") 213 | nodes/node_b = NodePath("../RigidBody2") 214 | 215 | [node name="Generic" type="Spatial" parent="Joints"] 216 | 217 | [node name="RigidBody" parent="Joints/Generic" instance=ExtResource( 3 )] 218 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -23.2888, 33.1278, 67.0796 ) 219 | gravity_scale = -3.0 220 | 221 | [node name="RigidBody2" parent="Joints/Generic" instance=ExtResource( 3 )] 222 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -23.2888, 33.1278, -0.445078 ) 223 | 224 | [node name="Generic6DOFJoint" type="Generic6DOFJoint" parent="Joints/Generic"] 225 | nodes/node_a = NodePath("../RigidBody") 226 | nodes/node_b = NodePath("../RigidBody2") 227 | 228 | [node name="Hinge" type="Spatial" parent="Joints"] 229 | 230 | [node name="RigidBody" parent="Joints/Hinge" instance=ExtResource( 3 )] 231 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 18.6153, 33.1278, 59.2096 ) 232 | gravity_scale = -3.0 233 | 234 | [node name="RigidBody2" parent="Joints/Hinge" instance=ExtResource( 3 )] 235 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 8.17695, 33.1278, 19.1751 ) 236 | 237 | [node name="HingeJoint" type="HingeJoint" parent="Joints/Hinge"] 238 | nodes/node_a = NodePath("../RigidBody") 239 | nodes/node_b = NodePath("../RigidBody2") 240 | 241 | [node name="Pin" type="Spatial" parent="Joints"] 242 | 243 | [node name="RigidBody" parent="Joints/Pin" instance=ExtResource( 3 )] 244 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -23.2888, 4.83369, 116.28 ) 245 | gravity_scale = -3.0 246 | 247 | [node name="RigidBody2" parent="Joints/Pin" instance=ExtResource( 3 )] 248 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -23.2888, 18.4589, 10.7729 ) 249 | 250 | [node name="PinJoint" type="PinJoint" parent="Joints/Pin"] 251 | nodes/node_a = NodePath("../RigidBody") 252 | nodes/node_b = NodePath("../RigidBody2") 253 | 254 | [node name="Slider" type="Spatial" parent="Joints"] 255 | 256 | [node name="RigidBody" parent="Joints/Slider" instance=ExtResource( 3 )] 257 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -23.2888, 17.7427, 19.1751 ) 258 | gravity_scale = -3.0 259 | 260 | [node name="RigidBody2" parent="Joints/Slider" instance=ExtResource( 3 )] 261 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -33.3355, 16.2845, 19.1751 ) 262 | 263 | [node name="SliderJoint" type="SliderJoint" parent="Joints/Slider"] 264 | nodes/node_a = NodePath("../RigidBody") 265 | nodes/node_b = NodePath("../RigidBody2") 266 | linear_motion/softness = 1.43 267 | -------------------------------------------------------------------------------- /Physics/3D/RigidBody3D.gd: -------------------------------------------------------------------------------- 1 | extends RigidBody 2 | 3 | 4 | func _physics_process(delta: float) -> void: 5 | add_force(Vector3(0, 4 * delta, 0), Vector3(0, 0, 0)) 6 | pass 7 | -------------------------------------------------------------------------------- /Physics/3D/RigidBody3D.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Physics/3D/RigidBody3D.gd" type="Script" id=1] 4 | 5 | [sub_resource type="SphereShape" id=1] 6 | 7 | [node name="RigidBody" type="RigidBody"] 8 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -23.2888, 33.1278, 19.1751 ) 9 | gravity_scale = 5.0 10 | continuous_cd = true 11 | linear_velocity = Vector3( 0, 5, 0 ) 12 | script = ExtResource( 1 ) 13 | 14 | [node name="CollisionShape" type="CollisionShape" parent="."] 15 | transform = Transform( 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0 ) 16 | shape = SubResource( 1 ) 17 | 18 | [node name="CSGSphere" type="CSGSphere" parent="CollisionShape"] 19 | -------------------------------------------------------------------------------- /Physics/3D/StaticArena.gd: -------------------------------------------------------------------------------- 1 | extends Spatial 2 | 3 | 4 | func _process(delta): 5 | rotate(Vector3(0, 1, 0).normalized(), 2 * delta) 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Godot regression test project 2 | This repository contains project which is used to find regressions in Godot. 3 | 4 | It aims to check as much as possible functions and states, be easy in maintain and provide quite reproducible results. 5 | 6 | ## Basic Informations 7 | This project contains a few different scenes and `Start.tscn`(default one) which opens every other scene. 8 | 9 | List of this scenes are available in `Autoload.gd` file. 10 | 11 | ![B](https://user-images.githubusercontent.com/41945903/104442905-060e7c00-5596-11eb-9000-f9bb338ece79.png) 12 | 13 | It is possible manually set how long project need to be executed from command line, just by adding at the end number of seconds - `godot 40`. 14 | 15 | At first `all_in_one` scenes opens, execute `_ready` function and exit. 16 | 17 | The available time(default 25s) is divided equally between each scene in `alone_steps`. 18 | 19 | Then, one by one, each scene is created and after a certain amount of time it is deleted and another scene from the `alone_steps` takes its place. 20 | 21 | This project is running in CI with a version of Godot compiled with Address and Undefined sanitizers(`scons use_asan=yes use_ubsan=yes`) so without these options it won't always be possible to detect the bug or get so detailed backtrace. 22 | 23 | ## Searching for a malfunctioning scene 24 | ### Logs 25 | When searching through the logs for the error you may come across something like this 26 | ``` 27 | Changed scene to res://Rendering/Lights2D/Lights2D.tscn 28 | Test is running now 35 seconds 29 | Test is running now 40 seconds 30 | Changed scene to res://Rendering/Lights3D/Lights3D.tscn 31 | ##### CRASH ##### 32 | Godot crashed with signal ... 33 | ``` 34 | This log indicates 2 potentially broken scenes 35 | - `Lights3D.tscn` - crash occured because scene started work 36 | - `Lights2D.tscn` - crash occured because scene was removed 37 | ### Autoload 38 | You can freely comment out selected lines in `alone_steps` or `all_in_one` to choose which scenes will run `Start.tscn`. 39 | You can also use `time_to_show` variable to set time how long the project will run. 40 | 41 | ![Autoloads](https://user-images.githubusercontent.com/41945903/115044743-16582f00-9ed6-11eb-889f-4f07ad6c7d13.png) 42 | 43 | ### File System 44 | The last way is to manually run each scene from the file system to find the one malfunctioning. 45 | 46 | ![File](https://user-images.githubusercontent.com/41945903/115044733-13f5d500-9ed6-11eb-9364-43a1a142a6f1.png) 47 | 48 | ## "Safe" fuzzer 49 | A scene that will probably give people a hard time quite often is `FunctionExecutor.tscn`. 50 | This is a fuzzer, but with removed ability to use random argument values (the arguments are identical every time it is run). 51 | When the engine crashes, in logs usually will be something like this: 52 | ``` 53 | #################### LineEdit #################### 54 | 55 | LineEdit._text_changed --- executing with 0 parameters [] 56 | GDSCRIPT CODE: LineEdit.new()._text_changed() 57 | 58 | LineEdit._toggle_draw_caret --- executing with 0 parameters [] 59 | GDSCRIPT CODE: LineEdit.new()._toggle_draw_caret() 60 | 61 | LineEdit.set_align --- executing with 1 parameters [100] 62 | GDSCRIPT CODE: LineEdit.new().set_align(100) 63 | ERROR: set_align: Index (int)p_align = 100 is out of bounds (4 = 4). 64 | At: scene/gui/line_edit.cpp:592. 65 | scene/resources/line_edit.cpp:186:2: runtime error: member access within null pointer of type 'struct LineEdit' 66 | handle_crash: Program crashed with signal 11 67 | Dumping the backtrace. Please include this when reporting the bug on godotengine/godot/issues 68 | [1] bin/godot.linuxbsd.tools.64s() [0x1e697d8] (/home/runner/work/godot/godot/platform/linuxbsd/crash_handler_linuxbsd.cpp:54) 69 | [2] /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7fd1ca5b0210] (??:0) 70 | ``` 71 | There are some interesting things to discuss here. 72 | This line shows what class we are testing now 73 | ``` 74 | #################### LineEdit #################### 75 | ``` 76 | which method 77 | ``` 78 | LineEdit.set_align 79 | ``` 80 | and which parameters 81 | ``` 82 | --- executing with 1 parameters [100] 83 | ``` 84 | Next you can see GDScript command which is executed and you can copy it and test manually in Godot 85 | ``` 86 | GDSCRIPT CODE: LineEdit.new()._toggle_draw_caret() 87 | ``` 88 | Then you can see errors caused by invalid arguments, which you can ignore if they don't cause other crashes/leaks etc. 89 | ``` 90 | ERROR: set_align: Index (int)p_align = 100 is out of bounds (4 = 4). 91 | At: scene/gui/line_edit.cpp:592. 92 | ``` 93 | At the end we can see Godot's crash log with additional information that tried to use null pointer incorrectly: 94 | ``` 95 | scene/resources/skeleton_modification_2d_physicalbones.cpp:186:2: runtime error: member access within null pointer of type 'struct SkeletonModificationStack2D' 96 | handle_crash: Program crashed with signal 11 97 | Dumping the backtrace. Please include this when reporting the bug on godotengine/godot/issues 98 | [1] bin/godot.linuxbsd.tools.64s() [0x1e697d8] (/home/runner/work/godot/godot/platform/linuxbsd/crash_handler_linuxbsd.cpp:54) 99 | [2] /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7fd1ca5b0210] (??:0) 100 | ``` 101 | In most situations, the latest executed function/created object is responsible for crash 102 | ``` 103 | LineEdit.set_align --- executing with 1 parameters [100] 104 | GDSCRIPT CODE: LineEdit.new().set_align(100) 105 | ``` 106 | So we can just take GDScript code from above, copy it into Godot and test project, which should crash engine 107 | ``` 108 | LineEdit.new().set_align(100) 109 | ``` 110 | 111 | ## Nodes 112 | Scene simply adds and removes at once all available nodes. 113 | It is used to catch early very obvious and easy to reproduce bugs. 114 | 115 | ## ReparentingDeleting 116 | This is more advanced variation of Nodes scene. 117 | In random order adds, remove and move in scene tree nodes. It may not sound spectacular, but it sometimes allows you to find bugs that are hard to detect. 118 | 119 | ## CreatingAllThings 120 | This scene creates, prints and removes object. 121 | Can be used to quicly check if classes don't crash when executing simple commands on them. 122 | 123 | ## Others 124 | Scenes like `Physics2D.tscn` or `Lights3D.tscn` are normal scenes with specific types of nodes. They are only used to manually check visual differences between different Godot versions. 125 | 126 | ![Physics](https://user-images.githubusercontent.com/41945903/115050994-9da8a100-9edc-11eb-99f6-9375ef917be1.png) 127 | 128 | ## Epilepsy Warning 129 | Due using by project a lot of functions from each type of Node, screen may flicker, images and objects may change randomly color and size which may lead some users to health problems. 130 | 131 | ## Problems with project 132 | The project should not cause too many problems in CI when adding and removing features in Godot, since it don't uses too much functions but for example removing a base type e.g. `TYPE_INT` or changes in GDScript(e.g. changing `instance` to `instantiate`) can mess it up. 133 | 134 | -------------------------------------------------------------------------------- /ReparentingDeleting/ReparentingDeleting.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | # Script first adds nodes to scene, then choose some random nodes and reparents 4 | # them or delete and replace with new ones 5 | # This is not really reproducible, but crashes find by this tool should be quite easy to recreate 6 | 7 | ## Algorithm 8 | # - Add multiple nodes to scene 9 | # - Set name to each 10 | # - In _process 11 | # - Get random node 12 | # - Detach it from its parent 13 | # - Play with a russian roulette: 14 | # - If node will be deleted, be sure to get list of its all children and then 15 | # replace all with new nodes(change also name) and old remove with queue_free() 16 | # - Get another random node 17 | # - If nodes are the same, add node to root one(cannot set self as self parent) and repeat steps 18 | # - If second node is child of first, add first node to root one(prevents from memory leaks due invalid reparenting) 19 | # - At the end add first random node as child of second 20 | 21 | var number_of_nodes: int = 0 22 | 23 | # Collected nodes 24 | var collected_nodes: Array = [] 25 | # Disabled nodes which won't be used 26 | var disabled_classes: Array = [ 27 | "ReflectionProbe", #GH 45460 28 | ] 29 | 30 | var debug_enabled: bool = false 31 | 32 | 33 | func collect() -> void: 34 | var classes: Array = ClassDB.get_class_list() 35 | classes.sort() 36 | for name_of_class in classes: 37 | if ClassDB.is_parent_class(name_of_class, "Node"): 38 | if name_of_class.find("Editor") != -1: # We don't want to test editor nodes 39 | continue 40 | if disabled_classes.has(name_of_class): # Class is disabled 41 | continue 42 | if ClassDB.can_instance(name_of_class): # Only instantable nodes can be used 43 | collected_nodes.append(name_of_class) 44 | 45 | if debug_enabled: 46 | var to_print: String = "DEBUG: List of classes used in ReparentingDeleting scene:\n" 47 | to_print += "DEBUG: [" 48 | for index in range(classes.size()): 49 | to_print += '"' + classes[index] + '"' 50 | if index != classes.size() - 1: 51 | to_print += ", " 52 | print(to_print) 53 | 54 | 55 | func _ready() -> void: 56 | seed(405) 57 | collect() 58 | number_of_nodes = max(collected_nodes.size(), 200) # Use at least all nodes, or more if you want(168 is probably number of all nodes) 59 | for i in range(number_of_nodes): 60 | var index = i 61 | if i >= collected_nodes.size(): # Wrap values 62 | index = i % collected_nodes.size() 63 | 64 | var child: Node = ClassDB.instance(collected_nodes[index]) 65 | child.set_name("Special Node " + str(i)) 66 | add_child(child) 67 | 68 | 69 | func _process(delta: float) -> void: 70 | # assert(Performance.get_monitor(Performance.OBJECT_ORPHAN_NODE_COUNT) == 0) # Don't work good when instancing more than 1 scene, because node queued for deleting 71 | 72 | var choosen_node: Node 73 | var parent_of_node: Node 74 | for i in range(5): 75 | var number: String = "Special Node " + str(randi() % number_of_nodes) 76 | choosen_node = find_node(number, true, false) 77 | parent_of_node = choosen_node.get_parent() 78 | 79 | var random_node = find_node("Special Node " + str(randi() % number_of_nodes), true, false) 80 | parent_of_node.remove_child(choosen_node) 81 | 82 | if randi() % 6 == 0: # 16% chance to remove node with children 83 | var names_to_remove: Array = find_all_special_children_names(choosen_node) 84 | for name_to_remove in names_to_remove: 85 | var node: Node = ClassDB.instance(collected_nodes[randi() % collected_nodes.size()]) 86 | node.set_name(name_to_remove) 87 | add_child(node) 88 | choosen_node.queue_free() 89 | continue 90 | 91 | if choosen_node.find_node(random_node.get_name(), true, false) != null: # Cannot set as node parent one of its child 92 | add_child(choosen_node) 93 | continue 94 | if choosen_node == random_node: # Do not reparent node to self 95 | add_child(choosen_node) 96 | continue 97 | random_node.add_child(choosen_node) 98 | 99 | 100 | # Finds recusivelly all child nodes which will be also removed to be able to add 101 | # exactly same number of nodes in replacement. 102 | func find_all_special_children_names(node: Node) -> Array: 103 | var array: Array = [] 104 | array.append(node.get_name()) 105 | for child in node.get_children(): 106 | if child.get_name().begins_with("Special Node"): 107 | array.append_array(find_all_special_children_names(child)) 108 | 109 | return array 110 | -------------------------------------------------------------------------------- /ReparentingDeleting/ReparentingDeleting.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://ReparentingDeleting/ReparentingDeleting.gd" type="Script" id=1] 4 | 5 | [node name="ReparentingDeleting" type="Node"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /Start.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | var current_scene: int = -1 4 | var time_to_switch: int 5 | const NUMBER_OF_INSTANCES: int = 1 # Use more than 1 to stress test, 1 should be optimal for casual CI 6 | 7 | var array_with_time_to_change: Array = [] 8 | 9 | 10 | func _ready(): 11 | Autoload.can_be_closed = false 12 | 13 | for i in Autoload.alone_steps.size() + 1: 14 | array_with_time_to_change.append(Autoload.time_object.get_ticks_msec() + i * Autoload.time_for_each_step) 15 | 16 | 17 | func _process(_delta): 18 | if current_scene < Autoload.alone_steps.size() - 1 && Autoload.time_object.get_ticks_msec() > array_with_time_to_change[current_scene + 1]: 19 | current_scene += 1 20 | if current_scene == Autoload.alone_steps.size() - 1: 21 | Autoload.can_be_closed = true 22 | 23 | for child in get_children(): 24 | child.queue_free() 25 | 26 | print("Changed scene to " + Autoload.alone_steps[current_scene]) 27 | 28 | for _i in range(NUMBER_OF_INSTANCES): 29 | var scene: Node = load(Autoload.alone_steps[current_scene]).instance() 30 | add_child(scene) 31 | -------------------------------------------------------------------------------- /Start.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Start.gd" type="Script" id=1] 4 | 5 | [node name="Start" type="Control"] 6 | anchor_right = 1.0 7 | anchor_bottom = 1.0 8 | script = ExtResource( 1 ) 9 | __meta__ = { 10 | "_edit_use_anchors_": false 11 | } 12 | -------------------------------------------------------------------------------- /export_presets.cfg: -------------------------------------------------------------------------------- 1 | [preset.0] 2 | 3 | name="Linux/X11" 4 | platform="Linux/X11" 5 | runnable=true 6 | custom_features="" 7 | export_filter="all_resources" 8 | include_filter="" 9 | exclude_filter="" 10 | export_path="" 11 | patch_list=PoolStringArray( ) 12 | script_export_mode=1 13 | script_encryption_key="" 14 | 15 | [preset.0.options] 16 | 17 | texture_format/bptc=false 18 | texture_format/s3tc=true 19 | texture_format/etc=false 20 | texture_format/etc2=false 21 | texture_format/no_bptc_fallbacks=true 22 | binary_format/64_bits=true 23 | binary_format/embed_pck=false 24 | custom_template/release="" 25 | custom_template/debug="PATH_TO_CHANGE" 26 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godotengine/regression-test-project/75f80398d7680ef39e9e9d89c2d5ec328cfda8aa/icon.png -------------------------------------------------------------------------------- /icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path.s3tc="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.stex" 6 | path.etc2="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.stex" 7 | metadata={ 8 | "imported_formats": [ "s3tc", "etc2" ], 9 | "vram_texture": true 10 | } 11 | 12 | [deps] 13 | 14 | source_file="res://icon.png" 15 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.s3tc.stex", "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.etc2.stex" ] 16 | 17 | [params] 18 | 19 | compress/mode=2 20 | compress/lossy_quality=0.7 21 | compress/hdr_mode=0 22 | compress/bptc_ldr=0 23 | compress/normal_map=0 24 | flags/repeat=true 25 | flags/filter=true 26 | flags/mipmaps=true 27 | flags/anisotropic=false 28 | flags/srgb=1 29 | process/fix_alpha_border=true 30 | process/premult_alpha=false 31 | process/HDR_as_SRGB=false 32 | process/invert_color=false 33 | stream=false 34 | size_limit=0 35 | detect_3d=false 36 | svg/scale=1.0 37 | -------------------------------------------------------------------------------- /misc/check_ci_log.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import sys 5 | 6 | if len(sys.argv) < 2: 7 | print("ERROR: You must run program with file name as argument.") 8 | sys.exit(1) 9 | 10 | fname = sys.argv[1] 11 | 12 | fileread = open(fname.strip(), "r") 13 | file_contents = fileread.read() 14 | 15 | # If find "ERROR: AddressSanitizer:", then happens invalid read or write 16 | # This is critical bug, so we need to fix this as fast as possible 17 | 18 | if file_contents.find("ERROR: AddressSanitizer:") != -1: 19 | print("FATAL ERROR: An incorrectly used memory was found.") 20 | sys.exit(1) 21 | 22 | # There is also possible, that program crashed with or without backtrace. 23 | 24 | if ( 25 | file_contents.find("Program crashed with signal") != -1 26 | or file_contents.find("Dumping the backtrace") != -1 27 | or file_contents.find("Segmentation fault (core dumped)") != -1 28 | ): 29 | print("FATAL ERROR: Godot has been crashed.") 30 | sys.exit(1) 31 | 32 | # Finding memory leaks in Godot is quite difficult, because we need to take into 33 | # account leaks also in external libraries. They are usually provided without 34 | # debugging symbols, so the leak report from it usually has only 2/3 lines, 35 | # so searching for 5 element - "#4 0x" - should correctly detect the vast 36 | # majority of memory leaks 37 | 38 | if file_contents.find("ERROR: LeakSanitizer:") != -1: 39 | if file_contents.find("#4 0x") != -1: 40 | print("ERROR: Memory leak was found") 41 | sys.exit(1) 42 | 43 | # It may happen that Godot detects leaking nodes/resources and removes them, so 44 | # this possibility should also be handled as a potential error, even if 45 | # LeakSanitizer doesn't report anything 46 | 47 | if file_contents.find("ObjectDB instances leaked at exit") != -1: 48 | print("ERROR: Memory leak was found") 49 | sys.exit(1) 50 | 51 | sys.exit(0) 52 | -------------------------------------------------------------------------------- /misc/ci/sources.list: -------------------------------------------------------------------------------- 1 | deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse 2 | deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse 3 | deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse 4 | deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse 5 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | [application] 12 | 13 | run/main_scene="res://Start.tscn" 14 | config/icon="res://icon.png" 15 | 16 | [autoload] 17 | 18 | Autoload="*res://Autoload/Autoload.gd" 19 | ValueCreator="*res://AutomaticBugs/ValueCreator.gd" 20 | BasicData="*res://AutomaticBugs/BasicData.gd" 21 | ParseArgumentType="*res://AutomaticBugs/ParseArgumentType.gd" 22 | 23 | [debug] 24 | 25 | gdscript/warnings/enable=false 26 | gdscript/warnings/standalone_expression=false 27 | 28 | [logging] 29 | 30 | file_logging/enable_file_logging.pc=false 31 | 32 | [memory] 33 | 34 | limits/message_queue/max_size_kb=131072 35 | 36 | [network] 37 | 38 | limits/debugger_stdout/max_chars_per_second=16384 39 | limits/debugger_stdout/max_messages_per_frame=100 40 | limits/debugger_stdout/max_errors_per_second=1000 41 | limits/debugger_stdout/max_warnings_per_second=1000 42 | 43 | [rendering] 44 | 45 | environment/default_environment="res://Environment.tres" 46 | --------------------------------------------------------------------------------