![]() 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. 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 keep doing this, until our total revenue does not increase any more. Next up, we do the same, but then with a and a. Our second attempt would be, and our third attempt would be. Given that all scavenges are enabled, we'd start with. ![]() Of those three options, we check which gives the highest revenue and keep that one. With this initial “a” we calculate how much we’d get per hour, and save this in a variable. 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. Now this is a formula that we could start brute-forcing to find the ideal “a”. 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 function can be summed four times, with a spread of the iCap (or capacity) for all different ratios. 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) World information for duration_factor used to figure out the formula. I am totally useless at JS, so don't ask me how you actually make one. They are written in Javascript, one of the most common programming languages. 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). What is a script Scripts are codes, which generally aid you playing tribalwars. On NL73 it’s 0.9045869428, on NLP9 it’s exactly 1. If you have an incoming and/or your own command landing on the current opened village, click on the command/incoming and landing time field will be updated to match the landing time of the command/incoming. Press F10 and now enter b again and you should get 2. Doing the same with b, youll get undefined, because at that point in time it hasnt been defined. Anyway put the below into the console: var a 1 debugger var b 2 and in the console enter a, it will give you 1. This seems to be loosely based on the world speed. Get rid of that debugger by resuming execution (. In this formula, df stands for the duration factor. 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) 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. In the game javascript the following formula can be found for how much a scavenge brings in: iCap * iRatio ![]() – The name of the world (start of the URL). In order for me to add a world, I need the following information: All of this (and more) has been baked into the library.This calculator was approved on under ticket number T13900636. The more decisions like this are taken away from the developer the faster she/he can focus the attention on the core business logic of the script instead of having to think about how to solve trivial tasks like how to fetch world data safely, check if the current world has support for archers or not, etc. ![]() What this means is that through this library I try to take away decisions from the user and integrate those decisions into the library. The ideology behind this is based on a principle similar to “convention over configuration”. This is a private project, it is not affiliated or supported by Tribal Wars. This is an unofficial Tribal Wars scripts library. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |