Character walkDirection ADD mode -#INF error #34349

Closed
opened 2013-02-21 17:51:23 +01:00 by Angus Hollands · 8 comments

Category: Physics

%%%It appears that if you set two character motion controllers on the same axis with opposite signs at the same time (ADD) it will sometimes result in an infinite vector for walk direction (and thus worldPosition). In the test file hold (W then S) or (S then W) or (A then D) (for some reason D then A doesn't do this).
Showing the console will show the outcome.%%%

**Category**: Physics %%%It appears that if you set two character motion controllers on the same axis with opposite signs at the same time (ADD) it will sometimes result in an infinite vector for walk direction (and thus worldPosition). In the test file hold (W then S) or (S then W) or (A then D) (for some reason D then A doesn't do this). Showing the console will show the outcome.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%Might I also add the following points (primarily so that I don't forget and If you have time you could check it out):

  1. Changing the substeps for physics changes the fall speed
  2. For some reason the Bullet gravity is set to 3Gs in the character controller defaults in Extern/Bullet2
  3. The falling doesn't seem to be very smooth at all.
    %%%
%%%Might I also add the following points (primarily so that I don't forget and If you have time you could check it out): 1) Changing the substeps for physics changes the fall speed 2) For some reason the Bullet gravity is set to 3Gs in the character controller defaults in Extern/Bullet2 3) The falling doesn't seem to be very smooth at all. %%%
Author

%%%also it doesn't return a reference to the walkDirection in the wrapper, only a copy of the value, which seems inconsistent%%%

%%%*also it doesn't return a reference to the walkDirection in the wrapper*, only a copy of the value, which seems inconsistent%%%

%%%As of r54738 you will no longer get the -#INF issues. However, the actual results will depend on the order of when the actuators are fired. For example, if the current walk direction is <1, 0, 0> we can have two possibilities. We'll have actuator A add <1, 0, 0> to the walk direction and B add <-1, 0, 0> to the actuator. If A goes off first, the result will be <1, 0, 0> (the result is normalized) followed by <0, 0, 0> and the character stops. Otherwise if B goes first, then we get <0, 0, 0> first then <1, 0, 0> second and the character keeps moving in the same direction. I'm not sure how to solve this problem, or if it's something that should be solved. So, I'm open to some feedback on how to tackle this.

As for the other issues you mentioned:

  1. This is already noted in another bug report somewhere, and is a Bullet issue.
  2. Again, this is a Bullet thing.
  3. This seems rather subjective, and I haven't had too many problems here.
  4. All the character wrapper has is a copy; I can make sure this is noted in the docs.%%%
%%%As of r54738 you will no longer get the -#INF issues. However, the actual results will depend on the order of when the actuators are fired. For example, if the current walk direction is <1, 0, 0> we can have two possibilities. We'll have actuator A add <1, 0, 0> to the walk direction and B add <-1, 0, 0> to the actuator. If A goes off first, the result will be <1, 0, 0> (the result is normalized) followed by <0, 0, 0> and the character stops. Otherwise if B goes first, then we get <0, 0, 0> first then <1, 0, 0> second and the character keeps moving in the same direction. I'm not sure how to solve this problem, or if it's something that should be solved. So, I'm open to some feedback on how to tackle this. As for the other issues you mentioned: 1) This is already noted in another bug report somewhere, and is a Bullet issue. 2) Again, this is a Bullet thing. 3) This seems rather subjective, and I haven't had too many problems here. 4) All the character wrapper has is a copy; I can make sure this is noted in the docs.%%%
Author

%%%This is always an issue with character controllers. Except your example is incorrect I believe(?)
If the direction has an x component of 1.0, then A followed by B would equate to: (Start) 1 -> (+A) 2.0 -> (+B) 1.0
However, if you stop the motion at the end of an input, would it be better to involve a callback of some sort that would operate after all logic bricks are executed? This would best demonstrate group behaviour of logic bricks rather than each acting as a self contained component. However, this may break the preconception that all logic bricks have only the smallest dependencies (e.g Collisions -> Bullet)%%%

%%%This is always an issue with character controllers. Except your example is incorrect I believe(?) If the direction has an x component of 1.0, then A followed by B would equate to: (Start) 1 -> (+A) 2.0 -> (+B) 1.0 However, if you stop the motion at the end of an input, would it be better to involve a callback of some sort that would operate after all logic bricks are executed? This would best demonstrate group behaviour of logic bricks rather than each acting as a self contained component. However, this may break the preconception that all logic bricks have only the smallest dependencies (e.g Collisions -> Bullet)%%%

%%%Actually, the add isn't a straight add. Otherwise, calling the same direction over and over would start to make you go very fast, which is why you get <1, 0, 0> and not <2, 0, 0>.%%%

%%%Actually, the add isn't a straight add. Otherwise, calling the same direction over and over would start to make you go very fast, which is why you get <1, 0, 0> and not <2, 0, 0>.%%%
Author

%%%I see. Well, one possible solution to this would be to register a callback. Each time an actuator processes using ADD it adds the vector to a Set - like data structure stored on the GameObject (Or should it be within the Logic system?). That way only unique vectors are stored. At the end of the logic frame we sum the vectors for a resultant and apply that?%%%

%%%I see. Well, one possible solution to this would be to register a callback. Each time an actuator processes using ADD it adds the vector to a Set - like data structure stored on the GameObject (Or should it be within the Logic system?). That way only unique vectors are stored. At the end of the logic frame we sum the vectors for a resultant and apply that?%%%
Member

Closed as duplicate of #44328

Closed as duplicate of #44328
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
3 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#34349
No description provided.