Incredible destabilization of physics when using jointed objects with suspendDynamics() #35423

Closed
opened 2013-05-18 18:55:40 +02:00 by Adam Friesen · 13 comments

Category: Physics

%%%Hello, this is my first bug report, registering on this site was something I was somehow trying to avoid for a long time, but I guess that it's now the time to do it.

Anyway, I'm here with a physics bug that came into Blender fairly soon after the 2.66 release, or around the time of the big Bullet Physics Engine upgrade and integration with the 3D viewport, and yes, this is with the Game Engine.

The .blend file should be pretty self-explanatory, there are two objects jointed together, when you play the game they will tumble over the ground and one of the objects will then have its physics suspended (and not the other one).

You will notice that as soon as the physics of that one object is disabled, the other object starts to go all over the place, this lasts for about 5-10 seconds of so before it finally settles down. I will also note that the bug also seems to manifest itself if the objects have enough time to hit the ground before the dynamics are suspended, if they are in midair, then nothing unusual will happen. I have apparently found a very limited choice of physics settings that allows avoidance of the bug in this case, but the expected behavior is broken for the other 99 percent of setting combinations and even then what prevents it here may not work for a larger setup.

I know the attached file uses the logic bricks to suspend the dynamics of one of the objects, but it also happens when one uses the suspendDynamics() function in Python as well. A final note is that I have confirmed that this bug will happen in any case involving a jointed setup where you suspend the dynamics of some objects, but not others, and I will remind you that this did indeed work as expected in the 2.66 release.

%%%

**Category**: Physics %%%Hello, this is my first bug report, registering on this site was something I was somehow trying to avoid for a long time, but I guess that it's now the time to do it. Anyway, I'm here with a physics bug that came into Blender fairly soon after the 2.66 release, or around the time of the big Bullet Physics Engine upgrade and integration with the 3D viewport, and yes, this is with the Game Engine. The .blend file should be pretty self-explanatory, there are two objects jointed together, when you play the game they will tumble over the ground and one of the objects will then have its physics suspended (and not the other one). You will notice that as soon as the physics of that one object is disabled, the other object starts to go all over the place, this lasts for about 5-10 seconds of so before it finally settles down. I will also note that the bug also seems to manifest itself if the objects have enough time to hit the ground before the dynamics are suspended, if they are in midair, then nothing unusual will happen. I have apparently found a very limited choice of physics settings that allows avoidance of the bug in this case, but the expected behavior is broken for the other 99 percent of setting combinations and even then what prevents it here may not work for a larger setup. I know the attached file uses the logic bricks to suspend the dynamics of one of the objects, but it also happens when one uses the suspendDynamics() function in Python as well. A final note is that I have confirmed that this bug will happen in any case involving a jointed setup where you suspend the dynamics of some objects, but not others, and I will remind you that this did indeed work as expected in the 2.66 release. %%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%I have attached a new file to demonstrate a much more complex case that (in 2.66 at least) demonstrates where it actually useful to suspend the dynamics of objects while they are jointed to other objects.

Someone on BA noted that this simple case seems resolved when 'compound' is checked, but for this rather complex case, this will not help at all as the code will generate joints for all objects. Let me just quote what I wrote there on what to do and what goes wrong.


"To see the issue in this file, uncomment the optimization in the code shown when opening the file. Sure, I can decide to not have those lines, but disabling the dynamics in certain cases is actually critical for maintaining performance for a high number of objects when the substeps value is higher than 1.

The whole idea here is to give games a joint-based destruction system that allows objects to break into arbitrary shapes when objects crash into them, this file worked in 2.66, but the building just explodes in 2.67. "


To note, it doesn't matter if there's a force acting against an active object connected to a suspended object, just the mere activation of some of the objects is enough to cause major initial jittering which then, according to the conditions where the code activates the objects, activates everything else and causes the whole building to explode.

If anyone here can look into this issue, look at both files, and ultimately fix the issue, it would be very appreciated.

Thanks.%%%

%%%I have attached a new file to demonstrate a much more complex case that (in 2.66 at least) demonstrates where it actually useful to suspend the dynamics of objects while they are jointed to other objects. Someone on BA noted that this simple case seems resolved when 'compound' is checked, but for this rather complex case, this will not help at all as the code will generate joints for all objects. Let me just quote what I wrote there on what to do and what goes wrong. --------------------------------------------------------------------------------------------- "To see the issue in this file, uncomment the optimization in the code shown when opening the file. Sure, I can decide to not have those lines, but disabling the dynamics in certain cases is actually critical for maintaining performance for a high number of objects when the substeps value is higher than 1. The whole idea here is to give games a joint-based destruction system that allows objects to break into arbitrary shapes when objects crash into them, this file worked in 2.66, but the building just explodes in 2.67. " ------------------------------------------------------------------------------------------- To note, it doesn't matter if there's a force acting against an active object connected to a suspended object, just the mere activation of some of the objects is enough to cause major initial jittering which then, according to the conditions where the code activates the objects, activates everything else and causes the whole building to explode. If anyone here can look into this issue, look at both files, and ultimately fix the issue, it would be very appreciated. Thanks.%%%
Author

%%%Oops, I guess the file was too large for this site, I have the file uploaded here.

http://www.mediafire.com/?c9nfa4a4awzbnrd%%%

%%%Oops, I guess the file was too large for this site, I have the file uploaded here. http://www.mediafire.com/?c9nfa4a4awzbnrd%%%

%%%Can't reproduce here on 64bit linux.
From what I understood, just open the file and press p to see the problem? Maybe I'm missing a step?
Please give your system info and try the latest buildbot version: http://builder.blender.org/download/

If there's a thread somewhere discussing the problem, it might be usefull to post the link to that as well.

Also, for bug reports small files that isolate the problem are mouch more usefull, you don't need to attach complex setups :)%%%

%%%Can't reproduce here on 64bit linux. From what I understood, just open the file and press p to see the problem? Maybe I'm missing a step? Please give your system info and try the latest buildbot version: http://builder.blender.org/download/ If there's a thread somewhere discussing the problem, it might be usefull to post the link to that as well. Also, for bug reports small files that isolate the problem are mouch more usefull, you don't need to attach complex setups :)%%%
Author

%%%Yes, just open the file and press 'P'. the one I uploaded initially (ie. the one that actually uses the projects.blender.org attachment system), does not require any user interaction (and is the most basic setup needed to show the issue). The other file does require interaction as it involves a ball that you can move into the buildings with the arrow keys (but as I said, the bug in that file wouldn't be seen until you uncomment the two lines of code shown in the text editor, which allows the jointed objects to have their physics disabled under certain conditions).

Also, this was just tested with the most recent buildbot build and I've seen no changes in behavior compared to the one I was initially using. This on a Win7 64 bit machine with 16 GB of RAM, an Ivy Bridge i7 processor, and a midrange ATI GPU.

BTW: The thread is here.
http://www.blenderartists.org/forum/showthread.php?291891-Anyone-else-get-this-Spaz-out-issues-with-jointed-objects-and-suspendDynamics%28%29%%%

%%%Yes, just open the file and press 'P'. the one I uploaded initially (ie. the one that actually uses the projects.blender.org attachment system), does not require any user interaction (and is the most basic setup needed to show the issue). The other file does require interaction as it involves a ball that you can move into the buildings with the arrow keys (but as I said, the bug in that file wouldn't be seen until you uncomment the two lines of code shown in the text editor, which allows the jointed objects to have their physics disabled under certain conditions). Also, this was just tested with the most recent buildbot build and I've seen no changes in behavior compared to the one I was initially using. This on a Win7 64 bit machine with 16 GB of RAM, an Ivy Bridge i7 processor, and a midrange ATI GPU. BTW: The thread is here. http://www.blenderartists.org/forum/showthread.php?291891-Anyone-else-get-this-Spaz-out-issues-with-jointed-objects-and-suspendDynamics%28%29%%%

%%%Ok, seems like a windows bug then.
I can't test this atm, at best I could make a patch based on guesses.%%%

%%%Ok, seems like a windows bug then. I can't test this atm, at best I could make a patch based on guesses.%%%
Author

%%%Hi again, I think I have a need to be even more specific, here is why.

I tested the file again with the MingW build I got from the buildbot yesterday (not the VC build) and the problem went away.

So not only is it specific to Windows builds, it's also more or less specific to those built with the Visual C 2008 compiler.

Hope that helps.
%%%

%%%Hi again, I think I have a need to be even more specific, here is why. I tested the file again with the MingW build I got from the buildbot yesterday (not the VC build) and the problem went away. So not only is it specific to Windows builds, it's also more or less specific to those built with the Visual C 2008 compiler. Hope that helps. %%%
Member

Added subscriber: @brita

Added subscriber: @brita
Member

@Ace_Dragon I was also not able to reproduce this on my linux machine.
Can you confirm if it is still happening on windows?

@Ace_Dragon I was also not able to reproduce this on my linux machine. Can you confirm if it is still happening on windows?
Author

Hi. I had time to test the file again for post 2.71 builds.

The simple situation I posted is now completely stable in VC2013, but the complex file I posted still has major issues with blocks suddenly disappearing when the physics are continually suspended and restored.

If you have access to windows, you might try the larger file since it seems like the bug is now limited to larger setups (or at least would be harder to reproduce on simple cases).

Hi. I had time to test the file again for post 2.71 builds. The simple situation I posted is now completely stable in VC2013, but the complex file I posted still has major issues with blocks suddenly disappearing when the physics are continually suspended and restored. If you have access to windows, you might try the larger file since it seems like the bug is now limited to larger setups (or at least would be harder to reproduce on simple cases).
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Aaron Carlisle self-assigned this 2019-06-29 02:20:26 +02:00
Member

This task is being closed because the BGE has been removed in Blender 2.8.

This task is being closed because the BGE has been removed in Blender 2.8.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#35423
No description provided.