[A16] Melee Skill Rebalance [Updated 3/04/2017]

Started by oreganor, March 23, 2017, 01:54:29 PM

Previous topic - Next topic

oreganor

MELEE SKILL REBALANCE



= DESCRIPTION =

This Mod is an attempt to bring more utility to Melee Skill highlighting its impact on close quarters combats. Currently the main changes are:

   
- Altered skill progression/curves/defaults so what appears in-game tooltips as Melee Chance gets closer to real chances to land a hit on the enemy. The overall effect sought is that highly skilled fighters become deadlier while low skill fighters become much worse at dealing melee damage compared to Vanilla. Non Skilled entities will show their 60% chance to hit, as it was already the case inside the melee evaluation code. Their combat effectiveness will change based on their current health status.


- Created a "Parry" mechanic as a 3rd type of result on any melee attempted. The chance a regular hit turns into a "Parry" is based on the Melee Chance of the target. A parried attack has different effects on its target based on a few factors:

* If the target is wearing any piece of Apparel able to absorb damage, the full damage of the attack will be absorbed by it. Vanilla Personal Shields are an example of this change, they will try to absorb the damage of a melee attack that's parried.
   
* If the target is wielding a Melee Weapon, no wound will be suffered but the Weapon will loose HP as a fraction of the attack damage. This fraction is reduced the higher the Melee Chance of the target. The weapon will be dropped to the ground if a hit was strong enough to destroy it.
   
* An unarmed target will suffer half the damage on a Parry. A pawn wielding a Ranged Weapon falls on this category also.

* Parry chances are reduced the more parries a pawn does between his/her melee attacks.


- Pawns have a Melee Mode order players can change. Each mode modifies regular hits and have a chance ("Chance" in Mode tooltip) to trigger a special effect. For a special effect to happen the Pawn has to have effective hit chances equal or higher than the inherent difficulty of the stance ("Threshold" in the tooltip). The current modes are:

* Kill: Regular Damage on normal hits. Double damage on Special effect.
   
* Capture: Half Damage on normal hits. "Anesthezise" Incapacitation on Special effect.
   
* Stun: Half Damage on normal hits. Short stun on Special effect.
   
* Disarm: No Damage on normal hits. Enemy weapon droped to the ground on Special effect.


- AI Pawns use Attack Modes based on individual goals & capabilities.


= ACKNOWLEDGEMENTS =

pardeike: Without Harmony, gracefull detouring wouldn't have been possible. His input on safe access to private methods have been a very valuable lesson.
haplo: For inspiration on how to make my own art and for his excellent tutorial on modding.


= INCOMPATIBILITIES =

Currently this mod Detours 2 Vanilla methods using Harmony Library:
- Rimworld.Verb_MeleeAttack.TryCastShot()
- Rimworld.Pawn_DraftController.GetGizmos()


ATM the mod leaves no traces on your savegame, meaning it's safe to use on an ongoing game and safe to be removed without further considerations.


= KNOWN ISSUES =

- Parry counters are reseted on reloading.
- Attack Mode settings are reseted to "Kill" on reloading.


= TODO =

My current focus is to learn modding... Thus why my 1st goal is a mod that players aren't afraid to test, that's why no savegame trace is a must for now. If enough brave souls offer feedback and/or find this usefull, this are the next steps (In no particular order and, OFC, heavily shaped by the feedback I may gather)

- Parry Saturation. ATM the number of concurrent fighters attacking the same defender do not alter defender's parry chances. This is not ideal and will be changed sooner or later.

- Full Harmony library integration. I'm holding Sources publishing until I can show a decently clean code were all interactions derived from using detours go through Harmony Library, not just Detours themselves. I have some issues using Traverse tool that I need to investigate/report in Harmony channels.

- Make melee weapons that are destroyed while parrying to be droped with a few hp instead. For better visualization of what's going on and for users of repair mods to have a chance to keep their best melee weapons.

- Melee Combat toggle buttons to customize Pawn behaviour regarding "safety" while meleeing and/or allowing different "Attack Modes".

- Parry Chance Stat. As a standalone so apparel/traits can affect defensive chances independently of offensive chances.

- Better Sounds/Visual notifications when a Parry happens.

- Make this mod fully compatible with other mods that do not relay on Harmony without user patches.

- Better Sounds/Visual notifications when a Special effect happens.

- Make AI better at selecting which Attack mode to use. ATM they default to "Kill Mode".

- Find a way to notify players that their Pawns may be trying an attack mode that has no chance to trigger a special effect because their current target is just too skilled at Melee.


= POWERED BY =

Harmony 1.0.9.1. Detouring Library.


= DOWNLOAD & INSTALLATION =

This is the latest version on the GITHUB repository of the project. If you want to access older versions, just browse on the "Releases" Tab and get the .zip of the one you want.

To install, simply unzip it into your [Rimworld Install Path]\Mods directory.


= PERMISSIONS =

Feel free to use/reuse, tear apart, the Mod and its sources at your leasure. I would appreciate to be credited if you think this mod is useful enough and/or provided some fun for you in any way or form ;).


= CHANGELOG =

1.4.0:
- AI will now use different Attack Modes based on individual pawn's goals & capabilities.
- Tweaked Attack Modes thresholds & chances.
- Reduced Parry counter penalty.

1.3.2:
- Added overlays to Attack Mode button to describe effective chances of a special effect to happen.
- Compatibility with "Defensive Positions" mod.

1.3.1:
- Using Shortcut "M" (Misc 7) as default.
- RTS behaviour on Attack Mode button when multiple pawns are selected.

1.3.0:
- Added Attack Mode command.
- Added Basic Localization: English.

1.2.1:
- Fixed Null Error while attacking Buildings.

1.2.0:
- Full integration with Harmony Library.
- Parry chances of a pawn are reduced the more parries it has to do between his/her melee swings.

1.1.0:
- Melee weapons badly damaged on a parry are droped to the ground.

1.0.0:
-Initial Implementation.
Contributions:
Melee Skill Rebalance

oreganor

Contributions:
Melee Skill Rebalance

TAA6

A point that should be made here I feel is also on important stats for melee. Now maybe I'm not well read on the topic but as I understand it manipulation has no effect on melee quality, which is pretty stupid if you ask me. Something to potentially rectify here.

oreganor

#3
QuoteA point that should be made here I feel is also on important stats for melee. Now maybe I'm not well read on the topic but as I understand it manipulation has no effect on melee quality, which is pretty stupid if you ask me. Something to potentially rectify here.

Good point and, certainly can be defined, as I'm already using the Def that contains the conditions affecting a given stat... So far Vanilla defines only 2:

100% Consciousness
40%   Perception

The way modifiers are applied is normalized so, in principle, there wouldn't be a problem to add your suggestion. I will do some numbers on the common causes (and how bad/good they can become) to get a figure on the weight to add manipulation as a factor affecting Melee Chances.

Thanks for the feedback.
Contributions:
Melee Skill Rebalance

PetWolverine

Sounds like a great mod, I'll look forward to trying this out!

Quote from: TAA6 on March 23, 2017, 03:08:52 PM
A point that should be made here I feel is also on important stats for melee. Now maybe I'm not well read on the topic but as I understand it manipulation has no effect on melee quality, which is pretty stupid if you ask me. Something to potentially rectify here.

I think ideally manipulation would affect armed but not unarmed combat, so losing fingers would reduce a pawn's effectiveness at wielding a sword, but scyther blades, as a hand replacement with 20% manipulation, would retain their tradeoff of producing highly specialized melee super-soldiers who can't really do anything else.

XeoNovaDan

This looks like an excellent mod, hope it becomes well-known in the community. That's part of the reason I'm stoking the reply train to keep this post up there.

Definitely going on my mod list!

ChJees

Will keep an eye on this mod. Greatly interests me since i think the way melee combat worked was very bad.

Also put on Steam :P ?

jimthenoob

YES! A simple balance mod to ass some flavour to the melee combat is what I have been looking for, gonna keep an eye on this one!

slugman4

Could you consider a critical attack working a bit like the stun attack bears have also adding more dmg to the equipment and body parts maybe start with 150% at under 10 melee and 250 % dmg above 10 melee?

I think these changes would balance the whole issue of not making close quarters fighters?

Mufflamingo

Add cooldowns to parry. Higher melee skill, lesser cooldown. So that when engaged with many opponents, pawns wont be able to parry every attack. Well except for that Godlike 20melee pawn who can parry attacks every 0.2 seconds. 😂
Bleeeee. . . . .

SpaceDorf

Maxim 1   : Pillage, then burn
Maxim 37 : There is no overkill. There is only open fire and reload.
Rule 34 of Rimworld :There is a mod for that.
Avatar Made by Chickenplucker

oreganor

#11
Thanks for the detailed feedback.

QuoteCould you consider a critical attack working a bit like the stun attack bears have also adding more dmg to the equipment and body parts maybe start with 150% at under 10 melee and 250 % dmg above 10 melee?

I think these changes would balance the whole issue of not making close quarters fighters?

The idea I have for special effects is a toggle button were players can select the intention their pawns go with into a melee and when a "critical" happens the selected special effect is triggered (This is what I meant on the TODO section as "Attack Mode" buttons). The current draft I have is like this:

- Killer. Double Damage.

- Capper. Double Pain.

- Defensive. Disarm/Stun. Depends on what I find easier to implement. Disarm is the more attractive because there is a lot of tactical depth into it... But it has a lot of potential fallout to check regarding how AI reacts to it. Stun, on the other side, is very easy to do as there is a current mechanic for it... "Surprise Attacks", which is what Animals trigger when they "hunt" unsuspecting prey.


QuoteAdd cooldowns to parry. Higher melee skill, lesser cooldown. So that when engaged with many opponents, pawns wont be able to parry every attack. Well except for that Godlike 20melee pawn who can parry attacks every 0.2 seconds. 😂

The draft I have for Parry Saturation is based on the concept of Parry counters. The more a Pawn accumulates the less His/Her melee chance can reduce attackers'. The Parry counters reset to 0 each time the Pawn attacks. The reasson is mainly technical, because allows me to evaluate EVERYTHING into the same Method (Thus controlling the Impact my mod has on the overall code). As a secondary goal, I want that weapon speed matters more than now... To balance the fact that slow hard hitter weapons can still easily one shot Pawns on a lucky hit. So players can find tactical use for a variety of scenarios:

- Slow Big Weapons. Better for 1 v 1 duels. Better chance at disabling in one hit versus higher max ammount of parry counters between swings.

- Fast Small weapons. Less chances to disable in one hit versus lesser max ammount of parry counters between swings.


In BOTH cases, the current showstopper is the same... Implementing them REQUIRES leaving something "saved" (Either because I need to store states that evolve over time... Or because I have to create a new entity ingame that will leave a trace on the savegame itself). ATM, I'm not confident enough in my modding skills to allow this to happen, because 1st I want ppl to get a feeling on how it looks... And for that they should be able to jump in, install the mod and be able to remove it without consquences if they do not like what they see.

Once my learning process allows me to create safe and clean ways to disable this mod with "savegame" entities... I will proceed to add "fancy features" like the 2 commented.


QuoteAlso put on Steam :P ?

Partially linked to my "still-to-learn" moding savegames... Steam is a nightmare for the average user that just subscribe to mods if they do not leave savegames intact. I know I'm missing a lot of audience, but I prefer to be honest about my current knowledge limits and expose this mod on a channel were users are more aware of the implication this important step has. In time, I will add it to the workshop when I feel it's rich, fun, diverse and robust enough to justify a potential lost savegame in the worst case scenario after an autoupdate.

I know that in the permissions I stated I don't mind what you do with this mod now or in the future... So can't really blame anyone that uploads it to the workshop directly. Please, if you do, at least warn the subscribers about what I comment here, that at some point this MOD will leave savegame traces and then they will be exposed to all the autoupdate madness Workshop may trigger.
Contributions:
Melee Skill Rebalance

XeoNovaDan

Definitely excited to see how this'll turn out. I feel it'll synergise very well with my Better Shooting Skill mod

PetWolverine

Quote from: oreganor on March 23, 2017, 07:26:50 PM
In BOTH cases, the current showstopper is the same... Implementing them REQUIRES leaving something "saved" (Either because I need to store states that evolve over time... Or because I have to create a new entity ingame that will leave a trace on the savegame itself). ATM, I'm not confident enough in my modding skills to allow this to happen, because 1st I want ppl to get a feeling on how it looks... And for that they should be able to jump in, install the mod and be able to remove it without consquences if they do not like what they see.

Once my learning process allows me to create safe and clean ways to disable this mod with "savegame" entities... I will proceed to add "fancy features" like the 2 commented.

As a software engineer, I have to commend your discipline. This is an unusually careful and responsible attitude.

ChJees

Initial feedback: Melee weapons break pretty darn fast.

Had a colonist fight off a wild hog with a club. The club broke pretty fast from all the parrying. Some way to mitigate weapon from taking damage could be nice i guess.