Ludeon Forums

RimWorld => Mods => Unfinished => Topic started by: XeoNovaDan on July 18, 2019, 12:32:49 PM

Title: [1.0] [RELEASED] Adrenaline!
Post by: XeoNovaDan on July 18, 2019, 12:32:49 PM
Note: This mod has now been officially released and discussion has therefore been locked. Thanks for testing, folks!

Ludeon thread: https://ludeon.com/forums/index.php?topic=29503.msg462493#msg462493
Steam workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1823138604




Preface:
This mod is virtually complete, but the reason I published it on this Unfinished thread before fully releasing it is because I woud like balance feedback and additional suggestions. If you're willing to provide said feedback, that would be very much appreciated!

(https://i.imgur.com/SsfvsBM.png)

Overview:
This mod adds, as the name suggests, adrenaline to the game. Pawns gain a burst of adrenaline when they see anything that they perceive as a threat, or whenever they take any damage. In terms of what is perceived as a threat, humanlike pawns will consider other pawns and turrets, with the level of perceived threat being based on 'combat power' ratings and baseline market value respectively; animals only consider other pawns, with the perceived threat being based on the animal's body size compared to the threat's.

(https://i.imgur.com/wF5wmn3.png) (https://i.imgur.com/NlN1l72.png)

Adrenaline in RimWorld primarily affects how much pain a pawn feels as well as their blood pumping, though it also affects their breathing, consciousness, movement and damage dealt in melee combat. Due to RimWorld's time scale, adrenaline will generally be prevalent for around a couple or so in-game hours depending on the duration and intensity of a battle.

Adrenaline can also be gained through the use of adrenaline syringes which can either be purchased or made from neutroamine once Penoxycyline has been researched. You can also have pawns pocket adrenaline syringes via drug policies (or Smart Medicine's 'Stock Up'/Combat Extended's loadouts) so that if they go down, you can make them inject any adrenaline syringes directly next to them which could potentially get them back into/away from the fight.

(https://i.imgur.com/jyRtBt0.png)

Additionally, two new traits are added which relate to adrenaline rushes:A pawn cannot be an adrenaline junkie and cool-headed at the same time. Pawns that can't gain adrenaline of any form also won't generate with any adrenaline-related traits.

(https://i.imgur.com/X08lHv1.png) (https://i.imgur.com/pMi3HDQ.png)

There are currently four distinct stages of adrenaline rush. The following table details each stage and its effects on a pawn:







Stage          Pain          Blood Pumping          Breathing          Consciousness          Moving          Sight          Melee Damage          Mood Bonus          Other Effects
Slight          x90%          +10%          +10%          +5%          +5%          +5%          1.05x          +4          -
Moderate          x83%          +20%          +15%          +10%          +10%          +10%          1.125x          +8          -
Intense          x75%          +30%          +20%          +15%          +15%          +15%          1.2x          +12          -
Extreme          x65%          +50%          +25%          +20%          +20%          +20%          1.3x          +18          Heart attack risk

Beware though, because adrenaline rushes can lead to 'adrenaline crashes' where affected pawns become lethargic, nauseous and more prone to having mental breaks! The severity, duration and symptom onset speed of an adrenaline crash depends on the intensity and duration of the accompanying adrenaline rush, with severe cases potentially lasting for a few in-game days. Symptoms typically start becoming apparent a few hours after the adrenaline rush starts, though short and mild rushes may not even result in an adrenaline crash.

The following table details each stage of an adrenaline crash:







Stage          Tiredness          Consciousness          Mental Break Threshold          Vomiting (average)
Minor          +30%          x90%          +2%          Once per 5 days
Moderate          +50%          x80%          +4%          Once per 3 days
Severe          +70%          x70%          +6%          Once per 2 days
Extreme          +100%          x50%          +8%          Once per day

Credits so far:Compatibility Notes:
Mods:If you are a modder and wish to make animals or alien races have different adrenaline characteristics, you might be interested in checking out this mod's GitHub wiki: https://github.com/XeoNovaDan/Adrenaline/wiki

Saves:Links:
Download: https://github.com/XeoNovaDan/Adrenaline/releases
Source Code: https://github.com/XeoNovaDan/Adrenaline
Title: Re: [1.0] [WIP] Adrenaline! Release Candidate 2 (2019-07-18)
Post by: XeoNovaDan on July 18, 2019, 07:57:40 PM
Pushed a second release candidate

Shortened Changelog (full changelog on GitHub releases):

Balance:The objective of these balance changes is to reduce the amount of 'extreme' adrenaline occurences

New:
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-19)
Post by: Trunken on July 19, 2019, 04:48:43 AM
Another ebic mod by the legend :-) Thank you XND
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-19)
Post by: Sonsalt on July 19, 2019, 09:15:07 AM
Amazing idea!!!

Does this affect aiming etc?
It could be a great suppression mod too
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-19)
Post by: XeoNovaDan on July 19, 2019, 09:55:48 AM
@Trunken - Thanks! And you're welcome :P

@Sonsalt - This doesn't affect aiming speed, no. However, accuracy does improve due to the minor sight bonuses. Regarding suppression, that's out of this mod's scope but IIRC there's a standalone suppresson mod out there already, and CE also has suppression mechanics.
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-19)
Post by: creepyguyinblack on July 20, 2019, 02:57:43 PM
I think there should be some small penalties towards skilled work (smithing, tailoring, construction, art etc) research and possibly even social, increasing with the adrenaline level for both balance and realism. I have a hard time keeping my hands steady or mind focused when I've just had an adrenaline pumping event inreal life. As it is rn, it seems like just a free stat boost with No resources cost, risk or any negatives.
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-19)
Post by: XeoNovaDan on July 20, 2019, 03:41:56 PM
@creepyguyinblack - Thanks! Yeah, I've fiddled with adrenaline balancing a bit more in the next version and will also add an 'adrenaline crash' hediff that starts after the initial hediff finishes.
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-19)
Post by: Brightsideguy on July 20, 2019, 11:08:00 PM
This is a really fantastic idea.  Thanks for making this!  Few ideas / suggestions.

Blood Pumping Only --- blood pumping already affects speed, so perhaps only this (or just speed) should be used.  Since a blood pumping boost could theoretically result in a pain-numb pawn only staying alive due to adrenaline (e.g. their blood pumping would be 0% without it due to heart damage etc) and dying once that wore off, by choosing blood pumping you'd have to decide if you'd want that to be a feature ("he survived long enough to defend the colony") or if that'd just be annoying from a user perspective ("wait why did they suddenly die?!?).

Not manipulation or breathing --- I agree with creepyguy in that adrenaline should have immediate negatives (not just a post-fight hediff as you're planning). A medic or sniper or recruiter doing their job better because they are hurt or afraid, doesn't sound realistic. But raising manipulation and breathing (via consciousness) actually makes these skilled jobs easier. Perhaps do away with the health stats and just stick to specific skill impacts when under adrenaline?  [i.e. skilled work efficiencies down, social down, shoot accuracy down, shoot speed up, etc]  Or heck, actually make it lower manipulation, so even freaked out fighters miss a little more.

Cool Headed Trait --- With the above idea in mind.  It'd be interesting to have a "cool headed" trait where adrenaline mechanic doesn't affect the pawn at all. Imagine picking a combat medic based on knowing that they won't screw up tend jobs by being shot at. Or giving the best weapon to the gunner who will always aim well under fire. Or if going the lower-manipulation-for-all route, have your cool-headed melee fighter be the one who makes the hits when it counts.
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-19)
Post by: XeoNovaDan on July 21, 2019, 05:39:40 AM
@Brightsideguy - Cheers! In the next version of the mod, the way that adrenaline accumulates has been completely reworked and has had its bonuses nerfed, as well as an 'adrenaline crash' hediff which will affect the pawn negatively (faster tiredness gain, lowered consciousness etc.) for a longer period of time. Cool headed trait would be a good idea too, I'll get that in before the next release of the mod.
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-21)
Post by: XeoNovaDan on July 21, 2019, 03:40:02 PM
Alright, just pushed the fourth release candidate! This is a major update which incorporates many of the changes suggested here as well as suggestions I received via Discord.

You may receive a few errors if loading an ongoing save with the newest version of this mod if you were also using an older version, but the errors should be harmless.




Full change log:

Balance:
Completely reworked how adrenaline is gained over time to be more realistic
Tweaked adrenaline stage bonuses
    Slight
    Moderate
    Intense
    Extreme
Adrenaline Syringe:
New:
'Adrenaline Crash' hediff - happens alongside adrenaline rushes but has delayed symptom onset
'Cool-headed' trait - Never gains adrenaline from perceived threats or taking damage. They can still receive adrenaline rushes from injections though

Misc:
This mod finally has a thumbnail!
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-21)
Post by: Brightsideguy on July 21, 2019, 06:48:32 PM
Just a note that with the current release from a few hours ago.

With Combat Extended active.

I can get a pawn to go down from punches without adrenaline ever going beyond slight. Aka punched unconscious isn't that frightening to the pawn.

I can stab a pawn twice in the torso for 10 damage (out of total 50 torso health) with heavy bleeding and its just slight adrenaline, that goes away pretty quickly.
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-21)
Post by: Brightsideguy on July 21, 2019, 06:59:32 PM
Oh and that test is with breathing, consciousness, and sight changes disabled.  If that matters at all?   
(I sort of edited a version for myself that instead implements the medical / shooting etc negative buffs when adrenaline kicks in).
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-21)
Post by: XeoNovaDan on July 21, 2019, 07:15:52 PM
@Brightsideguy - Ah, this seems to be because the code that checks for perceived threats only checks attacking pawns in the case that the other pawn wouldn't normally be hostile. This wouldn't be a problem in most cases since in realistic combat scenarios, both pawns would pass a hostility check and thus both receive adrenaline, but if you have two colonists and order one to attack the other while the other stays still, only the attacking pawn gains adrenaline. I guess this is a potential cheese tactic, but OTOH it could be worth changing just for the sake of completeness and hey, who am I to limit what one wants to do to give their pawns a rush?
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-21)
Post by: Brightsideguy on July 21, 2019, 07:28:03 PM
Ooooh, my apologies, I had assumed the pain was the main calculator.   Eh, I feel like forcing your own colonists to attack another is already a weird scenario, and not worth you changing your system to account for.

....unless there's something like, an explosion near the pawn that causes massive damage to the pawn. If that doesn't get their adrenaline pumping, maybe that'd seem weird?   But again, I'm not inclined to say its worth dealing with.  Combat seems like the main reason for adrenaline to have importance anyways.
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-21)
Post by: XeoNovaDan on July 21, 2019, 07:44:50 PM
@Brightsideguy - Yeah, the main calculator's actually just the total 'significance' of a threat that a pawn faces, with damage being supplementary. Either way, I'm already working on trying to implement a solution to account for the melee case since that's bugging me now  ;D
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-21)
Post by: XeoNovaDan on July 21, 2019, 09:11:35 PM
Alright, I've made a new commit to the development branch which addresses the melee attacking thing. I'm also working on opening more stuff up to XML via new DefModExtensions such as adrenaline's severity characteristics, but for now, I've only opened up melee damage multipliers.

Too tired to do a proper release, but a technically updated version does exist. Link for convenience: https://github.com/XeoNovaDan/Adrenaline/tree/development
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-22)
Post by: XeoNovaDan on July 22, 2019, 08:35:04 AM
Just pushed yet another new update. This one's just minor balance tweaks, bug fixes and internal changes

Change log:

Balance:
    Increased melee damage modifiers for adrenaline:
    Adrenaline gain from taking damage is now scaled by the injury's pain caused instead of by its severity and a constant

    Increased tiredness penalties for adrenaline crash:
Bug fixes:
Technical:
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-23)
Post by: XeoNovaDan on July 23, 2019, 06:14:57 PM
Pushed another update today, another fairly minor one

Changes:
* Fixed bug where when a colonist hunts, neither the colonist or their target gains any adrenaline
* Animals now also consider their health and their target's health when determining threat significance
* Colonists now also consider age's body size multiplier when determining threat significance
* Slightly reduced the maximum duration of adrenaline crash
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-23)
Post by: Brightsideguy on July 24, 2019, 06:37:00 PM
Been playing with the mod for a bit now. After a specific fight I had, I feel like adrenaline crash length may need to be toned down and I think being behind cover /having no injuries / being in your own base should factor into how high the adrenaline rush could get to begin with.

Its weird to have had a group of 5 fight against a single tough wild animal (barbslinger via a mod), shoot from the comfort of a killbox, win without a single injury, and then be crashing for several hours afterwards. On top of that, an older gent (who wasn't firing anything) and a baby animal had a heart attack after fight and everyone had a severe crash after. It felt like way too many consequences.  Especially considering one is fast asleep for maybe 4 hours and still at a severe level.
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-23)
Post by: Brightsideguy on July 24, 2019, 06:38:31 PM
Woops.  Missed the update.  So above statement is only for the version before my comment a day or so ago.
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-23)
Post by: XeoNovaDan on July 24, 2019, 06:48:08 PM
@Brightsideguy - A very good point with cover actually! I'll try to get that one in at some point. Injuries are already effectively factored in since part of the formula in determining a threat's 'significance' is each pawn's 'SummaryHealthPercent', and I'll consider a map's owning faction check but that might not get in.

Yeah, adrenaline crash isn't as harsh now. It stays at peak severity for about 30% less time (maximum of 42000 ticks/16.8 hours -> maximum of 30000/12 hours) and drops in severity 25% faster than previously (0.4 per day to 0.5). I did also actually reduce the chances of heart attacks by about 30% with extreme adrenaline rushes (MTBDays from 1.2 to 1.7) but forgot to mention that in the change log.

Thanks!
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-26)
Post by: XeoNovaDan on July 26, 2019, 10:26:39 AM
Updated to Release Candidate 8

Change Log:
* Reworked adrenaline gain from taking damage; target severity and severity gain rate now spike upwards for a very short period of time (half an ingame hour or about 20 seconds per hit) instead of adrenaline being applied instantly
* Pawns that are hunting or otherwise attacking other pawns that aren't fighting back view their victims as only 1/3 as significant of a threat - mainly to reduce extreme adrenaline crashes for hunters
* Manned turrets and pawns manning turrets are each viewed as 1/2 of a threat (for 1 threat collectively instead of 2)
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-30)
Post by: XeoNovaDan on July 30, 2019, 03:12:11 PM
Updated to Release Candidate 9. This just fixes an issue with Prepare Carefully
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-30)
Post by: XeoNovaDan on August 01, 2019, 07:18:37 AM
Alright, things are looking pretty good here. I'm probably going to go for an official release either later today or some time tomorrow - thanks for the feedback people!
Title: Re: [1.0] [BETATEST] Adrenaline! (Updated 2019-07-30)
Post by: XeoNovaDan on August 02, 2019, 05:08:34 PM
This mod has now been officially released. Thanks for the testing and feedback everybody!

Ludeon thread: https://ludeon.com/forums/index.php?topic=29503.msg462493#msg462493
Steam workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1823138604