godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
87.05k stars 19.54k forks source link

[Bullet] RayCast pointing at SoftBody freezes game (no scripting involved) #59423

Open dlstar89 opened 2 years ago

dlstar89 commented 2 years ago

Godot version

3.4.3

System information

Windows 10, GLES3, Intel Iris Xe (30.0.101.1340)

Issue description

Game freezes when RayCast is pointing at a SoftBody, please pay attention to the structure of the mesh supplied to soft body, this are basically 2 planes joined in blender

breaks_game

Steps to reproduce

No scripting is involved Supplied project contains scene 'scene_not_working.tscn', when you run it game should freeze, if you disable RayCast then it works fine

Minimal reproduction project

softbody_raycast_project.zip

dlstar89 commented 2 years ago

Same issue persists in 3.4.4.stable

Calinou commented 2 years ago

@dlstar89 Does this occur with a single, non-disjointed plane (with 4 or 8 vertices)?

dlstar89 commented 2 years ago

@Calinou Just to make sure things are clear ill post 3 examples, all are single meshes and hopefully I use correct terminology

This mesh works fine, as can seen there are 8 vertices and 3 faces works_1

This does not work, 8 vertices and 2 faces doesnt_work_1

This does not work, 8 vertices and 2 faces, connected vertices to create edge ([1,2], [3,4]) doesnt_work_2

Unchecking Ray Pickable option doesn't solve the freezing issue with none working meshes image

dlstar89 commented 2 years ago

@Calinou Just to mention, the last version it worked fine was in 3.3.4.stable

Calinou commented 2 years ago

@Calinou Just to mention, the last version it worked fine was in 3.3.4.stable

Can you reproduce this in any of the 3.4 betas and RCs to determine when the regression started?

dlstar89 commented 2 years ago

@Calinou I only tested on Windows 10 using Godot 64 bit version

BETA freeze start from: Godot_v3.4-beta6_win64 RC freeze starts from: Godot_v3.4-rc1_win64

Calinou commented 2 years ago

Commits between 3.4beta5 (last working version) and 3.4beta6 (first broken version): https://github.com/godotengine/godot/compare/dd0ee487280d1a6dc4941235cc85bf211cebc444...3e2bb415a9b186596b9ce02debc79590380c2355

In text-based form (git shortlog dd0ee487280d1a6dc4941235cc85bf211cebc444...3e2bb415a9b186596b9ce02debc79590380c2355):

Aaron Franke (4):
      [3.x] Make the GLTF module not depend on the RegEx module
      [3.x] Warn when using the dectime method
      [3.x] Fix GLTF light import
      Add locale rename for the "C" locale

Alexandr Xenofontov (1):
      added optional cropping for texture atlas importer

Ansraer (1):
      implement better ui scaling

Bartłomiej T. Listwon (2):
      Fix RichTextLabel character horizontal offset calculation
      Add missing WIN32_LEAN_AND_MEAN

BimDav (1):
      Reload kinematic shapes when changing PhysicsBody mode to Kinematic

Chaosus (2):
      [3.x] Draggin in/out from ports to create nodes in Animation Blend Tree
      Merge pull request #52966 from Chaosus/blend_tree_connection_improvement_3.x

Daniel (1):
      Added wakeup() call to velocity, force and impulse functions.

David Socha (1):
      export "Keep" import option when multiple files are selected

Duarte David (1):
      Fixes the normals of SphereMesh when the sphere/hemisphere is oblong

Eric M (2):
      Added properties and methods to allow for dragging and dropping multiple files onto exported arrays.
      Fixed drag and drop not respecting type on exported arrays.

Fabio Alessandrelli (8):
      Merge pull request #52973 from selgesel/patch2
      [HTML5] Implement mouse/touch/key events in JS library.
      [HTML5] Implement fullscreenchange in JS library.
      [HTML5] Implement window blur in JS library.
      [HTML5] Implement Pointer Lock API in JS library.
      [HTML5] Refactor display/input JS library code.
      [HTML5] Refactor JS library listeners to OS.
      [HTML5] Remove "maximize" support.

Florian Kothmeier (1):
      Fix AnimationNodeStateMachinePlayback start() on nonexistent node

Francois Belair (6):
      Make LSP send applyEdit to connect editor signals
      Makes LSP report new() as _init; fixes docstrings
      Add up/down keys to inc/dec val in spin slider
      Fix LSP crash parsing scripts of temp size 0
      Fix extends parsing breaking if it has the cursor
      Fix empty line hover; fix open non-res:// script

Fredia Huya-Kouadio (1):
      Provide a getter for the project data directory.

Gergely Kis (1):
      Fix GDNativeLibrary::get_current_library_path()

Germanrc (1):
      C# script reload fixed

Haoyu Qiu (10):
      Make 3D selection box independent of object size
      Fix 3D view name typo
      Fix crash in Tween.follow_property
      Fix crash when casting from null
      Fix LineEdit undo crash
      Fix doc for Dictionary.erase
      Fix crash when creating thread
      Fix crash when pinned SoftBody point is out of range
      Fix crash when deleting Camera2D and Viewport assigned to it
      Fix crash when tooltip_request_func object is freed

Hugo Locurcio (12):
      Color error and warning lines in the editor debugger's Errors panel
      Add history navigation in the script editor using extra mouse buttons
      Use a yellow color for editable children properties instead of red
      Clarify what the `Node.filename` property contains
      Improve the documentation for `ease()` and `smoothstep()`
      Tweak the Viewport configuration warning to mention 2×2 size requirement
      Document that tangents are required for normal mapping in SpatialMaterial
      Use a Big Sur-style macOS icon for the Godot editor
      Document how to set up UPnP in a non-blocking manner
      Add an example on iterating an array backwards
      Document SurfaceTool must generate tangents for proper normal display
      Add an editor setting to configure number of threads for lightmap baking

Jordan Schidlowsky (1):
      revert 0d7409a so additional error information prints in release builds

Kirill Diduk (1):
      #52499 Fix parsing 'preload': increase/decrease parenthesis count

Kongfa Waroros (1):
      Check if the line pointer goes away from the image buffer's EOF in the BMP importer

LATRio (3):
      fix crash in Variant::get_method_default_arguments when wrong type is passed
      Fix crash at SoftBodyBullet::reset_all_node_positions when bt_soft_body isn't initialized
      Prevent out of bound access through 'm_nodes' in SoftBodyBullet

Laurenz Reinthaler (1):
      Fix VisibilityEnabler2D throwing a signal error when process_parent or physics_process_parent are enabled

Lucy (1):
      Fix Platform Thread Override

Lyuma (1):
      Backport to 3.x "gltf export: Fix export of skeletons, skins and blend shapes."

Manuel Moos (1):
      Fix negative delta arguments

Manuele Finocchiaro (1):
      Compile bullet with threasafe switch on

Marcel Admiraal (1):
      Increment index when populating PhysicsShapeQueryParameters exclude array.

Matthew Newall (2):
      Updated Tabs to not update excessively
      Corrected Save Scene and Save All Scenes not working when the scene's dir no longer exists

Maxime Lapointe (1):
      Improve error message when instantiating virtual class

Metin Celik (1):
      Add half frame to floor()

Michael Alexsander (3):
      Make mirror button in Template Manager use the lighter version of its icon
      Expose `TabContainer`'s tab hidding for scripts
      Fix `Tabs` offset overreaching when scrolling fast

O01eg (1):
      Implement override of get_message

Pedro J. Estébanez (2):
      Fix check for freed object during cast
      Reset scene conditionals assumed to be false

PouleyKetchoupp (7):
      Don't override KinematicCollision reference when still in use in script
      Update mesh AABB when software skinning is used
      Optimize AABB calculation in software skinning
      Fix buffer overflow in 2D BVH
      Improved logic for KinematicBody collision recovery depth
      Fix Rayshape recovery in test_body_ray_separation
      Fix editable children errors when packing scene tree at runtime

Robbie Cooper (1):
      Fix file panel renaming unable to change the case of dirs on Windows

Rémi Verschelde (94):
      Merge pull request #52922 from timothyqiu/view-name-typo-3.x
      Merge pull request #52925 from timothyqiu/follow-property-null
      Merge pull request #52955 from nekomatata/fix-kinematic-collision-reference-3.x
      Merge pull request #52894 from laws65/3d-skeleton-bone-fix
      Merge pull request #52883 from Germanrc/script_reload_fix
      Update AUTHORS and DONORS list
      Merge pull request #53010 from Calinou/editor-debugger-color-error-warning-lines-3.x
      Merge pull request #53026 from kleonc/texture-preview-updating-3x
      Merge pull request #53022 from Schweini07/ve2d-signal-fix
      Merge pull request #52984 from pycbouh/disable-freaky-subinspectors-3.x
      Merge pull request #53039 from pycbouh/tree-fix-folding-arrow-with-margin-3.x
      Merge pull request #53068 from Razoric480/apply-new-signal
      Merge pull request #53015 from timothyqiu/cast-crash
      Merge pull request #53105 from aaronfranke/3.x-fix-gltf-light
      nanosvg: Sync with upstream ccdb199
      CI: Build test binaries with debug symbols, then strip
      Revert "Fixes the normals of SphereMesh when the sphere/hemisphere is oblong"
      Revert "Load assets before enabling editor plugins"
      Merge pull request #53136 from akien-mga/3.x-cherrypicks
      Merge pull request #53143 from naeu/fix_folder_icon_3.x
      Merge pull request #53144 from nekomatata/software-skinning-aabb
      Merge pull request #53142 from RandomShaper/fix_cast_freed_check_3.x
      Merge pull request #53140 from V-Sekai/gltf_naming_fix
      Merge pull request #53041 from pycbouh/docs-color-picker-and-button-3.x
      Merge pull request #53168 from LATRio/53120
      Merge pull request #53157 from boruok/fix-atlas-texture-return-null
      Merge pull request #53113 from danger-dan/wake_on_force
      Merge pull request #53202 from timothyqiu/line-edit-undo
      Merge pull request #53065 from godotengine/template_manager_mirror_icon_3
      Merge pull request #52947 from zmanuel/negative-delta-fix-3x
      Merge pull request #53063 from stebulba/3_x_undo_closecurve
      Merge pull request #53190 from nekomatata/software-skinning-aabb-optimization
      HTML5: Fix minification error with Emscripten 1.39.9
      Merge pull request #53207 from o01eg/virtual-translation-3.x
      Fix -Wextra warnings from GCC 11
      Merge pull request #53213 from akien-mga/3.x-fix-gcc-11-Wextra
      Merge pull request #53094 from Razoric480/fix-func-doc-_init
      bullet: Sync with upstream 3.17
      Merge pull request #48300 from akien-mga/3.x-bullet-3.09
      Merge pull request #53183 from m4nu3lf/threadsafe_bullet_3.x
      Merge pull request #53220 from KoBeWi/dark_editor
      Merge pull request #48686 from bruvzg/bundle_icon_3
      Merge pull request #53261 from Razoric480/lsp_crash_vim_ale
      Merge pull request #53258 from boruok/3.x-fix-atlas-texture-get_data-crash
      Merge pull request #53309 from Razoric480/fix-lsp-token-issues-3x
      Merge pull request #53307 from Calinou/doc-spatialmaterial-normal-tangents
      Merge pull request #53335 from LATRio/53331_2
      Merge pull request #53349 from LATRio/53331_1
      Merge pull request #42365 from madmiraal/fix-39887-3.2
      Merge pull request #53060 from timothyqiu/thread-obj-3.x
      Merge pull request #52752 from Pineapple/fix-richtextlabel-character-offsets
      SCons: Add `DEV_ENABLED` defines for `target=debug` builds
      Merge pull request #53380 from timothyqiu/soft-body-3.x
      Merge pull request #53383 from akien-mga/3.x-DEV_ENABLED
      Merge pull request #52509 from jitspoe/3.x.csg_fixes_and_simplification
      Merge pull request #53387 from akien-mga/3.x-cherrypicks
      Merge pull request #53369 from RandomShaper/fix_shader_state_3.x
      Merge pull request #53397 from pycbouh/theme-improve-change-propagation-3.x
      Merge pull request #53300 from Calinou/viewport-tweak-configuration-warning-3.x
      Merge pull request #53347 from migeran/fix_gdnative_get_current_library_path
      Merge pull request #53410 from pycbouh/editor-theme-guard-bitmap-fonts-3.x
      Merge pull request #50718 from LightningAA/drag-multiple-resources-onto-array-export-3.x
      Merge pull request #53263 from Calinou/editor-inspector-warning-yellow-3.x
      Merge pull request #53226 from aaronfranke/3.x-c-locale
      Merge pull request #53052 from kleonc/animated-sprites-centered-rendering-3x
      Merge pull request #53393 from lawnjelly/dev_asserts
      Merge pull request #53090 from Razoric480/key_up_down_spin_slider_32
      Merge pull request #53067 from Calinou/add-script-nav-extra-mouse-button-3.x
      Merge pull request #53012 from lawnjelly/portals_unload_reason
      Merge pull request #52964 from Pineapple/WIN32_LEAN_AND_MEAN
      Merge pull request #51086 from aaronfranke/3.x-warn-dectime
      Merge pull request #52274 from aaronfranke/3.x-gltf-noregex
      Merge pull request #51728 from lawnjelly/proj_settings_misc
      Merge pull request #51438 from timothyqiu/selection-box-sep-3x
      Merge pull request #53429 from KoBeWi/listener3.x
      Merge pull request #53233 from metinc/fix-animated-sprite-precision-error
      Merge pull request #52812 from Faless/js/3.x_our_input
      Merge pull request #52365 from jitspoe/3.x.viewport_error_fix
      Merge pull request #52137 from Ansraer/3.x-2d-scale-factor
      Merge pull request #52952 from Calinou/cpu-lightmapper-num-threads-editor-setting
      Merge pull request #52652 from boruok/optional-crop-for-texture-atlas-importer
      Merge pull request #47500 from briansemrau/nan-inf-tscn-parsing-bug-3.x
      Merge pull request #52714 from m4gr3d/provide_getter_for_project_data_dir_3x
      bullet: Fix UWP build by disabling TaskScheduler dynamic loading
      Merge pull request #53458 from akien-mga/3.x-bullet-fix-uwp
      Merge pull request #53454 from stebulba/path_simplify_angle-fix-error-from-merge
      Merge pull request #53448 from lyuma/backport_gltf_skin_export
      Merge pull request #53451 from nekomatata/kinematic-body-recovery-depth-3.x
      Merge pull request #53453 from nekomatata/fix-rayshape-snap-3.x
      Merge pull request #53459 from timothyqiu/camera-viewport-3.x
      doc: Fix style inconsistencies for `[b]Note:[/b]` paragraphs
      makerst: Make external links anonymous
      Merge pull request #52521 from kdiduk/52499-preload-parsing-error-when-newline-encountered
      Merge pull request #53461 from timothyqiu/tooltip-request-func-3.x

Saracen (1):
      Fixes naming conflict in GLTF importer

Selgesel (1):
      [3.x] Release pressed events when the window is blurred on HTML5 platform

Shatur95 (1):
      Fix CONNECT_REFERENCE_COUNTED

Stéphane Fortin (2):
      add missing undo on CloseCurve
      Fix merging error path_simplify_angle CSGPolygon

Thakee Nathees (1):
      NaN, INF read/write bug fixed

Tomasz Chabora (3):
      Add a special case for 0-time interpolations
      Fix editor stuck dimmed because of unsaved script
      Add Listener2D

Yuri Sizov (7):
      Disable sub-inspectors for properties with their own editors
      Correctly calculate position of the folding arrow in Tree
      Add usability notes to ColorPicker and ColorPickerButton descriptions
      Reorganize Theme resource code for better maintainability
      Expose API to retrieve Theme's default font
      Make Theme report property list changes less often
      Safeguard against BitMap fonts in the CanvasItem editor

boruok (2):
      fix atlas texture return null
      [3.x] Fix AtlasTexture get_data crash

bruvzg (1):
      [macOS] Prefer .app bundle icon over the default one.

jitspoe (2):
      CSGPolygon fixes and features: Added angle simplification, UV tiling distance option, and interval type, which allows distance-based intervals (old) and subdivision-based intervals (new to 3.4).
      Fix ViewportTexture error when viewport is used from a child scene

kleonc (3):
      TexturePreview Update text when texture is being changed
      SceneTreeDock Ensure to deactivate multi edit when selection changes to a single node
      Fix rendering centered odd-size texture in AnimatedSprite/AnimatedSprite3D

lawnjelly (3):
      Portals - add reason string to unload message
      Add DEV_ASSERT and DEV_CHECK macros
      Create 'rendering/misc' project settings section

laws65 (1):
      Prevent being able to set bone's parent as itself

naeu (1):
      Set dialog folder icon color

skyace65 (1):
      Add note that for _gui_input(event) event position is relative to the control origin

zacryol (1):
      Fix typo with example variable name in Dictionary docs, and fix error in C# example
dlstar89 commented 2 years ago

@Calinou The only entry which mentions SoftBody IMG_20220331_202331.jpg

timothyqiu commented 2 years ago

This behavior is introduced since Bullet is updated to 3.17: #48300

Before the update, it works fine but there are errors in the console:

ERROR: Spatial node not defined in the pinned point, this is undefined behavior for SoftBody!
   at: _update_cache_pin_points_datas (scene/3d/soft_body.cpp:770)

Looks like there are undefined behavior in the SoftBody setup.

dlstar89 commented 2 years ago

@timothyqiu Errors went away after providing Spatial Attachment Path, but the game still freezes with this kind of mesh image

dlstar89 commented 2 years ago

@Calinou Is there anything else needed to get this looked at by someone else?

Calinou commented 2 years ago

@Calinou Is there anything else needed to get this looked at by someone else?

I don't know how to fix this myself, sorry.

fbcosentino commented 2 years ago

Just confirming I get this issue on 3.5.rc3, and I at least got the project to work by keeping the SoftBody mask layer to the collision layer of interest but moving the collision layer to an unused one. So softbody finds objects but objects don't find it. No longer freezes then