Progress update- Brain Reactions done!

Huge apologies for missing several weeks of posts. My life got stressful, and I went back to my bad habit of quietly working on code and ignoring everything around me. No excuses here- I just gotta improve my stress management strategies.
Good news though! I've been working on the Reactions systems. It has two parts- the Brain's side and Body's side. I finished the Brain's side. It is... a lot of logic, quite technical, but very exciting.
It's also all just code, so I'll do my best to explain if you're interested. If you wanna just wait to see it animated though, that's valid lol. I am a nerd for this stuff >.>;

The simplest Brain Reaction
You define a Reaction on the Brain. It has conditions for triggering. For example, the character feels at most 20% 'happy', 30-80% 'exhausted', and exactly 0% 'nervous'. 
In game, those 3 conditions get evaluated. If they all pass, then we find the average strength they're all passing (so 10% 'happy' and 55% 'exhausted' would be passing at exactly 50% overall). Then that Reaction + average strength gets passed on to the body, which will play the correct animations.
Cool, but limited. We need to support a character who can make tons of unique facial expressions. Each different expression is one Reaction. If 13 Reactions have their conditions met, the character's face will be displaying a mix of 13 different expressions, which will just inevitably be an accidental meme face. 
So we use Reaction Pools.

Reaction Pools
A Reaction Pool is a list of Reactions ordered by priority. Higher priority Reactions override lower priority ones. While this is important for "strong" reactions that should override everything else (like the face made while unconscious, for example), the coolest part of this is defining mixed expressions.
For example, imagine our character is nervous, being tickled, and being edged all at once. There's one expression for being nervous, one for being tickled, etc. If we just said "make a face that's 33% of each of those expressions" then the result would be an unpredictable and probably dumb-looking face.
So instead, we can make a higher-priority Reaction that triggers when all 3 of those conditions are active. A unique 'nervous-tickled-edged' face. Now I can define a specific facial expression to that exact scenario, and it'll trigger instead of making a procedurally-mixed face. 
Okay, but we still want to make use of procedural expressions, even if there's an exact face for this highly-specific scenario. So on each Pool, we define how many "primary" reactions to use. For the face, we (currently) use the top two strongest Reactions in the Pool and blend those together. 
So a 'nervous-tickled-edged' expression would be our strongest, but then maybe the individual 'edged' expression is getting stronger by the second, and so it would make that part of the mixed expression stronger and stronger.

Underlying expressions
This is already pretty good, but we can do better. Even tiny motions on the face can convey a lot. We still want to show a hint more than just the top 2 expressions. But as mentioned, too many complicated expressions mixing together will just look confusing and bad. So if we want to show the hint of an underlying emotion, we need that underlying expression to be very simple so it mixes well into anything.
The solution: 
Each normal expression defines a "simplified" version of itself. So 'pain', 'anger', 'distress' would all simplify to a simple 'negative' expression. If the character is feeling several negative things, but those don't sneak their way into the top 2 expressions, then a hint of the simple 'negative' expression will creep through depending on how strong they feel it.
We can define how many "primary" and "underlying" expressions to use in the data where we create all these expressions. This is a core engine feature and it's not specific to facial expressions, just any Reaction at all. For the face, I want a lot of complexity, so I'm using 2 primary and 1 underlying expression. But for simpler things like ear motions, we'll only have 1 primary and 0 underlying reactions. 
Right, very cool, but there's more to this. I don't need to have only one Pool for facial reactions. After all, blushing isn't really a facial expression like smiling. It should be triggered by completely different conditions. So I can have a separate Pool for blushing. Multiple Pools of varying complexity can overlap.

The overlapping complexity of Pools
Pools add overlapping complexity without everything blending together into uncontrolled mush. The face will use 4 pools. One for the main facial muscles/expression, one for the pupils (like its size, turning into hearts, shininess, etc), one for blushing, and one for handling tears. If I need more/less I can just add another Pool to the game data without touching code at all.
Each Pool controls its part of the face using different logic, so the face can be super dynamic while still maintaining tight control overall. 

Conclusions
Yep, that's where we're at. It was complex. And I need to do a bunch of testing to make sure I'm not missing anything. But I'm very satisfied with how this came together.
Next, I work on the Body Reactions. So the Body's Expression Reactions system will take every Reaction that comes from the Brain tagged as an 'Expression' and turn them all into one singular expression using our facial 'bones/muscles'. 
The last link in this chain is the animation system, which turns the positions of those bones/muscles into actual animations to play on the rig. Thankfully this part's already coded, so it's just that middle step left... plus lots of testing.

But, well, that's it. This is the final feature before I stop, clean up the current set of mechanics, and release the first playable build. I am equal parts hyped and exhausted lol.

...and that's all for now!
I've been utterly destroyed by sleep issues lately. I'm in the process of getting better treatment. It's stressful right now though, cause I never know if I'm gonna wake up and be rested or be worse off than if I'd just stayed up all night. It's impacted my work and personal life a lot. Without my partner's support and patience I'd have completely collapsed without knowing I needed to seek help in the first place.
But instead, I'm making it through, and feel proud of the progress. It's frustrating to not have visual examples for such a big step forward, but that's the next thing I'm working on. 
I really can't fathom how I'd be able to make this stuff work without the insane amount of dedicated support y'all are giving me. Thank you. I'm extremely excited to use this engine in this and many future games. It's thanks to you peeps that this engine's anything more than the silly lil sandbox it started as. 
<3