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: :

unit | available | FF | BB | SS | RR |

spear | 0 | 0 | 0 | 0 | |

sword | 0 | 0 | 0 | 0 | |

axe | 0 | 0 | 0 | 0 | |

archer | 0 | 0 | 0 | 0 | |

light | 0 | 0 | 0 | 0 | |

marcher | 0 | 0 | 0 | 0 | |

heavy | 0 | 0 | 0 | 0 | |

ideal cap | 0 | 0 | 0 | 0 | |

res. per run | 0 | 0 | 0 | 0 | 0 |

res/hour | 0 | 0 | 0 | 0 | 0 |

hour/run | 0 | 0 | 0 | 0 |

## Integration (approved under **T13915666**)

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)`

.

World | duration_factor | game_speed | unit_speed |

zz1 | 0.8845033719 | 1.25 | 0.8 |

nlp9 | 1 | 1 | 1 |

nl71 | 0.6830201284 | 2 | 0.5 |

nl72 | 1 | 1 | 1 |

nl73 | 0.9045869428 | 1.2 | 0.8 |

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.

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

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!

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!

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?

Thank you very much!

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!

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!