Search Unity

Controller Renegade Project [DriverN Shooter system]

Discussion in 'Tools In Progress' started by dibdab, Aug 4, 2017.

  1. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    this way procedural modification of animations played by mecanim is doable

    opens up many possibilities
    - root transform position / rotation [lateupdate, matchtarget]
    - hip transform position + foot adjust / hip rotation [onanimIK, lateupdate]
    - footL/footR position / rotation [ik/ccd]
    - handL/handR position / rotation [ik/ccd]
    - spine fwd / bck / left / right bend [ccd]

    though usin all at once might be heavy but switch on/off a couple ones


    latest R.99 demo
    added transitions between RFWD-RBCK and LFWD-LBCK
    so locomotion is 90% ready

    R0999a.gif
    you see in the demo
    that velocity trackin should be used for
    situations like run forward > stop run > run backwards
    and limitations for switchin from turn state to state [like walk turn can > idle turn > run turn, but run turn can be only run turn, other turns need slow down first]
    or limitation for run turn to be inplace or switched from run [so can start run turn from idle, but it's different in run (btree) same xc for loco dif velo dif xc for turn ]

    added xt dependant on xc like this
    xt.jpg

    and works like this
    http://www.mediafire.com/file/pm0gu9qyhl2jgfs/R099_92.ZIP/file

    added switchLegs which works on leg position and feels a kinda random
    but could be made to be explicitly set by input
    switchlegs.gif
     
    Last edited: Sep 27, 2020
  2. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    killed a lot of days on stairs

    wanted to get go non-kinematic but
    that's virtually impossible because of collisions and frictions

    made animations w dif step heights and lengths
    and using blendtree
    added targetmatching too but have to analyze that
    5th version
    stairsF74.gif stairsF72.gif

    the things is that it variates a bit
    fallin state not final either

    only for forward yet

    //link removed
     
    Last edited: Oct 12, 2020
  3. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    added start run
    [leftShift] + direction [arrow keys]
    099d.gif
    and added stop run

    A D : turn L R
    W S : turnAngle
    G F : left / right
    M N : speed up / down

    //link removed


    there seems to be a bug with stairs setting doesn't clear (?)
     
    Last edited: Oct 12, 2020
  4. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    Last edited: Oct 13, 2020
  5. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
  6. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    added avoid left and right
    and avoid turn

    [key Q] avoid L
    [key E] avoid R
    [1] avoid turn L
    [3] avoid turn R

    avoidnTrn.gif


    now some parameters are ex posito on slideor

    I need to differantiate on fadeins. [values array for blend ranges?]

    //link removed
     
    Last edited: Oct 29, 2020
  7. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
  8. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    fixes:
    avoid can transit to diagonal
    circ can transit to diagonal
    roll and slide transits to walk/run not stand

    new:
    added start walking [leftShift] + direction [arrow keys]
    added stray L/R [key Y/U]

    added GPControl first version
    but there seems to be an issue in the build with the GP input I never experienced in the editor
    (then trying again was no issue, maybe my GP controller went crazy?)

    update:
    fixed startLoco >> StopLoco
    improved 180 turn
    GP now controls turn parameters

    //link removed
     
    Last edited: Oct 29, 2020
  9. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
  10. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    animFixer starts to shape up

    (original on the left)
    16_06.gif 127_25.gif
     
    Fibonaccov likes this.
  11. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
  12. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    Fibonaccov and atomicjoe like this.
  13. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    sword mechanics mixed with 0.98Renegade Ai

    still full of bugs, but performance seems good
    sword20ai.gif
     
  14. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    Last edited: Feb 5, 2021
    Fibonaccov likes this.
  15. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    added

    turn towards moving direction
    turn towards target.forward when reached
    aiwalker99c1.gif
     
  16. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    added turning to direction by animation

    also turn towards opposite direction
    turn2mov.jpg

    aiwalker99c2.gif
     
  17. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    added formations (squads)
    and obstacle avoidance

    squad1.gif
     
  18. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    think I will replace targetmatching with lerpcontrol
    found matchtarget unreliable and do not want to switch off colliders
    lerpcontrol can control position, speed better

    also added custom bounds (capsule height) based on actor pose
    and calculating if contact bodypart is beyond contactpoint

    different distances lerping to contact point
    jumplerpx3.gif
     
    Last edited: Feb 16, 2021
    Fibonaccov likes this.
  19. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    Artoodiitoo and Fibonaccov like this.
  20. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    locomotion improvements startwalk/startrun interruptions
    (looks nothing special but was quite tricky to get working together)

    stepsunsteps.gif stepsunsteps2.gif
     
  21. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    Renegade0.99 locomotion features look like kinda final.
    did not want to move on until got this sorted out.

    animselect on state
    R99locoanimselect0.gif

    didn't like strafe always on, so made it switch on/off on input. [front left button + stick1]

    R99rollslidecrouchsneak.gif

    it has these states:
    slide, roll, sneak, crouch, jump, jumpOn, jumpOver, jumpClimb
    start/stop, turn, sidestep, stray, avoid, avoidturn


    the jumps are doubleclicks
    and most of the states are button + stick combos

    known issues:
    - strafe and stop anims are not in syncron / which foot forward
    - the velocity transfer on ragdoll is sometimes off
    - jumpclimb hanging orientation is sometimes off


    NEEDS GAMEPAD
    https://www.mediafire.com/file/xey9er49yz7rarf/R99LOCO.ZIP/file



    just noticed something
    speed increase [stick2 v] function
    in 1440x900 resolution doesn't work
    in 1400x1050 it works. this is hilarious :)
     
    Last edited: Mar 13, 2021
  22. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    transport system updated

    - checkin empty spot on storage and carrier
    - selection
    - different types of wares, carriers

    transport_truck.gif transport_plane.gif
     
  23. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
  24. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    money system [walletMG]
    moneysys.gif
    update:
    implemented multiple transport vehicle select
    moneysys2.gif
     
    Last edited: Mar 22, 2021
    Fibonaccov likes this.
  25. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    (fake) physical reactions
    physreact.gif
    jump to grab (with ragblend)
    jumpgrab.gif
     
  26. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    pointAt while hanging
    (w percentage)
    jumpgrab_pointat.gif
     
  27. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    Renegade 0.99a [preview version] coming soon

    why is Renegade different?

    it is built around CrossFade and (almost) doesn't use mecanim's flow-chart transitions
    so in a situation like this
    hurdlesjump.gif
    it has to calculate foot position not just when jumping but also when jump ends and running starts
    notice left foot and right foot (jump start and landing)

    hurdles.gif
    started this demo for limb collisions but works pretty well for just capsule collision too

    note: it is quite hard to move root motion in a straight line because
    it is not simple like zeroing out hip rotations, but
    the forward is
    https://answers.unity.com/questions/1512245/how-unity-define-transformforward-of-humanoid-avat.html
    "The average body orientation up vector is computed out of the hips and shoulders middle points.
    The front vector is then the cross product of the up vector and average left/right hips/shoulders vectors."

    animFixer now can visualize this forward vector (and modify by rotating spine and hip transforms)



    also PhysReaction demo available

    https://www.mediafire.com/file/pl8lcwhf6sjr6kr/ragBLENDPHYSREACT.ZIP/file
    [space] shoot ball
    [backspace] getup
     
  28. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    the 0.99a version up

    not compatible with previous versions
    previously separate, now all in Renegade : [lateUPD] ragBlend. CCD. easyIK. upbodyMX. pointAt.
    now xc [speed] is in the range of 0 - 1 on the blend trees


    contains: sword mechanics, transport system, physreactions, ai squad etc
    updated: plane, car, helicopter controller

    for swordplay just the stances and guards are included
    if you want the swordplay animations used [non-commercial]
    drop me a line w the proof of purchase


    to do: driving, fighting and weapon usage

    roadplan:
    • support for A* Pathfinding
    • optimization: to avoid many updates, collecting data managers into one master [stamina gang wallet(?)]

    storepackages.jpg

    missed to include old animators for the 0.98 scenes
    download them here and copy into the Assets/ folder
     
    Last edited: May 6, 2021
  29. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    new foot position tracking
    calculated from animator.pivot and converted into state.ntime

    the yellow dot [going up-dwn on the side] represents foot position
    and it works for even sideways movement
    footpos.gif

    the red cube at the feet is the pivot position


    new car door rotation by hand position
    previously animator.animation
    hand2door.gif
     
    Last edited: May 6, 2021
  30. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    okay so what I was workin on
    and what is needed for a entering animation

    1. it is impossible to seamlessly transition between two animations that have different root transform XZ or Z.
    so if want to use centered sitting animation (and not sitting offset) first the entering animation must end on 0 height.


    2. then was trying to adapt animation for a vehicle in animfixer and think I broke it
    but come up with a solution for lerping root and ik transforms

    original
    entercar0.gif
    modified
    entercar1.gif


    and the final thing
    baked original
    entercar03f.gif
     
    Last edited: May 16, 2021
  31. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    optimize test

    30 cars w skidsmoke and skidmarks
    30cars.gif
    same thing w shadowcasting optimization
    30carsSH.gif
     
  32. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    so the objective is to

    : the least transforms [only seat and ik points are transforms. coded: enter exit points +lookAt point]
    : one enter point, multiple seats
    : no update on enter trigger
    : enter w anim / no-anim
    : stable when run into by capsule
    runinto.gif


    added 15 cars to the gp drivin but sometimes slowdown happens
    and the shadows are off for other cars
    https://www.mediafire.com/file/cmojzx4w5czk5j7/RENEGADE15GP.ZIP/file
    the slider sets rear sideways friction

    https://docs.unity3d.com/Manual/iphone-Optimizing-Physics.html
    burntyre.gif
     
    Last edited: May 19, 2021
  33. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    workin n fightMX update

    the design has been changed. there's fwd, low [blend parameters] for knocks
    knocks can be punches and hooks
    switch stance is for high-kick, high- left n right hook

    basically its built around
    1. fwd : stand or move [might be +switchstance if3)
    2. up/low : attack height [-1:leg 0:stomach 1:head]

    might have to explain the decision
    all states blend trees have unique parameters
    there's more parameters for blend trees because every branch need separate to not mix up w next animation being transitioned to [if it would being effected by the same parameter]

    current state
    fight.gif
    fightpunches.gif
    NEEDS GAMEPAD
    https://www.mediafire.com/file/jk4fr9z9awyi1tt/RENEGADEFIGHTGP.ZIP/file [re-up]]

    there's actor modes introduced
    on gpcontrol there are profiles
    gpmodes.jpg
     
    Last edited: May 23, 2021
  34. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    fightpunchstate.jpg
     

    Attached Files:

    Last edited: May 23, 2021
  35. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    jumpbodydata.gif

    bodyDataCheck off / on
    jumpbodydata2.gif

    jumpbodydata3.gif
     
    Last edited: May 27, 2021
  36. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    jumpMX changes

    - removed the need for animation events
    now jumpoffTime, contactTime and fallTime is set in each jump style

    - added foot position calculation for movement before jump
    now dist.move, dist.min and dist.max are set on jump style.dist

    jumps can have one step or steps before jump-off,
    or 0 steps, but those are not interesting for footP

    so +new variable of steps is set for movement before jump-off
    jumpMX.jpg
    startT 0 : jump-offP 0.45 : contactP / fallP 0.65

    jumpsT.jpg
     
    Last edited: May 28, 2021
  37. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
  38. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    80 Renegade actors w animators
    no gpu instancing, no animator culling


    still full of peculiar bugs

    yes, we got a demo
    automatic jump set [think it work synchronously w controlled jumps]
    [link removed]


    I swear I crushed half a dozen bugs
    then new ones occured, among those that that it is different in editor to the build one
    renegade50c.jpg
    it is almost impossible to get in the car w automatic jump

    update
    apparently the build doesn't like getting ragdoll transforms on start, so cached them
    but again, some new bugs out if nowhere
    now
    100 actors and 7 cars
    [link removed]
     
    Last edited: Jun 4, 2021
  39. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    locomotion slow-mo (there is default ntime-based footmatching, but the side-variants will have to be factored later)
    slowmo1.gif

    jump slow-mo w footmatching (and dist.mov 2 + dist.min 2. obstacle at apprx.6)
    slowmojumps1.gif
    but I'm wondering if the root position thing is because
    the animation is too fast (at lower timescale it looks okay)
    or the transition with offset offsets root position too
     
    Last edited: Jun 2, 2021
  40. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    bugfixes

    100 actors 20 cars
    https://www.mediafire.com/file/2hhikh4o7lj9zq8/RENEGADEGPF.ZIP/file

    will create new project and submit a streamlined 0.99b


    so what is changed
    - ragdollControl is in Renegade now: bones.ragd.
    - bodyData is also managed from Renegade

    what to expect
    - jumps and grabs tests
    - pathfinding for aI
    - secondary jumps re-implementation
    - dirControl entegrated under Renegade [tracersCX]
    - going to investigate how this fixerSeq could be tied in w upbodyMX
    upBodyMX is based upon weapon x loco-sneak-stand and vec3 +started by input
    fixerSeq is based on stand vec3 +timed lerp [seq]

    the Renegade.cs looks like this now
    renegade099.jpg
     
    Last edited: Jun 4, 2021
  41. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    haven't seen anywhere anatomically correct values for ragdoll [characterjoint]
    think are these (correct me if I'm wrong)

    thigh lowTwist -65 hiTwist 120 swing1 30
    knee lowTwist -120 hiTwist 0
    foot lowTwist -10 hiTwist 50 swing1 25 swing2 15

    arm lowTwist 0 hiTwist 110 swing1 30 swing2 120
    elbow lowTwist -60 hiTwist -20 swing1 25 swing2 70

    ragdolldef.gif
     
  42. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    new type of jumpgrab [blend parameter up = 0]

    jumpgrab0.gif
     

    Attached Files:

  43. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    fightMX

    almost lost that hold punch behavior after adding checks, but added it back
    and now it can be switched on in fightMX.action.punch [canHoldpunch]
    canholdpunch.jpg

    off and on
    holdpunch.gif
     
  44. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    current state
    ikStop, bodyhitmap in next version

    punches01.gif
     
  45. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    the delay was because removed statemachinebehavior, and had to do some tuning on jumps
    the default is 8 type of jumps for gamepad control (planning jumps sets w override controller)
    on one button switching style w stick2 while jump / doubletap
    to do: rootmotion nrm on jumps starts and ends

    found using rb.usegravity false is better than animator.setfloat.gravity to zero
    jumps991.gif
    it's good to choose jumps that end on same orientated stance
    but all automatic and extendable (stance [land>stand] or stoploco [stoprun])
    animation end [fallT] can be set to foot landing and foot matching/mirroring is supported.
    jumps993.gif

    still very sensitive to settings [jumpOT normtimes] if using dynamic collider
    but there's boundx.useRootPos which sets bounds floor to animated
    might be option to use static collider for jumps that are not moving much

    jumps992.gif

    jumpOT set to 0.3

    noStopRun can be set on each jump
    here's an example of it switched off
    jumps994.gif
     
    Last edited: Jun 15, 2021
  46. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    0.99b
    in 2019.4.28
    different setup>
    ragdoll bones set on Renegade, from the ragdoll animator, so ragdoll object has to start being switched on (if ragbones not set up)

    imports OK, but some physics don't work
    2019colldetect.jpg
    this doesn't happen in 5.6 but needs more work

    high fps for one
    2019basic.gif

    last thing did for jumpstart
    jumpstart.gif
     
  47. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    the car test has better performance, can run 60 cars at 40
    but physics is different, motortorque has to be rumped up to 95000
    carstest60.gif


    the 5.6 scene files for 0.99 versions will be here
    https://www.mediafire.com/folder/o7n4jsbojifif/sceneFiles_5.6

    known bugs
    - vehicle get in erratic
    - fighterMX doesn't throw more punches after some time (I don't see anything wrong with it, but apparently after some input doesn't punch anymore)

    gettin in 5.6
    getin567.gif
    mostly works but sometimes fails
    (if vehicle is moved during get-in, should work as expected)
     
    Last edited: Jun 21, 2021
  48. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    this is some kinda bug or regression in 2019, doesn't happen in 5.6

    the best to sit in the car:
    switch collision detection to discreet
    set usegravity on driver rbody off
    transform position to v3.zero

    but rotation is still off Unity_MOMn2u65VT.png
    bet some code will correct this. but not ready


    also at first time playing the scenes
    should re-configure gamepad switchin NotSetAtStart on
    notsetgp.jpg
    and the set confuguration is saved in PlayerPrefs
     
    Last edited: Jun 26, 2021
  49. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    Renegade 0.99 scenes in 2019.4
     
  50. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    670
    0.99b is up
    099b.jpg

    want to include destructible buildings in Renegade
    and layers are updated based on their numbers, so all the building layers are wrong
    (the tags update automatically, the layers don't)

    I thought that will have to remake all the destructible prefabs, but if redone
    those are put at 0,0,0, so would lose the buildings too
    only solution I see, will have move the ragdoll and kinem layers of Renegade elsewhere
    (and redo the Renegade scenes, of course)