• Advertisement
Sign in to follow this  

When the Player and the CPU attacks at the same time

This topic is 755 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been thinking about how my players should interact with the enemies. One problem I saw was when the player and the CPU attacked at the same time allowing their attacks to meet each other. Does anyone  have any suggestions?

Share this post


Link to post
Share on other sites
Advertisement

All of the enemies aren't the same size as the character. Also that is the functionality of blocking. would it be redudant to block by blocking and block by attacking too?

Share this post


Link to post
Share on other sites

The good old 'sword lock'?  I think Soul Calibur or Bushido Blade had it (or maybe both), you also see it in many a Star Wars movie.  In the games, you usually had to mash buttons to try to win the contest, and doing so knocked the opponent back and/or stunned them.

Share this post


Link to post
Share on other sites

An action test seems alright but I know my inner demon would make grouped enemies act opportunistically. Hmmm this could lead to more strategic play thought. Anything else?

Share this post


Link to post
Share on other sites

The good old 'sword lock'?  I think Soul Calibur or Bushido Blade had it (or maybe both), you also see it in many a Star Wars movie.  In the games, you usually had to mash buttons to try to win the contest, and doing so knocked the opponent back and/or stunned them.

That one is nice for popcorn theater (and for that reason, possibly for games, too... since it's what people expect). But it's sooooooooooooooooooooooo much wrong, flawed, screwed up.

 

See for example: 

 

Note how although the blade is "sticky" much in the same way as your hands are in e.g. wing chun, it never locks and instead adapts to the direction of pressure, keeping the edge outside your face. The reason is that obviously as soon as the other blade is free to move anywhere, it's free to injure your body, On the other hand, if the blades lock, the physically stronger fighter inevitably wins.

 

So, instead of mashing buttons, you should need to press the correct button quickly at the correct time.

 

Anyhow, for equal-size equal-strength opponents, it might be mighty fine to do whatever you like because the audience probably doesn't care if it's reasonable. On the other hand, if there are enemies that are much larger in size than the player, it's kind of silly (Tom&Jerry style) if the player can actually fence with them, no matter how you do it. In such a case, the much larger opponent not only has a strength an order of magnitude higher, but also has much larger range. Which means he can hit the player long before the player could hit him anyway.

Share this post


Link to post
Share on other sites

 

the player always being the winner.


...in easy/casual mode. Or in hardcore mode, the enemy is always the winner smile.png

 

 

Or have it based upon certain weapons / characters / etc.  Can't riposte Boss B, but you can Boss A.  Or you can if you're using a rapier, but not if you're using a claymore, or what have you.  

 

Personally, I still lean towards the lock, realism be damned, because it's the most 'fair' to both parties, easily understandable what happened, and can add an extra frenzied moment of gameplay as the player has to either mash buttons or do some sort of QTE, etc.

Share this post


Link to post
Share on other sites

Or have it based upon certain [...] characters [...].  Can't riposte Boss B, but you can Boss A.

 
A good way to to confuse and annoy your players is to establish a mechanic and communicate the rules to the player via gameplay, and then ignoring your own rules with future enemies.

Share this post


Link to post
Share on other sites

Did a bit of research on martial arts to find scenarios that match my problem. I found nothing but I do have an idea. I going to have 4 states the character can be in after meeting an enemy's attack. Stumble , Wobble, Blasted, and Destroyed. If the character stumble he can parry, dodge, attack again, or block. Wobbling make the character lose the ability to block. Blasted knocks the character back and the player can only dodge or block. Destroyed does half damage, and little knock back  and randomly allow the character to parry or block.

Share this post


Link to post
Share on other sites

In actual combat it is perfectly possible to have both sides attack and hurt/kill each other. 

 

Depending on the nature of your game, I would say this is acceptable, and even a good mechanic to discourage random button mashing and force the user into more careful thoughts about what they're doing.

 

Another aspect that ties into this is that just because you've stabbed your opponent isn't always an indicator that they're not going to just stab you right back. Being able to deliver a killing blow without taking one in return is kind of an important factor in real fights.

Share this post


Link to post
Share on other sites


Destroyed does half damage, and little knock back  and randomly allow the character to parry or block.

 

I have a very different definition of Destroyed.

Share this post


Link to post
Share on other sites

In actual combat it is perfectly possible to have both sides attack and hurt/kill each other. 

 

Depending on the nature of your game, I would say this is acceptable, and even a good mechanic to discourage random button mashing and force the user into more careful thoughts about what they're doing.

 

Another aspect that ties into this is that just because you've stabbed your opponent isn't always an indicator that they're not going to just stab you right back. Being able to deliver a killing blow without taking one in return is kind of an important factor in real fights.

 

I was just about to mention this, actually.

 

The most obvious, and most common, way to deal with the situation in games is that nothing special happens when two attacks collide, they just hit or miss as normal.

 

Attacks interacting with one another is actually fairly uncommon, and when it does occur, it's more often only in specific scenarios (e.g. weapon attacks in Samurai Shodown can clash with one another - triggering a minigame where the loser is temporarily disarmed - but only if certain requirements are met) rather than a general occurrence.

Share this post


Link to post
Share on other sites

 


Destroyed does half damage, and little knock back  and randomly allow the character to parry or block.

 

I have a very different definition of Destroyed.

 

 

I'm a generous man.

Share this post


Link to post
Share on other sites

Are you sure it's an issue? Unless it's a turn based game it's almost impossible for two things to happens at exactly same time (especially if you have a low timescale, below a second). Anyway, in the rare situation when it happens I would prioritise the player (psyhological, if you both hit at the same time and the enemy deals damage the player sees it as a bug and complains, but if the hit is scored by  the player he/she thinks "I barely managed it but I was slightly faster").

Share this post


Link to post
Share on other sites

Are you sure it's an issue? Unless it's a turn based game it's almost impossible for two things to happens at exactly same time (especially if you have a low timescale, below a second). Anyway, in the rare situation when it happens I would prioritise the player (psyhological, if you both hit at the same time and the enemy deals damage the player sees it as a bug and complains, but if the hit is scored by  the player he/she thinks "I barely managed it but I was slightly faster").

 

Its more frame based than time based, 16 ms overlap is rare, but not impossible.  Though because of that rarity, I'd probably just do whatever takes the least amount of work, unless the OP really wants to turn it into a feature, and then I'd probably suggest opening the number of frames that would cause the feature to happen.   (For example:  Swordlock would occur if there is ever an overlap during any part of the attack animations of either pair, instead of just the brief frame that the attack animation checks for hitting the opponent's collider.

Edited by ferrous

Share this post


Link to post
Share on other sites

All of the enemies aren't the same size as the character. Also that is the functionality of blocking. would it be redudant to block by blocking and block by attacking too?


Since enemies vary in size, adjust knock back accordingly. Bigger enemies push the player back further than themselves, and in some cases, do not get pushed back by the player.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement