Tribal Wars scavenge calculator

Enter the amount of troops you have.
Check the raids available. (FF, BB, SS or RR. FF is sometimes also known as LR)
Click submit.
The table will show what troop distribution should be used to achieve either the max amount of resources per hour, or the max amount of resources per run.
It’s possible that some troops are left unused, due to rounding. Use those however you like.

Max time away: :



unitavailableFF BB SS RR
spear0000
sword0000
axe0000
archer0000
light0000
marcher0000
heavy0000
ideal cap0000
res. per run00000
res/hour00000
hour/run0000

Integration (approved under T13915666)

Select what troops you want to send with the checkboxes, then hit “Open calculator” to automatically have your troops filled in. Copy the JSON generated below into “Calculator output” and hit “Plaats calculator output in templates.” to place the troops from this calculator into the templates.

JSON representation of result:

Iterations to achieve result:

This calculator was approved on tribalwars.nl under ticket number T13900636.

If your world(speed) is not here:

Please leave a comment below. In order for me to add a world, I need the following information:
– The name of the world (start of the URL).
– The game speed of the given world.

How this works

In the game javascript the following formula can be found for how much a scavenge brings in:

iCap * iRatio

where iCap is the total capacity of all units, and iRatio is 10% for the first hunt, 25% for the second, 50% for the third and 75% for the fourth.

The following equation is found for the duration of a scavenge:

((Math.pow(Math.pow(iCap, 2) * 100 * Math.pow(iRatio, 2), 0.45) + 1800) * df)

In this formula, df stands for the duration factor. This seems to be loosely based on the world speed. On NL73 it’s 0.9045869428, on NLP9 it’s exactly 1. By throwing the data of the duration_factor and game_speed into google sheets and letting sheets calculate a power trendline, I found that the formula is game_speed^(-0.55).

Worldduration_factorgame_speedunit_speed
zz10.88450337191.250.8
nlp9111
nl710.683020128420.5
nl72111
nl730.90458694281.20.8
World information for duration_factor used to figure out the formula.

This gives the following formula for resources per hour:

iCap * iRatio / ((Math.pow(Math.pow(iCap, 2) * 100 * Math.pow(iRatio, 2), 0.45) + 1800) * df)

This function can be summed four times, with a spread of the iCap (or capacity) for all different ratios. Let’s assume “a” to be an array representing the spread of carry capacity over the four scavenges, where the sum of the 4 elements <= 1. This gives the following:

iCap * a[0] * 0.10 / ((Math.pow(Math.pow(iCap * a[0], 2) * 100 * Math.pow(a[0], 2), 0.45) + 1800) * df) +
iCap * a[1] * 0.25 / ((Math.pow(Math.pow(iCap * a[1], 2) * 100 * Math.pow(a[1], 2), 0.45) + 1800) * df) +
iCap * a[2] * 0.50 / ((Math.pow(Math.pow(iCap * a[2], 2) * 100 * Math.pow(a[2], 2), 0.45) + 1800) * df) +
iCap * a[3] * 0.75 / ((Math.pow(Math.pow(iCap * a[3], 2) * 100 * Math.pow(a[3], 2), 0.45) + 1800) * df)

Now this is a formula that we could start brute-forcing to find the ideal “a”. Once we find that one, we can simply multiply the total capacity by the individual elements of “a” in order to find how much capacity we should send on a given scavenge hunt.

With this initial “a” we calculate how much we’d get per hour, and save this in a variable. After that, we move half of a[0] to a[1]. We also do the opposite. Of those three options, we check which gives the highest revenue and keep that one.

Given that all scavenges are enabled, we'd start with [0.25,0.25,0.25,0.25]. Our second attempt would be [0.125,0.375,0.25,0.25], and our third attempt would be [0.375,0.125,0.25,0.25].

Next up, we do the same, but then with a[1] and a[2]. After that, we do it with a[2] and a[3]. And then we start over.

We keep doing this, until our total revenue does not increase any more. At that point “a” is distributed so that it gives us the ratio of carry capacity required to get the maximum amount of resources per hour. We then calculate that back to how many troops are required to get as close to that required carry capacity, and show this as an output.

7 thoughts on “Tribal Wars scavenge calculator

  1. Goedemiddag Daniel,

    Je rooftochten script ziet er goed uit, de calculatietool heeft me al veel vooruit geholpen. Nu is het echter zo dat wanneer ik het script probeer te installeren door de ‘Download Integration’ button te gebruiken, ik een foutmelding krijg;

    ”Deze site is niet bereikbaar
    https://gitweb.dmvandenberg.nl/Scavenge%20calculator%20integration.user.js?p=tribalwarsscripts.git;a=blob_plain;f=Scavenge%20calculator%20integration.user.js;hb=master#bypass=true werkt even niet, of de pagina kan verhuisd zijn naar een nieuw webadres.”

    Ben nog een beetje nieuw met zo’n soort scripts, maar weet jij of dit verholpen kan worden?

    Alvast bedankt!

    Met vriendelijke groet,
    Rob

    1. Goedemorgen Rob,

      Dank je voor je bericht. Ik had toevallig gisterochtend wat serveronderhoud uitgevoerd, en blijkbaar waren mijn scripts daarmee even tijdelijk niet bereikbaar. Ik heb dit zojuist opgelost, je kan het script nu weer downloaden!

  2. Wow Great calculator thank you!
    When I install the script however, I click “Open Calculator” And nothing happens. What am I doing wrong?
    Thank you so much!

    1. Hi Gavin,

      On what server are you playing? I’m guessing it’s a bug with specific troops being enabled/disabled.

      Edit:
      I have just placed an update that should make the script more robust. Can you try updating it, and then try again?

  3. Thanks for keeping this tool up to date Daniël helps us alot out there with scavenging <3

    I have seen in the scripts section other scripts is there a way to get an english description for it or is it only in netherland?

    Thanks in advance!

    1. Hi Christian,

      I have not provided English translations for any scripts, as I’ve been told that no servers but the .nl servers allow the use of userscripts. If you could provide me with information that proves otherwise, I’d definitely be interested to start working on translated versions!

Leave a Reply

Your email address will not be published.

CAPTCHA ImageChange Image