Update colony_integrator.md (updating description)#118
Update colony_integrator.md (updating description)#118adriansmart69-debug wants to merge 4 commits into
Conversation
Making the description clearer for the "progress" and "status" variable for getResearch(). Signed-off-by: BudgiusTarquin <adriansmart69@gmail.com>
Signed-off-by: BudgiusTarquin <adriansmart69@gmail.com>
| | children: `table?` | A list of any child research | | ||
| | progress: `number` | Research progress | | ||
| | children: `table?` | A list of any child research | | ||
| | progress: `number` | A value between 0 & 72/144/288/576/1152/2304 for level 1-6 researches respectively. Ticks up when the research is in progress | |
There was a problem hiding this comment.
A value between 0 & 72/144/288/576/1152/2304
Is there any reference? If so I believe it is better to link it
There was a problem hiding this comment.
Iirc I straight up stole that from the source code
And yes, a link would be better, but I am not sure what the reference was
There was a problem hiding this comment.
I had to test it out personally. Minecolonies has a very weird bit of code working out the time a research takes. The first level of research takes half an hour, it then doubles everytime. However in game it doesn't tell you exactly how long each research takes. Only to the nearest 15 minutes. I had a devil of a job working out what the progess value actually stood for, which is why i thought the AP code was broken. Remember this is the backend of the code so thats why the numbers are so ugly. I think I found the formula in the code, I can't remember where though.
There was a problem hiding this comment.
The base research time is 60 * 60 / 25 / 2 https://github.com/ldtteam/minecolonies/blob/dd437dcb0dae9f732f33fdca767626742c64e4f2/src/main/java/com/minecolonies/api/research/util/ResearchConstants.java#L25
Which comes to 72 (According to the comment)
The base time of a research is then calculated based of
(BASE_RESEARCH_TIME * this.baseTime * Math.pow(2, depth - 1))
Where base time is depending on the research tree - can be looked up in the data folde rof th emod under data/minecolonies/researches but currently always 1.0
Depth is the The university level for the research. So I assume 1-5
For example for the fertilizer research in the tech tree that has the research level 5
72 * 1 * 2^(5-1) which is 1152
And that fits for every other value the author provided, one for every research depth - some researches have a depth of 6 or are instant
@adriansmart69-debug would you be able to document it a bit with the math I provided?
You can use the math integrations of material for mkdocs, but that's optional
| | children: `table?` | A list of any child research | | ||
| | progress: `number` | Research progress | | ||
| | children: `table?` | A list of any child research | | ||
| | progress: `number` | A value between 0 & 72/144/288/576/1152/2304 for level 1-6 researches respectively. Ticks up when the research is in progress | |
There was a problem hiding this comment.
The base research time is 60 * 60 / 25 / 2 https://github.com/ldtteam/minecolonies/blob/dd437dcb0dae9f732f33fdca767626742c64e4f2/src/main/java/com/minecolonies/api/research/util/ResearchConstants.java#L25
Which comes to 72 (According to the comment)
The base time of a research is then calculated based of
(BASE_RESEARCH_TIME * this.baseTime * Math.pow(2, depth - 1))
Where base time is depending on the research tree - can be looked up in the data folde rof th emod under data/minecolonies/researches but currently always 1.0
Depth is the The university level for the research. So I assume 1-5
For example for the fertilizer research in the tech tree that has the research level 5
72 * 1 * 2^(5-1) which is 1152
And that fits for every other value the author provided, one for every research depth - some researches have a depth of 6 or are instant
@adriansmart69-debug would you be able to document it a bit with the math I provided?
You can use the math integrations of material for mkdocs, but that's optional
Making the description clearer for the "progress" and "status" variable for getResearch().