Bug #817118

Great Library wrongly gets technology from 2 players, not 2 teams

Added by fomalhaut pa about 1 year ago. Updated 5 months ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


ver 2.6.0

The behavior of "Tech_Parasite" effects is strange.


#1 Updated by Alexandro Ignatiev about 1 year ago

It's how it is designed to work - based on count of players, not teams. But, maybe, we really should better base it on teams or players' percentage? (But it hardly will appear prior to v.3.1.)

#2 Updated by fomalhaut pa about 1 year ago

It has changed in ver 2.2.3 (

The effect of the Great Library wonder is by team rather than individual players in teams. GNA#16442

And I confirmed that "Tech_Parasite" was based on the number of teams in ver 2.5.9.
Is this changed again?

#3 Updated by Alexandro Ignatiev about 1 year ago

Probably something was missed in this 2014 commit that makes parasited tech random:

#4 Updated by Marko Lindqvist 7 months ago

  • Tracker changed from Task to Bug
  • Category set to General
  • Target version set to 2.6.2

Alexandro Ignatiev wrote:

Probably something was missed in this 2014 commit that makes parasited tech random:

Yes, it seems to replace 'researches_iterate()' with 'players_iterate()'

#6 Updated by Marko Lindqvist 6 months ago

Marko Lindqvist wrote:

I hope someone can test it before 2.6.2 release.

This would be a good way to contribute without needing to write code.

#7 Updated by Chippo Elder 6 months ago

Test what, exactly? It seems like S2_6 and default rules. Something to do with the Great Library and what techs you receive each turn. What should happen, and what used to happen wrong?

#8 Updated by Jacob Nevins 6 months ago

I'm not involved, but as I read it:

The rule for Great Library in classic ruleset is supposed to be "The civilization which builds the Great Library gets every advance that at least two other teams have achieved."

But, the engine is erroneously counting individual players, not teams.

So, in a game with team_pooled_research and a team with at least two players, if that team learned an advance that no-one else knew (including Great Library owner), the Great Library owner would get that advance, when they should not have got it until a second team got it.

#9 Updated by Marko Lindqvist 6 months ago

Jacob's interpretation is correct, and it actually makes a point I had overlooked. Though we have talked about teams unconditionally, it really requires team_pooled_research to be true. If team_pooled_research is false, individual players within a team count up.

On a related note I checked if the wording in README.effects takes this to account, and it turned to be even worse than I expected. It speaks of "players" (so actually documentation and implementation did agree, only both were different from what has been stated as the intent in the commit messages (the one that changed implementation part to be about teams + the one that maybe-accidentally changed it back)).

#12 Updated by Chippo Elder 6 months ago

Marko Lindqvist wrote:

S2_6 patch version that also updates README.effects.

Yesterday, I took 2.6.1+ (modified b31d594a73) and applied that 0018 patch from this thread and started a game a teamy game of "classic" ruleset. I acquired Marco Polo's Embassy (so we can see who has what) and someone is about to get Great Library (me or one of another 6 players).

Now, that game is still good for testing whether you fixed the bug or not, right? This more recent patch looks like a copy of the 0018 one that I already applied, plus some documentation fixes, yes?

#13 Updated by Chippo Elder 5 months ago

I can confirm that your patch works as desired for the case where another team (of AIs) has the Great Library. I haven't tested the case where my own team has the Great Library yet.

#14 Updated by Chippo Elder 5 months ago

Your patch works for the other case, where I have the Great Library.

In the attached savegame, this is the first turn where I didn't get any tech from the Great Library. You can see that both members of Team 12 have Metallurgy, and the Great Library did not give it to me.

You can close this ticket.

#15 Updated by Marko Lindqvist 5 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Thanks. Pushed.

AFAIK this is the first time a dedicated tester has been credited in our commit messages.

Also available in: Atom PDF