Can the 'kill vs. incapacitation' ratio be modded?

Started by Thundercraft, December 03, 2016, 09:39:52 AM

Previous topic - Next topic

Thundercraft

I've been trying to get 'non-lethal' modded weapons like the tranq gun, stun gun, and baton to be less lethal. I wanted at least one of them to always incapacitate. But it seems that the game is coded to make all weapon attacks inherently lethal to a certain degree, regardless of how little damage they inflict (even zero) and regardless of how they are coded.

When I posted about this issue, schizmo informed me:
Quote from: schizmo on November 30, 2016, 09:13:21 AM...As for kill over incapacitation, the game is coded specifically to make incapacitation events happen less and less frequently the more colonists you have, it's done as a form of population control.

Question: Is there an .XML file somewhere that I could tweak to adjust the 'kill vs. incapacitation' ratio? Or is it hard coded such that it would require a .dll-mod or using CCL to change?

I have considered adjusting the 'Desired minimum', 'Desired maximum' and 'Critical' population limits in my Storytellers (e.g., the Double Population mod) as a sort of workaround. But I'd rather not adjust lethality that way. And I'm sure that no matter how high I set the population limits, that won't entirely remove my lethality problem.

tonsrd

theres a few weapon mods that add tasers. or stun grenades etc.

one explosive mod adds sleep gas

Thundercraft

Yes, I know there are mods that add so-called 'non-lethal' weapons. I've already tried them. And they are not truly non-lethal. There's always a good chance that they will kill the target instead of incapacitate. Did you really read my OP?

The mod's comments say that they might kill. Often, the mod's author admits as much. And that has been my experience in my testing. No matter how I alter the weapons code in .XML, there's always a good chance that they will kill.  (I haven't heard of the sleep gas, though. I'll have to look that one up.)

I'm just asking if there's a way to mod something to change that game behavior so I can have modded weapons that are truly non-lethal - that are extremely unlikely to kill.

tonsrd

I didn't read it as  much as I should of, heres the remote explosives mod link with the gas bomb.

https://ludeon.com/forums/index.php?topic=17285.0

firs tpost inc pics of sleep gas in use and 4 downed colonists.

Thirite

Someone already made a small mod that completely removes the chance of instant death on a pawn being "Downed", but I think it would be rather simple to mod the weapon def loader to have an xml entry for "lethality", being a value somewhere between 0 and 1. Where 0 results in never killing on downing and 1 acts as vanilla does.

Thundercraft

Quote from: Thirite on December 04, 2016, 12:11:52 PM
Someone already made a small mod that completely removes the chance of instant death on a pawn being "Downed"...

Interesting. Could you share the link? Do you remember what it was called?

Quote from: Thirite on December 04, 2016, 12:11:52 PM...but I think it would be rather simple to mod the weapon def loader to have an xml entry for "lethality", being a value somewhere between 0 and 1. Where 0 results in never killing on downing and 1 acts as vanilla does.

Are you talking about how simple it would be for Tynan to create a new xml entry so modders could change the lethality of weapons? If so, I would agree that should be simple enough to do.

Thirite

#6
Well pretty much anything in RimWorld can be modded with method detours, so Tynan wouldn't need to do it though I agree he should. I could do it easily enough given the time.

Edit: Right, the mod
https://ludeon.com/forums/index.php?topic=27580.0

nccvoyager

I made a tiny "tranquilizer" mod that didn't use damage; it added a modifier (that was basically a copy of the anesthetic for surgery) to a pawn "hit" by a tranquilizer dart.
Drops consciousness to below the "conscious" threshold, resulting in a 100% non-lethal downing, and will wear off after a time period.
(Unless something else modifies the consciousness below the "alive" threshold. Though, it wouldn't directly be the tranquilizer's fault then, and it is fully acceptable.)

I was going to add effectiveness modifiers, immunity buildup, and tranquilizer level buildup as well, though I never got those parts to work, and eventually abandoned it.

If I can find it, I would be willing to upload a copy of it here, if you wanted to take a look at it.

Not particularly important off-topic text wall below.
It should be noted that the available "non-lethal" weapon mods are more accurate simulations than the one I made.
Real-life "non-lethal" weapons should actually be called "less-lethal" weapons as there is still always a chance that they can be fatal.
There is always a chance a tranquilizer can cause an allergic reaction, or interact with a medication someone is taking.
If the tranquilizer used does not stop a person, additional tranquilizers need to be used, resulting in greater chances of adverse effects from large tranquilizer doses.
The tranquilizer needles themselves may damage internal organs or the spinal cord if they hit near or directly on them.
There is always a chance that a taser can stop a heart, cause irregular heartbeats to form, disrupt nerve impulses in a way that stops autonomic functions, or disrupt the operation of a pacemaker.
Rubber bullets and firearm-launched-beanbags can also be lethal if they hit certain parts of the body, (like the rear of the neck, damaging the brain stem), or if they hit a person with sufficient force to crush internal organs or break bones leading to internal bleeding.
They can even be lethal if enough of them hit a person before the person falls, leading to large swathes of bruises and ruptured blood vessels, opening the possibility of severe drops in blood pressure, or the restriction of internal organs, resulting in death.
Even paintball guns, and the paint ball projectiles themselves, often used as recreational toys, can be lethal if improper, or a lack of, protective clothing is used.
Paint balls can cause the above massive bruising, or can obstruct breathing if a face mask is not used.
Direct hits to the eyes can rupture them, resulting in permanent vision loss, head trauma, and major bleeding.
Just because popular media shows a 100% success rate, and testing shows an "acceptable level of risk," that doesn't mean it is completely risk-free.
Okay, rant over, I realize from a game mechanics standpoint it is easier and nice to just throw a 100% success rate there.

Thundercraft

#8
Quote from: nccvoyager on December 06, 2016, 04:25:19 PMI made a tiny "tranquilizer" mod that didn't use damage; it added a modifier (that was basically a copy of the anesthetic for surgery) to a pawn "hit" by a tranquilizer dart.
Drops consciousness to below the "conscious" threshold, resulting in a 100% non-lethal downing, and will wear off after a time period.
(Unless something else modifies the consciousness below the "alive" threshold. Though, it wouldn't directly be the tranquilizer's fault then, and it is fully acceptable.)

Sounds interesting. Usually, ranged weapons in RimWorld have to do at least 1 point of damage or they don't seem to do anything. At least, that was my experience from my experiments. (So called "non-lethal" melee weapons can get away with doing 0 points of damage, though.)

Quote from: nccvoyager on December 06, 2016, 04:25:19 PM[snip]...and eventually abandoned it.

Have you considered just releasing what you had? I sometimes end up with unfinished projects, myself. But I usually regret when they never see the light of day and nobody benefits from the effort.

Quote from: nccvoyager on December 06, 2016, 04:25:19 PM
If I can find it, I would be willing to upload a copy of it here, if you wanted to take a look at it.

That'd be appreciated. I'd like to take a look. (Also, it seems the author of the Blowgun mod is in the process of expanding his mod to including a tranquilizer gun and some other non-lethal devices. Perhaps he'd be interested, too?)

Quote from: nccvoyager on December 06, 2016, 04:25:19 PMNot particularly important off-topic text wall below.

Yes, I realize that, IRL, non-lethal weapons do not have a 100% success rate. However, if used properly, I think most have a fatality rate of a single digit percentage or less. (Though, I seem to recall that tranquilizer darts are on the dangerous side and normally aren't used on humans.) I would hope that they have a better than 37% success rate! :o (RimWorld 'random death mechanic' is roughly 67% of all attacks, depending on how many colonists we have.)

The best non-lethal weapon mod I've tested so far is the Blowgun mod, with a success rate of roughly 85% (about 15% fatal). That's much better, but still not ideal.

nccvoyager

#9
I'll take a look around my HDD, and see if I still have it, or if it got deleted during the "Great Purge" during the summer.
I'll probably still have it; I know I have a few other old mods I had made there too.
May be a few days, or a week, before I get back here.
No internet available where I live, and driving 15km into town every day is getting expensive.

Edit: In case I can't find it, or if you want to try to do it yourself before I do, here's a summary of what I did.
-Cloned the "surgery anesthetic" hediff, changing it to "tranquilizer" instead of anesthetic. (Functionally identical.)
-Cloned the "pistol" object, changing it into a "tranquilizer pistol."
-Coded things up to add the tranquilizer hediff to a "positively hit" target.
---In order to do this, I created a new damage type that is incapable of creating wounds, and thereby incapable of physically harming or killing a pawn. This damage type simply adds the tranquilizer hediff to a "hit" pawn. Since "reduced consciousness" is the cause of downing and not excessive damage, it is not considered a combat-forced-downing, and is always non-lethal. (With the previously mentioned exception of existing conditions which reduce consciousness being able to reduce consciousness below the "alive" threshold.)

The main downside of this that I found was that it was too perfect.
That is to say, I couldn't figure out a way to stop the tranquilizer from being 100% effective, always resulting in an instantly-downed pawn upon hitting.
This is an issue with me, and I am entirely sure there is a way of doing this I simply could not see at the time.


Edit 2: Okay, so, the mod was lost in the purge.
Unfortunately, I don't remember how I managed to get projectiles to add a hediff without also making a wound.
As such, the version of a tranquilizer pistol I just made does exactly the same thing as all the rest; including an approximate 1/3 chance of death on downing.
So, unfortunately, my information was useless.

That being said, if I remember correctly, in the original I bypassed the injury giver, and forced the projectile to directly give the tranquilizer hediff to the target.
How I did that is a mystery, even to me.

Perhaps I added the tranquilizer the same way that surgery anesthetic is applied?
I wish I could remember.

I will continue looking around and playing with the code until I manage to get it working, or until someone else provides a much more elegant solution than I ever could.