New Beta Version - March 2nd (3-2)

Status
Not open for further replies.
Well! I finally got an unforced vassalage offer from my neighbor China - probably because they didn't want the same fate as their (soon to be former) neighbors, The Huns. Turns out The Huns aren't very strong against Carthage's navy lol.
 
There is something strange with the Authority policy Honor in my game. What happens is if a city reaches a multiple of 10 pop it gains a free unit, which I normally have no issue with, but in my current game as the Huns this is not happenning in all cases. Cities I have built seem to receive uints but capital of Maya & Singapore didn't. I thought perhaps this only applied to cities you founded but then other cities I had conquered did gain an extra units when reaching 10 pop, so mystified. Also whether being a puppet made a difference, though these two were not. The only other thing I can think of, though have no evidence to prove this, is that the reason certain cities hadn't received a unit was they had already reached that level in size, but lost citizens when conquered. Trouble is cannot remember what size they were, so not sure. Anyone know.
 
If the city was already 10+ pop before you capture them and it grows to 10 pop again it won't give you a unit.
 
If the city was already 10+ pop before you capture them and it grows to 10 pop again it won't give you a unit.

I have a feeling that is probably what happened, though not sure why as a CS firstly doesn't have policies & Mayans had Tradition. The policy doesn't just give a free unit when you reach 10 pop but also if you have reached a multiple of 10 when taking that policy, so surely if neither city hadn't had free units through having the policy, you should still get units as city had reached that size. Not the end of the world, but like putting any free units as garrisons & don't like being robbed :)
 
At least the city of Mhlahlandlela has got a free unit, though what I am going to do with a free Galleas in a pond in the middle of nowhere I have no idea.:)

upload_2021-3-28_10-49-5.jpeg
 
delete it and get free gold :lol:

I can either do that or give it as a gift to a CS I suppose. Annoying really as only have one ship. I remember someone else mentioning this, & informing them I hadn't seen that recently, as usually can do forts to get it to the ocean, but first time this has happened to me for awhile. Other thing I have noticed is when a city has a pond next to it you keep getting advice to build Lighthouses in the middle of nowhere. Pretty annoying when your puppet cities do that.
 
They do count, you can test it pretty easily by moving the ground unit out and looking at your culture, it just doesn't count double.

Naval units are a bit wonky for city strength though, they only count if there is no ground unit so you can sometimes increases the CS by moving a unit out of a city.

Lighthouses do give +1 supply and +4 trade route food so there is some value in making them in lake cities
 
This vassalage thing is really annoying. Please make an option to not play with it in the next version. About to roll back to a previous patch. Thank you for all the work. Cheers
 
This vassalage thing is really annoying. Please make an option to not play with it in the next version. About to roll back to a previous patch. Thank you for all the work. Cheers

I've done that.
 
Fwiw I really appreciate the vassalage change -- I've used it to end wars against AI previously, nice to see this tactic being used effectively by my opponents too. Hope its not going away completely

It's not. But it's nerfed in that the master will now DoW everyone who is currently at war with the voluntary vassal before the agreement takes place.

(I did add code for the AI to be able to handle it; we'll see how well that goes :) )

Code:
/// Do we want to accept ePlayer as our voluntary vassal?
bool CvDiplomacyAI::IsVoluntaryVassalageRequestAcceptable(PlayerTypes ePlayer)
{
   // We will only accept forced capitulation from backstabbers and people who have stolen cities from us.
   if (IsUntrustworthy(ePlayer) || GetNumCitiesCapturedBy(ePlayer) > 0)
       return false;

   vector<PlayerTypes> vTheirTeam = GET_TEAM(GET_PLAYER(ePlayer).getTeam()).getPlayers();
   int iNumCaps = 0;
   bool bWeLikeOneOfThem = false;

   for (size_t i=0; i<vTheirTeam.size(); i++)
   {
       if (!GET_PLAYER(vTheirTeam[i]).isAlive() || GET_PLAYER(vTheirTeam[i]).getNumCities() <= 0)
           continue;

       if (!GET_PLAYER(vTheirTeam[i]).IsHasLostCapital())
           iNumCaps++;

       iNumCaps += GET_PLAYER(vTheirTeam[i]).GetNumCapitalCities();

       bool bWeLikeThem = IsDoFAccepted(vTheirTeam[i]) || IsHasDefensivePact(vTheirTeam[i]) || (GetCivOpinion(vTheirTeam[i]) >= CIV_OPINION_FRIEND && GetCivApproach(vTheirTeam[i]) == CIV_APPROACH_FRIENDLY);

       // We must be stronger.
       if (bWeLikeThem)
       {
           if (GetPlayerMilitaryStrengthComparedToUs(vTheirTeam[i]) > STRENGTH_STRONG)
               return false;

           if (GetPlayerEconomicStrengthComparedToUs(vTheirTeam[i]) > STRENGTH_STRONG)
               return false;

           // If we like them and we can't honestly protect them, then don't agree.
           if (GetPlayer()->GetProximityToPlayer(vTheirTeam[i]) < PLAYER_PROXIMITY_CLOSE)
               return false;

           bWeLikeOneOfThem = true;
       }
       else
       {
           if (GetPlayerMilitaryStrengthComparedToUs(vTheirTeam[i]) > STRENGTH_AVERAGE)
               return false;

           if (GetPlayerEconomicStrengthComparedToUs(vTheirTeam[i]) > STRENGTH_AVERAGE)
               return false;
       }
   }

   // Do not accept voluntary capitulation if we need their capitals to win.
   if (IsGoingForWorldConquest() || IsCloseToDominationVictory())
   {
       if (iNumCaps > 0)
           return false;
   }

   // We must be willing to go to war with everyone they're currently at war with.
   vector<PlayerTypes> vNewWarPlayers;

   for (int iPlayerLoop = 0; iPlayerLoop < MAX_CIV_PLAYERS; iPlayerLoop++)
   {
       PlayerTypes eLoopPlayer = (PlayerTypes) iPlayerLoop;

       if (!IsPlayerValid(eLoopPlayer))
           continue;

       // We're already at war - ignore
       if (IsAtWar(eLoopPlayer))
           continue;

       if (GET_PLAYER(ePlayer).IsAtWarWith(eLoopPlayer))
       {
           if (std::find(vNewWarPlayers.begin(), vNewWarPlayers.end(), eLoopPlayer) == vNewWarPlayers.end())
               vNewWarPlayers.push_back(eLoopPlayer);

           vector<PlayerTypes> vLinkedWarPlayers = GetLinkedWarPlayers(eLoopPlayer, false, true, false);
           for (std::vector<PlayerTypes>::iterator it = vLinkedWarPlayers.begin(); it != vLinkedWarPlayers.end(); it++)
           {
               if (std::find(vNewWarPlayers.begin(), vNewWarPlayers.end(), *it) == vNewWarPlayers.end())
                   vNewWarPlayers.push_back(*it);
           }
       }
   }

   for (std::vector<PlayerTypes>::iterator it = vNewWarPlayers.begin(); it != vNewWarPlayers.end(); it++)
   {
       // Don't attack friends or people keeping us financially afloat.
       if (!IsWarSane(*it))
           return false;

       // Don't attack if they're not a potential war target.
       if (GET_PLAYER(*it).isMajorCiv() && !IsPotentialWarTarget(*it))
           return false;
           
       // Ignore City-States unless peace blocked, since we can just make peace as their new master if we want.
       if (GET_PLAYER(*it).isMinorCiv())
       {
           if (GET_PLAYER(ePlayer).GetDiplomacyAI()->GetPeaceBlockReason(*it) == 6 || GET_PLAYER(ePlayer).GetDiplomacyAI()->GetPeaceBlockReason(*it) == 7)
           {
               if (GetCivApproach(*it) > CIV_APPROACH_HOSTILE && GetPlayerMilitaryStrengthComparedToUs(*it) > STRENGTH_AVERAGE)
                   return false;
           }
       }
       // Avoid DoWing a powerful neighbor.
       else if (GET_PLAYER(*it).GetProximityToPlayer(GetID()) >= PLAYER_PROXIMITY_CLOSE)
       {
           if (GetCivApproach(*it) == CIV_APPROACH_AFRAID)
               return false;
           else if (GetCivApproach(*it) != CIV_APPROACH_WAR && GetWarGoal(*it) != WAR_GOAL_DEMAND)
           {
               if (GetBoldness() > 6 || bWeLikeOneOfThem)
               {
                   if (GetPlayerMilitaryStrengthComparedToUs(*it) > STRENGTH_STRONG)
                       return false;
               }
               else if (GetPlayerMilitaryStrengthComparedToUs(*it) > STRENGTH_AVERAGE)
                   return false;
           }
       }
   }

   // If everything is clear, then accept.
   return true;
}

Edit: Fixed some issues in said code.
 
Last edited:
It's not. But it's nerfed in that the master will now DoW everyone who is currently at war with the voluntary vassal before the agreement takes place.

(I did add code for the AI to be able to handle it; we'll see how well that goes :) )

Code:
/// Do we want to accept ePlayer as our voluntary vassal?
bool CvDiplomacyAI::IsVoluntaryVassalageRequestAcceptable(PlayerTypes ePlayer)
{
   // We will only accept forced capitulation from backstabbers and people who have stolen cities from us.
   if (IsUntrustworthy(ePlayer) || GetNumCitiesCapturedBy(ePlayer) > 0)
       return false;

   vector<PlayerTypes> vTheirTeam = GET_TEAM(GET_PLAYER(ePlayer).getTeam()).getPlayers();
   int iNumCaps = 0;
   bool bWeLikeOneOfThem = false;

   for (size_t i=0; i<vTheirTeam.size(); i++)
   {
       if (!GET_PLAYER(vTheirTeam[i]).isAlive() || GET_PLAYER(vTheirTeam[i]).getNumCities() <= 0)
           continue;

       if (!GET_PLAYER(vTheirTeam[i]).IsHasLostCapital())
           iNumCaps++;

       iNumCaps += GET_PLAYER(vTheirTeam[i]).GetNumCapitalCities();

       bool bWeLikeThem = IsDoFAccepted(vTheirTeam[i]) || IsHasDefensivePact(vTheirTeam[i]) || (GetCivOpinion(vTheirTeam[i]) >= CIV_OPINION_FRIEND && GetCivApproach(vTheirTeam[i]) == CIV_APPROACH_FRIENDLY);

       // We must be stronger.
       if (bWeLikeThem)
       {
           if (GetPlayerMilitaryStrengthComparedToUs(vTheirTeam[i]) > STRENGTH_STRONG)
               return false;

           if (GetPlayerEconomicStrengthComparedToUs(vTheirTeam[i]) > STRENGTH_STRONG)
               return false;

           // If we like them and we can't honestly protect them, then don't agree.
           if (GetPlayer()->GetProximityToPlayer(vTheirTeam[i]) < PLAYER_PROXIMITY_CLOSE)
               return false;

           bWeLikeOneOfThem = true;
       }
       else
       {
           if (GetPlayerMilitaryStrengthComparedToUs(vTheirTeam[i]) > STRENGTH_AVERAGE)
               return false;

           if (GetPlayerEconomicStrengthComparedToUs(vTheirTeam[i]) > STRENGTH_AVERAGE)
               return false;
       }
   }

   // Do not accept voluntary capitulation if we need their capitals to win.
   if (IsGoingForWorldConquest() || IsCloseToDominationVictory())
   {
       if (iNumCaps > 0)
           return false;
   }

   // We must be willing to go to war with everyone they're currently at war with.
   vector<PlayerTypes> vNewWarPlayers;

   for (int iPlayerLoop = 0; iPlayerLoop < MAX_CIV_PLAYERS; iPlayerLoop++)
   {
       PlayerTypes eLoopPlayer = (PlayerTypes) iPlayerLoop;

       if (!IsPlayerValid(eLoopPlayer))
           continue;

       // We're already at war - ignore
       if (IsAtWar(eLoopPlayer))
           continue;

       if (GET_PLAYER(ePlayer).IsAtWarWith(eLoopPlayer))
       {
           if (std::find(vNewWarPlayers.begin(), vNewWarPlayers.end(), eLoopPlayer) == vNewWarPlayers.end())
               vNewWarPlayers.push_back(eLoopPlayer);

           vector<PlayerTypes> vLinkedWarPlayers = GetLinkedWarPlayers(eLoopPlayer, false, true, false);
           for (std::vector<PlayerTypes>::iterator it = vLinkedWarPlayers.begin(); it != vLinkedWarPlayers.end(); it++)
           {
               if (std::find(vNewWarPlayers.begin(), vNewWarPlayers.end(), *it) == vNewWarPlayers.end())
                   vNewWarPlayers.push_back(*it);
           }
       }
   }

   for (std::vector<PlayerTypes>::iterator it = vNewWarPlayers.begin(); it != vNewWarPlayers.end(); it++)
   {
       // Don't attack friends or people keeping us financially afloat.
       if (!IsWarSane(*it))
           return false;

       // Don't attack if they're not a potential war target.
       if (GET_PLAYER(*it).isMajorCiv() && !IsPotentialWarTarget(*it))
           return false;
          
       // Ignore City-States unless peace blocked, since we can just make peace as their new master if we want.
       if (GET_PLAYER(*it).isMinorCiv())
       {
           if (GET_PLAYER(ePlayer).GetDiplomacyAI()->GetPeaceBlockReason(*it) == 6 || GET_PLAYER(ePlayer).GetDiplomacyAI()->GetPeaceBlockReason(*it) == 7)
           {
               if (GetCivApproach(*it) > CIV_APPROACH_HOSTILE && GetPlayerMilitaryStrengthComparedToUs(*it) > STRENGTH_AVERAGE)
                   return false;
           }
       }
       // Avoid DoWing a powerful neighbor.
       else if (GET_PLAYER(*it).GetProximityToPlayer(GetID()) >= PLAYER_PROXIMITY_CLOSE)
       {
           if (GetCivApproach(*it) == CIV_APPROACH_AFRAID)
               return false;
           else if (GetCivApproach(*it) != CIV_APPROACH_WAR && GetWarGoal(*it) != WAR_GOAL_DEMAND)
           {
               if (GetBoldness() > 6 || bWeLikeOneOfThem)
               {
                   if (GetPlayerMilitaryStrengthComparedToUs(*it) > STRENGTH_STRONG)
                       return false;
               }
               else if (GetPlayerMilitaryStrengthComparedToUs(*it) > STRENGTH_AVERAGE)
                   return false;
           }
       }
   }

   // If everything is clear, then accept.
   return true;
}

Edit: Fixed some issues in said code.
Looking forward to it
\Skodkim
 
I just got a conscripted melee ship in a small lake near wonderful Rome... :rolleyes:
Spoiler :
1.jpg

Btw, could the lighthouse create a connection from here to a city on another continent, with just another lake next to it?
 
Status
Not open for further replies.
Back
Top Bottom