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

Establishing Missions (probability)

Discussion in 'Civ4Col - Religion and Revolution' started by scottfreitas, Dec 2, 2017.

  1. scottfreitas

    scottfreitas Chieftain

    Joined:
    Mar 30, 2008
    Messages:
    34
    Hi all. Using R&R, I tend to endlessly tinker with the XML text files, altering them from game to game to make things more interesting.

    Haven't yet found a way to alter the odds of Missionaries establishing new Missions. Currently, each new mission you establish has a lower chance of success than did the previous one (far from being historically accurate btw, but oh well, only so many details people can be bothered with).

    Is there an XML command somewhere which determines the percentage chance of each added Mission being successful? Or no?

    Hopefully someone knows the answer, I sure don't... (yet).
     
  2. devolution

    devolution Prince

    Joined:
    Oct 7, 2016
    Messages:
    300
    Gender:
    Male
    Location:
    Stavanger, Norway
    Hi!

    The calculations that determine the chance of establishing a new mission can be found in this member function:

    CvUnit::getMissionarySuccessPercent()


    Code:
        // 1. Find out how many missions already exist at this Native-Nation -> Missioning Rate
        CvPlayer& kCityOwner = GET_PLAYER(pCity->getOwnerINLINE());
    
        int numCitiesTotal = kCityOwner.getNumCities();
    
        int numCitiesMissioned = 0;
     
        CvCity* pLoopCity;
        int iLoop;
    
        for (pLoopCity = kCityOwner.firstCity(&iLoop); pLoopCity != NULL; pLoopCity = kCityOwner.nextCity(&iLoop))
        {
            if (pLoopCity->getMissionaryPlayer() != NO_PLAYER)
            {
                numCitiesMissioned = (numCitiesMissioned + 1);
            }
        }
    
        // 2. Get Attitude of Natives to currently missioning Player
        int attitudeNativeToMissioningPlayer = kCityOwner.AI_getAttitude(getOwnerINLINE(), false);
    
        // 3. Check Attitudes of old missioning player and existing Mission
        int attitudeChanceImprovement = GC.getDefineINT("CHANCE_IMPROVEMENT_EACH_ATTITIUDE_LEVEL");
        int penaltyExisingMission = 0;
        int attitudeNativeToOldMissioningPlayer = 0;
    
        if (pCity->getMissionaryPlayer() != NO_PLAYER)
        {
            attitudeNativeToOldMissioningPlayer = kCityOwner.AI_getAttitude(pCity->getMissionaryPlayer(), false);
            penaltyExisingMission = GC.getDefineINT("CHANCE_PENALTY_OTHER_MISSION_ALREADY_EXISTS");
        }
    
        // 4. Getting the expertmodifier of this unit
        int expertModifier = getUnitInfo().getMissionaryRateModifier();
    
        // 5. Getting Min and Max
        int minChance = GC.getDefineINT("MIN_CHANCE_MISSIONING");
        int maxChance = GC.getDefineINT("MAX_CHANCE_MISSIONING");
    
        // 6. Putting it all together
    
        //expert starts with higher value
        int totalChance = 50 + expertModifier / 2;
        //the more missions exist, the harder it gets
        totalChance = totalChance - 100 * numCitiesMissioned / numCitiesTotal;
        //now take a look at attitudes
        totalChance = totalChance + attitudeChanceImprovement * (attitudeNativeToMissioningPlayer - attitudeNativeToOldMissioningPlayer);
        //now substract the penalty for exising mission
        totalChance = totalChance - penaltyExisingMission;
    
        if (totalChance > maxChance)
        {
            totalChance = maxChance;
        }
    
        else if (totalChance < minChance)
        {
            totalChance = minChance;
        }
    
        return totalChance;
    
    
    As you can see, the chance depends on many factors. It is interesting to note that the factor (numCitiesMissioned) that depends on the number of cities that are already a target of missions, cannot be changed from XML. This is, from what I gather, the most important factor after a couple of missions have been established. This factor is per tribe though, so you still have an incentive to establish missions, but you will have to target another tribe.
    If you think the rate of success drops off too quickly, then the quickest way to mod this will be to increase MIN_CHANCE_MISSIONING (GlobalDefinesAlt.xml, defaults to 25). This is the floor of the function, so it defines the lowest chance you'll ever have at establishing any mission.

    If this reply was too technical, do feel free to ask for clarifications :D
     
    Last edited: Dec 4, 2017
  3. scottfreitas

    scottfreitas Chieftain

    Joined:
    Mar 30, 2008
    Messages:
    34
    Thanks much, devolution! You found exactly what I was looking for, in GlobalDefinesAlt.xml.

    There are three pertinent commands in that section for me, in fact: Minimum chance of establishing a mission; maximum chance of establishing a mission; and the chance of suffering a penalty when another Mission already exists.

    By the way, there is a fourth one I find amusing:

    <Define>
    <DefineName>OTHER_EUROPEAN_ANGRY_FOR_DESTROYING_MISSION</DefineName>
    <iDefineIntVal>2</iDefineIntVal>
    </Define>

    This.

    Just another variable to play with, depending on what sort of relations you want with the other colonial powers...

    Thanks again, devolution!

    /hat tip
     
  4. Lord Chambers

    Lord Chambers King

    Joined:
    Nov 23, 2001
    Messages:
    999
    I'm unable to found a mission in Indian villages. What are the rules for founding them?

    I've founded 3 missions prior. Those villages all disbanded. Now, later in my game my Jesuit is taking tour and can't find an Indian village that will have him. There are no european flags indicating they have missions in these villages. Any ideas?
     
  5. rah

    rah Deity Supporter

    Joined:
    Sep 12, 2005
    Messages:
    9,268
    Location:
    Chicago
    Is there a chance that he was working in a city and you didn't declare him a missionary again and he's just a colonist. That happened to me and it took me quite a bit to figure out what I had done.
     
  6. Lord Chambers

    Lord Chambers King

    Joined:
    Nov 23, 2001
    Messages:
    999
    I appreciate the reply. You nailed it! Problem solved.
     

Share This Page