read mepdf v3_0_07_02meleeweaponcontrol
TRANSCRIPT
Customizable Limb + Transition Independent Combo System
(CuL-TICS)
Last Updated in 2.5
Melee Combo is independent of how each motion got linked to each other. User can use AuxMeleeCombo to create all kinds of Combo they wished.
…. As long as ones have a desired motion to plugged in the Animator… Hit Detection are Limb based and customizable, User are not restricted to using fixed Collider.
Melee Weapon
Last Updated in 2.5
When an attack hit a target, HitFX will be play based on Weapon’s Material.
Force determine how much target will get pushed when attacked
TotalForce = Weapon’s Force x Motion’s Force
Power determine how much power does it have to overcome Target’s defence
TotalPower = Weapon’s Power + Motion’s Power
See ReadMePDF_V2_5_08_DamagingControl
Length and Radius will be explain in each Hit Detection Type
If WeaponHitFX contain something, it will override Material
GlobalFXSet
Last Updated in 2.5
Inside GlobalFXSet
When an Attack hit something, it will play HitFX.
Anything beside the 2 weapons count as Blunt attack, unless overriden by Motion.
If Weapon has anything set, it will override GlobalFXSet.
If MotionData has anything set, it will override both.
Depending on Weapon’s Material, SoundFX will be play based on GetHitSoundFX();
Setup Melee Weapon Prefab
Last Updated in 2.5
At Weapon’s Base Transform, add AttackTransform, this will be use as base Location where Hit Detection Generated If there is more than one, all will be use when doing Attack If there is none, WeaponSlot will be referenced instead. FXTransform is use to determine where FX Object will be play. SoundTransform is use to determine where soundFX will be play. If none is available, AttackTransform will be reference instead. If there is more than one, MotionDataRef can determine which one to reference to.
Aux Melee Combo
Last Updated in 2.5
Aux_MeleeCombo contain lists of MotionDataRef_MeleeMotion to determine what to do with each Melee Motion
ComboMotionData’s size determine Maximum Combo the Unit Can do.
Inside WeaponControl_Base_CloseCombat,
GetNextMotion()
Any motion that got returned here, will be the next motion that Character will transition to.
GetMotion Data
Last Updated in 2.5
Inside Unit_InputModule ,the following controls which motion got selected
If CancelAttack() return true, AttackInput will be canceled
MeleeAttack1() will call Motion from ComboMotionData
Based on WeaponCombo Index
MeleeAttack2() will call Motion from PowerMotionData
Based on WeaponCombo Index
If Unit is not grounded, Aerial version will be called instead.
For Player, if the Unit is moving Forward, DashAttack will be call
GetUpAttack() will be call if Attack is call while in Downing State
See ReadMePDF_V3_0_08_DamagingControl
Attack MotionRef concept
Last Updated in 2.5
0.0 1.0
Motion Normalized Timer
Attack Motion On
Hit detection for specific Limb,
will only be on during this period
0.1 0.5
0.9
NextMotion Timer
Blend to next Melee Motion when time went beyond here
0.8
FX Start Time
FX will be play once, when timer went
beyond here
MotionDataRef_MeleeMotion
Last Updated in 2.5
MotionIndex determine which Motions the Character will transition to
Use RootMotion will determine whether to turn rootMotion on or not.
Next Motion Timer will determine for how long the motion will play until being able to blend into the next combo.
MotionDataRef_MeleeMotion
Last Updated in 2.5
AuxMode determine extra Attack Value to Weapon.
If element is anything other than NONE, it will override Weapon’s Element
**Consumption is not implemented**
Attack Motion Timer
Last Updated in 2.5
Depending on Attack Motion’s size,
Multiple Limb can do attack simulatneously.
Limb on DropBox determine which Limb will HitDetection be on.
The Slide value will determine when to turn on Hit Detection.
Until HitDetection is off, Target can be hit only once per on session.
In this sample image, An object can be deal damage 4 times.
Length and Radius determine the size of HitDetector,
This will be explain in each HitDetection Type
FX Obj and Sound FX will be play when Attack Hit a target.
This will override anything the Weapon has.
FX Timer
Last Updated in 2.5
FXTimer and AudioTimer are use to play FX at a certain time during motion.
FxObject will Get FXObject from data pool, if there is none availble, it will be instantiate at the location of AttackLimb’s Transform Index
If FXObject has Component<FollowTarget>()
It will follow the Transform;
If not, it will be play and stay at the location.
FX will play once after motion went beyond StartTime
FX GameObject Setup
Last Updated in 2.5
Melee Control utilize object pooling for FX Objects.
The process is automated as soon as they are needed.
In order for Pooling to work,
FX Object must be deactivated after completion, instead of destroyed.
Otherwise, new Objects will keep getting created, causing Performance problem.
Global Setting
Last Updated in 2.5
Override All Motions Timer will override each Motion Data NextMotionTimer
HitDetectionOnUnitLayer will determine on whether or not each Character’s base Collider can be hit detected.
MeleeSphereOnAttackTransform
To MeleeMeshColliderGenerate
are HitDetectionType
And they will only be activated if these are on.
MeleeAtkOn determine which Limb can have HitDetection on.
Some of them could be turned off for optimization.
Global Setting
Last Updated in 2.5
MeleeRotateToNearestTargetInFront
Will determine whether Character should do automatic rotation toward nearest target or not.
TargetFrontDistance and Radius
Detect whether there are any target in front.
Distance
Radius
Hit
Not Hit
MeleeSpherecastAttack
Last Updated in 2.5
Attack Transform
Length
Z-Axis
To prevent Object that are really close from being went through,
MeleeSphereOnAttackTransformFixedPosition
should be use with this as well
Not Hit
MeleeMeshColliderGenerator
Last Updated in 3.0
If this type is use,
HitDetector will be generate
under Character’s base Transform
Attack Transform
Previous Frame
Length
Attack Transform
Current Frame
Length
Hit
Not Hit
Hit
Not Hit
Will Do warning in Unity 5.x, But the system still worked as normal
Body Attack
Last Updated in 2.5
If AttackMotion is set to Body, this will ignore all other settings and do the following
Hit
Not Hit
Chest Bone
Length
Radius UnitTransform.forward
Melee Weapon Deal Damage Schematic
Last Updated in 2.5
Melee Weapon Hit Something
Can Target
Return;
NO
Send Target Transform to Weapon Manager
Weapon Manager Calculate Total Damage, DealDamage to Target
Target Received Damage and Calculate how much of its HP is loss based on its own internal
algorithm
YES
Aiming, Difference in Melee and Range Weapons
If the Weapon is a Melee Weapon, when Aiming, the Camera will move to the back of Unit
Last Updated in 2.0
If the Weapon is a Range Weapon, when Aiming, The Unit will Rotate itself toward TargetIK
AimIK
Camera Still
Unit Rotate
Camera Moved
Unit Still
Any Weapon Type return true here will be consider a Melee Weapon
Editing and Optimization
Inside WeaponControl_Base_CloseCombat, AttackTransformDataSet control HitDetection on each Limb, and they are called every frame. If some part are not needed, they should be commented out. For example, you might need only a simple Action game where something in front of Unit
simply got hit. In this case, only bodyAttackSet is needed. Editor will show Compiling Error, follow each warning and keep commenting out relevant parts.
Last Updated in 2.5
Editing and Optimization
Turn off Settings in Global Setting will prevent Runtime Execution of unnecesary parts. However, the holding Data will still remain there
Last Updated in 2.5
Editing and Optimization
ATTACKLIMB enum inside EnumCollection should be edited as well
Last Updated in 2.5
**If you choose to do so** make sure that AttackMotion in each MeleeMotion Data got updated as well
Add more motions
Last Updated in 2.5
Inside Animator, add relevant Melee Motion, Transition In from Any State, Transition Out to Move
** TAG MUST BE SET TO “Attack”**
Add more motions
Last Updated in 2.5
Inside Transition In, Can Transition To Self must be turn on Conditions must contain MeleeAttackTrigger and ComboMotionIndex Equals MotionIndex from MeleeMotionData
Aerial Attacks
Last Updated in 2.5
Aerial Attack have specific workflow Use Root Motion should be tick off if the motion is to be control via Action_Falling. If Root Motion is on, Unit will ignore Gravity and use RootMotion only.