# Minimise battle time in Monster's Den

So there is this excellent flash game, Monster's Den. In order to make a high score, I must complete many battles..this question is about battles with the Legendary Monsters.

The target is to reduce the single enemy's HPs to 0 as quickly as possible. To do this, physical damage is very slow (these are strong enemies) - we are going to use poison, which leads in an arithmetic progression style of attack.

## Definitions

T is a time constant used below.

H is the enemy health.

P is the poison attack.

## Setup

The game is turn based. Each turn, each character gets to either make an action (takes T time), pass (do nothing, takes T/2 time), or leave the battlefield without being able to return (takes 0 time).

## Characters

Enemy: Every time will make an attack (which we dont care about) which takes T time. Each round, its HP is reduced by its accumulated poison.

Mariah: Can attack in order to increase the enemy poison accumulation by P.

George: Can make an attack with unimportant damage. There is a 25% probability that nothing else happens, and then the round will have taken T time. Else, there is a 75% probability that Mariah is led to make a follow up attack, causing P as before, and this whole thing will have taken 2T time. As an exception, George may NEVER leave the battlefield.

Regina: Can make an attack with unimportant damage, with 100% probability of leading Mariah into attacking, and this whole thing will have taken 2T time.

## Question

What is the tactic that minimizes the time of the battle? Provide a formula for that minimum time.

From the comments, I gather the question is not clear enough. I will thus pose some thoughts:

In the beginning, one should find the optimal character setup for rapid poisoning. George must always be there, and Mariah must be too in order to poison, so the first question in: is regina's time worth the extra poison she generates?

Near the end, the poison accumulation is so large that increasing it is not worth its time. It is sure that in the optimal strategy, the final step is to have George pass and wait until the poison does its job. The thing is, when is the sweet time spot for each character to leave.

• What kind of formula are you looking for? With what notation? Could you provide an example, non-optimal formula? Commented Sep 29, 2020 at 16:44
• Typical maths based on the constants. If only enemy and mariah was in there, and P was normal damage instead of poison, it would take H/P turns to end, with 2T per turn, so it would be 2HT/P. But poison makes progression maths come in, and after some time chars must leave to let the already accumulated poison act fast. Commented Sep 29, 2020 at 16:47
• What does "chars" mean? What is that final formula (2H/PT) supposed to mean? Why is T in the denominator? It would be most helpful if you edit in more explanation of what the solution should look like. Commented Sep 29, 2020 at 16:49

It gets a bit messy, but in the end it comes down to algebra.

First, yes Regina is initially worth it.

Mariah is an obvious win, and the monster is mandatory. We can lump those together into a 2T action that adds P poison. George is less efficient than that. As such, the combination of all three is less efficient than 2T for 1P. By extension, Regina (who clocks in at exactly 2T for 1P) is worth having, at least initially. This continues to be the case until the monster taking damage ticks starts actually being a significant contribution to the fight. At the same time, Regina attacking (rather than gone) gives you 1 poison per 2 ticks (3/6). George attacking (rather than passing) gives you .75 poison per 1.25 ticks (3/5). Regina should leave before George starts blocking (and George should start blocking before Maria leaves).

So, now, we have three setups to consider. The first is full-court. It adds 2.75P to the poison counter, deals the poison counter worth of damage, and takes 5.75T time. When we swap out Regina, it goes down to 1.75 poison add, deals the poison counter worth of damage, and takes 3.75 time. With George passing, it's 1 poison, one damage tick, and 2.5 time. Once Mariah leaves, it's just a damage tick in 1.5 time, because George is going to pass.

So... monster lifespan remaining is effectively life divided by poison. Each damage tick subtracts one from it, and each poison added divides it by (x-1)/x, where x is the new poison level. initial state is 11/23 poison and 4/23 ticks. After Regina leaves, it's 7/15 poison and 4/15 ticks. George passing is 2/5 poison and 2/5 ticks. After Maria leaves, it's no poison and 2/3 ticks.

So now we consider that total damage pool is ticks times poison, and we don't really care about what the numbers are - just the ratio between them. Each turn spend in each stance will deal poisonFraction times ticks remaining, as increased poison is added that will last that much longer, and tickfraction times current poison, as the poison ticks over and damage is done.

So let's coin D, for "doom factor" - indicating how doomed the poor monster is. D is the amount of poison (measured in maria-hits) divided by the amount of time remaining (measured in monster actions) Thus, the various states produce effective damage as follows: Initial state is (11+4D)/23. Once regina departs, it's (7+4D)/15. Once George starts passing, it's (2+2D)/5, and at the end it's just 2D/3.

Thus, basic algebra tells us that it makes sense for Regina to depart when 165+60D == 161+92D, or D == 1/8 (ie, when the total monster-turns remaining if you sat and did nothing was equal to 8 times the number of poison hits landed). George should start passing at D == 1/2, and Maria should leave at D == 3/2.

• Wow, that took some time to sink in. A pity I have to actually be measuring the hits already received (nominator of D), but having no awkard arithmetic progression formulas is good news! Commented Sep 29, 2020 at 21:17
• @GeorgeMenoutis if they have some "current poison counter" that lets you know how poisoned the critter in question is, you should be able to just track that (and divide by Maria's average poison-per-hit), rather than having to remember how many hits have landed. Commented Sep 30, 2020 at 14:54
• Some nitpicking on an good answer: The discrete nature of the rounds is not taken into account. At the end George should not pass in some cases e.g. if 101 hits remain while the poison is at 100 (and Maria has had her initial turn) Commented Oct 1, 2020 at 9:46
• @Retudin at the end, Maria is going to be gone anyway, so George has no ability to apply poison. It's possible that there are points where the discrete nature could have an impact, but George's randomness is a pretty hard limit on them up to the point where he stops passing, and I can't think of any that would kick in afterwards. It's always better to have Maria stay on for another round rather than have George take a swing so that she can step out a round early, for example. Commented Oct 1, 2020 at 14:00