NokiMo
ancestress
ancestress

patreon


1.7 Delay: Soft-lock bug. (With explanation!)

(LONG POST WARNING. TL;DR: 1.7 is delayed until I fix a softlock that occurs because Darkest Dungeon's AI is weird and particular.)

Hey lovelies! The bug is persisting. My patch simply made it significantly less likely to occur - but still entirely possible. That's not good enough for me.

So let's break it down. What the heck is going on here?

1 - Crimson enemy uses a 'Catch' move.
2 - There is no heroine with the curse available to target.
3 - The Catch move fails, and the engine doesn't really know what to do about that. The move's title 'Catch' persists on screen until any other move is used in combat to clear it out of the queue.
4 - If the fight ends while 'Catch' is still stuck in the queue, the game's engine doesn't know what to do, and doesn't properly call an end to the battle.
5 - You are now stuck in a fight that doesn't end. Oh dear.

Why is that happening? Can't you just make her use a different move?

Sorta. Darkest Dungeon AI works like this:

1 - An enemy's turn starts.
2 - The enemy first chooses a skill to use.
3 - The enemy chooses a valid target for that skill.
4 - The enemy uses that skill on that target.

Here's an example turn for our Crimson Rider's AI:

1 - The Rider's turn starts.
2 - The Rider chooses a skill to use.

(It has a 50% chance to use its grab, a 25% chance to claw, and a 25% chance to use poison.)

3 - The Crimson Rider chooses to use Grab.
4 - The Crimson Rider chooses a target.

5 - Can we use 'Random Target'? Nope. That's for 'Rider_Claw' only. Skip this one.
6 - Can we use that second 'Random Target'? Nope. That's for 'Rider_Poison' only. Skip this one.
7 - Can we use the third 'Random Target'? Nope, it has its base chance set to -1, so we never use this.
8 - Can we use 'Vampire Target'? Yes! One of the heroines has the crimson curse, so let's pick her to be the target of 'Rider_Grab'!
9 - The Grab attack is launched, and is a success! Yay!

... But wait, what if there isn't a valid heroine for step 8? Let's go back.

8 - Can we use 'Vampire Target'? Nope. None of the heroines has the crimson curse, so we can't find a target this way.
9 - ... Uh -- we... we uh-- well. The attack launches and doesn't find a heroine. We'll just launch the attack without one, and forget to clear the queue. This shouldn't be a problem if another move ends up in the queue.
10 - A different enemy launches a skill. The queue is cleared.
11 - The fight continues.

... But wait just a second, what if the fight ends there? Let's go back.

9 - The attack launches and doesn't find a heroine. The queue isn't cleared and we have an attack waiting to go off.
10 - The Crimson Rider dies to a DoT (for example) and the fight ends with 'Catch' still stuck in the queue.
11 - The engine is waiting for 'Catch' to resolve.
12 - The engine is waiting for 'Catch' to resolve.
13 - The engine is waiting for 'Catch' to resolve.
14 - The engine is waiting for 'Catch' to resolve.

... And thus we have our softlock.

But what can we do?

If you're stuck, remember you can always put -forcetown in your launch parameters and the game will boot you back to the Hamlet safe and sound.

How can you fix this, Ancestress?

1.7a simply made it way less likely for this situation to occur, by making sure the Crimson enemies can only use their grab if they have at least one ally with them at the time. But what if they both die to a DoT? It can happen - it's rarer, but we will be left with a softlock again.

If I simply remove the '-1' random target chance, the game's AI will fail.

If I add a new random target chance, there will always be a chance that 'Catch' will target a heroine without the curse, breaking the immersion of the fight. It's better than a softlock, sure, but we can do better than that.

So, new idea: What if I make a guaranteed action that occurs immediately after a failed catch?

It's entirely possible with bonus initiative desires using the 'last_skill' parameter. What I'm going to do is have the Crimson creature's AI always get a bonus action right after it uses Catch. One of two things will happen:

1 - If the Catch is successful, the creature will transform into its captor_full variant, and the bonus action will cease to be. Success!
2 - If the Catch is unsuccessful, the creature will be get a bonus action immediately forcing it to use a non-grab move, which will hopefully clear the queue and prevent the softlock from occurring.

I'm going to give this a go tonight and publish a new hotfix, but I'm afraid until the softlock is gone, I can't publish 1.7 publicly.

I don't like to release broken updates. Please be patient with me!

Kind regards,
Ancestress.

Comments

Hello, I'm new here and interesting in getting this mod, but I must know if this mod works with other skin mods. I'm looking to get some Niur skins and wondering if they work with your game. Thanks for your time.

Cactus22

Thank you! I like to think breaking things down into simple terms is one of my talents! ❤

Ancestress

I've got to say for backing a "smut" game, I have been really impressed with your timely updates and transparency. This post was a delight to read through even as a person who's only knowledge of coding is very limited. I also think that you do a very good job of explaining why something is not working or why certain features cannot be implemented, which is also appreciated.

Scar3dCr0w


Related Creators