Opportunity based melee attack system

Our current melee system is pretty simple: when you attack, you attack with currently wielded weapon. Then you get bonus attacks due to mutations (if you have them).

How about this:

[ul][li]When attacking, game enumerates all possible attacks[/li]
[li]Some of them are pretty weak most of the time: headbutts, elbow strikes, pistol whips[/li]
[li]The attacks get some random permutation to accuracy/expected damage every time[/li]
[li]The effectiveness of attacks is evaluated based on enemy (for example, armor is subtracted from damage)[/li]
[li]Attacks are weighted somehow: usually just by DPS, but sometimes by being finishing strikes (dropping monster to 0 hp or less) or special effects[/li]
[li]Best one is picked and executed[/li][/ul]

The advantages are:

[ul][li]Natural execution of ideas like kicks, weird martial art tricks and so on[/li]
[li]Sensible dual wielding: not double damage at extra move cost or anything, just more opportunities for attacks[/li]
[li]When wielding an unwieldy item (tank full of water), you no longer become very vulnerable - you can now kick and maybe even bite[/li]
[li]Mutations don’t need to grant extra attacks, just modify existing ones (beak is just mutant bite, horn headbutt is just mutant headbutt, claw strike is just human scratch turned not-useless)[/li]
[li]Naturally extends to multiple attacks per weapon, such as haft strikes and halberd chop/thrust/hook[/li]
[li]One-handed weapons have the advantage of keeping a hand free for off-hand strikes[/li][/ul]

Disadvantages are:

[ul][li]Complexity in implementation[/li]
[li]Complexity in understanding without a good UI showing all the chances[/li][/ul]

DF has something relatively similar.

Worth the effort?
Of course this is a post-0.D idea, there is no way it is going to be in this stable.

How about martial arts shifting the focus? Some will give priority to damage-per-hit while other prioritise fast attacks or dodge/block.

I’d prefer the AI attack selecting part not to be tied too much to in-game mechanics.
If martial arts become a problem, I’d rather add a menu to allow disabling certain attacks.

I think it’s a great idea, it improves melee combat in several ways:

[ul][li]More varied combat descriptions.[/li]
[li]If done well, will apply flavors to combat, in that you would tend to use different sets of attacks against different enemies.[/li]
[li]More variance in how combat plays out since different attacks might inflict wounds or conditions in addition to straight damage. For example if you end up immobilizing a target, you might move away from them and then mop them up later. Even short of that, breaking the predictability of “X strikes to kill a zombie” would be worthwhile.[/li]
[li]If we come up with actual logic behind when enemies are vulnerable to different attacks, we can just add it without changing player behavior or the UI[/li][/ul]

Side note, I’m strongly against anything resembling df’s UI for combat. The underlying system is ok, but the micromanagement of combat is horrific. This system seems like it’s grabbing just the good parts, so this is intended more for commenters than Coolthulu.

Some extensions, not necessary for a v1:
As opposed to any kind of player or martial art black/white -listing, I’d prefer to see attacks (defined in json of course) with one or more attributes stating the “goal” of the attack, such as “damage”, “crippling”, “defense”, “avoidance”, “delaying”, “stunning”. The player would choose a goal for their attacks, basically switching “modes”, and that would bias which attacks get selected. Examples of how that might play out at the end.
In addition to or instead of random variation every turn, the attacks might have various cooldowns so they’re not usable indefinitely. This would be nice because it could lend a cadence to combat, you might hit an enemy with a number of good attacks, but at some point all your good ones are in the process of cooling down, so you might want to go on the defensive for a turn or two to let them reset.
Attacks could change the state of the player after use, for example some concept of how the weapon is being held, the facing of the player relative to the enemy, the degree to which the player has their weapon, arms, or legs ready to block. This could be leveraged to trigger either combos, where attacks set the player up to perform a specific next attack, or failures could be combo breakers, changing the player to a state where they don’t have good attacks available. This sort of thing could also provide cadence to combat, since eventually these changes are going to get you into a state where attacking isn’t necessarily the best option. You might want to go on the defensive, or maybe even retreat for a bit (your stamina is getting burned at the same time too).
Attacks could inflict minor and temporary conditions on enemies that can be capitalized on, for example a hard hit could inflict an off-balance condition, and a follow up attack could cause a knockdown. This is the most complex option, requiring a large number of attacks to be augmented with this kind of thing for the system to work.
A related idea is replacing mandatory counterattacks (which suck in several ways) with inflicting a “counter-attackable” condition, if the player attacks a monster with this kind of condition, it triggers a counterattack, which will generally be beneficial in some way, either by being faster, or hitting harder, or inflicting another condition.

Some examples of how attack modes might play out:
If you’re in a fighting retreat vs an overwhelming number of zombies, you might set your goal to “delay”, and when a zombie catches up to you, you might trip, or push, or hip-throw, or mule kick, etc in order to temporally disable opponents, giving you time to escape.
If on the other hand you were cornered, you might switch to “crippling”, and you’d kick ankles, break arms, snap necks, cut tendons, etc in order to cripple the opponents near you, forming a wall between you and the rest of the horde (they might push past each other to get at you, so this wouldn’t be foolproof).
Another crippling mode scenario would be if there are just a few too many zombies to deal with at once, you might try and cripple a few before the main group arrived to even the odds a bit, then switch to damage to finish them off.
A very simple alternating pattern would be offence vs defence, defensive attacks would tend to do less damage, but allow your stamina to recover, so you can either alternate between the two, or if you’re hurt it might be worthwhile to just stick with defense. On the other hand if something lands an attack that causes bleeding, you might not be able to stay on defense, requiring you to either finish off some opponents or run away.

I think offence/defense toggle is good enough, and let AI handle the rest. And monster melee AI should be as good as player AI.

I see multiple reasons against blacklisting, but I’d still want it in.
Blacklisting would avoid situations where the player has no option to subdue someone “weird” (not handled by AI well), no option to disable weapon attacks with a fragile weapon or costly attack type (say, electric zap).
The presets you listed do sound like a good idea, but I’d prefer to allow player to at least disable specific attacks out of those. Disabling would not offer objective advantages (opportunity for attack is simply missed, nothing replaces it), but sometimes the player has a good idea that the devs simply can’t account for properly due to sheer mass of probabilities.

In addition to or instead of random variation every turn, the attacks might have various cooldowns so they're not usable indefinitely.

Pretty interesting idea, but I’m a bit worried about AI misusing those, requiring player micromanagement. How about per-target cooldowns rather than attacker cooldowns?

A related idea is replacing mandatory counterattacks (which suck in several ways) with inflicting a "counter-attackable" condition, if the player attacks a monster with this kind of condition, it triggers a counterattack, which will generally be beneficial in some way, either by being faster, or hitting harder, or inflicting another condition.

I think this could be done even now, though hackily: by having a counter-attacks that only inflicts a status.

The “cooldown” concept drives me crazy - yes, I could use a palm-nose strike on that guy, but I used on the previous guy, so I can’t just this minute, I’ll have to just punch him instead. Oh, now I can use it, yay!

Either there’s some kind of condition that has to be dealt with (a status on yourself) or inflicted (a status on them), or you have to have the energy to do it (stamina). Those two things are quite sufficient, I think. Want to have some kind of “cool down” from doing SuperAwesomePunchInFace attack? Make it take a lot of stamina, require the enemy to have some kind of “vulnerable” status (“off balance” for instance), or require a status of the player (“chi-focused” or something - takes an action to get it ready), or give the player a status afterwards that prevents it (“chi-drained” or such). Don’t have very many of these statuses, mind you, but have them overlap - if I can’t SuperAwesomePunchInFace because I’m too tired from doing it a moment ago, there’s no reason I should be able to SuperAwesomeKickInFace instead, since I’d be too tired to do that one, as well.

On top of just not liking the cooldown idea on the whole, I’d point out that we already have statuses and stamina - I don’t think we should add another thing like cooldowns into the mix.

The idea of “offense/defense” sounds GREAT, though - when I’m dealing with a horde, and I’m out of stamina, my DPS drops by half, and that’s really all there is to it (both good and bad). If I want to try to get my stamina back up (say, to run away), there’s really nothing useful for me to do but stand there and take hits.

Some kind of “just keep them back while I catch my breath” sort of thing would be great - I’m not using my full strength trying to put them down, I’m just batting their clawing hands away, or tripping them to delay them a few moments. Stamina restores at normal rate, but there’s no attack eating it back up (or some kind of significantly lesser usage).

I think I’d like to see that system be be somewhat skill-gated, which might address some of the anti-cooldown issues that deoxy raised as well - If I’m melee 0 / unarmed 1, even if I choose a focus there could still be ‘suboptimal’ techniques added to the list of things to try, and so I won’t SuperAwesomePunchInFace every turn. As I acquired martial arts and became more skilled, the selection of techniques available would grow and the biasing would grow stronger[1] so that when someone is melee 10 / unarmed 10 and they choose “damage”, they might be able to SuperAwesomePunchInFace almost every turn, which I think would be a nice way to demonstrate skill progression beyond the current “do more damage”. It might also mean that lower-skilled characters could flail away with whatever setting because it didn’t do much, but a skilled fighter needed to manage their settings more closely - SuperAwesomePunchInFaceing every turn might be great for damage, but drain stamina quickly, and so a skilled fighter wouldn’t just stay on “damage” all the time, but would alternate between damage and defense or avoidance as they needed to, much like an actually-skilled fighter.

[1] Possibly with the option to choose multiple goals, which would just expand the pool of possible techniques while focusing even more on the ones that did both - damage + stunning might heavily prioritize something like Brutal Strike that is slow but high-damage and provides a stun.

I understand where you’re coming from, but IMO a cooldown system sits in between a totally random system like what Coolthulu proposes (and what df does) and a MUCH more detailed system. As far as believability, random and cooldown are similar, both reflect the concept of, “situational factors influence relative value of different attacks” in a very abstract way. Where cooldowns are better is they allow more flavorful attacks to happen periodically but consistently, where random throws any idea of consistency out the window.

I’d prefer this kind of thing too, but it’s about 20x as much work to make it work like this (that’s my actual estimate, not hyperbole), and since I’m not the one stepping up to write it, there’s only so much I can insist on. IMO a cooldown gets us 60-80% of the behavior we want with 5% of the work.
To more directly address your example, you might not be able to execute SuperAwesomePunchInFace over and over again because now your dominant arm is extended, or the enemy is knocked back too far, or you’re off balance after the last one, or a number of other things. The question is, is it worthwhile to track all of those things and implement that level of detail in order to get the specific behavior? I’m honestly not sure.

This idea fundamentally does something to vary which attacks are made. Not adding, “something more than stamina” means rejecting the idea as a whole. IMO randomly tweaking chance of success or damage output every turn is going to be less understandable and predictable than a simple concept like a cooldown.

[quote=“deoxy, post:7, topic:13457”]The idea of “offense/defense” sounds GREAT, though - when I’m dealing with a horde, and I’m out of stamina, my DPS drops by half, and that’s really all there is to it (both good and bad). If I want to try to get my stamina back up (say, to run away), there’s really nothing useful for me to do but stand there and take hits.

Some kind of “just keep them back while I catch my breath” sort of thing would be great - I’m not using my full strength trying to put them down, I’m just batting their clawing hands away, or tripping them to delay them a few moments. Stamina restores at normal rate, but there’s no attack eating it back up (or some kind of significantly lesser usage).[/quote]
Glad you like that part, this concept was preexisting and I just wanted to make sure that it didn’t get lost .

As much as I dislike it for the logical slap in the face, I do have to agree with your point.

When I said, “Don’t have very many of these statuses, mind you, but have them overlap” I really meant it - it shouldn’t be a LOT of work to implement, because there should be very few statuses involved.

To crib from other systems a bit, even a single status goes a LONG way. In 3rd edition D&D, there was the concept of “focused” for monks, where they had to do something to achieve a “focused” state; having that state allowed a few different things, some of which were fairly minor, and some of which were more major but cost you the “focused” state. In 4th edition, there was the generally applicable “combat advantage” state - the classic “backstab” worked when you had combat advantage against the target for any reason, among other such things.

I would suggest at MOST 2 of each kind of state (good and bad), so four states, max. Actually, we already have “stunned” and “down”, both of which have an inherent penalty and suggest some kind of vulnerability, so I’d suggest only one more bad state, one that gives the vulnerability part with no inherent penalties - “off balance” or something. One “good” state would probably be sufficient (like “focused”).

Combat should involve a significant amount of randomness, at least against intelligent opponents… against zombies, maybe less would be OK, as you could pull the same trick as many times as you wanted.

If SuperAwesomePunchInFace becomes a thing around here, I am going to laugh. A lot. For a loooooonnng time.

I may have to make a mod that gives a martial arts style just for that. Gives nothing but defensive stuff and a crit technique for x50 damage and half movement points, available at level 10 unarmed skill. snerk

how about:

if you roll a Hit and roll high on a random die and pass a threshold (e.g. you roll 70 on a d100 and pass a 10 check):
you deal your primary damage and then:
get to roll to hit again on the same turn with a penalty and if you succeed, you do one of your fancy attacks from your fancy attack list. After attacking, roll the d100 and if you pass the harder check now, you get to roll to attack again until you run out of luck or possible attacks. If your attack kills your target and you pass another ‘lucky’ roll you get to roll a ToHit on a nearby hostile enemy?

so you attack a zombie, hit him, ‘pass a luck check’, get to roll another to hit with a different attack from your list of possible attacks, hit with it, roll luck and pass again, repeat.

Every other luck check ought to be more difficult than the last lest you want to be able to combo forever. It could be weighted or modified by some stats/statuses or whatnot. This is more passive than having to choose modes, prompts, going through menus or whatever, which is good for a game with thousands of possible enemies and encounters. Having to manually swap attack modes and styles would get cumbersome and tedious over time.

[quote=“viggolo, post:11, topic:13457”]if you roll a Hit and roll high on a random die and pass a threshold (e.g. you roll 70 on a d100 and pass a 10 check):
you deal your primary damage and then:
get to roll to hit again on the same turn with a penalty and if you succeed, you do one of your fancy attacks from your fancy attack list.[/quote]

This would drop a lot of the advantages of the opportunity system. For example, attacks would no longer be “always good” - you’d want to remove bad attacks from the list just so that they don’t eat up your fancy attack slots. This would mean either manual blacklisting (bad) or having to wear gloves to cover your claws just so that they don’t aux-attack (horrible).

I’d disagree about that estimate: cooldown would get us a lot of behavior, but it would eventually turn into a lot of work if we were to combine it with automatic selection.

Having a simple, mostly stateless, player-driven “attack routine” means that we can give player a combat AI which will almost always pick the best attacks for a given situation. It wouldn’t require micromanagement.
By adding cooldowns to that, we now force the player to micromanage around the AI: we want to use the SuperAwesomePunchInFace against hulk, FlyingGroinKick against survivor zombie, then SissySlap against everything else until our good attacks cool down. But this would impair player’s ability to influence combat: we want the good attacks to proc against strong stuff as soon as possible so that they can cool down, while we also want to use the optimal attacks. So manual “use SAPIF against hulk” doesn’t cut it - it forces the AI to drop the attacks which could actually be BETTER than SAPIF (due to them gaining random turn advantage).

By having only move cost, accuracy, and damage (clipped to monster’s current hp) to care about, the simple AI system could easily make best decisions in vast majority of cases, whether player was in a serious fight or just otab-ing through a dungeon. This would mean that the player wouldn’t need to “switch to manual” often, saving us a great deal of UI, which we all hate to write and use.

[quote=“Coolthulhu, post:1, topic:13457”]Our current melee system is pretty simple: when you attack, you attack with currently wielded weapon. Then you get bonus attacks due to mutations (if you have them).

How about this:

[ul][li]When attacking, game enumerates all possible attacks[/li]
[li]Some of them are pretty weak most of the time: headbutts, elbow strikes, pistol whips[/li]
[li]The attacks get some random permutation to accuracy/expected damage every time[/li]
[li]The effectiveness of attacks is evaluated based on enemy (for example, armor is subtracted from damage)[/li]
[li]Attacks are weighted somehow: usually just by DPS, but sometimes by being finishing strikes (dropping monster to 0 hp or less) or special effects[/li]
[li]Best one is picked and executed[/li][/ul][/quote]

Game picking the most damaging and accurate (of all of them on average) available free attack from the list automatically is a pretty simple way to go here. I like this, even if it results in the player doing the same one-two punch over and over, it gets the job done and that’s what matters. Disabling some attacks you’d want to avoid should also be possible (e.g. if the game automatically chooses an attack that always knocks an enemy away when you don’t want that to happen)

I totally forgot to mention that as an example of an undesirable attack, even though I kept thinking about it.

Knockback is probably the best reason to include that blacklisting, yeah.

I totally forgot to mention that as an example of an undesirable attack, even though I kept thinking about it.

Knockback is probably the best reason to include that blacklisting, yeah.[/quote]

I’d still like to be able to (attempt to) let the game know what sort of effects I (as the player) want, and let the game (as the character) work out what I can actually do based on some randomness and the character’s skills. It seems appropriate that even if an unskilled character wanted to, they couldn’t perfectly control what sorts of attacks they were doing, it would mostly just be swinging and hoping for a hit. Similarly, if the character has high skill I (as the player) don’t want to have to repeatedly alter the set of moves that are being used (from ‘only the fast, safe moves’ for normal zombies to ‘only the high-damage stunning moves’ for brutes to ‘moves with knockdown and knockback’ to clear space for a retreat), I’d like to be able to choose categories of moves (potentially pre-defined, potentially that I’ve set up myself) that the character can (because they are high-skill) reliably pull off. If I don’t want knockback I don’t blacklist knockback moves, I choose a style that doesn’t use them like ‘fast attacks only’ or something.

I’d disagree about that estimate: cooldown would get us a lot of behavior, but it would eventually turn into a lot of work if we were to combine it with automatic selection.[/quote]
I don’t follow, attacks that are cooling down wouldn’t be added to the list of available attacks, it couldn’t be simpler from that angle. I could definitely be missing something though.

This is a good point and an unintended side effect of the cooldown approach.

The thing I’m trying to prevent is that random variations with no cooldown will do one of two things.

  1. Execute the same attack every time if the difference between the best and next best attack is larger than the random variation. (Also applies to each additional attack option, there will be a strong bias toward the top few attacks).
  2. Sometimes nerf the best attacks so much that an extremely suboptimal attack is executed repeatedly, leading to YASD because damage output is so unreliable.

I don’t think it’s too hard to work around this, but we need to be clearer about our goals as opposed to the mechanisms we’re using.

This bias toward damage over time would lead to non-damage-dealing attacks not being worthwhile. Even if you switch modes and consider only attacks that cripple, delay, or deal other status effects, only the ones that deal the most damage would actually execute. I don’t want to sacrifice more interesting kinds of attacks in order to add more variation in just damage dealing attacks.

There’s a straightforward solution though, instead of filtering the list, alternate attack modes could change the evaluation function that selects the best attack. “Delay” mode could evaluate based on chance-to-delay, expected delay, and move cost.

This could get complex fast, but I’m afraid it has to - avoiding manual control isn’t easy.

The weight change of effects would probably have to depend on the target. Otherwise the player would need to switch to aggressive to attack hulks, then back to defensive in the next turn, thus defeating the whole point of modes.

I’d disagree about that estimate: cooldown would get us a lot of behavior, but it would eventually turn into a lot of work if we were to combine it with automatic selection.[/quote]
I don’t follow, attacks that are cooling down wouldn’t be added to the list of available attacks, it couldn’t be simpler from that angle. I could definitely be missing something though.

This is a good point and an unintended side effect of the cooldown approach.

The thing I’m trying to prevent is that random variations with no cooldown will do one of two things.

  1. Execute the same attack every time if the difference between the best and next best attack is larger than the random variation. [glow=red,2,300](Also applies to each additional attack option, there will be a strong bias toward the top few attacks).[/glow]
  2. Sometimes nerf the best attacks so much that an extremely suboptimal attack is executed repeatedly, leading to YASD because damage output is so unreliable.

I don’t think it’s too hard to work around this, but we need to be clearer about our goals as opposed to the mechanisms we’re using.

[glow=red,2,300]This bias toward damage over time would lead to non-damage-dealing attacks not being worthwhile. Even if you switch modes and consider only attacks that cripple, delay, or deal other status effects, only the ones that deal the most damage would actually execute. I don’t want to sacrifice more interesting kinds of attacks in order to add more variation in just damage dealing attacks.

There’s a straightforward solution though, instead of filtering the list, alternate attack modes could change the evaluation function that selects the best attack. “Delay” mode could evaluate based on chance-to-delay, expected delay, and move cost.[/glow][/quote]

From one side: why would one actively engage in mortal combat with an enemy if not to neutralise them as quickly and efficiently as possible? Choosing to cripple your opponent over dealing immediate lethal damage is pretty much absurd. Landing a crippling strike ‘may’ be useful when you know you can’t deal enough damage to your opponent in a short time frame (swarmed from every side) or when you know that there is no way that you could harm your opponent (insanely armoured) but then why wouldn’t you just run in the first place… seems like an error in judgement from the start. So that’s probably why the game should always prioritise maximum damage/accuracy because it expects you to know better not to engage in combat you aren’t going to win.

However, there ‘could’ be some attacks in ‘some’ very specific and rare situations which stat-wise don’t do a lot of damage but would debuff the opponent to take more damage from there on. Such a strike would probably be much weaker damage-wise than a full broadsword swing to the dome piece, but cumulatively allow to stack more damage on your opponent than if you’d just be swinging at it wildly. Or of course you may want to cripple a zombie’s legs while he’s in a doorway to stop the horde from catching up. Another lower dmg attack would be one that is focused on penetrating armour (precise stab between the plates doesn’t have as much punch behind the swing) which might be more useful in a specific combat situation vs a tanky enemy.

For general-purpose combat versatility, damage/accuracy is still preferred

Stunlocking+knockbacklocking hulks is an overpowered technique. While it isn’t supposed to be treated as a proper tactic here, the combat AI system should, where possible, allow efficient “mashing”, without player having to constantly click through menus.
Similar for the acid zombies, which are better disabled and killed in 4 turns than killed in 2 turns with one of those turns spent under their attack.
So the ability to prioritize debuffs and mobility would be helpful.

Neutralization doesn’t require killing for one, if your actual goal is to run away it’s a hell of a lot easier to trip an opponent and run than to kill them.
Another is effort expended, if you need to make a single low-effort attack to neutralize an opponent for long enough to escape, that conserves energy for escaping and neutralizing other opponents.
Another is dealing with multiple opponents, it might be feasible to temporarily incapacitate several opponents for long enough to deal with one of their allies, but if you tried to kill the first outright it’s allies could get some hits in.
In our particular scenarios, these effects are even more exaggerated, because some opponents are relatively easy to incapacitate temporarily, such as by tripping a zombie, but at the same time are more durable than humans, such that one-shot kills are difficult or impossible to perform.

In other words, if you make such an error in judgement, the system should just abandon you to your fate? In case it’s not clear, rhetorical question, it shouldnt.