What is the formula for the garrison effect?

OnmyojiOmn

Prince
Joined
Aug 4, 2006
Messages
371
I'm having a hard time figuring this out in-game and I really don't want to install OpenOffice just to open the effect spreadsheet. Can anyone just post the formula?

Thanks
 
I'm having a hard time figuring this out in-game and I really don't want to install OpenOffice just to open the effect spreadsheet. Can anyone just post the formula?

Thanks

upload it to google docs, then look at it. Google doesn't require you to install software.
 
I didn't realize Google Docs supported ODS. Makes sense that it does. :)

Edit: okay, so can anyone point me to the spreadsheet? I assumed it would be in the download or in SVN but it's not.
 
This is faster and definitely correct ...

Code:
            garIdx = 0
            if( hasLiberalism ) :
                garIdx = -int( 2*pow(pCity.plot().getNumDefenders(iPlayer)/2, .5) - .5 )
            else :
                if( pCity.getBuildingDefense() > 75 ) :
                    garIdx = -int( 3*pow(pCity.plot().getNumDefenders(iPlayer)/2, .6) + .5 )
                elif( pCity.getBuildingDefense() > 25 ) :
                    garIdx = -int( 2.5*pow(pCity.plot().getNumDefenders(iPlayer)/2, .6) )
                else :
                    garIdx = -int( 2*pow(pCity.plot().getNumDefenders(iPlayer)/2, .6) - .5 )

            garIdx = int(math.floor( self.garrisonModifier*garIdx + .5 ))

            if( natIdx > 0 ) :
                garIdx = max([garIdx,-5])
            else :
                garIdx = max([garIdx,-8])

Where pow(x,y) raises x to the power y, and natIdx is the nationality index ... if you have a low nationality percentage, then the cap is -5, otherwise cap is -8.
 
Can someone translate this for me? I've been having problems keeping some of my more distant cities under control, and any benefit would help me. Also, do I need a specific civic to benefit from garrison stability? I'm running Rise of Mankind / A New Dawn, if that changes anything.
 
Building city walls will help, as will piling more units in the city ... but you get diminishing returns on units.

Hereditary Rule is useful if you have just a couple problem cities, as you can get large happiness boosts. Representation and Un Suf help lower distance issues, so that helps as well.
 
Top Bottom