Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Controller Renegade Project [DriverN Shooter system]

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

  1. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    renegadea1.gif

    thirdperson controller w walk/run/jump/slide etc
    weapon pickup and use
    vehicle driving w enter/exit

    features ragdollBlendin (ragcopy+animated limbs)
    jump-interruptions, finger control, ai systems, sword mechanics,
    truck-driving, helicopter physics, fight mechanics
    post filters, gamepad support
    ______________________________________
    includes
    cWalker2R
    basic Weapon Pickup
    basic Vehicle
    basic LowRider

    win demo
    0.95 version :
    http://www.mediafire.com/file/ki96czkzku56cu5/Renegade095D.ZIP
    0.97 version* : http://www.mediafire.com/file/1905tctlf891h5c/RENEGADE097B.ZIP

    *the trees in 0.97 version are not included, but come from free packages

    keys:
    [O] getup
    [L] throw / slide
    [R] run
    [space] jump

    Pickup [P]
    Use [leftCtrl]
    Holster [leftAlt]
    Hold [F6]
    Aim [F7]
    Carry [F8]


    Climb [ I ]
    Throw[CapsLock]

    Stoop [-]
    SmallSteps [Z]
    Crouch [C]
    Sneak [ S ]
    [left Shift] draw gun inside vehicle

    [H] weapon aim left
    [J] weapon aim down
    [ U] weapon aim up
    [J] weapon aim right

    [Z C V] left window
    [Y U I] right door
    [B N M] left door
    [J K L] right door
    [F1][F2][F3] cameras

    [F10] cam target change
    [F11] cam rotation off
    [1][2][3][4][5][6][7][8] extra anims

    renegade2a.gif
     

    Attached Files:

    Last edited: Sep 4, 2020
    ARLTB likes this.
  2. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    new feature: glass shatter
    glassshatter2.gif
     
  3. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    new feature: tyre damage

    new feature: hand close/open
     

    Attached Files:

    Last edited: Dec 31, 2017
  4. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    dropped upperbody mask for weapons and changed it to full body.

    _____________________________
    reworking the bootcamp animations
    on the right: the original rig
    on the left: mixamo humanoid rigs, first one how it applies, middle one a bit repaired
    soldiercrouchaim.jpg
     
    Last edited: Sep 6, 2017
  5. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    had to iron some bugs out, test and adapt to some edge cases,
    extend some functionalities and bring in some new choices

    more precise bounds (capsule collider)
    boundsxa.gif
    boundxb.gif

    new feature: shooting while driving
    shootinwhiledrivin.jpg
     
  6. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    new demo is up!

    recoil, muzzleflash, draw gun etc

    shootinsveh.gif
     
  7. Rin-Dev

    Rin-Dev

    Joined:
    Jun 24, 2014
    Posts:
    574
    This is extremely cool. Are you making this for your own project or do you have different plans for it?
     
  8. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    hey, thanks.
    is for my own projects and will try to get it on the assetstore too.
    but the character will be changed to midpoly makehuman models

    update: there was some problem with left-right rotation between cameras, now it's better in renegadedemo3b
     
    Rin-Dev likes this.
  9. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    new demo

    sneaking [ S ]
    cameras F[1-4]
    change camera F[10]

    the fullbody animations was a wrong route, back to upperbodymasks
    these will be the makehuman models if it goes right
    makehuman.jpg

    wasn't happy with the makehuman rig, so changed it and recorded w skele
    and this is what I ended with (the makehuman rig is on the left)
    mhtpose.jpg
     

    Attached Files:

    Last edited: Dec 31, 2017
  10. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    working on other seat positions
    the poser scripts will be included for making simple animations

    drivebyshootin1.jpg
     

    Attached Files:

    Last edited: Dec 31, 2017
  11. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    also turning into ragdoll when impacted done
    st2damaged.gif
     
    julianr likes this.
  12. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    a jump-over from unity
    the two types: goin to walk and goin to run
    I think I'll do raycast check ahead so could delay the steps for the right distance

    jumpover.gif
     

    Attached Files:

    Last edited: Oct 4, 2017
  13. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    also was tryin if can do this full-turn driveoff
    got brakes but still hard to do in narrow places
    [F11] camera rotation off


    got implemented fake rubber burning
    [Space] braking
     

    Attached Files:

    Last edited: Dec 31, 2017
  14. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    new demo is up !
     
  15. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    in the meantime been working on it
    but still there are some bugs

    wip documentation
    http://renegadesystem.blogspot.com

    enabled sneaking, crouching, smallsteps, stooping
    changing between holds
    holdweapon.gif weaponcrouch.gif

    0.6 demo is up

    and yes I got a car up on the first floor
    caronfloor.jpg
     
    Last edited: Oct 24, 2017
    manpower13 likes this.
  16. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    new demo is up

    added baseball bat (damaging not implemented)
    baseball.gif

    2 tags for driver when enter vehicle
    when shot, force is added to joints

    also bigger city
    but noticed some buildings have bad uvs, so many won't be included
    inthecity.gif
    inthecity0.gif
     
  17. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    added physical reaction
    physreact.gif

    and shot force looks like this
    physbullet.gif
     
  18. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    added uzi
    crosshair
    crosshair.jpg
    non-physical bullet
    nonphysbullet.gif
     

    Attached Files:

    • uzi.jpg
      uzi.jpg
      File size:
      20 KB
      Views:
      915
    Last edited: Jan 6, 2018
  19. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    also added climbing (experimental, without targetmatching)
    climbup3.gif climbup2.gif climbup.gif
     
  20. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    added sliding on slopes and moving platforms
    slopeslidin.gif movingplatform.gif

    and character selector
    charselector.gif
     
  21. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    the biggest challenge will be drawcalls.

    did a test with 20something walkers and started to hitchup in the editor on my comp
    the compiled demo looks like runs okay
    the buildings are very unoptimized, take up approx 300 batches
    the cars are also have separate all wheels
    but if you'd want building destruction, then separate floors is a need
    and separate vehicle wheels if you'd want wheel damage on each


    the last version demo's up

    yeah I already see some things I need to change back
     

    Attached Files:

    Last edited: Dec 31, 2017
  22. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    finally I found out what was causing an issue that was bugging me

    I thought it was bullets or some physical contacts or trigger that was acting to the effect of ResetCenterOfMass()
    ignoring the set COM and making the car wobbly

    and came out it was KeyCode.P
    (which I was using for pickup)

    you can see it in the demo
    if you don't press P, the car drives alright
    *I think I don't have ResetCenterOfMass() in my code, but will check now

    this issue probably won't appear with gamepad or touch controls, but with keyboard
     
    Last edited: Dec 28, 2017
  23. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    gamepad control and touch control is being added

    preview of it in the new demo
    gpntouch.jpg
     
  24. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    I'm curious, will you have Photon integration?
     
  25. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    no, I have not done networking yet, so it's not expected.

    plannin to add ai and pathfinding support
    other positions, mounted weapons
     

    Attached Files:

    Last edited: Jan 6, 2018
  26. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976

    Attached Files:

    Last edited: Feb 4, 2018
    Neviah likes this.
  27. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    in the new (hopefully final) demo before release

    set the gui to only appear for the selected player
    added vehicle damage by bullet
    adjusted weapon positions for all the players
     
  28. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    What's causing those 80ms cpu time per frame? That's crazy high! What hardware are you running it on?

    I like what you are doing with the animations, only just now discovered your project. Personally I'd recommend to go with something like Superhot's stylized lowpoly aesthetic to make sure you're not falling into the uncanny valley, get the workload down to something you can manage, and let people focus on the fancy animations.
     
  29. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    because of the drawcalls.

    it's not a small scene. I was testing how high can I go and looks like at 2000 it starts to slow down in the editor.
    the exe still runs okay (test it). I got 3.0GHz AMD Athlon II
    so I think 1000 drawcalls is okay for pc.
    stressscene.jpg

    another examples. the second is somewhat optimized


    the animations are usual unity animations, except the weapon hold poses, for which I'll include a simple tool
     

    Attached Files:

    Last edited: Feb 4, 2018
    Neviah likes this.
  30. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    also have a picture of how it would look a bit more populated
    but here has to optimize too (combine meshes where doable)

    scenepopu3.jpg
     
    Neviah likes this.
  31. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    forgot about static batching

    changed the buildings to static (left thedoors and glass non-static since they can move/break)

    and it's working nice
    statica0.jpg
    statica1.jpg
     

    Attached Files:

  32. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    been working on this bigjump animation from mixamo
    to be able to use for 2hands-shooting

    unmodified
    2handsgun0.gif
    and modified

    2handsgun1b.gif
     
    Last edited: Feb 14, 2018
  33. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976

    Attached Files:

  34. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    added strafe rotation
    and 45,90,180 turns for idle and run

    the turns are
    [4][8][6]
    [1][2][3]

    runturns.gif
    walkLRturn1.gif walkLRturn2.gif runLRturn1.gif
     
    Last edited: Feb 26, 2018
    xplicitgreek69, Martin_H and Neviah like this.
  35. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    couple days ago I watched this video linked on these forums (I can't seem to find where exactly)
    https://www.gdcvault.com/play/1012342/Animation-Warping-for-Responsiveness-in

    and thought for 'animation warping' to work, you need to know which frame of an animation is playing

    after two days of trial and error got it work
    thanks to Macro for the tip
    https://answers.unity.com/questions/628200/get-length-of-animator-statetransition.html

    check the demo
    startkey [Space]
    resetkey [Keypad0]


    http://www.mediafire.com/file/1l6g6yx6bl866i6/countingFrames.ZIP

    framecounting.gif

    just realized I had transition time set to 0, so made another demo where transition time can be set (0.01 - 0.25), which doesn't count animation frames so precise
    http://www.mediafire.com/file/i7bf77donjzirag/countingFrames2.ZIP
     
    Last edited: Feb 19, 2018
    Neviah likes this.
  36. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    an observation:
    the seat - driverhip distance fluctuates (between child and parent)
    I had a plan to use it for driver falloff but ragdoll weight turned out to influence vehicle driving
    (it was to be fixed joints with breakforce)

    so there is a change of distance while driver doesn't move (both set to interpolate, car is gravity, driver is kinematic)
    dseat3.gif



    will do bullet force to collision RBs
    there propably will be a minimap support

    roadmap:
    this week : I'll do a platformer demo

    so, the platformer didn't thought would be so hard with rootmotion controller
    since many anims have original root rotations
    but it's easy to keep them on straight line

    Code (CSharp):
    1. public Transform root;
    2.     public Transform origax;
    3.  
    4.     private Quaternion hipR;
    5.     private Vector3 hipP;
    6.  
    7.     void LateUpdate () {
    8.  
    9.         hipP = root.position;
    10.         hipP.z = origax.rotation.z;
    11.         root.position = hipP;
    12.     }
    13. }
    rplatform2.gif


    next week : mounted weapons
    in a month : dynamic animation feature and start workin on sensors

    what other feature would you like to be included?
    so what kind of games do you want to use Renegade system for?

    snipers? looters / sneakers? sport-games? platform runners?

    next > platform demo
     
    Last edited: Feb 26, 2018
  37. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    some useful repositories which might be used with this package

    MartinC Models
    Loopix Models
    ZenXChaos/ThirdPersonShooter-AnimationSets


    another thing I was thinkin about: using the blendtree as animation container
    there could be 9 clips, which sounds like enough for one action state

    something like this
    blendtreecontain.jpg

    but the transition time is only valid for one clip
    so others might need to be adjusted for that
    __________
    okay, so the good thing about Renegade system is modularity

    there are plugins/addons/moduls so called mechanincs (jumpMechanics, climbMechanincs)
    there are controllers (keyboard, gp, touch) and (ik, ragbones, anim, raycast)


    and the basic of the system is cWalker
    which controls these or has access to these mechanics and controls

    you can add new addons
    and all you have to do,
    reference cWalker like this and can access all variables in the system

    Code (CSharp):
    1. public cWalkerR cWalkerR
    2.  
    Code (CSharp):
    1. public string headway;
    2.  
    3. if(cWalkerR.raycastC.ray.head.fwd > 2) headway = "clear";
    this is just a random example
     
    Last edited: Feb 26, 2018
    Neviah likes this.
  38. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    been checking unity's volumetric lights

    volumlightA.jpg
    volumlightB.jpg
     
    Last edited: Feb 26, 2018
  39. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    another experiment with animation logic

    it is possible to set the exit animstate for an animstate (by statemachine behaviours)
    and the normTime range they could crossfade out if there's an input

    animlogic.gif

    the good thing about this:
    it can apply for only the animstate you want to (doesn't need to be set for all)
    others can work by default logic

    set it to 5 exit anims, which I think is enough (most of the time 2-3 would suffice)
    will see if this is a viable route


    also stop-and-play animation
    playncontinue.gif



    and forces to objects
    impactforce.gif
     
  40. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    now no new feature no demo

    just some things for future

    workin in 0.98 project now, rewriting the system

    but in the meantime I can release the base character (the blue t-shirt guy made in makehuman)
    if you want to make anims for him
    http://www.mediafire.com/file/qqgzlwqgilzi91f/cma.zip

    these are the positions+rotations for weapons
    weapon positions n rotat.jpg

    a note: if you got build errors w volumfog

    just assign again the volumfog script
    volumfog.jpg

    a note: separate animator controller is needed for every actor
    reason: 1. dynamic animator speed 2. animation state behaviour

    so the new plans is
    1. diagonal running so the locomotion scheme is full complete (though which foot down is yet to done but thats clip-based) which will be button-triggered

    now there's 180 workin for runnin F L R and if there's runnin switched on (R key), it stays on, the actor keeps in run mode
    (see in 0.98 wip)

    a note: if you do a full 180, when runnin left, you need to switch right/left otherwise the actor goes back to runnin left

    2. mounted weapons and other vehicles / positions and maybe switching between these modes [drivin, shotgunpos, secondarm, hangons] (should be on man root (modeSwitchControl?) hooked into enterexit.cs which has 3 connected now and can be other switchable class or something like that)
     
    Last edited: Mar 11, 2018
  41. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    How's the AI turning out for ya? Any news on that front? What's the expected ETA for release on this nice project?

    I must confess, I'd litter the scene with zombies haha
     
  42. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    :)

    yeah I was thinkin makin a zombie demo, there s a good one thats free on assetstore, but I'm not sure if I have zombie animations.

    the ai is mostly in preparing phase. there will be a sensor which triggers alarms(?) and there will be a decision maker and there will be a path finder.
    it will sort triggered objs by tags, have modes turn on by decisionmaker and select path based on targetdestination set by modes. hope that will be a good base for an ai.

    now that I'm on 0.98 and reworkin scripts (cWalker etc), I dont want to submit 0.97 project, and won't be submitting till I tested the functions to work (have to rebuild actors, change/select and gui too)

    in the meantime added new old things, like speedometer and sparks

    there's some weapons yet to add too, like rpg and grenade-launcher, flamethrower and minigun

    the full version (1.0) might be expected in 3-4 months if things go well
    it should contain
    all weapons (mounted and carried) except sword and melee mechanics
    4-wheeled vehicles
    jumping mechanics (jump over / down and off / up)
    experimental climb mechanics
    car deform, explosives
    aiWalker (sensors and path) and simple version of aiDriver
     
    Last edited: Mar 11, 2018
    Neviah likes this.
  43. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    added diagonal run (needs mixamo anims)
    diagonal1.gif

    and added new animstate type besides idleL/R-45/90/180 on spot
    stepL/R 45/90/180
    looks like this with cmu anims
    steppin2.gif
    and also I have made the unity soldier humanoid
     
  44. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    started with ai, registering enemies by group tag is done
    [lock weapon on target could go like : start w weapon [+script] or acquire weapon [part of ai], get position, rotate hip to match angle (check max angle> stepR(close value)), shoot by attitude enum def]

    next start to experiment with ai path
    something like on time walk up to vehicle, so I'm not sure if there's vehicle > player message already but that's no problem, since vehicle gots cWalker.
    then maybe walk up to something and start a game-event. ai has to got aiWalker w path (destination), timer w actions, complete on conditions, and seeSensor hearSensor components for enemies and companions
    and probably all these have to be in gameAction script with timer and that could be tied up with gameMissions...

    update:
    pathfinding is working (needs NodeMap)
    pathfindin1.gif
     
    Last edited: Apr 4, 2018
  45. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    dynamic path-changing is done

    obstacle avoidance was a bit tricky but is working now
    pathfindin2a.gif pathfindin2b.gif pathfindin2c.gif
     
    Neviah likes this.
  46. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    I know it's taking long, been dealing with issues,
    but the project now seems to be back on track

    added looped path
    integrated michsky's ui package
    check out his packages, he's got cool things
    https://github.com/Michsky?tab=repositories


    was trying to add volumetric fog
    https://github.com/SiiMeR/unity-volumetric-fog
    I really like this look
    volumfog.jpg

    but turned out it doesn't work when built to exe

    there's an alternative which can't be included with package
    https://github.com/AlpacasWang/DepthFog

    I was not happy with the makehuman rig (though the new has it own problems too :/ )
    also implemented continuous blend of walk to run
    see the difference
    walkrunblend1.gif walkrunblend2.gif
    the modified T-pose:
    rigdiff.jpg


    I'll try to get a 0.98 demo together in the coming days

    here's a preview
    http://www.mediafire.com/file/5ozyzq857fdpbhm/REN098E.ZIP
     
    Neviah likes this.
  47. omarzonex

    omarzonex

    Joined:
    Jan 16, 2012
    Posts:
    158
    WOW VERY COOL
     
    dibdab likes this.
  48. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    another experiment.

    swapping anims runtime is easy.

    but they don't do transitions.

    so I made an animstate from anyState and changing that anim.
    changer.jpg
    while changing in the intended animstate too, so the next time it would go with that anim, it will go through as normal.
    swappin.gif
    this could be most used for walking and running (or jumping)

    also I plan on move forward with the blendtree animation container idea. so there will be one animstate with max. 9 animations.
    it is/was possible to have more animstates for one mode (walk/run/etc) but still have to duplicate incoming transitions like when want to continue walk or run after a jump (does not have to go through idle) but with this still use the same conditions (bools etc) for transition.
    so it's more simple and use-friendly to have one instance and changing animations when want to.

    and there is transitions between blendtrees, though within blendtrees if used as anim container, not, but anyState clip-swapping can deal with that.
     
  49. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    started working on missions manager and first needed items with functions, to complete tasks.

    keys opening things, taking things out, taking to a place etc.

    missions1.gif

    update:
    now works with button and touch
    added locking
    dealt with issues like don't pick up when closed etc

    now one script and can do things like

    unlock trunk with a key, take out a suitcase, unlock suitcase, take out an object out of the suitcase
     
    Last edited: May 7, 2018
    Neviah likes this.
  50. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    finally was able to predict/add the landing spot and pose for a jump
    and lerp to that pose,
    it's like matchtarget with many bones

    but
    doesn't seem to like if animator speed is set to zero
    so animation is playing while lerping is done in lateupdate
    and there's only a narrow margin of lerptime and lerpspeed that looks okay

    lerpjump2.gif
    lerpjump3.gif

    update: lerping works in update
    made a separate lerping script (animator needs to be turned off or must lerp in lateupdate)
    lerps.gif
    can be lerped delayed and looped
    can go back to animated or ragdoll
    lerps2.gif lerps3.gif
     
    Last edited: May 21, 2018
    mgear and Neviah like this.