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:
    674
    mgear likes this.
  2. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    added KO
    can select fight moves to cause KO
    can set delay and force
    KO1.gif KO3.gif
     
    Last edited: Apr 12, 2022
  3. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    there are quirks, root motion oddities
    added jump options for kicks, the similar to KO inspector, with normTime
    Renegade is notified (no fall, no gravity) onAnimatorMove
    but jumps are sometimes offed too soon because of the ntimes
    fightkick00.gif fightkick01.gif
    multi element check not yet coded
    double timescale:
    fightkick02a.gif fightkick02b.gif
     
    Last edited: Apr 14, 2022
  4. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
  5. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    basic loco, no runstop, no walkstop, no jump
    fightkick03d.gif
    and on
    loco1.gif
     
    Last edited: Apr 15, 2022
  6. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    a bit of modif (like switching off gravity on kick start, not just onanimatormove)
    and looks better
    jumpkicks.gif
    also better on input abuse
    (this needed RootTransformPosition baked into pose on anim, to avoid floating)
    inputabuse.gif
     
  7. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    added custom reaction on hit
    customreact.gif
    this is how it looks with KO set for this move
    creactKO.gif
     
    Last edited: Apr 17, 2022
  8. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    bodyData got updated to support collision hits on fight moves too
    trigColl.jpg

    >> Renegade.bodyData
    traceColl001.gif

    yeah and, ramsterZ came out with a free demo of animations
    includes punches and kicks
     
  9. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    fightMX.changeStanceMidAttack : can set if possible or not to switch stance mid attack
    changestance.gif

    lockOn selectable on move fwd/side, knock/kick and can turn even if lockOn
    lockOn1.gif

    collision detections n reactions
    hand/foot fight move speed > reaction strength
    reactstrength.gif
     
  10. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    finally got this right

    transition to new animation while jumping and bodyposition is matched
    jumpbodyP.gif

    WIP feature demo, not implemented yet
    probably not in the next update

    update:
    so it's a bit more complicated.
    any animation movement has to be cancelled out like rb.velocity = v3.zero

    the capsule size and center should work when implemented in Renegade
    and the bodyPosition has to be lerped back to match w next state


    this is if bodyPosition is not adjusted
    jumpbodyPnoadjust.gif
    this is when adjusted
    jumpbodyPadjusted.gif

    debug lines:
    white : bodyPosition
    yellow: hip position
    red : rootPosition

    green : force velocity vector
     
    Last edited: Apr 25, 2022
  11. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    so the new version is up on the store
    099d.jpg

    the 5.6 scenes if you want to use it in older versions:
    https://www.mediafire.com/file/xnf7kknf4jxjxx9/_Scenes.zip/file
    I think you should be able to download full project from the store
    but here 's the inputManager and tagManager just in case:
    https://www.mediafire.com/file/i96vc67wmmbbv41/ProjectSettings.zip/file

    the physics of wheelColliders changed
    values should be approximately:
    in 5.6
    driveCX.maxTorque 125000
    wheelColl wheelDampingRate 600

    in 2020.LTS
    driveCX.maxTorque 1555000
    wheelColl wheelDampingRate 15


    found out what was wrong with the vehicle sitting in new versions,
    root motion of the anim was blocking the transform to move with the parent

    ___________________________
    future> started updating jump mechanics
    first making runstop generic, working in all directions
    jumprunstop.gif
     
  12. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
  13. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    added istart : mid-loco stop pose/anim
    istart.gif

    [bool] Renegade.loco.useIStart
     
  14. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    what works and what not
    midjump0.gif

    midjump0b.gif

    this startin to become a pattern: every blendtree needs to have its own parameters;
    can't even blend between two jumps (almost certain run into a strange blend) if they share a parameter.

    decided to use MIDJUMP blendtree state
    one state takes away some of the complexity
    don't have to deal w anim offsetT
    and adds possibility to extend it [w pose, side etc]
    behaves like a falling state
    midjumpd.gif midjumpd2.gif
     
    Last edited: May 14, 2022
  15. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    for situations like this should be pose checking used:
    midjumpslidepose.gif

    testing mindjump>midjumpgetup/landing>stand
    midjumpe.gif
    midjumpe2.gif
    second landing is ruled out
    root.addDragOnLanding
     
  16. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    two basic things define how the jump/fall/land look
    - rootmotion is on or not
    - physics force was added or not
    and probably the two best if not go together

    falling needs to have rootmotion off, so have to use force.
    but at landing depending if you want steadiness or not,
    either rb.drag or velocity.zero or rootmotion on can be used.
    sometimes it would look unrealistic landing
    so for this jump distance can be used [jumpMX.onJumpX.dist],
    if distance is over a defined value, use less drag, use runstop etc


    there's even another case if new jump starts after landing
    ie. you'd want some movement after landing if going to idle,
    but don't want movement, if going into jump right away.

    added trajectory prediction
    trajectoymidjump.gif trajectoymidjump2.gif
     
  17. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    added if jump exe input >>keep midjump pose
    sliding and not (same settings inconsistency)
    mjumpa2.gif
    and no input >> goes to fall pose
    mjumpa3.gif
     
    Last edited: May 18, 2022
  18. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    added customOffsetT
    this respects jumpOffTime and groundcheck is correct
    mjumpcustomoffset.gif
    original jump
    mjumpjumpOT.gif
     
  19. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    jumclimb to hang
    jclimb2hang.gif
    jumpclimb to pullup
    jclimb2pullup.gif
    I wanted to it to be able to move to both states
    this was a bit tricky since targetmatching doesn't work in transition
     
  20. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    added switch side based on foot forward

    no switch
    noswitchnofootP.gif
    switch
    switchnofootP.gif
     
  21. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    fall > midjump > jump
    secondjump1.gif secondjump2a.gif

    not always success
    secondjump2b.gif secondjump2c.gif
     
  22. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    as you might know, matchtarget is linear
    targmatch.gif
    matchtarget + using speed scale [0.4 - 0.9]
    targmatchspeedsc.gif
    lerpx + speed scale [0.4 - 0.9]
    lerpxspeedsc.gif

    lerpx + speed scale [0.4 - 0.9] + height curve
    lerpxcurvespeedsc.gif
     
  23. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    added groundcheck for hand
    changed the falling torque a bit
    fliphandscheck1.gif fliphandscheck2.gif
     
  24. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    so how it looks controlling it
    jumps221.gif
    jumps223.gif
    the hands' groundcheck is set a bit high (0.45) so it doesn't go ragdoll
    also depends on the animation quality and physics update rate (because physics are involved)
     
  25. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    the gameObjInfo what I included in the last update in otherSystems folder
    you'll have to delete before making a build.

    or copy to a diff location on hardrive as a Editor packages

    ..............
    demo build for jumps
    the footIK is clearly wrong. the update and position is off too.

    it's funny how many times falls
    https://www.mediafire.com/file/d7ef39nqhmlks4i/RENJUMP01.ZIP/file
     
  26. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    Last edited: May 31, 2022
  27. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    finally something like a parkour
    jump2x.gif
    raycast below foot
    must be set in jumpMX.rayCont.height.min [like -1.5, counted from hip pos]
     
  28. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    using foot position [jumpMX.jump.style.useFootP]
    ON
    usefootP1.gif
    OFF
    usefootP0.gif

    using capsule collision [jumpMX.jump.style.capsColl enum]
    use, switchOff (no collision)
    and useHigher (this raises the capsule low value higher)
    boundxCustomuHi.gif
    note: apparently this targetmatching inaccuracy happens if feet pos is baked on the animation
    but still useful options to deal with physics
    and bodyData still can be used for ragdolling if colliding during jump and capsule is switched off
     
    Last edited: Jun 6, 2022
  29. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    state of things now

    with automatic jump-On
    jumponauto1.gif
    at least one issue of abrupt targetmatching
    probably need to check distance and remaining time
    jumponauto2a.gif

    jumponauto5.gif
     
    Last edited: Jun 6, 2022
  30. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    the same thing plays out differently almost every time
    (mostly because of physics and update times I guess)
    jumponseq1.gif jumponseq2.gif
    for this flip the targetpoint should be a bit further because he slides back down

    also changed falling a bit, don't want it to play falling if only 0.1 above ground
    so there's ay exception for 0.4sec. (the thing is when rootmotion is on, gravity is slow)
    like here
    jumponseq3a.gif
     
  31. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    implemented physical jump (no rootmotion, but force added)
    but it seems feet must be baked
    the same jump with baking on and off
    jumpforcePhysFeetBake.gif
     
  32. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    so physical jump is done
    jphysSelect.jpg
    this doesn't apply for jumpOver since the contact body is hand or feet (not the root)
    but doable if you have the offset of root at contact point, but rootmotion for now

    added dragOnLandin
    ON
    jumpphys_drag.gif
    OFF
    jumpphys_nodrag.gif
     
    Last edited: Jun 12, 2022
  33. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    Last edited: Jul 7, 2022
  34. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    Last edited: Jul 8, 2022
  35. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
  36. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    not the most proficient physical wheel
    but found this kinda surprising that could make a phys collider follow a wheel collider
    wheelmix.gif
     
  37. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    Last edited: Aug 2, 2022
  38. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    wanted to add this type of parkour jump
    watchdogs2a.gif watchdogs2b.gif
    this need two jumps to sequence

    called leapJump in Renegade
    and the second jump can be jumpOn, jumpClimb (jumpOver not yet done)
    gets condition for jumps (height, dist etc) set in jumpOn.style and jumpClimb.style
    still needs some things, but the basis is working
    leapJOn.gif leapJClimb.gif
     
  39. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    vehicle get in/out, weapon handling while driving redone and working
    gui button and gamepad control

    getin2.gif

    get in initiated by bool in driveCX
    Renegade.comp.driveCX.eex.ins.getIn = true;

    gamepad profile is civil (not driver) for walking + driving
    right side get in can also be initiated by driver's controller

    weapon handling while driving is controlled through Renegade.comp.weaponMX
    vehicle passenger choosing through Renegade.comp.driveCX

    leaning out falling if door broken
    getin2leanoutfall.gif
     
  40. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    changed the way foot position is calculated for jumps > better transitions
    jumpfindFootP.gif
     
  41. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    the weights working
    jump on with different style weights
    (the distance max + steps are equal for both, so both jumps are x.ready at the same time)
    jumpOnWeight.gif

    also added step check if there's depth ahead
    switches to jump style that is ready and no steps before jump
    without check: the jump w steps initiates
    jumpOnstepcheck0.gif
    with check: the jump is switched, even if the other one has lower weight
    jumpOnstepcheck1.gif

    also added immediate jump if there's no other jump style w no steps ready
    jumpOnstepcheck1b.gif
     
    Last edited: Aug 16, 2022
  42. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    midjump roll testing (called secondary jumps before)
    and wanted to show this action
    midjumpRoll.gif
     
  43. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    some notes on debugging jumps

    - there should not be rootmotion on fall
    check this in Renegade.root.doDebug.isApplyRM

    - should not mix physics and targetmatching/curve/lerpx on jumps
    should be unchecked [jumpMX.style > targMatch, lerpx, useCurve]
    jumpphys.jpg

    physnotargm.jpg
    - transvelo.onfall is set true for jumpOn and jumpOver
    but it sets false on physical jump

    - physical jump curve is determined by height [jumpMX.onJumpX.physJump.height]
    physical jump uses root for trajectory
     
  44. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    Last edited: Aug 25, 2022
  45. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
  46. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    aiChopper

    rotate towards target forward
    aichopper1a.gif
    rotate towards target position
    aichopper1b.gif

    move towards (turn)
    aichoppe3c.gif
     
    Last edited: Sep 7, 2022
  47. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
  48. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    throwing is back in fightMX and updated
    no anmMatch is used now but a pre-state
    throw1a.gif

    can set ROffset (from attacker rotation)
    ROffset 160, 240, no ROffset
    throw1b.gif
     
  49. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    throws continued
    w i p

    there's two versions: paired and sequential.
    paired uses premade hit animation, sequential uses two anim states [sthrown > thrown]
    this is from Frank's Fighting Set 3
    (the hit animation is backwards, so this does not work if attacked actor is approached from ahead)
    throwpaired1.gif
    same thing w seq
    throwseq1.gif
    or
    throwseq1b.gif
    throwsins.jpg
     
    Last edited: Sep 28, 2022
  50. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    674
    Last edited: Mar 6, 2023