View Single Post
  #9  
Old 08-30-2024, 01:22 AM
Balimon Balimon is offline
Fire Giant

Balimon's Avatar

Join Date: Mar 2013
Posts: 797
Default

Quote:
Originally Posted by bcbrown [You must be logged in to view images. Log in or Register.]
Although converting variables into numbers can make the calculations easier to follow, it will ultimately be more helpful to have a final equation where everything is a variable, so you can plug in different health regen rates, for example, to see how that will change the conclusions. Let's start with the first equation from the section above:
0 = 3500 - 30 * (health_to_burn / 31) - (t - health_to_burn / 31) * 40
30 is the mana burn rate in the first section: 50 - 20, or mana_burn - mana_regen
31 is the health burn rate: 60 - 29, or health_burn - health_regen
40 is the mana burn rate in the second section: 50 - 10, because we're only clicking the robe once every other tick, since each two ticks we will regain 58 health.

Putting these variables back in we get:
0 = starting_mana - (mana_burn - mana_regen_one) * health_to_burn / (health_burn - health_regen) - (t - health_to_burn / (health_burn - health_regen) * (mana_burn - mana_regen_two)

We can unify the mana regen rates by observing that the mana regen in phase two is equivalent to the mana gain from clicking the robe scaled by how many ticks it takes to regain the 60 health cost:
mana_regen_two = 20 * health_regen / 60 = robe_mana * health_regen / robe_health
mana_regen_one = robe_mana

this gives us:
0 = starting_mana - (mana_burn - robe_mana) * health_to_burn / (health_burn - health_regen) - (t - health_to_burn / (health_burn - health_regen) * (mana_burn - robe_mana * health_regen / robe_health))

I'm not going to try to simplify that, but I will plot the graph of mana over time with Python:
Code:
def mana(
    t,
    starting_mana=3500,
    mana_burn=50,
    robe_mana=20,
    health_to_burn=2000,
    health_burn=60,
    health_regen=29,
    robe_health=60
):
    if t < health_to_burn / (health_burn - health_regen):
        return starting_mana - (mana_burn - robe_mana) * t
    mana_spent_phase_one = (mana_burn - robe_mana) * health_to_burn / (health_burn - health_regen)
    mana_spent_phase_two = (t - health_to_burn / (health_burn - health_regen)) * (mana_burn - robe_mana * health_regen / robe_health)
    return starting_mana - mana_spent_phase_one - mana_spent_phase_two

import matplotlib.pyplot as plt
import numpy as np

# Generate x values (time)
t_values = np.linspace(0, 110, 100)  # Adjust range as needed

# Calculate corresponding mana values
mana_values = [mana(t) for t in t_values]

# Plot the graph
plt.plot(t_values, mana_values)
plt.xlabel('Time')
plt.ylabel('Mana')
plt.title('Mana Over Time')
plt.grid(True)
plt.show()
Adding more mana shifts the whole graph upwards, extending the time until mana=0. Adding more health lengthens the first part of the graph.

If you have a Google account you can play around with the assumptions here: https://colab.research.google.com/dr...Yw?usp=sharing

One final note: although I'm assuming canni-dancing the manna robe, I'm not taking into account of medding for mana regen. If you'd like to so do, you can just adjust the mana burn rate per tick to account for that.
Thank you for all this! What an incredible amount of work you've done, so I finally had a chance to dig into your posts and play around with the graphs. It seems to me, after plugging in different numbers that 1 mana is at least twice as effective as hit points in delaying zero mana. Do you think that spam clicking the robe would change the results at all? Are those the results you're seeing as well?
__________________

[ Kurrat - Arch Mage ]
[ Kurrate - Crusader ]
<Legacy of Fire>


Reply With Quote