New to the forums? Click here to read the "How To" Guide.

Developer? Click here to go to the Developer Forums.

Brainstorming Mechanics for Motion-Control Melee Combat.

CrashFuCrashFu Posts: 1,756 Valuable Player
Melee combat in motion-controlled  (first-person) VR games is a puzzle that has perplexed, if not outright frightened, many VR developers for years now.    In fact, as far as I've seen the two most common solutions to the problem are:

1)  Don't let players hit things in the first place.  Make combat in the game exclusively ranged (for example, Arizona Sunshine)

or 2) Let players hit things, but don't impede them in any way!  The thought being that ANY disconnect between action and result would cause disassociation and ruin immersion,  therefore either  2a)  the player has intangible melee weapons that pass through anything without resistance and damage things they pass through, or 2b)  The player-character is so superhumanly strong that anything they touch is thrown aside (if not destroyed outright) like it was made of paper-mache  (for example, Robo Recall)

In some situations, these can be acceptable, such as Robo Recall where the power-trip of being superhumanly strong is a defining point of the game.  But in other circumstances, these may not be good solutions.  Solution 1 can leave a player feeling helpless and intangible. Solution(s) 2 can be easily exploited, to the point of the melee option being game-breakingly OP.

So what else is there, hypothetically?

One idea is the "Stamina Bar" approach, as discussed by @Zoomie in another thread.  The player has a stamina bar which depletes when swinging their weapon  (IE moving it in an aggressive-enough fashion that the game registers it as an attempt at attacking/parrying/etc.).  Attacks either do 'full damage' as long as you have 'enough' stamina, and greatly reduced damage if you don't, or their damage scales proportionately to the fullness of the stamina bar at the time of attack.  Likewise, attempting to block or parry enemy attacks at low stamina would either have reduced or no affect,  as your exhausted character is unable to resist the force of the blow (effectively) or possibly even to keep their grip (strong) on their weapon.

A possible addition is a "power attack" mechanic, where the player holds their weapon in a certain fashion (or just "off-screen", or still in general) to "charge up", after which their next 'attack' or series of consecutive attacks are stronger, or a successful parry more effective.  This would generally serve as a risk-reward system, as a player could otherwise just be making quick swipes and jabs as often as their stamina bar can fill, and in raising / stilling their hand they are briefly making themself more open to attack, but in return they boost their offensive ability and gain the means to overwhelm a tough enemy's defense.

Different weapons may use stamina more or less per swing, charge-up for power attacks at different rate, and allow different numbers of consecutive attack PER power attack (IE a warhammer can do one mega-swing per charge-up, while charging up a dagger lets you do a flurry of multiple full-force stabs)   Likewise when blocking or parrying attacks, the stamina lost in exchange for nullifying the hit may be based on the mass of your weapon versus the mass or overall force of the blocked attack.


Another possible solution is a sort of.. Action-then-Result system..  (feel free to suggest a catchier term for it)

Essentially, the player's actions are tracked 1:1 but do not (always) serve as the exact motions of the character they are controlling.  Instead, the player's character attempts to match the player's actions 1:1 but is constrained by maximum rates of movement speed, the weight and balance of their equipped weapon, physical resistance from what they hit, the effects of low stamina or status condition, etc.   In ideal situations, the player character will follow the player's movements in effectively real-time,  such as a character with good stats and plenty of stamina, swinging a light weapon through the air or a soft target and not being deflected by anything..  conversely in extreme conditions there may be considerable lag between the player's motions and what their character does,  for example if they are tired and trying to swing an oversized weapon through a large, armored opponent.

RPG-style stat building could actively influence this system. For example, raising a Dexterity or Speed stat might increase the maximum potential speed the player-character can follow your movements (and the accuracy to which ranged weapons follow your hand motions in general), while raising Strength might decrease the effect of a weapon's weight (and the resistance of what you hit)  ON that speed, and allow you to stand your ground better when blocking / parrying strong blows.

In any case, the player's actual movements will always be shown on screen in real-time, through some kind of ghosted image separate from the player-character's body, to prevent total disconnect.  This could even be part of the game's lore.. for example, a fantasy game in which the player represents a ghost or deity that takes control of a mortal champion, willing their body to move yet limited by that body's physical limits.


Please, discuss.  Add to these ideas.  Voice your concerns with how well they would actually work.  Suggest entirely new ideas for us to consider.  Or talk about how specific VR games so far have handled melee combat, if you've seen one that you thought was done well!
It's hard being the voice of reason when you're surrounded by unreasonable people.

Comments

  • KillCardKillCard Posts: 1,078
    Wintermute
    edited June 2017
    I have been experimenting with this myself. In my current project I've gone for what you called here:

    2a) The intangible melee weapon that passes through anything. My solution for the "infinite waggle" exploit that is customary with this method is as follows:

    - The game keeps track of the base of your sword (where your hand is) and records the current position at the current frame.
    - In the next frame it then calculates the distance moved between the current frame and the last frame. This distance value gives a number representing the speed at which the weapon is being swung about.
    - I then use that speed variable to calculate damage which is then categorised as "weak/medium/strong". As long as the speed is within a certain "grade" and "colliding with an enemy" it deals damage accordingly, forcing the player to do large arcing movements to do the most damage and it does 0 damage if the player just tries to "stick his weapon in them and waggle it about". 

    I then have different weapons which have damage ratings as weak/medium/strong. For example, the Claymore sword does damage as 2/5/12 (weak/medium/strong), where as a Dagger would have something like 4/5/7. So the Claymore works better as a heavy hitter where as the Dagger is more dynamic but overall less damage.
  • CrashFuCrashFu Posts: 1,756 Valuable Player
    @KillCard -  Interesting.  Is there something about your system that encourages the player to swing the weapons like, well.. actual weapons, instead of trying to "cheat the game" by finding say, a repeatable pattern that maximizes the damage output while avoiding whatever criteria make an attack register as "weak"?   Like, instead of a panicked waggle, what if someone swung their hand in a circle?

    Also, does the damage output fall-off the more consecutive frames the weapon spends inside the target to encourage the player to draw back between attacks instead of just trying to trace the longest line through enemy bodies they can?

    Or perhaps, damage fall-off the longer the weapon spends within ANY "solid" objects in a short period of time, so that cleaving through multiple targets, attacking TOO rapidly without pause, or attack arcs that go through walls or other obstructions (including the enemies' own weapons and shields) before hitting the target would all give diminishing returns on damage output?
    It's hard being the voice of reason when you're surrounded by unreasonable people.
  • KillCardKillCard Posts: 1,078
    Wintermute
    The thing that "seems" to make it work is having the distance variable calculated by the base of the hand rather than the tip of the weapon (which is what it was at first). Basically if you were to just wave it around in a small circle, your actual physical hand doesnt really move all that much and I just adjust the threshold so that it is not enough to register as an attack (let alone a weak one). The strongest attacks appear to come from long sweeping attacks .. that appears to work so far unless theres a way to exploit it that I havent found yet.

    However there is still a way to play that feels "kind of dumb" .. where you can do wide swings left/right/left/right like a Musical Composer. I dont think thats really an issue though, you're still more or less swinging the sword around.
  • KillCardKillCard Posts: 1,078
    Wintermute
    Currently the Damage output is only applied while in motion, and every time contact is made there is a delay before contact can be made again. Essentially, to leave the weapon "inside" the enemy you need to keep it still or at least slow it down a considerable amount, which will turn off the damage collider.
  • KillCardKillCard Posts: 1,078
    Wintermute
    The one major downside I've seen is that I have in some cases been able to swing faster than the tracking can keep up which can nullify your attack. This could just be a performance issue though that I still need to sort out.
  • KillCardKillCard Posts: 1,078
    Wintermute


    Here, I put together a short video showing my latest little project. Still very janky at this point, theres lots of things that need to be tweaked/fixed.
  • ZoomieZoomie Posts: 1,777 Valuable Player
    edited June 2017
    Note to self, play KillCard's melee game.  Grab strap attached to Touch and swing the controller in a circle.  Buzzsaw attack confirmed!


    Any sufficiently advanced technology is indistinguishable from magic.
    - Arthur C Clarke
  • KillCardKillCard Posts: 1,078
    Wintermute
    Zoomie said:
    Note to self, play KillCard's melee game.  Grab strap attached to Touch and swing the controller in a circle.  Buzzsaw attack confirmed!


    Legit high lvl strat.

    Working as intended.

    xD
  • KillCardKillCard Posts: 1,078
    Wintermute
    edited June 2017
    Just tested it .. yea its pretty busted lol.

    It makes me like your stamina idea as a fix. In fact it could fit well into what I already have: strong attacks drain more stamina than medium/weak attacks etc.

    Then its simply a matter of giving feedback to the player of both the stamina bar and how to convey that "you're exhausted and your attacks will do no damage".
  • CrashFuCrashFu Posts: 1,756 Valuable Player
    Dang, @KillCard , you appear to be making the game I've been waiting years for someone to make :love:   How ambitious are your plans for this game?

    Also, a Question:  It seems like forward-thrusting motions would inherently have less velocity than swings or chops, and therefore would usually register as weak attacks?  Have you figured out a way to balance that for weapons that should be thrusting as much or more than they are swung, like spears, daggers, and certain kinds of sword?

    Would your combat system be able to compare the orientation of the motion control to its direction of movement, and use different damage values if it detects a thrusting motion?  IE if you tried to impale someone with a warhammer it would use far lower values than its swing-damage values, but a spear or dagger would do higher damage with thrusts..

    Or maybe you could even use a different set of rules together for thrusting attacks? When stabbing or impaling a target, the velocity on impact isn't quite as important as just how far you get it in..  giving someone a quick surface-jab with the tip of a sword would hurt, but really committing to the attack and plunging it deep into their chest should hurt a whoooole lot more, right?
    It's hard being the voice of reason when you're surrounded by unreasonable people.
  • ZoomieZoomie Posts: 1,777 Valuable Player
    edited June 2017
    Here are a few suggestions off the top of my head Crash and KillCard:

    1.  Have the weapon slowly glow as it gains energy.  If it's not glowing when you swing, it's not going to do much damage.  Yes, this requires the player to look at the weapon, but after a while you would instinctively know the timing without looking.

    2.  Use a sound like a chime to signal when the weapon is "reset" and ready to swing again.  The players will hear it a LOT so make sure it's a clear short sound that won't drive people insane after hearing it 1000 times.  It should also be audible over the grunts and clangs of combat which is why I suggest something like a chime.

    3.  Animate the arms so that the character momentarily drops their guard when you run out of stamina.  This carries the drawback that the weapon and arms don't track 1:1 with the player's own hands.  The advantage is that it stays true to the immersion aspect without introducing glowing weapons or chime sounds that may break immersion even more.  Imagine a heavy hammer swing.  You swing, the arms momentarily drop, then after 2 seconds your character grunts, hoists the hammer, and is ready to attack again.
    Any sufficiently advanced technology is indistinguishable from magic.
    - Arthur C Clarke
  • kzintzikzintzi Posts: 1,068
    Wintermute
    you could have a mechanic whereby the player sees their own movements ghosted as opposed to the Actor's movements and then give the player damage bonuses for matching the actors swing/position... then you can have a fighter style character that is rewarded for matching as closely as possible the actors movements, provide different super moves to use and other such things. it'd mean you'd need to come up with a bunch of actually-possible-to-do special moves for the player to learn but it'd encourage matching the actor.
    Though you are more than slightly incoherent, I agree with you Madam,
    a plum is a terrible thing to do to a nostril.
  • KillCardKillCard Posts: 1,078
    Wintermute
    edited June 2017
    CrashFu said:
    Dang, @KillCard , you appear to be making the game I've been waiting years for someone to make :love:   How ambitious are your plans for this game?

    Right now, as all my projects .. it's just a spare time project. If it turns into anything cool I will take it from there.

    Gameplay wise I have a few ideas but step 1 is just getting that core game loop of: explore random dungeons, kill bad guys, get loot - slot machine style.

    Other things I would like to eventually try is having NPC's (at least a vendor to buy/sell stuff to) and randomly generated events such as maybe finding items that generate quests or encountering NPC allies who will fight by your side. That stuff is all up in the air and not likely to happen any time soon or at all though.

    I was also thinking about skill/magic systems. I had an idea I want to try that involved:

    To use the skill you have to perform a pose of some kind, then it would be active. Say for example a paladin might hold his sword up to his face as if making a prayer and it would activate an Aura skill which might last a certain amount of time. Or a Warrior could form a stance/pose with the weapon held back ready to strike and that will cause the next attack to do more damage + some kind of special visual effect.

    I'm hoping that would be a fun way of making the player do silly immersive stances that make you feel like a hero in VR but look like an idiot IRL.

    Just an idea at this point though ... like I said before, core game loop first.

    Basically
    Also, a Question:  It seems like forward-thrusting motions would inherently have less velocity than swings or chops, and therefore would usually register as weak attacks?  Have you figured out a way to balance that for weapons that should be thrusting as much or more than they are swung, like spears, daggers, and certain kinds of sword?

    Yes, and this was an issue I intended to come back to.
    Would your combat system be able to compare the orientation of the motion control to its direction of movement, and use different damage values if it detects a thrusting motion?  IE if you tried to impale someone with a warhammer it would use far lower values than its swing-damage values, but a spear or dagger would do higher damage with thrusts..

    And yes this is the idea I had for solving it, but I had yet to try it out because I also wanted to get inventory system/loot working first.

    My only problem with it is deciding how complicated I should make it. Like you said, do certain weapons stab better than they slash?

    Do I end up having the item read:
    Slash damage: 3/6/12
    Stab damage: 6/8/15 
    ?

    Is that too cumbersome for the player to understand? .. do I have it work that way but have the information hidden? .. maybe the displayed damage is just an average of both?

    Or do I work towards just making the relative stabbing speed match the relative slashing speed. What if it causes issues with stacking the damage together? Adding the slash damage and the stab damage?

    These are all tricky issues I need to keep in mind when I try to tackle it.
    Or maybe you could even use a different set of rules together for thrusting attacks? When stabbing or impaling a target, the velocity on impact isn't quite as important as just how far you get it in..  giving someone a quick surface-jab with the tip of a sword would hurt, but really committing to the attack and plunging it deep into their chest should hurt a whoooole lot more, right?
    Yea, it might be possible to have an algorithm that picks up whether you have "slashed" or "stabbed" more and decide between the two. If I can, then I can make it detect damage based on different circumstances as you say. Something else I'm going to have to look at.
  • KillCardKillCard Posts: 1,078
    Wintermute
    Zoomie said:
    Here are a few suggestions off the top of my head Crash and KillCard:

    1.  Have the weapon slowly glow as it gains energy.  If it's not glowing when you swing, it's not going to do much damage.  Yes, this requires the player to look at the weapon, but after a while you would instinctively know the timing without looking.

    2.  Use a sound like a chime to signal when the weapon is "reset" and ready to swing again.  The players will hear it a LOT so make sure it's a clear short sound that won't drive people insane after hearing it 1000 times.  It should also be audible over the grunts and clangs of combat which is why I suggest something like a chime.

    3.  Animate the arms so that the character momentarily drops their guard when you run out of stamina.  This carries the drawback that the weapon and arms don't track 1:1 with the player's own hands.  The advantage is that it stays true to the immersion aspect without introducing glowing weapons or chime sounds that may break immersion even more.  Imagine a heavy hammer swing.  You swing, the arms momentarily drop, then after 2 seconds your character grunts, hoists the hammer, and is ready to attack again.
    1. This is similar to something I was going to try, basically I was thinking of adding a "wind swoosh" effect as you swing, except it would be color coded based on whether or not the attack is weak/medium/strong. Obviously the "text" on the screen in my vid is not something that is going to be there eventually and I wanted an easy way to convey that to the player. The thing is, I also wanted to be able to have weapons with magical effects/properties .. so you could hold a flaming sword for example. The problem is, those effects might make those "state" effects harder to see.

    2. This actually could be very good, I'm thinking something more like the beat of drums you hear in Skyrim when one of your skills levels up. A "ba-dum" sort of sound maybe?

    3. Yep, I thought of the same thing after thinking about your Stamina idea. When you're exhausted make the hands go "limp" a little bit and maybe make it lag as you move. I also think adding a grey-out effect to the visuals might help. Also the sounds of heavy breathing from the player character to indicate exhaustion.
  • CrashFuCrashFu Posts: 1,756 Valuable Player
    In response to @Zoomie 's  list (and KillCard's replies)..


    1.     Why not both?  For example, non-elemental weapons would just have the air-swooshes.  A fire weapon, on the other hand?  Light attacks could produce smaller flames, but when you do a strong attack with it, the flames flare up larger!   (and if in the future you differentiate stabbing attacks,  instead of a particle trail in the swing arc, the effect could originate from the stab-sight, like flames roaring from out of the 'wound' )

    2.     Just be verrrrry careful with audio cues... it's easy to cross that line and annoy the player.

    3.     Yeah, I think there are some good ways to do that.  Unless you're some kind of superhuman or god, fatigue IS a thing,  and fatigue can make it hard to hold a weapon upright  or to hold it steady.   A subtle, involuntarily arm-shakiness or having the weapon twist in your hand and 'bounce' off the target instead of going through rigidly would be great indicators. As is heavy breathing, hard to misunderstand that!

    Side note for KillCard:   That idea about pose-activated skills sounds great.  Have you, by any chance, played either of the D&D Arcade Beat-em-Ups?   I'm having flashbacks to the Cleric's sentai-poses when you use Turn Dead, haha.
    It's hard being the voice of reason when you're surrounded by unreasonable people.
  • KillCardKillCard Posts: 1,078
    Wintermute
    CrashFu said:
    In response to @Zoomie 's  list (and KillCard's replies)..

    Side note for KillCard:   That idea about pose-activated skills sounds great.  Have you, by any chance, played either of the D&D Arcade Beat-em-Ups?   I'm having flashbacks to the Cleric's sentai-poses when you use Turn Dead, haha.
    I have, but not in a long time. When I come to actually try and implement this feature I will go back and take another look for inspiration for all sorts of poses you can make. The key thing to try to remember is that its mostly going to have to do with how the hands are positioned in relation to the head (thats all we can really track obviously). I think there may be a lot of poses that while being different visually actually wind up being functionally the same in that regard.
Sign In or Register to comment.