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

[We the People] Bug reporting

Discussion in 'Civ4Col - We The People' started by Nightinggale, Sep 24, 2018.

  1. Sarin

    Sarin Prince

    Joined:
    Aug 18, 2013
    Messages:
    390
    I've had the same bug happen in my game. On Marathon, it can result in vast stretches of ocean being permanently visible. Does it break anything, short of some extra visibility?
     
  2. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,520
    Gender:
    Male
    Location:
    Stuttgart, Germany
    No, it does not break anything else.
    It is completely harmless considering gameplay itself.

    It may influence performance a bit though.
     
  3. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,356
    Thank you for your great work. This really narrows down the cause of the problem. Fixing it is much easier once the cause of the issue is identified rather than just the end result.

    I think if it happens to the AI, then the visible plot will be used for AI planning because it's visible. However unless you happen to end your turn with a ship at precisely that plot, it will be very unlikely that the AI will change behavior just because it can see a plot of water. The same is true for a human player. A few plots might not be covered by fog of war when they should, but that's not the same as you will change strategy.
     
  4. Raubwuerger

    Raubwuerger Chieftain

    Joined:
    Nov 24, 2014
    Messages:
    40
    Location:
    Bavaria
    Hi all,

    in my current game there are no wild animals at all. Neither on land nor in the ocean. I'm playing Louis de Frontenac an a gigantic map and the year is 1570 ...
    In the game settings you can select "No wild animals on land/water", but i've not checked this option.
    Is there a trigger then wild animals show up?
     
  5. Ramstormp

    Ramstormp Chieftain

    Joined:
    Jan 13, 2020
    Messages:
    41
    Gender:
    Male
    ../Assets/XML/GameInfo/HandicapInfo.xml

    For instance Pilgram difficulty level:

    <iAIAnimalLandNumTurnsNoSpawn>5</iAIAnimalLandNumTurnsNoSpawn>
    <iAIAnimalSeaNumTurnsNoSpawn>5</iAIAnimalSeaNumTurnsNoSpawn>

    I always put it to zero. I don't like the emptiness myself. If a bear succeeds in killing my pioneer, sad for him. I keep going until completely scalped and a little longer.
     
  6. Raubwuerger

    Raubwuerger Chieftain

    Joined:
    Nov 24, 2014
    Messages:
    40
    Location:
    Bavaria
    Will it take affect only if you start a new game? Or also if you change it and load a already saved game?
     
  7. Ramstormp

    Ramstormp Chieftain

    Joined:
    Jan 13, 2020
    Messages:
    41
    Gender:
    Male
    Well, It's not like I am the best person to answer these questions or anything. It won't break a save game. It will only take effect, I believe, if you happen to be at the less than five turns into the game stage, and it's not going to retroactively throw in extra animals to make up for lost spawns. And for some reason it took me until 1583 yesterday before I saw my polar bear roaming the desert border, even on '0', so maybe there is a bug; but I didn't really pay overt attention before.
     
  8. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,520
    Gender:
    Male
    Location:
    Stuttgart, Germany
    No there is no bug in there to my knowledge.
    (I had Wild Animals showing up quite regularly in my games.)

    The XML variables mentioned above only affect the earliest turn Animals spawn - but there are other variables as well that determine frequency and amount (per land mass) of animals spawned.

    However:

    There are many ways to mess up a Map Scenarios considering the max. amount of Players that will prevent Anmials to be spawned.
    (It will then not create a Player Wild Animals and thus not spawn Wild Animals.)

    So if Wild Animals do not show up in Game:
    Please check in WorldBuilder if Player "Wild Animals" exist.

    If it does not exist, then the Map Scenario is messed up.
    (The bug can not occur if you play a game created by a Map Script.)
     
    Last edited: Jul 15, 2020
  9. Schmiddie

    Schmiddie Emperor

    Joined:
    Feb 27, 2012
    Messages:
    1,371
    Location:
    Germany
    Since the last update the King ever refuses to grant troops in the diplomacy screen. Has something been changed in the DLL?
     
  10. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,520
    Gender:
    Male
    Location:
    Stuttgart, Germany
    I just tested and it works perfectly. :)
    (The troops were spawned as expected in Europe.)

    What is your relationship to the King? (His attitude.)
    Your King only grants troops if you have a good relationship with him.

    Do you have enough money?
    The troops cost a little bit - they are not completely for free.
     
    Last edited: Jul 26, 2020
  11. Schmiddie

    Schmiddie Emperor

    Joined:
    Feb 27, 2012
    Messages:
    1,371
    Location:
    Germany
    I have enough money but he does not grant anything - also at the beginning when the relationship is very good.
     
  12. devolution

    devolution Prince

    Joined:
    Oct 7, 2016
    Messages:
    383
    Gender:
    Male
    Location:
    Stavanger, Norway
    Thanks for the investigation!

    I've started to look into resolving this issue (see the progress here: https://github.com/We-the-People-civ4col-mod/Mod/issues/254). A save from a situation like in screenshot 1 or a recipe for reproduction would be most helpful :thumbsup:
     
  13. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,520
    Gender:
    Male
    Location:
    Stuttgart, Germany
    @Schmiddie

    As I said, it is working perfectly for me. :dunno:
    I see no reason why it should not work in unmodified WTP considering Unit balancing.
    (But I see a lot of possibilities to mess it up by XML changes - e.g. converting Cannons from Units to Professions.)

    I also checked the code:
    (Code excerpt at the bottom of the post.)

    The main checks it does is checking for Attitude in DLL (Cautious or better) and Gold in Python Diplo Screen logic.

    Python Diplo Screen logic is unmodified compared to Vanilla.

    It also tries to give you a Unit type you have least often. (So if you have lots of Artillery it might give you Hessians or something else instead.)
    But this part of the logic should also always work.

    devolution added a check for kUnit.getCombat() > 5 in DLL to determine valid Units to be given by the King.
    (Which basically checks for a min combat strength and should not cause any issues big issues with current balancing).

    @devolution
    Why did you change that code? Was there a bug? I am pretty sure it was working before as well.
    Also the Promotion check itself is / was not bad, because most expert Military Units come with a Promotion.
    (Non-Military Units do not have Promotions - at least I can not think of any.)

    I also have an issue with the current code:
    (unless I misread the code)
    Spoiler :

    Your code kUnit.getCombat() > 5 only checks Units and completely ignores the (default) Professions a Unit might have.

    Thus you directly ignore "Expert Line Infantery", "Expert Dragoons" and all other Units that are weak as a pure Unit but quite strong in their Default Profession.
    All that is left are Artillery and Hessian Mercenaries.

    It should work in our current balancing at the moment, and for my version (almost unmodified) it does.

    But as I said, it excludes a lot of military Units with Professions.
    (Thus making the feature a little bit more boring.)

    But once we change our current balancing (by e.g. transforming Artillery from Units to Professions, it might cause issues.

    Please remember Civ4Col is heavily based on Professions, not only Units.
    This is of course totally different in Civ4BTS.


    Summary:

    The code seems to work fine in unmodified WTP.
    (Although the variation of Units you may get is probably smaller.)

    It is possible though to create balancing where it will not work anymore.
    (because of kUnit.getCombat() > 5 that checks only Units)

    Spoiler :

    Code:
    int CvPlayerAI::AI_militaryHelp(PlayerTypes ePlayer, int& iNumUnits, UnitTypes& eUnit, ProfessionTypes& eProfession)
    {
       FAssert(GET_PLAYER(ePlayer).getParent() == getID());
    
       iNumUnits = 0;
       eUnit = NO_UNIT;
       eProfession = NO_PROFESSION;
    
       if (AI_getAttitude(ePlayer) < ATTITUDE_CAUTIOUS)
       {
           return -1;
       }
    
       CvPlayer& kPlayer = GET_PLAYER(ePlayer);
       int iBestValue = MAX_INT;
       for (int i = 0; i < GC.getNumUnitClassInfos(); ++i)
       {
           UnitTypes eLoopUnit = (UnitTypes) GC.getCivilizationInfo(kPlayer.getCivilizationType()).getCivilizationUnits(i);
           if (eLoopUnit != NO_UNIT)
           {
               CvUnitInfo& kUnit = GC.getUnitInfo(eLoopUnit);
               if (kUnit.getDomainType() == DOMAIN_LAND && kPlayer.getEuropeUnitBuyPrice(eLoopUnit) > 0)
               {
                   // ERIK: TODO: Find out how to check for combat / armed units
                   bool bValid = (kUnit.getCombat() > 5);
                   /*
                   for (int j = 0; j < GC.getNumPromotionInfos() && !bValid; ++j)
                   {
                       if (kUnit.getFreePromotions(j))
                       {
                           bValid = true;
                       }
                   }
                   */
    
                   if (bValid)
                   {
                       int iValue = kPlayer.getUnitClassCount((UnitClassTypes) i);
                       if (iValue < iBestValue)
                       {
                           iBestValue = iValue;
                           eUnit = eLoopUnit;
                       }
                   }
               }
           }
       }
    
       if (eUnit == NO_UNIT)
       {
           return -1;
       }
    
       iNumUnits = 1;
       eProfession = (ProfessionTypes) GC.getUnitInfo(eUnit).getDefaultProfession();
    
       return kPlayer.getEuropeUnitBuyPrice(eUnit) * GC.getDefineINT("KING_BUY_UNIT_PRICE_MODIFIER") / 100;
    }
    
     
    Last edited: Jul 27, 2020
  14. devolution

    devolution Prince

    Joined:
    Oct 7, 2016
    Messages:
    383
    Gender:
    Male
    Location:
    Stavanger, Norway
    I added that "quick hack" to work around the king offering Medics (due to them having medic 3 which is OP btw). I agree that it was an unforeseen consequence that the European infantry is now a profession rather than a unit which breaks this check.
     
  15. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,520
    Gender:
    Male
    Location:
    Stuttgart, Germany
    Ah ok I undstand. :thumbsup:

    The Medic was added during the time when I was not a team member.
    Thus did not think about it.

    It is not only the "European Line Infantery". There are many more "Experts for Military Professions".
    (e.g. Expert Dragoons, Expert Militia, Expert Townguards, ...)

    The code however could have an "OR" checking for the Combat Strength of the Units Default Profession.
    That should do the trick. :thumbsup:
     
    Last edited: Jul 28, 2020
  16. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,520
    Gender:
    Male
    Location:
    Stuttgart, Germany
    @devolution: I will take care of this and try to improve the logic, if you do not mind.
     
  17. devolution

    devolution Prince

    Joined:
    Oct 7, 2016
    Messages:
    383
    Gender:
    Male
    Location:
    Stavanger, Norway
    Go ahead :)
     
  18. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,520
    Gender:
    Male
    Location:
    Stuttgart, Germany
    It is fixed, tested and committed. :thumbsup:

    Now all possibilities (Land Experts of Military Professions and Land Military Units) are spawned.
    We now have a nice variations of many different Units the King grants (for a little gold).
     
  19. devolution

    devolution Prince

    Joined:
    Oct 7, 2016
    Messages:
    383
    Gender:
    Male
    Location:
    Stavanger, Norway
    .. and hopefully no medics :lol:
     
  20. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,520
    Gender:
    Male
    Location:
    Stuttgart, Germany
    Nope, no evil medics with their devlish poison ! ;)
    (Only Units for Combat of Units having a Default Profession for Combat are granted. No civil units.)

    The logic is checking iCombat of Units and CombatChange of their Default Professions in an "OR" logic.
    (Basically only the additional CombatChange of Default Profession was missing.)

    The feature logic used to give only "Heavy Artillery" and "Light Artillery".
    Now it also gives Cuirassiers, Dragoons, Militia, Line Infantery, ...

    To simplify:
    It can now handle Experts for Militarty Professions as well.
    We will not run into problems if we e.g transform Artillery Units into Experts of Artillery Professions.
    It will handle such changes correctly without having to adjust the logic itself.
     
    Last edited: Jul 29, 2020

Share This Page