Second character motion actuator overwirte forward motion [patch] #36703

Closed
opened 2013-09-11 16:33:48 +02:00 by Thomas Szepe · 14 comments
Member

%%%This bug report is related to [#36329] Character physics type doesn't react to actuator?.

I know that I can enable the "Add" button to get it work. But if add is enabled and you move and rotate the rotation speed does not match with the character rotation.
I made a fix for that. I also fixed the double jump problem. Now it is possible to jump permanently and make a double jump. I also removed the now unnecessary "Add" button.

%%%

%%%This bug report is related to [#36329] Character physics type doesn't react to actuator?. I know that I can enable the "Add" button to get it work. But if add is enabled and you move and rotate the rotation speed does not match with the character rotation. I made a fix for that. I also fixed the double jump problem. Now it is possible to jump permanently and make a double jump. I also removed the now unnecessary "Add" button. %%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

#40682 was marked as duplicate of this issue

#40682 was marked as duplicate of this issue
Member

%%%Is this a new bug, or just a patch for an existing bug?%%%

%%%Is this a new bug, or just a patch for an existing bug?%%%

%%%I haven't actually tested the patch, but I do see some issues with it. First off, the add button is to allow two motion actuator bricks to add movement (not just movement and rotation). For example, if I have four actuators that control 4 directions, I can combine two of those to get diagonals. It looks like your patch removes the ability to do this. Also, the motion actuator shouldn't be doing OnGround checks, this should be the responsibility of the character physics.

I've also refactored the physics code so (among other things) the motion actuator receives a character controller reference and doesn't need to keep doing nonsense with the generic physics controller. However, that's not really a problem with your patch; I'm just noting a future conflict.%%%

%%%I haven't actually tested the patch, but I do see some issues with it. First off, the add button is to allow two motion actuator bricks to add movement (not just movement and rotation). For example, if I have four actuators that control 4 directions, I can combine two of those to get diagonals. It looks like your patch removes the ability to do this. Also, the motion actuator shouldn't be doing OnGround checks, this should be the responsibility of the character physics. I've also refactored the physics code so (among other things) the motion actuator receives a character controller reference and doesn't need to keep doing nonsense with the generic physics controller. However, that's not really a problem with your patch; I'm just noting a future conflict.%%%
Author
Member

%%%@daniel-34 Strokes.
It is just a patch for the existing bug.

@Mitchell Strokes.
You are right. Diagonal movement is not possible, like the other motion actuator. I am also not satisfied with OnGround check in the motion actuator.
If I have time I try to find a better solution.%%%

%%%@daniel-34 Strokes. It is just a patch for the existing bug. @Mitchell Strokes. You are right. Diagonal movement is not possible, like the other motion actuator. I am also not satisfied with OnGround check in the motion actuator. If I have time I try to find a better solution.%%%
Member

%%%Moved from Game Engine to Patches%%%

%%%Moved from Game Engine to Patches%%%
Author
Member

%%%I uploaded a new patch. Now diagonal movement and rotation is possible.

The problem why the add button not working with rotated objects was, that GetWalkDirection() returns returns the rotated movement vector.
There are only two ways to fix that .

  1. Rotate the GetWalkDirection() vector back.
  2. Store the old set vector in a static variable.
    I choose the the number two because it need less calculations.

About the double jump fix. I think there are no much better way to fix that. Because I need to know when the keyboard key is released. This information I only can get from the motion actuator.
I can make noJump() or keyStatus(true) method or modify the Jump(true) method to pass this information through to the character physics. But this will need the same changes as passing the onGround() to the motion actuator.
I am also not sure which class(es) you mean by character physics and generic physics controller.

I added the "Add" button back. But I think this button is unnecessary. Add can be always on. There are only two things for that it is good for.
If you don't want to move diagonally or stop with a 0,0,0 actuator. But this can be also done with the logic controllers (XOR, AND) or just by releasing the key.

%%%

%%%I uploaded a new patch. Now diagonal movement and rotation is possible. The problem why the add button not working with rotated objects was, that GetWalkDirection() returns returns the rotated movement vector. There are only two ways to fix that . 1. Rotate the GetWalkDirection() vector back. 2. Store the old set vector in a static variable. I choose the the number two because it need less calculations. About the double jump fix. I think there are no much better way to fix that. Because I need to know when the keyboard key is released. This information I only can get from the motion actuator. I can make noJump() or keyStatus(true) method or modify the Jump(true) method to pass this information through to the character physics. But this will need the same changes as passing the onGround() to the motion actuator. I am also not sure which class(es) you mean by character physics and generic physics controller. I added the "Add" button back. But I think this button is unnecessary. Add can be always on. There are only two things for that it is good for. If you don't want to move diagonally or stop with a 0,0,0 actuator. But this can be also done with the logic controllers (XOR, AND) or just by releasing the key. %%%

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

How safe is such a static variable when there are multiple actuators?

How safe is such a static variable when there are multiple actuators?
Author
Member

Normally it is save to use static variables. But what I missed to test if we add more then one Character object.

For the actual patch D1206 it is not necessary any more. It get the actual rotation and velocity directly from the object.

Normally it is save to use static variables. But what I missed to test if we add more then one Character object. For the actual patch [D1206](https://archive.blender.org/developer/D1206) it is not necessary any more. It get the actual rotation and velocity directly from the object.

This issue was referenced by 29e968a315

This issue was referenced by 29e968a3158b2e51a7d03b993b5e64a47ebea276
Author
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

Closed by commit 29e968a315.

Closed by commit 29e968a315.
Author
Member

Added subscribers: @JosephMasaki, @brita, @sreich

Added subscribers: @JosephMasaki, @brita, @sreich
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
5 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#36703
No description provided.