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)

Area=10000000
Treasures=10

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

i=1
foundaccumprob=0
notfoundprob=1
breakpoint=0.1
while True:
    foundaccumprob = foundaccumprob + p(i)*notfoundprob
    notfoundprob=notfoundprob*(1-p(i))
    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)
        break
    i=i+1

"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 …

https://preview.redd.it/neoj3j1rpqv61.png?width=554&format=png&auto=webp&s=55a432a21deea3c769c46df617f9d6baf9441e5f

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 ….

Source: https://www.reddit.com/r/valheim/comments/mzs9ke/how_much_dark_forest_do_i_have_to_explore_to_find/

leave a comment

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