Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Third Person Controller (Third Person Shooter, Adventure, RPG, etc)

Discussion in 'Works In Progress - Archive' started by opsive, Dec 1, 2014.

  1. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    For the past few months we have been working on a third person controller for the Asset Store and I am excited to finally be able to show our progress:

    Announcement1.png

    The Third Person Controller is the ultimate framework for any third person genre such as third person shooters, adventure, and RPGs. A large set of professionally made Mecanim animations and a set of high quality artwork is also included.

    The Third Person Controller uses a flexible inventory system allowing for everything from pistols to rocket launchers and grenades. Inverse Kinematics (IK) will correctly position the limbs and ragdolls are used to enhance the death sequence.

    On the Third Person Controller webpage you can see the current set of features and sign up to receive an email when it has been released.

    Announcement2.png

    Announcement3.png
     
    Last edited: Dec 12, 2014
  2. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    Nice work.

    I hope you don't end up sticking a ragdoll on the main character? it's a waste of performance. It's fine on enemies though.

    Would be nice to see other weapons, like crossbow, bow, throwing axes etc.. make it a bit different from the current assets in store.

    Are you planing to make it work in FPS mode?

    ETA?

    ps. increase the tiling on that metal part he's standing on :)

    Regards
    Moe
     
    theANMATOR2b likes this.
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    Appreciate it!

    Right now we do have a ragdoll on the main character, but all of the ragdoll colliders are disabled until they are needed. I have been running some performance tests and Physics.Simulate takes 1-2% of the total CPU time, with Camera.Render taking the most amount of time at about 10%. All of the Third Person Controller Scripts are at about 1% or much less (with IK taking the most amount of time). None of the Third Person Controller scripts perform any allocations after they have been initialized.

    The scene in these screenshots demonstrates more of the third person shooter aspect of the controller. We are planning on having an adventure scene as well, which the weapons that you described would be perfect for. If we don't have this scene available at launch it will be added shortly after in an update. We've been working on this project for awhile and are itching to get it out there :)

    We are not but you did give me an idea to integrate it with UFPS. I'll add that integration in an update.

    If we had to we could probably submit it within a couple of weeks, but we don't really want to launch during Christmas/New Years so it'll be at the start of the year.

    Will do :)
     
  4. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    We just got grenades in and working. Here's a before picture:

    GrenadeBefore.png

    And after:

    GrenadeAfter.png

    The grenades are considered a "Quick Use Item". What this means is that you can use a grenade at any point in time and it doesn't have to be equipped like the pistol. When the grenade is thrown it uses standard Rigidbody physics and activates after a certain amount of time. It will then spawn whatever objects you want (such as an explosion) and be placed back in the object pool. When the explosion object spawns it applies a force to any Rigibodies nearby, and also decrements the health of any objects nearby. In this case the barrel has a Health component attached to it and will spawn an explosion object as well when its health reaches zero.
     
    theANMATOR2b likes this.
  5. GrooGadgets

    GrooGadgets

    Joined:
    Apr 2, 2009
    Posts:
    70
    Looks very good so far!

    Are you looking to add ledge/wall climbing, swimming etc?
     
  6. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    Thanks!

    Not in the first release but definitely shortly after. It is pretty easy to add new functionality/animations with the way everything is structured. Things like climbing and swimming would be perfect for the adventure scene that we are planning on creating.

    I have been meaning to give an update but for the past few days we have been mostly working on polishing the animation/documentation so screenshots don't work too well.
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Hella cool! Subscribing to thread.
     
  8. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    web demo ?
     
  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    @jerotas -

    Appreciate it!

    @blackbird -

    We'll definitely have one, just not yet. Shortly before we submit we plan on adding a web demo and a set of videos showing how everything works. We plan on submitting early/mid January so things will start to be released shortly before then.
     
    Last edited: Dec 14, 2014
  10. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    any pictures for RPG type ?
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    When the controller is initially released it will include the warehouse scene that we've been taking screenshots of and a smaller scene showing off the adventure/rpg functionality. We haven't made this scene yet but I imagine it will just contain a lot of the generic Unity prototype assets.

    Really the only thing that changes between the third person shooter genre and an RPG are the controls and a different set of animations. In an RPG the camera doesn't always face in the same direction as the player which allows the player to always look in the direction they are moving. Compare that to a TPS which allows you to strafe and move backwards. Both of these control types will be included in the first version (you'll only have to toggle a Boolean on the controller).

    For the most part everything else is still the same. The inventory, event system, interaction system, etc. are the same. Of course, each genre has their own set of features which are not in any other genre so as we see how people are using the controller we will add features to make that task easier. I am imagining that we will be updating this asset a lot and the first version will look nothing like what it looks like six months down the road.
     
  12. GrooGadgets

    GrooGadgets

    Joined:
    Apr 2, 2009
    Posts:
    70
    Hey Justin,

    Thanks for your reply. Will the character animations be driven by root motion?
     
  13. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    Yes, it will be. This took me awhile to figure out because I wanted the controller to use root motion but also still be able to respond to external rigidbody forces (such as explosions). You can see an example of what I didn't want if you take a look at the Unity Sample Assets on the Asset Store - you'll see that Ethan uses root motion but you can't apply any external forces to him because of the root motion.
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    The components within the Third Person Controller are very modular. Don't want the character to have any health? No problem, just don't add the CharacterHealth component (which is a subclass of the Health component). Or what if you don't want the character to respawn after death? Don't add the CharacterRespawner component (which is a subclass of the Respawner component).

    The disadvantage of this approach is that it takes some work to initially setup your character because you can't just add a single component to the GameObject. To help alleviate this problem, we are going to have builders for every type of object. I'm working on the Character Builder now which will add all of the components for you. It will even open Unity's Ragdoll Builder up for you with some of the fields already defined.

    Here's a preview of the first two sections of the Character Builder:

    Base.png

    Controller.png

    This Character Builder should make it really easy to get a new character up and running.
     
    hopeful likes this.
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,523
    Looking good!

    Have you considered supporting cover, like in Gears of War? It would be great for the Asset Store to finally have a drop-in controller with cover animations (entering/exiting cover, sliding left/right in cover, peeking, etc.) and auto-alignment to objects such as walls that are marked as cover areas. With other projects going on, I don't have the time to get my in-house system ready for the Asset Store any time soon, so someone should do it at least!
     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Hmm ... did you see the "Use Cover" checkbox in the picture above? :)
     
  17. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    I have no real suggestions on how to do it, but maybe this can be designed so it is more easily adapted for multiplayer?
     
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    Yes, cover similar to Gears of War will be supported with the first release. It will be a runtime cover system in that any object in the specified layers can be used for cover.

    In terms of multiplayer, I haven't done any networking in Unity so I don't know how to approach it yet either but it is something that I have planned. If it is a viable solution, I am almost thinking that I'll add Unity 5's networking just so the controller isn't reliant on a third party. The Third Person Controller is going to ship using Unity 4.3, and maybe if you want networking then you need to use Unity 5.

    And @TonyLi, I'll probably be talking to you in a few months about Dialogue System integration with the Third Person Controller :)
     
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,523
    Nope! :) Glad to see it's going to be in there!
     
  20. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Sounds good. As someone who has no practical knowledge of networking, I think the main thing would be to have a modular setup where an input script interprets button / axis states and sets a command state, and then an action script checks the command state and takes the appropriate action. Inventory checks would be similarly split as well, as the items possessed list could be on a server as opposed to locally held.
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    That is actually what I did to get the AI to work so hopefully networking won't have too many changes. Any component that uses input has a corresponding handler component that is actually gets the input. For example an item (or weapon in the case of a TPS) has an ItemHandler which actually calls the use function to use that item (such as shooting a weapon). This makes it very easy to add AI in that the AI agent can just call the final function directly without having a handler component.
     
    hopeful likes this.
  22. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    1. Will there eventually be melee options? Such as rifle-butt strike, bayonet, knife, crowbar, sword, etc. Even unarmed punches and kits, would make the kit universal.

    2. Someone desperately needs to make a TPS/FPS with bows and arrows, or crossbows at least!

    3. Will there an option to move the camera back further and even overhead, either with a chase or topdown view? Kind of like the Unity Stealth demo with the Ethan character.

    Thanks, the asset looks very promising!
     
  23. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    1. Yes, we will have a knife in the first version and that will have a melee attack. I have been planning on unarmed punches, though I don't know if we'll get it in with the first version. The framework is setup to be able to handle pretty much any item/animation, it's just actually creating those animations take some time.

    2. A bow and arrow will be in the adventure scene that we have planned for the first major update

    3. You can see the offset and FOV of the camera for both a normal and zoomed position. The camera does not support a top down view like what is in Unity Stealth though I can definitely see it being useful. I just wrote this feature down to add in an update.
     
    eridani likes this.
  24. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    246
    looking good man will keep my eye out on this one
     
  25. hamyshank

    hamyshank

    Joined:
    Jan 31, 2013
    Posts:
    88
    this will be an instant buy for me...

    what about changing the position of the aim camera? like to be able use the iron sites etc?

    my favorite third person controllers are from GTA and Arma series of games, just to give ideas or inspiration.
     
  26. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    Very Cool! Looking foward to it!
     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    @Computerkid23 & @Kuroato -

    Thanks! My partner and I are really looking forward to getting it out and seeing how people use it.

    @hamyshank -

    Awesome! You can change the position of the camera when it is zoomed, though it is just a single offset versus something like iron sights where you would need to keep the camera relative to the weapon. It shouldn't be too hard to implement though and I've written it down.
     
    ManAmazin likes this.
  28. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    You mean you will be able to smoothly zoom into IronSights or SniperScope from a third person view? That would be extremely cool and I don't think I've ever seen that before in a TPS shooter.
     
  29. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,685
    Any small chance you can release a video preview of the work-in-progress? since you are not releasing for chistmas/new year holiday time, maybe you can give us a video preview to hold us over for now lol... ^_^
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    I'm not promising anything yet ;)

    @Kuroato - I'll try to get a few more in game screenshots together but we have been working on polishing the animation so I don't want to do a video quite yet. We're getting close though and soon we'll be working on the normal videos so I'll try to get the promo video out sooner than later.
     
    jonkuze likes this.
  31. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    Here's a new screenshot of the shotgun that we just added. With the initial version we'll have a pistol, grenade, shotgun, knife, rocket launcher, and assault rifle in the TPS scene. We have the pistol, grenade, and shotgun done and in the game. The knife and rocket launcher still need to be animated. The assault rifle still needs to be textured and animated.

    These items are again for the TPS scene. We won't be releasing any adventure/RPG specific items at launch but that will come with the first feature update.

    (ignore the turret textures - they are currently mapped incorrectly)

    Shotgun.png
     
    Last edited: Dec 22, 2014
  32. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    no updates ?
     
  33. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    Since you asked :)

    We've been reworking the animator controller to make it as easy as possible to add new animations. We've been through probably five or six revisions and I think that we are finally setting on one that we like. As anybody who has used mecanim knows, it can be a pain to a new states because there can be so many different transitions.

    To get around this we decided to go with a more trigger based animator controller. Here's what the highest level of the Lower Body layer looks like:

    LowerBody.PNG

    And the Stand substate machine:

    Stand.PNG

    You'll notice that there are only transitions going into the states and not out of. This works because of the Any State. It makes adding new states a lot easier. Of course, there are situations where you want multiple states to play in a sequence and you can also do that. Here's an example of the Airborne state:

    Airborne.PNG

    As soon as the character lands he will play the Jump End animation. From there the Jump End specifies a manual transition into the different Stand/Crouch substates. We specify it manually to allow the blending to be a little bit longer than the blending from Any State.

    We aren't completely done implementing this new system yet but so far it is proving to work very well. You have the power of controlling the transition between any two states if you want to while also having the flexibility of not having to specify a transition between every single state.
     
    eridani and blackbird like this.
  34. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    I have been polishing the cover system so I figured that I would go into a little bit more detail in how it works. As I previously mentioned, the cover system is a runtime cover system so you do not need to per-designate any locations as "cover points". Instead it uses a layer mask in order to determine if the object can be used for cover. Both full cover and partial cover is supported. By partial cover I mean an object that isn't the full height of the character so the character has to crouch in order to take cover.

    In order to take cover, the character first has to look at an area to take cover. In this screenshot the character is looking at the boxes:

    Cover1.png

    The next step is to actually take cover. Right now I have the interact and the cover button mapped to the same button. As the character is taking cover they will rotate to face in the opposite direction of the cover normal:

    Cover2.png

    In cases where the character is taking cover behind a curved object (such as a column), the character will continue to face in the opposite direction as long as the cover object's new normal delta isn't greater than a specified threshold. While in cover the character can strafe left and right. When the character reaches an edge he can then pop out of cover to aim:

    Cover3.png
    At any point the character can come out of cover by just pressing the same button used to enter cover.
     
    hopeful and TheLetterS like this.
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,523
    Justin - It's looking great so far! Having to maintain my in-house cover system, I understand how much work it involves. How far are you planning to take it? Will characters be able to crouch in low cover, sprint-slide and/or dive into cover, peek around corners, blind fire, etc.? And that doesn't cover (sorry) the half of it, with edge cases like diving from cover to cover across an open doorway, switching cover surfaces around corners, reloading and switching weapons while in cover, and so on.

    Speaking of weapons, how are their animations being handled? Upper body/lower body animation layer split?
     
  36. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    Hey Tony,

    You're right - a cover system really could be an asset all by itself. Right now we just have basics - the character will move up to the cover point, rotate, then strafe left and right while staying aligned with the cover's normal. You can then pop out of cover to shoot. That's all that we are planning on shipping with for the first version. If cover is a popular topic then we plan on updating it to include new features in future versions. I'm not sure about the reloading and switching weapons yet. For the pistol it is easy but when you have a rocket launcher you really have to take into account the cover object behind you.

    The upper and lower bodies are on different animation layers so that gives us a little bit more flexibility.
     
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,523
    Sorry for getting over-enthusiastic with those questions. I was momentarily taken by visions of not having to maintain my own system any more. :) That all sounds perfect. The basics are what's important. That's what the rest of the gameplay systems are built around. The side features are just decoration that users can add on their own if needed.
     
  38. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    I like the idea of runtime cover. Will it be able to handle flying or otherwise elevated foes?
     
  39. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Will it be easy to swap out the character for any other mecanim-compatible character? Or will it take some elbow grease. Thank you.
     
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    Do you mean the cover system? In order for an object to be considered cover it has to satisfy three conditions:

    1. Be in the pre-specified cover layermask
    2. Be within the per-specified cover distance
    3. Have a collider at the same height as either the top or the bottom of the character. This is used by a raycast to determine if the character should take a high cover or low cover.

    We're trying to make it as easy as possible. Take a look at this post for some more background, but you'll be able to create a new character with the Character Builder. I wouldn't want to have to add everything manually as there are a lot of different components that get attached to the character:

    components.PNG
     
  41. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    So ... if I'm understanding this correctly, if the ceiling and floor and walls are in the cover layer, then NPCs can use them as part of cover-taking tactics?

    I'm thinking not only of dealing with flying opponents, but also situations on stairways and ramps, where characters could be firing at each other from above and below, and large multilevel rooms with adjoining hallways where the hallways could be used for cover when fighting opponents in the large room.

    It also sounds like maybe this system could apply cover for prone characters ...?

    One additional wrinkle might be to consider area of effect attacks. For instance, what should the AI do if a character is behind cover but is still taking damage?
     
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    So far everything that I've said has been from the perspective of a player controlling the character rather than an AI. I haven't created the Behavior Designer tasks yet and when the Third Person Controller is first released it will just contain relatively basic tasks similar to the UFPS integration. I have a lot more planned though and I'll be creating another pack similar to the Movement Pack that will be perfect for the third person controller.

    Our current focus is to just get this base framework out and then to continuously update it with new features. I haven't completely decided yet but I think that when we launch the first version it will be labeled with a beta tag and listed for a discounted price. We will then be officially at version 1.0 when the full adventure scene is included, and around then I hope to have the new Behavior Designer pack out as well.

    This situation sounds perfect for a behavior tree ;)
     
  43. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Oh that's nice. It will make it easier to put in my own respawning system, or integrate with Core Game Kit's respawner, etc. Modular is great! Good thinking.
     
  44. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    We are getting close to submitting! I have had a few people say that they are interested in testing the Third Person Controller before we submit and I'd like to get a couple more. Please send me a PM or email (support@opsive.com) if you're interested. Note that when I send out the files I won't have any of the documentation done so I'd prefer it if you already have a good amount of Unity experience.

    Edit: Thanks for the interest. We have enough now.
     
    Last edited: Jan 7, 2015
  45. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    Any spoilers on what will be the discounted beta price......?
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    This asset is going to integrate extremely well with Behavior Designer so we are anticipating a lot of crossover. Because of this we are planning on pricing it cheaper than we otherwise would have so we are currently planning on starting it off at $30. When we launch it may be slightly different than this but that's the plan right now.
     
    Last edited: Jan 8, 2015
  47. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    why not put Behavior Designer on sale to on the launch too, just saying ;)...

    waiting for this asset.......
     
  48. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,623
    Any integration with the Movement Pack? (I don't have the MP and wasn't planning on using it.)
     
  49. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    So far Behavior Designer has only been in Unity-sponsored sales and it was just in one about a month ago. I haven't put Behavior Designer back on that list to potentially be included in a sale and I probably won't for at least a couple more months. It'll then be up to Unity to decide when/if Behavior Designer is included in a sale. When the Third Person Controller is released I am actually planning on increasing the Behavior Designer price a bit, so you can consider it being on sale right now :)

    Yes, there will be. I haven't figured out the correct approach yet, but I do plan on it. It will hopefully be available shortly after the Third Person Controller is released.
     
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,086
    Here's a look of the weapons that are included with the third person shooter scene. These are in addition to the grenade which was mentioned earlier and is considered a QuickUse item so it can be used at any time.

    Pistol
    Pistol.png

    Knife
    Knife.png
    Shotgun
    Shotgun.png
    Assault Rifle
    AssaultRifle.png

    Rocket Launcher
    RocketLauncher.png
     
    jonkuze likes this.