I caught another oversight in my reading through of Toady's wall of text description... I misread how the odds of a research credit changes as they complete more cycles...

it rolls 0-50 vs. the number of completed cycles minus 50

So the first 50 research cycles have 0 odds of getting any research credit, and the 100th research cycle has 100% odds? If so, I vastly misread it. It still takes a while, but this means the first 50 cycles will have no research credit progress, the next 50 cycles will have an average of 50 credits progress (as I calculated) and the 100th and greater cycles will all have 100 credits progress per cycle (twice as fast as i calculated). I suppose I could try using the dfhacl script you gave to check this?

Yes, this is correct. I've seen my test scholar switch topics when they were at the start of research, but didn't finish their first ponder, going to sleep, and then getting back and having switched topics..

Toady didn't specify if Dwarfs switch topics after taking breaks, only that when do sequentially cycles of pondering there is a 2% chance to switch topics. I suppose this could be tested with Dwarfs modded not to need sleep/food/drink and careful monitoring of the number of days they spend pondering (presumably each day corresponds to a cycle of pondering?)

Unfinished sentence?

Opps, I mean that if a dwarf, on average (with no food/drink/sleep breaks?) makes a breakthrough half the time, and switches topics of pondering the other half, then that means that the 2% chance of switching topics only starts getting checked after they have accumulated enough research credit to also have a chance of breakthrough.

No, the wiki has all 313~ topics, determined by dfhack, that diagram as well is just the names determined via dfhack, it doesn't actually show the techtree. The dev quotes suggest that topics in one branch determine whether topics in another can be chosen, and it's pretty clear there's a relationship between the astronomy topics in the astronomy branch, and those in the engineering branch. I've also sort of noticed some others, like economic maps always showing up after gaining the topic of maps, and so forth.

Ah... I looked at an old section of discussion on the wiki and misinterpreted the .svg on the Topics page. In the case, that dependencies will be really hard to map out. Your civilization can start with topics already known right? So you either need a fresh world with no topics known yet, or you need to check in legends viewer beforehand and map out the knowledge that way? And not researching a topic doesn't rule out that it is available. So they best we can do through experimentation is determine which topics have no prerequisites? I guess a dfHack script is the way to go. Or just get Toady to outright give a map of the tech tree.

I've mostly been busy trying to figure out what skills are used for what topic right now. I also have enough experience now to understand that topics are chosen based on the highest rank of scholarly skill(once a scholar gains a proper rank in a single scholarly skill, they'll continue on pondering about those). Going through this I noticed that it sometimes requires multiple times of failing to advance a field before they'd get the topic, which is why I asked the fotf question. And then we got the full algorithm

Nice going with that! So a way to test this quickly is to embark with Scholars that only have single scholarly skills and then run a fort for a few years to see what topics they breakthrough on? If so I can help with that. What skills have already been investigated, what skills still need to be tested? While I am at it, I can try modding the dwarfs to have no need for sleep/food/drink to get them to ponder nonstop to test my assumptions about Toady's descriptions of the algorithms under more controlled conditions.

Also, with the way topics can switch after breaks or even just by chance, it seems that unskilled dwarfs with no scholarly skill will randomly change topics among too broad of a total pool of topics to ever actually make any breakthroughs (313 topics, randomly going from one to another, means an unskilled dwarf will almost never complete a breakthrough on anything). Whereas at least a skilled dwarf will go back to the same category/skill of topics. Also, do existing discussion put dwarf onto that topic? If so, discussion could be used to keep small group of Scholars focused on particular topics even as individual dwarfs in that group take breaks.

Edit: Okay I redid the calculations... they got a lot worse:

With zero contribution from skill rolls it takes an average of 50+8.54 cycles to get a breakthrough credit. This means an additional breakthrough dice every 1464 cycles for level 1 topics, every 2528 cycles for level 2 topics, every 5056 cycles for level 3 topics, and every 10112 cycles for level 4 topics. From that point, it is an average of 2528 cycles to get a breakthrough, or to switch intentionally topics.

I got 8.54 cycles with the following Matlab code:

`odds_of_finishing_at_ith_cycle(51)=0;`

odds_of_finishing_at_ith_cycle(1)=0;

expected_value=0;

for i=1:50

odds_of_finishing_at_ith_cycle(i+1)=(.02*i)*(1-sum(odds_of_finishing_at_ith_cycle(1:i)));

expected_value=expected_value+odds_of_finishing_at_ith_cycle(i+1)*i;

end