View Issue Details

IDProjectCategoryView StatusLast Update
0005599The Dark ModPhysicspublic01.01.2023 15:51
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionTDM 2.09 
Target VersionTDM 2.10Fixed in VersionTDM 2.10 
Summary0005599: Improve grabber on lightweight objects
DescriptionGrabbing lightweight objects is very dangerous, because they easily reach high velocities from small mouse movements.
They push nearby objects around and often bring noise, if not handled carefully.

I'd like to do a few improvements to this.
Additional InformationOriginally reported here:
  https://forums.thedarkmod.com/index.php?/topic/20907-grabber-improvements/
TagsNo tags attached.

Relationships

related to 0003543 new Bad physics for small moveables 
related to 0001081 new Grabber: Repeated collision sounds when sliding 
related to 0001609 new Grabber: Handling Heavy Objects 

Activities

stgatilov

stgatilov

01.05.2021 17:07

administrator   ~0013940

Last edited: 05.05.2021 14:46

Committed some possible changes:
  r9334. Scale velocity limit with amount of time "throw" button was held, just like impulse.
  [REVERTED] r9335. Apply velocity limit to dragged object, add mass of player's arm to mass of dragged object.

In case there are not good, simply revert both of them (or one of them separately).
stgatilov

stgatilov

05.05.2021 14:40

administrator   ~0013957

Last edited: 05.05.2021 14:46

More changes (follow-up for velocity limit of dragged object):
  [REVERTED] r9338. Raise velocity limit when grabbed object is far from the center of the screen.
stgatilov

stgatilov

07.05.2021 04:08

administrator   ~0013968

First of all, I have reverted my prior changes in dragging code:
  r9340. Reverted recent changes to grabber.
The changes in throwing code remain.

Then I added a whole new mode for grabber:
  r9346. Added idVec3::ProjectToConvexCone method for "sliding" physics behavior.
  r9347. Implemented new grabber.
(the first commit does not change behavior, only adds utility function)

The new grabber is enabled under tdm_drag_new cvar (enabled by default).
Its behavior is controlled by cvars like tdm_drag2_XXX.

The most important is tdm_drag2_rigid_silentmode: it controls when "silent" mode is used.
The silent mode disabled all impulses to other objects and bounce sounds, as well as stims, script events, fx, etc.
stgatilov

stgatilov

15.05.2021 06:54

administrator   ~0014020

Started a thread for feedback:
  https://forums.thedarkmod.com/index.php?/topic/20928-210-new-physics-for-object-manipulation-and-dragging-bodies
stgatilov

stgatilov

10.11.2021 04:01

administrator   ~0014526

There is one problem in the new grabber:
  https://forums.thedarkmod.com/index.php?/topic/20928-210-new-physics-for-object-manipulation-and-dragging-bodies/&do=findComment&comment=466408

Basically, we are supposed to be able to lift rat corpse.
Now dragging force is 80% of weight, so player cannot take the corpse off the ground.

Just raising the force leads to rat oscillating in the air, so some kind of damping is needed for such ragdolls...
stgatilov

stgatilov

08.12.2021 14:56

administrator   ~0014582

Pretty major commit to support lifting rats into air:
  r9686. Supporting lifting grabbed AF into air with new drag implementation.

Now I check for entity's "ground_when_dragged" spawnarg.
  If it is true, then force/weight is tdm_drag2_af_weight_ratio = 80%.
  If it is false, then force/weight is tdm_drag2_af_weight_ratio_canlift = 500%.

In order to fix oscillations, I did two things when dragged object is fully in-air:
 1) Apply force uniformly to all bodies, so that they are not moved relative to each other (normally, force is applied only to the selected body).
  2) Temporarily override global (air) friction parameters with 0.5.
I had to add some nasty code for the second point: saving/restoring friction coefficients, putting them to savegame file, making sure restore always happens.
stgatilov

stgatilov

28.01.2022 07:01

administrator   ~0014695

Added separate code path for rotating rigid objects too.

The reason is summarized here:
  https://forums.thedarkmod.com/index.php?/topic/20907-grabber-improvements/&do=findComment&comment=469460
  https://forums.thedarkmod.com/index.php?/topic/21198-beta-testing-210/&do=findComment&comment=469415

The old code slows down rotation of heavy objects (a lot).
Aside from general annoyance from such "realistic" approach, when "to-be-applied-in-future" rotation hits 180 degrees, the rotation direction is reversed.
That's because the code stores only target orientation of the object, instead of rotation angles to be applied.

Now rotation does not depend on object's mass and is pretty fast in general.

Issue History

Date Modified Username Field Change
01.05.2021 14:31 stgatilov New Issue
01.05.2021 14:31 stgatilov Status new => assigned
01.05.2021 14:31 stgatilov Assigned To => stgatilov
01.05.2021 14:31 stgatilov Relationship added related to 0003543
01.05.2021 14:33 stgatilov Relationship added related to 0001081
01.05.2021 17:07 stgatilov Note Added: 0013940
05.05.2021 14:40 stgatilov Note Added: 0013957
05.05.2021 14:46 stgatilov Note Edited: 0013940
05.05.2021 14:46 stgatilov Note Edited: 0013957
07.05.2021 04:08 stgatilov Note Added: 0013968
15.05.2021 06:54 stgatilov Status assigned => feedback
15.05.2021 06:54 stgatilov Note Added: 0014020
10.11.2021 04:01 stgatilov Note Added: 0014526
08.12.2021 14:56 stgatilov Note Added: 0014582
28.01.2022 07:01 stgatilov Note Added: 0014695
31.01.2022 16:54 nbohr1more Status feedback => resolved
31.01.2022 16:54 nbohr1more Resolution open => fixed
31.01.2022 16:54 nbohr1more Fixed in Version => TDM 2.10
01.01.2023 15:51 nbohr1more Relationship added related to 0001609