Melee combat
Last updated
Last updated
Different melee weapons have a different range and arc of reachable targets. A spear can reach far, but with a very narrow angle. A hammer has low range but with a wider arc of reachable target.
Below is a picture of a stun baton and a bat, and their respective arc and range.
Aiming in SS3D implies two things :
Selecting a target entity.
Selecting a body part on this entity.
Attacking a player happens when left clicking, therefore, click position matters to determine which entity to target.
First, an entity must be reachable to be targeted, meaning it must be in the area determined by Range and arc of the melee weapon.
This one is simple, if the target is reachable and the click is on the entity, the entity is selected.
If the click occurs outside of arc and range of the weapon, the selected entity will be one that :
Is reachable.
Is the closest from the player.
If the click occurs inside arc and range, even with a reachable entity, the target will be whatever was clicked on. This allow to smash an item (or just the ground) in close proximity of another player.
Out of combat mode, selecting a target relies solely on the interaction system, it therefore implies clicking on the target, and some checks are done to verify if the hitting interaction can occur.
Here's a drawing to sum it up : (This one assumes direction of aim is following player's rotation, look at the aiming's direction part for more details on this particular point)
The consensus is that it's simpler for now to simply use the targeting doll to select the body part one's want to hit.
The targeting doll allows one in the UI to select any given body part on a humanoid character. In case where one of those body part would be missing, the next closest body part would be selected (missing right hand and right hand selected -> hit right arm).
In combat mode, the direction of hitting should follow the mouse, it's independent from character's body rotation (note that in this mode the character is strafing).
Timing refers here to the time it takes between choosing a hit interaction, and landing the hit.
A simple solution could be first to reduce this time to zero. However, we might note that it'd be hard to make sense of animations if a player takes a hit before the swinging animation of the weapon even started. This is a point to consider, ongoing discussion.
In combat mode, strafing will be the main way of moving around, with the player's torso direction following the mouse cursor.