GeneralsGamePatch icon indicating copy to clipboard operation
GeneralsGamePatch copied to clipboard

GLA Worker has unused docking animation

Open MavroGada2 opened this issue 2 years ago • 7 comments

GLA Worker has unused docking animation. I simply copy pasted condition states from chinook and it worked.

Original:

https://user-images.githubusercontent.com/103841664/220640160-53ba10c6-d0ab-4509-a259-e8abf5c3a4a3.mp4

Fixed:

https://user-images.githubusercontent.com/103841664/220639732-ed1f474f-0013-4bb9-9ff1-7c48bc75f61e.mp4

WaitForStateToFinishIfPossible = TRANS_Docking

Added to DefaultConditionState.

   TransitionState = TRANS_Stand TRANS_Carry
     ShowSubObject = BOX
     Animation     = UIWRKR_SKL.UIWRKR_PIK
     AnimationMode = ONCE
   End

   TransitionState = TRANS_Carry TRANS_Stand
     ShowSubObject = BOX
     Animation     = UIWRKR_SKL.UIWRKR_PIK
     AnimationMode = ONCE_BACKWARDS
     Flags         = START_FRAME_LAST
   End

Changed to;

   ConditionState = DOCKING
     ShowSubObject = BOX
     Animation     = UIWRKR_SKL.UIWRKR_PIK
     AnimationMode = ONCE
	  TransitionKey = TRANS_Docking
   End

   ConditionState = CARRYING DOCKING 
     ShowSubObject = BOX
     Animation     = UIWRKR_SKL.UIWRKR_PIK
     AnimationMode = ONCE_BACKWARDS
     AnimationSpeedFactorRange = 2.3 2.3
     Flags         = START_FRAME_LAST
     TransitionKey = TRANS_Docking
   End

Worker starts moving without waiting for the animation(docking to building) to end and it slides while the animation continues. I couldn't find a way to stop this so added "AnimationSpeedFactorRange = 2.3 2.3" from Contra.

MavroGada2 avatar Feb 22 '23 14:02 MavroGada2

Nice. NProject Mod also has this implemented. Can also cross check with that.

    ConditionState      = DOCKING   ;TransitionState = TRANS_Stand TRANS_Carry
      Animation         = UIWrkr_SKL.UIWrkr_PIK
      AnimationMode     = ONCE
      TransitionKey     = TRANS_Drop
    End

    ConditionState      = DOCKING CARRYING   ;TransitionState = TRANS_Carry TRANS_Stand
      Animation         = UIWrkr_SKL.UIWrkr_PIK
      AnimationMode     = ONCE_BACKWARDS
      AnimationSpeedFactorRange = 2.3 2.3
      Flags             = START_FRAME_LAST
      TransitionKey     = TRANS_Drop
    End

xezon avatar Feb 22 '23 14:02 xezon

New

DOCKING 74 frames DOCKING CARRY 32 frames

Original

DOCKING 73 frames DOCKING CARRY 70 frames

xezon avatar Feb 22 '23 23:02 xezon

There is already a version of this on the fix-worker-lifting-technique branch which also fixes the worker walking / freezing on the spot before dropping the crate.

https://user-images.githubusercontent.com/11547761/220792536-25cefba9-abcc-497c-83fe-94261ae4f5ab.mp4


However, all solutions to the broken worker collection animations seem to introduce further issues where the worker continues playing the lifting animation when given a command during this state. Ordering a worker to collect while already holding a crate will also result in further jankiness. It's possible there may be no elegant solution.

https://user-images.githubusercontent.com/11547761/220792549-6e6c588a-af4a-4e98-8a5a-b72c669f7ef4.mp4

Stubbjax avatar Feb 23 '23 06:02 Stubbjax

Stubbi, tried adding DOCKING alias to MOVING state?

commy2 avatar Feb 23 '23 06:02 commy2

In my limited test so far it appeared as if drop off is now quicker than original, meaning worker will collect boxes faster. Need to double check. Perhaps this is introduced by AnimationSpeedFactorRange = 2.3 2.3 ? Absence of animation speed up will make animations look jank. It is not yet clear to me how docking times are really adjusted.

xezon avatar Feb 23 '23 08:02 xezon

Stubbi, tried adding DOCKING alias to MOVING state?

Yeah, that's how I solved the animation issue when dropping off of the crates (the worker is still considered moving at this time).

In my limited test so far it appeared as if drop off is now quicker than original, meaning worker will collect boxes faster. Need to double check. Perhaps this is introduced by AnimationSpeedFactorRange = 2.3 2.3 ? Absence of animation speed up will make animations look jank. It is not yet clear to me how docking times are really adjusted.

The collection / drop off delays are controlled by the SupplyCenterActionDelay and SupplyWarehouseActionDelay fields of ChinookAIUpdate, WorkerAIUpdate and SupplyTruckAIUpdate.

Stubbjax avatar Feb 23 '23 09:02 Stubbjax

Timings

I remeasured pickup and drop off timings and they appear to be identical. Slight measurement discrepancies stem from not being able to clearly tell when state starts or end. Just judged by actor movement.

Original

Pickup 73 frames Dropoff 70 frames

Mavro/NProject Implementation

Pickup 74 frames Dropoff 69 frames

Stubbjax Implementation

Pickup 74 frames Dropoff 70 frames

So looks like we need not to worry about timing changes.

Implementation comparison

As for Mavro/NProject vs Stubbjax implementation, my observation so far has been that Stubbjax implementation is significantly better than Mavro/NProject implementation, because it does not have issue where Worker is taking several animated walking steps after pickup and before dropoff without actually walking any distance. Instead the time is spend with pickup and dropoff.

Additionally the pickup to walking animation transition looks proper with Stubbjax implementation, but is broken with Mavro/NProject implementation.

Stubbjax impl. leftover issue 1

There is one issue that both implementations have in common: Before both pickup and dropoff, the actor will transition into moving state for one frame. So actor

  • stops and stands
  • moves for one frame
  • stops and stands
  • starts pickup routine

Perhaps there is still a Condition State missing to fix that too.

Stubbjax impl. leftover issue 2

As illustrated in video, worker slides away when trying to abort pickup and dropoff animations. Perhaps can add some interrupt somehow to fix it?

https://user-images.githubusercontent.com/11547761/220792549-6e6c588a-af4a-4e98-8a5a-b72c669f7ef4.mp4

Stubbjax impl. leftover issue 3

Ordering worker with box to pickup a new box at Supply Depot will make the worker play the dropoff animation, and when done clip to walking with box animation, which does not look gentle.

https://user-images.githubusercontent.com/4720891/220906043-d14eb33d-f367-439a-9f6b-5a845dd0669b.mp4

xezon avatar Feb 23 '23 12:02 xezon