Mooses2k / SecretHistories

First-person stealth/combat roguelite
Other
15 stars 12 forks source link

Melee with directional parrying #13

Open Mooses2k opened 3 years ago

Mooses2k commented 3 years ago

Some background

Best quick video on the cuts: https://www.youtube.com/watch?v=CPHQR8sZ9Gs

Guards: https://www.youtube.com/watch?v=rbTWAsxCGtY and https://www.youtube.com/watch?v=ByztoH2ML58 and https://www.youtube.com/watch?v=SXt-b2ji8v0

Other in-depth reference:

BASIC IDEA

LMB (tap) - cut LMB (hold) - thrust Mouse4 (hold) or maybe RMB (hold) - alternate guard/hold such as hanging guard with sabre or reverse grip with dagger

Which guard you're in changes by looking right, left, or up in relation to center of opponent (height of the shoulder, according to Hutton)

WEAPONS

COMPLEX HILT SINGLED HANDED SWORDS LIKE THE SABRE OR RAPIER

Guards, moving to guards should be automatic if facing the opponent. If multiple opponents, opponent nearest to the player.

Guards:

Guards while holding Mouse4 (or maybe RMB):

Cuts (from where player is looking relative to opponent's heart):

Thrusts (from where player is looking relative to opponent's heart):

ONE OR TWO-HANDED SIMPLE HILT SWORDS

Guards:

Strikes:

Mouse4 (hold) or maybe RMB (hold) - half-sword; thrust from there is half-sword thrust, cut from there move right-hand to become left-handed mordhau, performs mordhau, and stays in mordhau hold until Mouse4 released?

ONE-HANDED, SIMPLE-HILT WEAPONS (HATCHET, MACE)

TWO-HANDED AXES, SLEDGES

POLEARMS, STAVES, SPEAR

Grip should probably be thumbs-in, left-hand fore (weapon held on the right side of body). This makes it easiest to transition to overhead hold by swapping grip on right hand as raising weapon with left. This is much less natural for chops from upper-right though.

Guards:

Mouse4 (hold) or maybe RMB (hold) - change to overhead hold (like a hoplite)

Usual six cuts and a thrust

References: https://www.tota.world/article/2929/ https://www.youtube.com/watch?v=0_hEX6PRgW4&t=42s

GREATSWORD (MONTANTE)

https://www.youtube.com/watch?v=vxHaNRO705k&themeRefresh=1

CONSIDERATIONS AND TECHNICAL NOTES

how to deal with cutting low while in a high guard, have a little delay before changing guards? that could be annoying because you may need to get into guards quickly?

Should each cut or thrust be accompanied by a step or does that have to be controlled directly? Probably should be done manually, no automatic stepping

Definitely stepping gets limited once in a strike

Nielstoop: hmm yeah tweening(blending) between each guard pos I think will be enough for a simple version and I think we can do a quick lerp from the guard pos to the start pos for the attacks.

Mooses2k — Today at 2:14 PM The main cuts (1, 2, 3, 4) are all performed from mostly the same position too, arm outstretched center, wrist rotating, with elbow when necessary.

crazyStewie — Today at 2:46 PM I think one important thing to determine is if we are going to animate the hands, and forward kinematics the weapon, or animate the weapon, and inverse kinematics the hand. If we are doing pre-made animations, animating the hands is easier and more efficient but animating the weapon directly makes it easier to control the attack when doing procedural animations. You can have the tip of the weapon target specific positions or do specific movements, and propagate that to control the rest of the body. we could also do both, traditional animation for the NPCs, so they don't look too robotic, and procedural animation for the player, so the sword is more responsive, since you can't see most of the arms anyway.

well, the easiest way is to probably not have procedural animations at the moment, and the simplest way to hand animate it is probably to add some constraints so the hands stay on the handle and animate the weapon movement you want in blender but if you can mocap, that works as well

Mooses2k — Today at 2:55 PM I've already got mocap of all guards, all cuts, all thrusts, and some of the transitions between those So I guess that's how we'll start. Any ideas on the system of aiming directions of enemy center?

crazyStewie — Today at 3:02 PM Not sure you need a raycast for that. just gotta now where the center is, and you can define that on each enemies scene. even moving with the animations. and you can use a spherical area to determine which enemies are in range, detecting only those points. and then select the enemy closer to the tip of the sword and do some math to determine the orientation relative to that. Well, some dot products with the y and x vectors of the camera basis, or just the position relative to the camera using an inverse transform

https://docs.godotengine.org/en/3.5/classes/class_camera.html?#class-camera-method-get-camera-transform

https://docs.godotengine.org/en/3.5/classes/class_transform.html#class-transform-method-affine-inverse

Melee thrusts against you, down centerline need you to choose a side to sidestep and turn the opposite way to parry If enemy sidesteps, keep parry on current side until mouse moved significantly? yes

notes from Stewie on how to make: get sign for coordinates to see which quadrant player is pointing at camera and a position3d get global on position3d, then to-local angle instead of movement to determine when to move length_squared is faster for testing rough length

Additionally, hold Mouse4 holds sabre in hanging guard or simply point-down guards (so including half-circle?)?

Have some amount of tracking on attacks, but realistically delayed and more difficult to redirect, so not much

Stepping to the proper side when parrying a thrust improves chances - step opposite the direction your sword moves.

It will be important to slight adjust camera or animations or both to ensure player character's weapons are visible on screen in each of their guards. Ones that might be tough:

need crosshair for targeted thrusting?

Hanging guard maybe should reduce stamina regen but be structurally sounder, able to receive heavier blows.

BStyle: "The ik side of weapon clashing might be slightly easier, you just need to blend the physics with the actual animation frames, which is already done easily for other things"

Also, for multiple opponents: What ifyou want to defend to the left but the second enemy comes forward and you accidentally block the right. So, maybe it needs to be aware of which an attack is actually being made against the player as well, and not change to another target during that?

FOOTWORK

simply pressing forward (no LShift) should lunge. Continuing to hold forward will recover forward, letting go or hitting back with recover back.

Backwards during an attack is a fade or 'slipping the leg'

TASK LIST

Here's the rough task list that I came up with:

Much later adds

Styles

Mooses2k commented 2 years ago

make very basics, but not working right - can't detect current animation. Haven't pushed yet.

Mooses2k commented 2 years ago

made a cavalry sabre item, equppable, animation is right, its hurtbox detects enemy hitboxes, but doesn't kill em

Mooses2k commented 2 years ago

issue is that func attack only checks if hurtbox is in hitbox when attack is first called. Needs to be continuous.

Mooses2k commented 2 years ago

Guns still broken.

Added quarte, slash from quarte, and thrust from both, with recoveries.

Mooses2k commented 2 years ago

Added AnimationTrees for thrust, cut, guard and aligned them to basic animations I made. Alek will implement stuff tomorrow.

Mooses2k commented 1 year ago

Setup a system for selecting different movesets from an enum. Have sabre and pitchfork working as examples.

Also have thrust and cut done for sabre

added stamina drain for melee

Mooses2k commented 1 year ago

DEMO VERSION Simple version melee for the demo.

Animations, imagining a mace or hatchet: 1) Idle loop held at normal equipment hold point (roughly 90* elbow bend) 2) Raise over right shoulder and chop to center as if hitting a basketball right in front of you 3) Recover from there to animation 1 4) Rotate wrist down and thrust weapon towards center of enemy in front of you 5) Recover to animation 1

These could be the generic melee animations for demo, I think

Mooses2k commented 10 months ago

All that's left for demo is offhand

Mooses2k commented 10 months ago

Other issues: