How much Dark Forest do I have to explore to find Haldor? An estimate

Last night I made an estimate of the chance of finding haldor given that x% of the Dark Forest biome has been explored. The valheim wiki ways haldor has ten spawn locations. I think this is a conditional tree problem. I read the khan academy tutorial last night and wrote some python code to solve the problem:

import sys

def printf(format, *args):
    sys.stdout.write(format % args)


def p(i):
    return 1.0*Treasures/(Area-i)

while True:
    foundaccumprob = foundaccumprob + p(i)*notfoundprob
    if foundaccumprob > breakpoint :
        printf ("%7d   %7.4f n", i*100/Area, foundaccumprob)
        breakpoint = breakpoint + 0.1
    if i == (Area-1) :
        printf ("%7d   %7.4f n",i,foundaccumprob)

"Treasures" are the number of spawn locations. "Area" is set to 1M but some experimentation shows that the area really doesn't matter … that is to say if I double the area obviously it will take longer in the game to explore 20% of it, but if I explore 20% of a 1000 tile map or 20% of a 1M tile map the chance of finding Haldor remains. Here are the results I calculated …

ie, if Haldor has ten spawn locations and i have explored 6 percent of the total dark forest biome then I should have a 50% chance of finding Haldor. If I explore 11 percent of the dark forest, then the chance of finding haldor increases to 70%. In fact, at only one fifth of the dark forest biome explored I have a 90% chance of finding haldor.

We all know that the map is really big, but giving Haldor ten spawn locations drastically reduces the amount of biome we have to explore to find haldor.

Let the flames begin ….


leave a comment

Your email address will not be published. Required fields are marked *