Search Unity

Third Person Controller - Third Person, AI, Multiplayer, Mobile Framework

Discussion in 'Assets and Asset Store' started by opsive, Jan 21, 2015.

Thread Status:
Not open for further replies.
  1. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I've started to create a new set of videos to go along with the latest release. You can see all of the new videos on the Videos page.

     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Before we get started on implementing features for 1.1 we will be releasing version 1.0.2. In addition to any bug fixes, this version will also contain some polish dealing with features that aren't big enough for anybody to really request it. This includes minor features such as per-object decals.

    Another change that will be in 1.0.2 is a new default camera anchor. With the current demo scenes the camera is anchored to the character's head and because of the camera's smoothing it makes the movement animations look stiff. The camera's anchor is now set to the character's position and as a result the character is a lot more animated. We've updated the third person shooter and third person shooter AI demos if you want to see a preview of what this looks like (and give us any feedback :)). Doug also walks instead of runs by default, and you can run by holding the shift key.
     
    BackwoodsGaming likes this.
  3. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    When can we expect this update? Also, there is a small bug which lets the empty clip sound play repeatedly while holding the shoot button. Any update on new mobile controls?
     
    Last edited: Aug 9, 2015
  4. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I don't have a timeframe yet, we just started on 1.0.2 this morning. In general we try to get these minor releases out the door pretty quickly though.

    Thanks! Just fixed and uploaded a new web demo.

    In terms of new mobile controls, are you just talking about a virtual joystick instead of touchpad? In 1.1 I plan on adding Rewired and Control Freak integration, though if it's just a virtual joystick I should be able to add it to 1.0.2.
     
    Last edited: Aug 10, 2015
  5. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    A virtual joystick would help a lot. In older versions you used to be to shoot and move the camera while shooting if the button was big enough but now you cant. Is it possible to add that back?
     
  6. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    You should definitely be able to move and shoot. I'll add a virtual joystick and make sure that you can move and shoot at the same time for 1.0.2.
     
    Last edited: Aug 10, 2015
  7. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    You can move and shoot, you cant move the camera and shoot using the shoot button.
     
  8. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    I tried to add soldier AI to the "Adventure" scene. I've created prefab from Guard "Third Person Shooter AI" scene and reassigned Naomi as target in variables. AI can't follow Naomi - it always stucks at any hill on the terrain, sometimes it's even invisible in game view.
     

    Attached Files:

  9. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Does your nav mesh cover the sloped area? Also, you may need to adjust the Slope Limit on the RigidbodyCharacterController to allow the solider to move up the terrain.
     
  10. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Increasing slope limit fixes the problem, but my point is what if the hill is too high? My understanding is that AI should find another route.
     
  11. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    The AI will be able to traverse wherever a navmesh has been generated. In cases like this just make sure the navmesh hasn't been generated in that area. You can change the maximum slope when baking the navmesh
     
  12. Stan-B

    Stan-B

    Joined:
    Aug 5, 2013
    Posts:
    126
    Got it, thanks! Great assets and support!
     
    opsive likes this.
  13. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    -Questions from a non-programmer.

    1. Can I use the mouse-wheel to zoom the camera, without more coding?

    2. Can I switch back and forth from third person and adventure modes - real time? How?

    3. Can bow be used in 3rd person mode, or only adventure?

    4. Can I simply disable root motion?

    5. Are the 3rd person and adventure abilities active in ORK? Your weapons active in ORK?

    6. ETA for swimming?

    7. How about mounts? In ORK I can get my character on a horse and I have animations for horse and for rider, but I need them synced. How about adding mounts (horse, car boat, etc. to TPC?
     
  14. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    I asked this after he did the ORK integration. For now, he said it is just the character and camera controllers since ORK has all the other stuff... But he said he may look into further integration down the road.

    Curious about this as well since this is one of the abilities ORK doesn't seem to be able to handle natively (and from the sound of posts on their forums, doesn't sound like it is going to be).. Would be an awesome marketing point to ORK users to have integration the gets around that limitation!

    I'm thinking that may be beyond the scope of the character controller. But as easy as this one looks, I wouldn't argue with it having ability to deal with my horses, wagons, and boats too.. :)

    Still looking forward to giving it a play as soon as I can scrape funds together! Really looks to be coming along nicely!
     
  15. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for the help @Shawn67!

    Not in the current version but I'll add it to the next version, 1.0.2.
    Yes, you can call RigidbodyCharacterController.ToggleThirdPersonMovementType. This is also mapped to the "Toggle Movement Type" button.
    The bow can be used in any mode.
    Yes, that's an option on the RigidbodyCharacterController.
    @Shawn67 was correct - currently it is just the base character and camera integration. I'd like to get through a few more core Third Person Controller features before I add deeper ORK integration. There does seem to be a lot of interest in this integration though
    No time period yet, but I'd like to get it in 1.1.
    Mounting would be a separate ability. Currently this a little outside the scope but it would be really cool to have eventually.
     
    BackwoodsGaming likes this.
  16. Candescence

    Candescence

    Joined:
    Aug 26, 2014
    Posts:
    107
    Speaking of mounts, I actually want my game to be able to have pilotable mechs that are also driven by TPC. The tricky part is entering and exiting them, and making sure the transitions work smoothly.
     
  17. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    We dealt with this scenario a lot with the climbing animations. Take the ladder for example. Your character should be positioned so they will be in the center of the ladder when the start climbing. Within the Ability class you can use the method MoveToTarget. This will move the character to the correct position while playing the movement animations. Once you are in position you can then play the mounting animations, and if you use root motion you can ensure the position is exactly where you want it.
     
  18. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    i like the UFPS ladder system, not sure if it could be the same in tps, but you enter it, it just start using it. lookupside to go up, look downside to go down
     
  19. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    If you set the Input Start Type to None on the Climb ability then you'll be able to mount on the ladder without having to press a button first.

    I prototyped a ladder about a year ago when the Third Person Controller was in its very early stages. In this prototype the character would move up when the camera was looking up and the down when the camera was looking down. I can add it as an option to 1.0.2 - it should be a quick addition. This would affect all of the climb abilities so for example the same thing would happen with the vine or pipe.
     
  20. redchurch

    redchurch

    Joined:
    Jun 24, 2012
    Posts:
    63
    I'm getting this error in the console. I copied over the item pickups from the normal demo to the Third Person Shooter AI scene, since the AI demo only has a pistol. Could that have something to do with it?
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    @redchurch -

    That could be it. That error will occur when you try to pickup an item that hasn't been added to the character yet. Make sure you go through the Item Builder for the ItemType that you want to pickup. If you've already gone through that Item Builder with that specific for a different character then you can just copy that item GameObject to your new character. Make sure you place it under the "Items" GameObject though under the character's hand.
     
  22. redchurch

    redchurch

    Joined:
    Jun 24, 2012
    Posts:
    63
    Just to be clear - So the items from the Third Person Shooter demo cannot be placed in the scene for the Third Person Shooter AI, and must be re-built through the Item Builder? Does this mean that every new scene with different items in them, the items must be rebuilt in Item Builder or I should keep a "master item scene" somewhere and build the items into that? Just trying to understand what a good workflow is for copy/pasting item placement easily from scene to scene.
     
  23. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    It can be copied, you just that you need to make sure the ItemTypes match. For example, lets say that I want the AI to be able to carry a rocket launcher. The first thing that I do is copy the Rocket Launcher Item Pickup from the shooter scene. If you look at the ItemPickup component from that GameObject you'll see the following:

    ItemPickup.PNG

    The RocketLauncher ItemType must be added to an Item within the AI agent. Since I already have the Rocket Launcher item setup on the Doug character, I can just copy that GameObject to the AI agent (Top Guard in this case):

    RocketLauncher.PNG


    You'll see from this screenshot that I parented the RocketLauncher GameObject to the Items GameObject on the soldier's right hand. If you look at the right side of this screenshot you'll see an ItemType of RocketLauncher. This ItemType is a reference to the same ItemType in the Item Pickup component.
     
  24. redchurch

    redchurch

    Joined:
    Jun 24, 2012
    Posts:
    63
    Oh ok, thanks. That makes sense now. I think I misunderstood. My "Doug" has the correct setup so I was confused, the error is probably occurring because the AI doesn't have the weapons setup. So would this apply if I wanted to add the Adventure weapons (or vice versa the shooter weapons to Adventure) well?
     
  25. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Did the AI try to pickup one of the new weapons? Or did you add it to the AI's Default Loadout? Yes, these same steps can be followed for the adventure items as well.
     
  26. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Thank you Opsive and Shawn 67 for you responses.

    I remain excited about TPC and what can be accomplished with it integrated into ORK. ORK has many strengths, and is superior in its core RPG features, but its controller/camera is not on par, and the developer does not appear to be interested in swimming and mounts, of which I consider mounts a basic features for getting around in the outdoors.

    I also value moving platforms, which I am pleased to see implemented in TPC.

    I have a license for Mister Necturus' excellent Horseman animation collection that I am attempting to hook up in ORK, but, my preference would be to implement TPC and BD and use ORK Damage zones and dealers to compute health. I think they could work quite nicely together.
     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    That makes a lot of sense. We don't have a mount ability for horses but I think that if you did it right it could work for anything that you ride. Things like horses, cars, or planes could all use the same ability, you just have to specify a unique animation for that ability. You should be able to use ORK's Damage Dealers with the current version of the Third person Controller - the Third Person Controller's health component is not required so you can just remove that component and use the one provided by ORK.

    This is related to your post yesterday but I just wanted to mention that I've implemented the camera zoom with the scroll wheel feature. It'll be released with 1.0.2.
     
  28. redchurch

    redchurch

    Joined:
    Jun 24, 2012
    Posts:
    63
    Yeah it turns out the AI was trying to pick up weapons. Now that I've copied them over I don't get errors, but the AI doesn't want to shoot at me anymore. It just runs around without shooting. I know TPC isn't really an "AI solution" so I'm keeping my expecations realistic, but I was hoping to mock up a simple combat gameplay loop ala Max Payne, Stranglehold or something.

    BTW, is there a Skype channel or anywhere that TPC users hang out? You could maybe outsource a bit of your support if there was a place for users to hang out and give each other tips and what not. :)
     
  29. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    The AI should definitely be able to shoot ;) While you're right the core classes of the Third Person Controller doesn't include any AI, it has been designed to work well with other AI solutions and since you're using the Behavior Designer integration I should be able to help :) I'm guessing the Use task is returning failure when the agent tries to shoot? There's a few different things that can cause this task to fail. Obvious things include not having enough ammo or trying to use the item too quickly after it has already been used. The one thing that you may not think of is the Item Use Rotation Threshold. Make sure this value is high enough for the character to be able to use the item while facing the target.

    Not Skype but we do have our own forum on opsive.com. It's hard to search specific Unity threads so I've found that having this forum has really helped people get answers to questions that have already been asked.
     
  30. IndusGeek

    IndusGeek

    Joined:
    May 21, 2014
    Posts:
    34
    bought TPC and got my character moving and shooting..but i need to make it work on IOS Devices..any tutorial or link explaining how to add the controls on the mobile and get it working.
     
  31. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    There is an overview of how the mobile controls work here. In order for it to auto-detect a mobile platform you'll need to import the source.
     
  32. IndusGeek

    IndusGeek

    Joined:
    May 21, 2014
    Posts:
    34
    ok..great..thanks..added the Source..and changed the platform to IOS..but now getting error.
    NullReferenceException: Object reference not set to an instance of an object
    Opsive.ThirdPersonController.CameraController.CheckForCharacterClipping () (at Assets/Third Person Controller/Scripts/Camera/CameraController.cs:538)
    Opsive.ThirdPersonController.CameraController.LateUpdate () (at Assets/Third Person Controller/Scripts/Camera/CameraController.cs:377)
    ..Any Suggestions please.
     
  33. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    When did you create your character? Was it before 1.0.1? In previous versions the Character Builder would allow non-humanoid characters, but now it does a check for it. If you switched your character to humanoid after going through the Character Builder then it wasn't able to setup everything. To fix that error I would just go through the Character Builder again with a fresh character model. If you keep your old character you can drag your already-created items to the new character.
     
  34. den3d

    den3d

    Joined:
    Nov 23, 2014
    Posts:
    45
    Found 2 issues in TPC 1.0.1
    1. Shoot with no aim. When ammo depleted gun stay aimed also hear strange "jitter" sound.
    2. Equip gun, shoot few bullets. Start reloading then right away (when reloading not complete) move forward. You will see very strange animation like few anims blended.
     
  35. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks! I just fixed both of these so it'll be in 1.0.2. Let me know if you want the change ahead of time.
     
  36. den3d

    den3d

    Joined:
    Nov 23, 2014
    Posts:
    45
    Is any way to create flame thrower, chainsaw, electric shock, flashlight?
    So weapon or equipment with 2 states: idle and action. For instance chain saw run engine idle then max throttle when player hit attack.
    Also it could be some futuristic weapon.
     
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Yes, take a look at the ShootableWeapon -> Animator Options folout of the inspector. There are three different types of item animations that you can play:

    Idle
    Fire
    Reload

    In your case you would want to use the Idle and Fire states. The bow in the adventure scene has an example of using these states.

    Flightlights are a little bit different but that has been added. Take a look at the pistol within the shooter scene for an idea on how to set it up. In the ShootableWeapon inspector there is an Attachment Options foldout and that's where you specify it.
     
  38. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I've uploaded an integration package for plyGame. This is a character and camera integration so you can use the Third Person Controller within plyGame. Thank you @Darrkbeast for helping me test this integration.

    plyGameSample.png
     
    Darrkbeast likes this.
  39. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Hi,

    I noted that Run does not make a faster Walk Sound.

    Please can it. (I did attempt to dig around to see why the OnAnimatorFootDown event wasn't simply triggered more often but drew a blank as I am unfamiliar with the codebase yet).

    Thanks
     
  40. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    I originally added the FootDown event to the run animations but the event ended up being fired way too much. It was almost like the blend tree was calling the animation events twice, once for the walk and once for the run animation clips. I'm curious if you hear the same thing - just add a new animation event called FootDown to the run animation. An int is used to specify which foot is down (0 is left, 1 is right)
     
  41. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    no it works, but there is weird "long" random sample that due to the monophonous nature of the sound causes the shorter sounds to trigger late. Do you have a "random" sample that you drop from time to time and where are they set, I will have a play and see if I can get more sensible polphony.
     
  42. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    There shouldn't be a random clip that plays, only when it receives the footstep event. Take a look at the CharacterFootstep component on the character. You can set which sound plays per foot as well as play a random clip.
     
  43. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Version 1.0.2 of the Third Person Controller has been sent to opsive.com purchases and it should appear on the Asset Store soon. This version adds a lot and deserves more then a 0.0.1 release, but we have bigger plans for 1.1. You can view the full change list in this post. Here are some of the highlights:

    Added a RPG scene
    RPG.png

    Added a 2.5D scene
    2.5D.png

    Added per-object effects and damage visualizer
    blood.png

    Added the ability to drop items upon death

    explosion.png

    Added a mobile joystick
    joystick.png

    In addition to these, some of the more notable (but less screenshot worthy) features include the ability to switch items with the scroll wheel, lower body IK improvements, and improved character movement.
     
    twobob, Candescence, den3d and 2 others like this.
  44. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    Cant wait!
     
    opsive likes this.
  45. den3d

    den3d

    Joined:
    Nov 23, 2014
    Posts:
    45
    Great update, animations/states looks much better now!
    But how to make character always run, like before?
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Appreciate it! You have two options to get back the running:

    - If you don't want to change the animator at all, you can add the SpeedChange ability and set the Speed Change Multiplier to 2:

    SpeedChange.PNG

    Since the ability doesn't have an input name or start type it will always be active.

    - Modify the Animator blend tree to include running instead of walking:

    Animator.PNG

    This screenshot is from the Base Layer - > Grounded -> Movement state. You'll need to then change the upper body states to match the same. With this setup you do not need to add the Speed Change ability (which can then be used for sprinting).
     
  47. BadUncleGames

    BadUncleGames

    Joined:
    Aug 10, 2015
    Posts:
    39
    Hi folks,
    Loving the look of this asset but just before diving in and purchasing I have a few questions if I may.
    Firstly my apologies if my questions have been addressed in earlier posts, I have read quite a few of them already but not seen any comments addressing my specifics.

    1. How flexible is stats/attributes/health/damage etc system? I have my own formulae etc that is integral to the gameplay my team and I are developing and I want to know if is a simple matter of adding my own functions to say damage calculation and feed that into the damage functions of TPC.
    2. I understand that with a licence I can get the source code and therefore could add in other components but are there any hard coded pieces that can't be modified or expanded? For example something like item creation, is it feasible to write my own crafting routines that add a quality/durability stat to a specific instance of an item?
    3. In a similar vein to the above questions, I have a different approach to what happens when your health hits 0 and would like to branch off depending on various circumstances to different routines, is this something that I would have the ability to expand on? e.g. add in my own conditional statements/code in the death routine and spawn routines etc of TPC?

    I understand they are a bit open ended as any code etc requires a fair bit of effort on my own part and of course I understand the potential conflict down the track with updated versions of TPC and adding my won mods in there but happy to work around that I just want to be sure the above is at least possible before diving headlong in ;-)

    Appreciate any comments folks.
    Regards
     
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Thanks for taking a look at the Third Person Controller!

    There are two ways you could accomplish this. You could modify the CharacterHealth directly with your own formula, or you could create your own component. The system is modular so if you don't want to use the built-in CharacterHealth component then you don't have to. The weapons have an optional field which allows you to fire your own custom event. This would allow you to use your own health/damage component without changing the source for the weapons.

    Very few things are hard coded. I tried to make as many methods virtual as made sense, and I'm definitely open to modifying the base class if it would make implementing your own logic more feasible and makes sense for the entire project. Of course, since you have the source you can do it yourself but then as you mentioned you'd potentially have to rework the code with each update.

    Sure, you can subscribe to events when the health changes, and when the health reaches zero. This would allow you to add in your own functionality when the health hits 0.
     
  49. BadUncleGames

    BadUncleGames

    Joined:
    Aug 10, 2015
    Posts:
    39
    Thanks for the super fast response Justin. Looks like I'll be jumping into the TPC family this morning then (and it almost goes without saying that the BD offering when I am working on AI will be there as well).
     
  50. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,127
    Awesome - yeah the Third Person Controller and Behavior Designer really complement each other. With the Behavior Designer integration your AI character can do pretty much anything that a player controlled character can do.
     
Thread Status:
Not open for further replies.