Page 1 of 1

### Tech Tree test script

Posted: 24 Aug 2019, 18:27
I wrote a tech tree calculator that
- Calculates total research time
- Checks if any items are unresearchable
- Ratio of researchPower to researchPoints

I couldn't get the tech-tree-chart-generator script to work but I don't think it calculates total research time, just visualizes the dependencies.

I uploaded it to my Github

Maybe I can attempt to make a pull request to add it to the Warzone tools dir. I don't know Git that well and it would be a good exercise for me to accomplish. Part of the reason I'm working on this stuff is to gain familiarity with Git. Uploading files with commits is easy but integrating and working with others is ???

EDIT:

I'm unable to verify the calculations, it appears WZ is not calculating research times properly...

For example, in T1 full base a player can research the first armor upgrade R-Vehicle-Metals01 that has 1800 researchPoints and it takes 85 seconds to research.

1800/85 = ~21 and this makes sense because the research module has 7 researchPoints and a research facility has 14.

Everything is fine so far...

But then when I research the first research upgrade R-Struc-Research-Upgrade01, the research time for R-Vehicle-Metals01 goes from 85 seconds --> 69 seconds which implies 1800/69 = ~26

How does a research center go from 21 researchPoints to 26 if all research upgrades increase research rate by 30 or 30%???? (21*1.3 = 27 not 26)

Even though all research upgrades increase research by 30 or 30% it would appear as if they're actually increasing by 25% based on the actual research times

To clarify, R-Vehicle-Metals01 takes:

85 seconds with research center and module (1800/85 = 21)
69 seconds with research center and first upgrade (1800/69 = 26)
56 seconds with research center and second upgrade (1800/56 = 32)
49 seconds with research center and third upgrade (1800/49 = 36)

but

21 * .3 = 27
21 * .3 + 27 = 33
21 * .3 + 33 = 40

so it doesn't appear the research upgrade values of 30 are actually 30%....

### Re: Tech Tree test script

Posted: 27 Aug 2019, 02:37
This is due to some confusion with how Warzone's upgrade logic works.

upgrade_value += ceil(base_value * change_value / 100) <=== as taken from rules.js's eventResearched.

Code: Select all

``````The research facility base value is 14.
14 += ceil(14 x 30 / 100)
14 += ceil(14 x 0.3)
14 += ceil(4.2)
14 += 5
19
...
19 += ceil(14 x 30 / 100)
19 += ceil(14 x 0.3)
19 += ceil(4.2)
19 += 5
24
``````
So each research upgrade adds 5 points (all add 30%) to the final upgrade value. If there is a module on the facility, then a bonus constant of 7 points are added as a final step (which does not factor into the above equation, to be clear).

Code: Select all

``````14 [21 with module] - base
19 [26] - 1st
24 [31] - 2nd
29 [36] - 3rd
34 [41] - 4th
39 [46] - 5th
44 [51] - 6th
49 [56] - 7th
54 [61] - 8th
59 [66] - 9th
...
``````
And, assuming a module is on the facility, this should be about how many seconds it should take to research the first kinetic alloy upgrade:

Code: Select all

``````1800 / 21 = 85 seconds
1800 / 26 = 69
1800 / 31 = 58
1800 / 36 = 50
1800 / 41 = 43
1800 / 46 = 39
1800 / 51 = 35
1800 / 56 = 32
1800 / 61 = 29
1800 / 66 = 27
``````

### Re: Tech Tree test script

Posted: 27 Aug 2019, 17:27
lmao, dude... that's exactly how I thought it worked minus the ceil() part lol. I also didn't know this was in rules.js, I thought it was all in stats.cpp

I tried round() but it didn't make sense and I never thought to try ceil()

Alrighty, so I updated the script but I still have slightly different results than the betaguide. Betaguide says dragon takes 81 minutes but I came up with 79. I did verify though that dragon takes 834 seconds with max upgrades and that is the same results I got.

Crab took into consideration things like the amount of time to actually build the research center so it might be a little different.Anyways, I'm not too concerned with it. I needed a way to check if everything is researchable and the results.txt accomplishes that.

This is a print() statement output from what I came up with

Code: Select all

``````R-Struc-Research-Module  {'points': 4200, 'upgrade': 21, 'seconds': 300.0}
``````

### Re: Tech Tree test script

Posted: 27 Aug 2019, 20:28
script is good, but there is something similar at http://betaguide.wz2100.net/Research.php?timeline=1