1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[R&F] Impossible to trade a city just conquered

Discussion in 'Civ6 - General Discussions' started by OxydoReduction, Apr 4, 2018.

  1. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    9,865
    What is the symptoms and I can check, ceding is an area that I know well as I have heavily tested it.
    I need to check ceded cities anyways as they say they have changed warmonger behavior and all evidence so far has been anecdotal.
    I never saw inconsistency in all my previous testing so am interested in how it exhibits itself.
     
  2. OxydoReduction

    OxydoReduction Chieftain

    Joined:
    Oct 14, 2017
    Messages:
    16
    Location:
    France
    Thanks for all your replies.

    This makes sense. Maybe one can't trade a city that's about to flip loyalty (i.e. with the red punching hand on it), except with the civilization that owned the city before...

    I'm also a bit unconvinced by this, but I guess I'll have to check it out and test several possibilities.

    Just to be clear: I really wasn't trying to "exploit a bug" or something like that, I wanted to play like in real life: I'm allied with a civilization and at war with another, I conquer a city that's on the border between the two of them; instead of keeping it, I give it to my ally. Seems RP!
     
  3. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    9,865
    agreed it should be possible but you can see the problem with the mechanic.
    Maybe the right way to deal with it is the Ai has to assess if the city they are being given/sold will flip and may not want it based on that as well as proximity
     
  4. OxydoReduction

    OxydoReduction Chieftain

    Joined:
    Oct 14, 2017
    Messages:
    16
    Location:
    France
    Yes, I thought it may be that problem. Because when the city flipped loyalty to "free city", the original city owner had more loyalty pressure than my ally. So that may be one of the reasons...
     
  5. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    9,865
    Just started testing it. A ceded city still has some stupid warmongering issues...however
    After a cede I can only trade it mack to the home civ for about 3 turns, then I can trade it to other civs
    I need to do verification a few times and also test non ceded trading etc and also get to the bottom of some weird change in warmongering
    I'll post a new thread for the details because I know a few people will be interested.. will be an hour or 2 away
     
  6. OxydoReduction

    OxydoReduction Chieftain

    Joined:
    Oct 14, 2017
    Messages:
    16
    Location:
    France
    That is actually pretty similar to the problem I encountered.
    I'll check it! Thanks for your dedication.
     
  7. liv

    liv Warlord

    Joined:
    Dec 2, 2010
    Messages:
    1,393
    I am noticing that I cannot trade a freecity that I captured (at present it is 10 turns away from full loyalty, and it is not occupied)
     
    Last edited: Apr 6, 2018
  8. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    9,865
    Correct... I tested this... after 3 turns I can trade the captured OR ceded city but not the free one taken even though fireturner says its original owner was mongolia
     
    BenitoChavez and liv like this.
  9. Aristos

    Aristos Lightseeker

    Joined:
    Dec 11, 2001
    Messages:
    3,575
    Gender:
    Male
    Location:
    Deep inside...
    If I remember correctly, we made the bug "visible" when adapting IDS to CQUI. I coded a lot for that integration to the point that CQUI's IDS is very different from the original. While doing this, cities started to disappear from the list, or you would click a city and the deal would populate with another city. After a lot of trial and error, I noticed that the internal ID's of the cities (internal as in within the code, most likely inside the dll) was not being returned by the corresponding dll function in a consistent manner, basically returning values for another city than the one you would click. So I hacked a solution in lua to compensate for this huge, hidden bug, and I made IDS work fine.

    I don't remember manifestations of this hidden bug outside of CQUI/IDS, but maybe only because I did not notice the inconsistencies (I am usually not a warmonger, so I seldom use the Cede/Return cities mechanic, thus I would not notice inconsistencies). Code from the extended functions of CQUI/IDS is what exposed the bug. After that, and as CQUI was working fine, I never returned or never noticed anything again.

    Since R&F, I am not using CQUI/IDS, and I personally did not notice anything strange, but this post reminded me of that hidden bug, and I wondered if it was ever solved or not. I am not sure you can test it, as it is really elusive, but what the OP is reporting might well be one of the symptoms. In example, look for inconsistencies in the list of cities, in the info in the tooltips for cities, or even look for cities that should be in the list but are not (say, a civ for which you know and can see all its cities, yet when you enter the deal screen, one or more cities that you can clearly see are not in the list).
     
  10. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    9,865
    Ok thanks for the clarity, I’ll try and keep an eye out, firetuner can show this I think and that’s where I do most my testing although ceding does take a real game.
    I’m just glad it’s elusive because cede seems consistently pointless beyond a points victory... well detrimental in fact.
    I’ll be posting my findings tonight but it still looks like you get punished with more warmonger points for accepting a ceded city.
     
  11. Aristos

    Aristos Lightseeker

    Joined:
    Dec 11, 2001
    Messages:
    3,575
    Gender:
    Male
    Location:
    Deep inside...
    Now that I think of it, I think I remember seeing this specific symptom post R&F... I doubt you will see any useful manifestation in the logs or Firetuner (I don't remember seeing them when hacking that bug, that's why it was soooo hard to catch with only lua), but you may see the above manifestation.
     
  12. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    9,865
    @OxydoReduction and @liv
    I had a free city and a captured city and before I made peace I got them to 100% loyalty and could trade them with anyone as soon as I made peace. Still doing more tests. Lots of warmonger points changes.
    The free city I can trade before I make peace as long as it is at 100% loyalty
     
  13. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    9,865
    @Aristos

    Is this ID what you are after? that is deemed the city ID from pCity:GetID
    upload_2018-4-6_20-23-55.png

    It depends on how well you know the logs and what symptoms are being reported... I guess if I do not know what information is displayed wromngly for the city I cannot look.
     
  14. Aristos

    Aristos Lightseeker

    Joined:
    Dec 11, 2001
    Messages:
    3,575
    Gender:
    Male
    Location:
    Deep inside...
    Hacks I had to use to compensate for the hidden bug:

    Code:
    for i, entry in ipairs(possibleItems) do
    
          local type = entry.ForType;
          local subType = entry.SubType;
          local pCity = player:GetCities():FindID( type );
          -- Handle occupied cities
          if pCity == nil or (entry.ForTypeName ~= GetCityData(pCity).CityName and not pCity:IsOccupied()) then --ARISTOS
            pCity = otherPlayer:GetCities():FindID( type );
            -- AZURENCY : fix for persia not having occupation penalties
            if pCity == nil then
              pCity = player:GetCities():FindID(valueType);
            end
          end
    
          local icon = renderCity(pCity, player, iconList.ListStack);
    
          icon.SelectButton:ReprocessAnchoring();
          iAvailableItemCount = iAvailableItemCount + 1;
    
          -- What to do when double clicked/tapped.
          icon.SelectButton:RegisterCallback( Mouse.eLClick, function() OnClickAvailableCity(player, type, subType); end );
        end
    
    Code:
    function PopulateDealCities(player : table, iconList : table)
    
      local pDeal = DealManager.GetWorkingDeal(DealDirection.OUTGOING, ms_LocalPlayer:GetID(), ms_OtherPlayer:GetID());
      local playerType = GetPlayerType(player);
      local otherPlayer = GetOtherPlayer(player);
      if (pDeal ~= nil) then
        ms_IconAndTextWithDetailsIM:ReleaseInstanceByParent(iconList.ListStack);
    
        local pDealItem;
        for pDealItem in pDeal:Items() do
          local type = pDealItem:GetType();
          local valueType = pDealItem:GetValueType(); --ARISTOS
          local valueName = pDealItem:GetValueTypeNameID(); --ARISTOS
          if (pDealItem:GetFromPlayerID() == player:GetID()) then
            local dealItemID = pDealItem:GetID();
    
            if (type == DealItemTypes.CITIES) then
              local pCity = player:GetCities():FindID(valueType);
              -- Handle occupied cities
              if pCity == nil or (valueName ~= GetCityData(pCity).CityName and not pCity:IsOccupied()) then --ARISTOS
                pCity = otherPlayer:GetCities():FindID(valueType);
                -- AZURENCY : fix for persia not having occupation penalties
                if pCity == nil then
                  pCity = player:GetCities():FindID(valueType);
                end
              end
    
              local icon = renderCity(pCity, player, iconList.ListStack);
    
              -- Show/hide unacceptable item notification
              icon.UnacceptableIcon:SetHide(not pDealItem:IsUnacceptable());
    
              icon.SelectButton:RegisterCallback(Mouse.eRClick, function(void1, void2, self) OnRemoveDealItem(player, dealItemID, self); end);
              icon.SelectButton:RegisterCallback( Mouse.eLClick, function(void1, void2, self) OnSelectValueDealItem(player, dealItemID, self); end );
    
            end
          end
        end
    
        iconList.ListStack:CalculateSize();
        iconList.ListStack:ReprocessAnchoring();
    
      end
    
    
    end
    
    Code:
    function OnClickAvailableCity(player, valueType, subType)
      local pDeal = DealManager.GetWorkingDeal(DealDirection.OUTGOING, ms_LocalPlayer:GetID(), ms_OtherPlayer:GetID());
      if (pDeal ~= nil) then
    
        -- Since we're ceding this city make sure to look for this city in the current owners city list
        local cityName;
        if subType == 1 then -- CitySubTypes:CEDE_OCCUPIED
          cityName = GetCityData(GetOtherPlayer(player):GetCities():FindID(valueType)).CityName
        else
          cityName = GetCityData(player:GetCities():FindID(valueType)).CityName
        end
    
        -- Already there?
        local pDealItem = pDeal:FindItemByValueType(DealItemTypes.CITIES, subType, valueType, player:GetID());
        if (pDealItem == nil or pDealItem:GetValueTypeNameID() ~= cityName) then --ARISTOS
    
          -- No
          pDealItem = pDeal:AddItemOfType(DealItemTypes.CITIES, player:GetID());
          if (pDealItem ~= nil) then
            pDealItem:SetSubType(subType);
            pDealItem:SetValueType(valueType);
    
            if (not pDealItem:IsValid(pDeal)) then
              pDeal:RemoveItemByID(pDealItem:GetID());
            end
            UpdateDealPanel(player);
            UpdateProposedWorkingDeal();
          end
        end
      end
    
      UI.PlaySound("UI_GreatWorks_Put_Down");
    
    end
    
     
    Victoria likes this.
  15. Aristos

    Aristos Lightseeker

    Joined:
    Dec 11, 2001
    Messages:
    3,575
    Gender:
    Male
    Location:
    Deep inside...
    @Victoria :

    funny that we are cooperating here, and clashing in that other thread... only Civ can do that!

    (if you ask me which one we should stop, I would say the clashing... fair enough?)

    About the hacks: if I remember correctly, the FXS original code uses pCity:GetID() as their main comparator to identify cities, but that function was the one behaving inconsistently up to two-three patches ago (whenever I did the CQUI/IDS coding referenced above), so as you can see, my compensating hacks got rid of that function as comparators, and instead use the city names and other attributes (such as not occupied)...

    Bug is nasty, I can tell you, and I am not sure they solved it. We did report it officially at that time in the 2K system, but never ever got any answer at all...
     
    cvb likes this.
  16. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    9,865
    sure, already have :)
    too busy testing warmonger
     
    cvb likes this.
  17. OxydoReduction

    OxydoReduction Chieftain

    Joined:
    Oct 14, 2017
    Messages:
    16
    Location:
    France
    Looks like it was a loyalty problem after all, if I'm understanding this right... I can't quite understand all about this "hidden and elusive bug" but it sure seems nasty.
     
  18. Aristos

    Aristos Lightseeker

    Joined:
    Dec 11, 2001
    Messages:
    3,575
    Gender:
    Male
    Location:
    Deep inside...
    ...and we got a deal. That is always better and more efficient in terms of our time and entertainment (and that of others). Good.

    What's up with warmonger again? More bugs?
     
  19. Victoria

    Victoria Regina Supporter

    Joined:
    Apr 11, 2011
    Messages:
    9,865
    Well Cede has always been utter rubbish and it looks like it has not changed
    You go for peace and part of the deal is for them to cede you a city.
    If you accept the cede you get more warmonger points (current testing seems to be twice era as a blanket but probably wrong guess at this stage)
    If you do gain a cede you get a better deal and less warmonger points
    After peace the only difference I can find between ceded and non ceded is a non ceded city does not count towards a points victory ... and we know how useful that is.
    So cede is worse than useless, it damages your rep and you get a worse deal.

    Warmonger has always annoyed people, not so much me as I am more a mechanic than a historian
    The lastest patch states it has changed some of the mechanics around this and city razing
    So befofre the patch if you were attcked by another player declaring a formal war on you in the modern era they would get 24 WM points for declaring the war and 12 for each city taken while as the defender you would get 18 WM for any city you take as you are always deemed to be 'surprised' ... from what I have seen so far this is fixed but exactly how will take time and testing. currently it looks like you get the same but maybe you always get formal or maybe its more fixed, dunno yet.

    Sadly War weariness acts the same way for the defender, hopefully that has changed... maybe its linked, will check it out.
     
    Last edited: Apr 6, 2018
  20. cvb

    cvb Chieftain

    Joined:
    Jun 12, 2017
    Messages:
    293
    Maybe the 'Cede/Return cities' function does essentially nothing right now, because it is mainly commented out ... in order to avoid larger problems in connection with the (not yet fixed / finally analyzed) inconsistent return values mentioned by Aristos?!
     

Share This Page