Research:Dark Sight

From Discworld MUD Wiki
Jump to: navigation, search

Duration

Observations

| duration | modifier                | area | self | target |
|----------+-------------------------+------+------+--------|
|      532 | near a proper party     |  362 |  283 |    362 |
|      532 | near a proper party     |  362 |  283 |    362 |
|      532 | near a proper party     |  362 |  283 |    362 |
|      532 | near a proper party     |  362 |  283 |    362 |
|      532 | near a proper party     |  362 |  283 |    362 |
|      535 | area considered holy    |  362 |  283 |    362 |
|      535 | area considered holy    |  362 |  283 |    362 |
|      528 | far from a proper party |  362 |  283 |    362 |
|      528 | far from a proper party |  362 |  283 |    362 |
|      528 | (none)                  |  362 |  283 |    362 |
|      528 | (none)                  |  362 |  283 |    362 |
|      528 | (none)                  |  362 |  283 |    362 |
|      528 | (none)                  |  362 |  283 |    362 |
|      517 | (none)                  |  353 |  277 |    353 |
|      517 | (none)                  |  353 |  277 |    353 |
|      517 | (none)                  |  353 |  277 |    353 |
|      535 | (none)                  |  369 |  289 |    369 |
|      535 | (none)                  |  369 |  289 |    369 |
|      540 | (none)                  |  366 |  292 |    366 |
|      535 | (none)                  |  362 |  289 |    362 |
|      528 | (none)                  |  353 |  283 |    353 |
|      540 | (none)                  |  353 |  292 |    353 |
|      550 | (none)                  |  362 |  299 |    362 |
|      570 | (none)                  |  362 |  312 |    362 |
|      562 | (none)                  |  353 |  305 |    353 |
|      570 | (none)                  |  362 |  312 |    362 |
|      225 | (none)                  |   79 |  118 |    254 |
|      225 | (none)                  |   79 |  118 |    254 |
|      232 | (none)                  |   79 |  121 |    254 |
|      232 | (none)                  |   79 |  121 |    254 |
|      232 | (none)                  |   79 |  123 |    254 |
|      247 | (none)                  |   79 |  127 |    254 |
|      250 | (none)                  |   79 |  129 |    254 |
|      249 | (none)                  |   79 |  129 |    254 |
|      258 | (none)                  |   79 |  132 |    254 |
|      262 | (none)                  |   79 |  134 |    254 |
|      265 | (none)                  |   79 |  137 |    254 |
|      577 | (none)                  |  362 |  318 |    362 |
|      588 | (none)                  |  362 |  324 |    362 |
|      595 | (none)                  |  362 |  330 |    362 |
|      603 | (none)                  |  362 |  337 |    362 |
|      273 | (none)                  |   79 |  139 |    254 |
|      277 | (none)                  |   79 |  142 |    254 |
|      292 | (none)                  |   79 |  148 |    254 |
|      295 | (none)                  |   79 |  150 |    254 |
|      300 | (none)                  |   79 |  153 |    254 |
|      303 | (none)                  |   79 |  155 |    254 |
|      310 | (none)                  |   79 |  158 |    254 |
|      315 | (none)                  |   79 |  159 |    254 |
|      315 | (none)                  |   79 |  160 |    254 |
|      318 | (none)                  |   79 |  161 |    254 |
|      319 | (none)                  |   79 |  163 |    254 |
|      322 | (none)                  |   79 |  164 |    254 |
|      325 | (none)                  |   79 |  165 |    254 |
|      325 | (none)                  |   79 |  166 |    254 |
|      330 | (none)                  |   79 |  167 |    254 |
|      330 | (none)                  |   79 |  168 |    254 |
|      333 | (none)                  |   79 |  169 |    254 |
|      615 | (none)                  |  362 |  343 |    362 |
|      615 | (none)                  |  362 |  343 |    362 |
|      480 | (none)                  |      |  251 |        |
|      622 | (none)                  |  362 |  349 |    362 |
|      630 | (none)                  |  362 |  355 |    362 |
|      637 | (none)                  |  362 |  362 |    362 |

Analysis

Duration plot

Went with scipy's curve_fit: numpy's polyfit works too, but I guess it's more likely that a square root would be used in the code, rather than a polynomial:

from scipy.optimize import curve_fit
import numpy as np
import matplotlib.pyplot as plt

bonus = [283, 283, 283, 283, 277, 277, 277, 289, 289, 292, 289, 283, 292, 299, 312, 305, 312, 118, 118, 121, 121, 123, 127, 129, 129, 132, 134, 137, 318, 324, 330, 337, 139, 142, 148, 150, 153, 155, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 169, 343, 343, 251, 349, 355, 362]
duration = [528, 528, 528, 528, 517, 517, 517, 535, 535, 540, 535, 528, 540, 550, 570, 562, 570, 225, 225, 232, 232, 232, 247, 250, 249, 258, 262, 265, 577, 588, 595, 603, 273, 277, 292, 295, 300, 303, 310, 315, 315, 318, 319, 322, 325, 325, 330, 330, 333, 615, 615, 480, 622, 630, 637]

def func(x, a, b):
    return a * np.sqrt(x) + b

popt, pcov = curve_fit(func, bonus, duration)
predict = lambda x: func(x, *popt)

p_bonus = np.arange(100, 500)
p_duration = predict(p_bonus)
plt.scatter(bonus, duration)
plt.plot(p_bonus, p_duration, c = 'r')
plt.show()

Then an approximation is: duration = 50.79484076 * sqrt(bonus) - 327.43039153. Could be off by a couple of seconds (possibly some rounding is causing that).

Unsup (talk) 03:24, 6 July 2022 (EDT)