Liberty specialist bug

Ahriman

Tyrant
Joined
Jun 8, 2008
Messages
13,266
Location
Washington, DC
What's the status of the Liberty specialist bug - the one that gives +2 production to all specialists, rather than to a single specialist? This policy is really game-breaking, and means that civs that don't choose Liberty basically have no chance. It also makes it really hard to evaluate the game economy if you're using Liberty.

Any chance this bug could be prioritized?
 
I presumed the code would be similar to what is used for guruship (if applied to a policy rather than a belief). If that helps. I agree it's one of the last major bugs from GEM.
 
This is not technically a bug, but I understand what you mean. The original plan was +3:c5production: for cities with a specialist, but I don't believe we can get the AI to recognize that without changes to the game core. This is why I instead nerfed all specialists -1 yield and added +2:c5production: per specialist to the policy. The current effect is somewhat weaker than the original plan, but the AI understands it.
 
As another question about intended implementation issues... is the VEM 75% threshold coming back for national wonders? (Or has it been in and I just hadn't noticed in a while)
 
I intend to do that when I can. The ProductionPopup file changed a lot in G&K, and my initial attempts at compatibility were not successful. The other thing I did for that file was sorting the production lists by flavor and name. The default game has no sorting at all... it just shows things in whatever order they appear in the files.
 
I recalled they changed it a lot, wasn't sure if you had had time to look back at it. Higher priorities out there, but it definitely makes them more useful for wide-play also (Both of those when addressed would help wide in some sense).
 
Huh, so this is not a bug, and is intentional?

Okay, well, it was certainly fun to play with, but... Liberty is the found-lots-of-cities branch. Tradition is the few-big-cities branch and Freedom is the lots-of-specialists branch. Doesn't really feel right putting a boost like this in Liberty.
 
Consider players Alice and Bob:
  • Alice has a tall empire with a large capital producing 30 :c5production: per turn. Changing a village-worker to an engineer increases city production by +10%.
  • Bob has a wide empire with many small cities with 6 :c5production: per turn. Changing to an engineer increases city production by +50%.
I believe flat bonuses like +1 production are better for wide empires because they give a proportionately greater boost for small cities (like the liberty finisher). I think percentage bonuses help tall empires more than wide, since the percentage affects a larger number (like the tradition finisher). I also believe great people help tall more because great people provide per-nation benefits instead of per-city.

This is why I designed Liberty to use specialists for flat yields, while Tradition uses specialists for percentage great person increases.

Freedom focuses on large cities in GEM, not specialists like in vanilla.
 
I agree that flat yields are better for wide than tall, and your guruship-like approach was neat for that - if you're going wide-and-short, you want to avoid food, so one or two specialists is optimal. And under that setup, your Alice-and-Bob example is completely right. But when you had to change it to something the AI could work with, it became

But Alice has way more than one specialist slot available in that 30-hammer city, and she gets the bonus for each one.

OTOH, there is something grossly satisfying about these specialists with Korea. +4 yield per specialist in the Classical era, plus the farm spam to feed them.

I'm not convinced that GP help tall more? I can kinda see both sides.
 
Great people favor tall empires because we can concentrate :c5greatperson: generation in one city. If many cities produce GP points, a majority of those cities will never produce a great person. Some cities produce a GP first, which increases the threshold required for the next GP, and that threshold goes up faster than the weakest cities can reach it. Tall empires use more :c5greatperson: points they create, while most GP points in wide empires go wasted.

I believe tall empires have more specialists per city, while wide empires have more cities with specialists. Tall might have one city with Smithy and Factory, while wide has two cities with Smithies. I think the total number of specialist slots is about the same in either empire.

In addition to these other considerations, the Liberty tree has numerous advantages for wide empires, while the Tradition tree is focused on tall empires. Players can theoretically get both finishers, but that strategy should be weaker than spending the points on more useful policies.
 
+2 hammers on all specialists, from very early in the game, is incredibly strong, and is very out of flavor for wide empires.

We have discussed this before at length. There was widespread opposition to any specialist bonus for Wide-empire trees, but the +production for one specialist was accepted as a compromise. +2 production on all specialists is not a compromise, it pushes Liberty into a very specialist-oriented playstyle.

I don't think specialists should be about basic yields at all, I think they should be about great people. Adding 2 production to them means that they produce higher yields than working tiles. So tiles and improvements and terrain become totally unimportant. Food is the only important yield, everything else you can get from specialists.

It's game-breaking.
 
This is weaker than the original plan for wide empires with 2 specialists per city. Cities in the original plan had 11 yield from specialists (4*2+3), compared to 10 yield in the current setup (3*2+2*2). I do not believe wide empires work 3 specialists per city very early in the game.

Specialists having 1 role (tall) or 2 roles (tall, wide) is a discussion you and I had for years. I think we're both rather set in our philosophies about that broader topic. :)
 
Just as a curiosity then, how was the original intended design implemented? My observation would be that the AI does use specialists if its city AI is anything like our own (left to its own devices). It would receive a bonus even if by accident probably most of the time. I'd suggest the alternative of maxing specialists is something less probable to teach the AI to do (and I agree it pushes liberty toward heavy specialist use).

If we can't teach the AI to use a base city bonus, is this because the code for using guruship is hardcoded in as a beliefs bonus rather than something the AI recognizes as bonus production?
 
Effects have 3 parts:
  • 1) the data
  • 2) the code which makes the data do stuff
  • 3) the code which tells the AI how it works.
We can do 1 and 2 without a core mod. The third part requires a core mod. AI stuff already exists for "specialists give higher yields" and "beliefs give yield with any specialist." There is no AI part for making policies give yield from any specialist.

Here is how Guruship works.

1) This data says the Guruship belief gives 2 production when the city has any specialist:
Code:
<Belief_YieldChangeAnySpecialist>
  <Row>
    <BeliefType>BELIEF_GURUSHIP</BeliefType>
    <YieldType>YIELD_PRODUCTION</YieldType>
    <Yield>2</Yield>
  </Row>
</Belief_YieldChangeAnySpecialist>
2) This part of the core checks that data, and adds production to cities with the belief and a specialist. This part is easy with a non-core mod.
Code:
int CvReligionBeliefs::GetYieldChangeAnySpecialist(YieldTypes eYieldType) const
{
  CvBeliefXMLEntries* pBeliefs = GC.GetGameBeliefs();
  int rtnValue = 0;

  for(int i = 0; i < pBeliefs->GetNumBeliefs(); i++)
  {
    [B]if[/B]([B]HasBelief[/B]((BeliefTypes)i))
    {
      rtnValue += pBeliefs->GetEntry(i)->[B]GetYieldChangeAnySpecialist[/B](eYieldType);
    }
  }

  return rtnValue;
}
3) This part of the core tells the AI the data is important. This is impossible to add or change without a core mod.
Code:
int CvReligionAI::ScoreBeliefAtCity(CvBeliefEntry* pEntry, CvCity* pCity)
{
  ...
  
  // Specialist yield change
  [B]iTempValue [/B]= pEntry->[B]GetYieldChangeAnySpecialist[/B](iI);
  if(pCity->getPopulation() >= 8)  // Like it more with large cities
  {
    iTempValue *= 3;
  }
  iRtnValue += iTempValue;
  
  ...
}

I was avoiding core modding because I estimate it will take 100-150 hours over several weeks to translate the main parts of the mod from lua (used for non-core mods) to c++ (used for the core). It might be necessary effort, though. It would definitely speed up the mod because c++ is dramatically faster than lua. :think:

The setup was originally 4 yield specialists with the policy giving +3 for cities with a specialist.
 
Sounds like something that might also be easier to distribute by farming out too. C++ is probably more widely known for coding (from my amateurish perspective).

My concern with this one in particular is partly that I think the current design is a) imbalanced (against the AI, as Ahriman points out, if they don't take liberty most games they're probably hosed and non-competitive) and b) not a compromised approach toward the intended design. It's a completely different approach.

Having it active in the non-core method in my view would still be imbalanced against the AI because it would only randomly have the bonus, but I'm not sure it would be as imbalanced as the current structure is because of how powerful a policy this is right now. So far as I can tell, the AI should use specialists in cities with the normal city AI (based on how that AI manages our cities with specialist slots). This would mean it would get the bonus a good chunk of the time, it just wouldn't prioritize keeping it as much as it should.

I wouldn't say it's a high priority fix, especially given the hours involved. But it's something to keep in mind if it does get converted over as a core-mod over time (or work distributed to coders to help out with the load).

Or we could open up some debate over how to amend the policy again for the short-term (but that was messy with fortified positions). I'm pretty sure there's higher priorities to get the mod polished and debugged at the moment than revisiting the philosophical schisms.
 
I don't see how this is even an open question.

The policy makes specialists generate higher yields than working tiles. Why work a mine for 3 or 4 production when you can have a specialist with 5 production and 2 great people points?

The main effect of the Liberty Finisher is the free great person. That is a big advantage in the early game (note that it allows generation of a great prophet, and so an early religion). The specialist effect is supposed to be a mild secondary effect mostly for flavor. Instead, it is one of the most powerful policies in the game, particularly for coming so early.

So yes, even in wide empires, I run cities with 5+ specialists because of the Liberty policy from ~the medieval era. There are a lot of slots out there, particularly for coastal cities. I don't need to work any tiles except bonus/luxuries and farms and coasts.

I understand it may be hard to fix, but then I would remove the effect completely in the meantime, or make it temporarily + production per city. That would be much less unbalancing than the current effect.
 
Just to clarify this "I wouldn't say it's a high priority fix" is meant to imply that I'd rather see the proposed/intended policy setup (+3 production per city) implemented in the meantime than keep the +2 per specialist active until such time as the core-mod approach is in the works. If that change can be done simply enough. I put this as a lower priority change than bug fixes and other polishing effects that may be simpler but something to keep on the table.

I think we had relative agreement that was a sensible compromise for how to deal with the specialist/tall/wide divisions. The current structure is not as it pushes too far into the "always use (many) specialists" portions of the strategy arc.
 
Why work a mine for 3 or 4 production when you can have a specialist with 5 production and 2 great people points?

Mines were overpowered, and this policy makes them less important, which improves game balance. It's no longer critical to start near mines.

The specialist effect is supposed to be a mild secondary effect mostly for flavor.

The specialist effects are designed as the main game-changing bonuses on each finisher. They separate specialists into two roles: great people (tall empire tradition finisher) and yields (wide empire liberty finisher). The other finisher effects have secondary importance. I don't think we will make progress to get into the philosophical discussion of the desired roles of specialists again. :)
 
Mines were overpowered, and this policy makes them less important, so it improves game balance.
I disagree that mines are overpowered - I just think that villages are slightly underpowered because they are gold + science rather than 2 gold.

But even if that were so, then you would deal with the problem by changing mines. Not by creating an overpowered policy that only ~1/3 civs will take. And not by boosting specialists, which doesn't address mine vs other improvement, or specialist vs other improvement.
Villages also don't make sense when I can get 3 gold + 2 production + 2 GPPs from a merchant.

My goal was for the specialist bonus to be the main effect, not flavor.
I don't think this is what was discussed at the time. I think there was general agreement that the free great person in the early game was very powerful and a fun way to give a great person to Liberty civs who otherwise might have fewer great people.
I think that should remain in place.
But to do so means that it is the primary effect of the policy, and so any other effects need to be weak. If you insist on having another primary effect on the finisher (and one which can easily give +6 to +10 production per city), then you have to remove the free great person.

But as many of us argued at the time, I still think that forcing Liberty players into a specialist-focused playstyle is bad for the game. We agreed on a boost that would encourage players to use one specialist per city. That is totally different from pushing Liberty players into primarily using specialists, and making it so that Liberty players mostly don't need to work tiles except food and bonuses.
 
For some of the earlier discussion, see for example
http://forums.civfanatics.com/showthread.php?p=11755400

http://forums.civfanatics.com/showthread.php?t=470381&highlight=liberty+specialist+finisher&page=18

And if you remember we had a lot of discussions about policies that gave boosts of +1 yield to a particular type of specialist, which are far weaker than +2 yields to all specialists.

The effect was originally proposed as +3 production cities that have a specialist, and it was intended to be a minor part of a policy where the main effect was +1 happiness in connected cities.
http://forums.civfanatics.com/showpost.php?p=11757592&postcount=368
 
Back
Top Bottom