Ultimate Character Controller WIP

Justin

Administrator
Staff member
Starting a thread for new Ultimate Character Controller updates. To get things going, in version 2.1 a new gravity zone component has been created allowing your character to change gravity dynamically instead of just based on the surface normal. In this example a gravity zone has been added to two planets so the character can jump between them.

 

Justin

Administrator
Staff member
In version 2.1 you'll be able to set custom scales on your character's transform. While this seems like a standard Unity feature it has to specifically be added when the controller is doing all of the collision detection.

 

Justin

Administrator
Staff member
One of the improvements for the melee system in 2.1 is the ability to have input combos start a particular attack. For example, you may only want to play a heavy slashing animation when the player performs a series of inputs such as down, right, down. Or you may want to play a special counter attack after the enemy got a hit on you. These situations can now be accomplished the the Ability Starter.

The Ability Starter is an abstract class that allows you to decide when the ability should start. It can be thought of as being similar to Ability.CanStartAbility with an Automatic start type, except it's generic so you don't have to code the conditions within a specific ability. A new start type of Custom has been created, and when it is set to custom you can select a class that inherits the AbilityStarter class. In version 2.1 we will be shipping an AbilityStarter that will start the ability after an input combo has been performed:

ComboTimeout.PNG

With the above setup the ability will start after the Action, Action, Crouch inputs have been detected with Button Down. If Combo 2 or Combo 3 is not detected within 0.2 seconds from the previous input then the combo will restart. This class is just an example, but the AbilityStarter API gives you full control over when you can start your ability:

C#:
        /// <summary>
        /// Can the starter start the ability?
        /// </summary>
        /// <param name="playerInput">A reference to the input component.</param>
        /// <returns>True if the starter can start the ability.</returns>
        public abstract bool CanInputStartAbility(PlayerInput playerInput);

        /// <summary>
        /// The ability has started.
        /// </summary>
        public virtual void AbilityStarted() { }

        /// <summary>
        /// The ability has stopped running.
        /// </summary>
        public virtual void AbilityStopped() { }

        /// <summary>
        /// The object has been destroyed.
        /// </summary>
        public virtual void OnDestroy() { }
 

Justin

Administrator
Staff member
Along with version 2.1 we are also working on the Agility Ability Pack. The Agility Ability Pack will contain 7 abilities focused on different agility animations. We plan on including the following abilities in this pack:

Balance
Crawl
Dodge
Hang
Ledge Strafe
Roll
Vault

A few of these abilities existed in version 1 of the Third Person Controller and compared to version 1 we plan on expanding on the abilities so they are able to do more. One of the things that we are expanding on is the hang ability. When you are hanging you will be able to jump hang to different hang objects in the horizontal and vertical direction. You will also be able to hang on rounded objects.

1544914296134.png
 

chrisk

Active member
awesome! I'm really looking forward to this. I'm curious how easy it is to setup hang objects. Would it be smart to detect the edges automatically?
 

Justin

Administrator
Staff member
I'm trying to make it as easy as possible. So far everything is dynamically detected and you don't have to configure any special triggers or anything like that.
 

chrisk

Active member
Wow, I'm impressed. Dynamically detecting edges will also apply to other environment interactions. Things will just work! I just hope it's not prohibitively expensive to do so. ^^
 

Justin

Administrator
Staff member
This is a smaller one but @TimeStrafer recently requested the ability for the Item Manager to be able to create a first person item that does not have any arms. A new button has been added to the Item Manager which allows you to do this:

1545594302914.png

Since this use case isn't as common and the button looks so clickable a dialogue will pop up when you click it:

1545594600206.png

I'll also be updating the documentation to mention what this button does. Hopefully this is enough to reduce confusion.
 

Justin

Administrator
Staff member
Another small but useful one:

@Rin wanted to know when a combo was finished but the Animator State Selector API currently doesn't have a method which gives that information. A new method has been added that you can override called AnimatorAudioStateSelector.ResetStateSelection which will allow your selector to know when the combo has completed and you can reset which state plays next.
 

Justin

Administrator
Staff member
In version 2.1 the attribute system has been expanded to the items:

1. The shield will now use the Attribute Manager instead of having a separate Durability field. This gives you more flexibility in defining if you'd like the shield to be able to restore itself:

ShieldDurability.PNG

2. UsableItems have two different attributes: one that affects the item itself, and one that affects the character.
  • The first attribute (called Use Attribute) affects the Attribute Manager that exists on the item itself. An example use is for melee weapons and wanting to give them a set number of uses because their durability degrades with each use.
  • The second attribute (called Character Use Attribute) affects the Attribute Manager that exists on the character. An example use is affecting the character's stamina value with each use.
UseAttribute.PNG

One of the next features that I plan on adding is the ability for the item to be removed when the durability reaches 0.
 
These both look awesome Justin. I can see how this can give great freedom for many RPG items and scenarios.

I have two questions:

1) Do you have any plans to expand the effect of the attributes to the character the melee/shootable weapon collides with (i.e. hit an enemy with a sword to apply a damage over time effect)?

2) I know that UCC focuses on being a character controller, but is there any plan to incorporate at least a sample attribute management system in the demo scene. Currently there seems to be two asset initiatives that might end up tying RPG attributes to UCC without using these native UCC attributes. It would be great to have an embedded sample interface that shows how the attributes work together, such as a simple RPG character sheet, where the defined attributes could be visually seen. Just a thought.
 

Justin

Administrator
Staff member
1) Do you have any plans to expand the effect of the attributes to the character the melee/shootable weapon collides with (i.e. hit an enemy with a sword to apply a damage over time effect)?
I could see adding this in a future release, but 2.1 has already grown the include a lot of stuff so I don't want to keep adding to it at this point. Right now the attribute additions are more for affecting the current object/character, rather than affecting the object that they hit. This would actually go really well with the future magic item.

2) I know that UCC focuses on being a character controller, but is there any plan to incorporate at least a sample attribute management system in the demo scene. Currently there seems to be two asset initiatives that might end up tying RPG attributes to UCC without using these native UCC attributes. It would be great to have an embedded sample interface that shows how the attributes work together, such as a simple RPG character sheet, where the defined attributes could be visually seen. Just a thought.
I think that in cases like this it makes sense to keep it separate out of the core character controller. RPGs require a lot of data tracking so in order to really do it justice it would have to be a separate asset (sort of like the Deathmatch AI Kit).
 

Justin

Administrator
Staff member
Is that in the roadmap, maybe with the magic pack, or as a separate pack?
The number 2 item? Right now it's not planned, there are other higher priority assets that we want to do first. Maybe in a couple of years if nobody has released anything similar :)
 

Justin

Administrator
Staff member
One of the next features that I plan on adding is the ability for the item to be removed when the durability reaches 0.
This has now been added. When the shield's durability attribute or the usable item's use attribute reaches the minimum value they can be removed. The character will drop the item with an ItemType count of 0 to prevent the character from being able to pick up that item again.

1546027295142.png
 

Justin

Administrator
Staff member
Yes, everything shown so far will either be in 2.1 or the agility pack.

@Deckard_89 and @amrita asked about showing the third person hands while in a first person view. You've always been able to setup the first person perspective to always show the third person hands, but you haven't been able to toggle when the third person hands are shown.

I've added the option to version 2.1, and this is also beneficial for the hang ability. Since Unity's IK system doesn't support generic rigs the first person perspective of the hang ability will use the third person hands. Here's a look at the game view:

HangFirstPerson.PNG

And a look at the scene view:

HangScene.PNG
 

Justin

Administrator
Staff member
A roll ability has been added to the Agility Pack. All of the ability packs will support both first and third person, and with roll it can make you dizzy pretty quickly:



In order to reduce the dizzying effects the roll ability has the following options when in first person:

- Roll with the head rotation, as is in the gif above.
- Roll without the head rotation, so the camera does not go upside down.
- Switch to third person view while the roll ability is active.
 

slik

New member
Since Unity's IK system doesn't support generic rigs the first person perspective of the hang ability will use the third person hands.
What if you use humanoid rig with mask for FPS arms? It would allow to use unity's IK and retargetting. Won't it have to much impact on performance?
 
Top