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

News: BOTM 59 -- Starts October 15

Discussion in 'Civ4 - Game of the Month' started by kcd_swede, Oct 11, 2012.

  1. Sleepless

    Sleepless Deity

    Joined:
    Feb 11, 2006
    Messages:
    3,513
    Roll on tomorrow. Thanks in advance for the game and the interesting concept. :)

    Must admit I missed the mongol keshiks in the middle. That would have been a shock when opening the game!! :lol:

    Bit unsure of how to start this one but think the main thing will be to try and avoid the mongols/barb spears early and hope they kill each other off. Think I'll try and link 3 together and send the other hut hunting.
     
  2. jesusin

    jesusin Ant GOTM Staff

    Joined:
    Aug 26, 2005
    Messages:
    4,135
    Location:
    Madrid
    What a way to get no player settling in place! :lol:


    What really really does concern me is this: do Mongols know about this rule? :eek:




    To anyone who knows: What about culture? Can you keep a pop1 city if it has had its first border expansion?
     
  3. Ronnie1

    Ronnie1 Deity

    Joined:
    Apr 10, 2006
    Messages:
    7,613
    Location:
    47.48N 117.77W
    Anyone try to make a test game?
     
  4. Manco Capac

    Manco Capac Friday,13 June,I Collapse

    Joined:
    Mar 1, 2010
    Messages:
    8,051
    Let settles this so no more doubt:

    Spoiler :
    Code:
    bool CvCity::isAutoRaze() const
    {
    	if (!GC.getGameINLINE().isOption(GAMEOPTION_NO_CITY_RAZING))
    	{
    		if (getHighestPopulation() == 1)
    		{
    			return true;
    		}
    
    		if (GC.getGameINLINE().getMaxCityElimination() > 0)
    		{
    			return true;
    		}
    	}
    
    	if (GC.getGameINLINE().isOption(GAMEOPTION_ONE_CITY_CHALLENGE) && isHuman())
    	{
    		return true;
    	}
    
    	return false;
    }


    In CvCity.cpp file, that is the function (or global variable) that rules the autoraze.

    It is said if the game hasn't been set up with "No city Razing" AND the highest pop ever for that city is 1, then autorazing=true. Too bad. :sad:

    MaxCityElimination is a multiplayer setting where for a set up number of cities, if a player loses exactly that number, then all other cities are autorazed because the player loses the game.
    In InitCore.cpp thingy file, I think it's SetMaxCityElimination() that settles the highest number of lost cities before losing the game. Whatever, it doesn't really concern us for that game.
    This could be compared to CivIII: King has been killed and the whole civilization vanishes. I think that was like that.

    The other "if" block is about OCC setup that is only applied for human players.
    If all those conditions are not satisfied, then the function autorazing=false , that is no autorazing.

    Those are the sole parameters for autorazing. Culture has nothing to do with. An AI could received a free wonder in a scenario, but if it had not reached over 1 pop, then yes, sadly, the wonder goes with the city.

    ==================================================================

    About AI razing cities (which Mongol wins over most AI's), I'm not afraid. I've seen at some point the code section that rules conquering by AI and it put some restrictions...
    I'm looking for it right now....

    Ok, found it:

    Spoiler :
    Code:
    void CvPlayerAI::AI_conquerCity(CvCity* pCity)
    {
    	CvCity* pNearestCity;
    	bool bRaze = false;
    	int iRazeValue;
    	int iI;
    
    	if (canRaze(pCity))
    	{
    	    iRazeValue = 0;
    		if (GC.getGameINLINE().getElapsedGameTurns() > 20)
    		{
    			if (getNumCities() > 4)
    			{
    				if (!(pCity->isHolyCity()) && !(pCity->hasActiveWorldWonder()))
    				{
    					if (pCity->getPreviousOwner() != BARBARIAN_PLAYER)
    					{
    						pNearestCity = GC.getMapINLINE().findCity(pCity->getX_INLINE(), pCity->getY_INLINE(), NO_PLAYER, getTeam(), true, false, NO_TEAM, NO_DIRECTION, pCity);
    
    						if (pNearestCity == NULL)
    						{
    							if (pCity->getPreviousOwner() != NO_PLAYER)
    							{
    								if (GET_TEAM(GET_PLAYER(pCity->getPreviousOwner()).getTeam()).countNumCitiesByArea(pCity->area()) > 3)
    								{
    									iRazeValue += 30;
    								}
    							}
    						}
    						else
    						{
    							int iDistance = plotDistance(pCity->getX_INLINE(), pCity->getY_INLINE(), pNearestCity->getX_INLINE(), pNearestCity->getY_INLINE());
    							if ( iDistance > 12)
    							{
    								iRazeValue += iDistance * 2;
    							}
    						}
    					}
    
    
    					if (pCity->area()->getCitiesPerPlayer(getID()) > 0)
    					{
    						if (AI_isFinancialTrouble())
    						{
    							iRazeValue += (70 - 15 * pCity->getPopulation());
    						}
    					}
                    
    			        if (getStateReligion() != NO_RELIGION)
    					{
                            if (pCity->isHasReligion(getStateReligion()))
                            {
    							if (GET_TEAM(getTeam()).hasShrine(getStateReligion()))
    							{
    	                        iRazeValue -= 50;                            
    						}
    							else
    							{
    								iRazeValue -= 10;
    							}
    						}
    					}
                        
                        int iCloseness = pCity->AI_playerCloseness(getID());
                        if (iCloseness > 0)
                        {
                        	iRazeValue -= 25;
                        	iRazeValue -= iCloseness * 2;
    					}
                        else
                        {
                        	iRazeValue += 60;
    					}
    
    					if (pCity->area()->getCitiesPerPlayer(getID()) > 0)
    					{
    						if (pCity->getPreviousOwner() != BARBARIAN_PLAYER)
    						{
                                iRazeValue += GC.getLeaderHeadInfo(getPersonalityType()).getRazeCityProb();
    						}
    					}
    					
    					if (iRazeValue > 0)
    					{
    					    for (iI = 0; iI < GC.getNumTraitInfos(); iI++)
    					    {
                                if (hasTrait((TraitTypes)iI))
                                {
                                    iRazeValue *= (100 - (GC.getTraitInfo((TraitTypes)iI).getUpkeepModifier()));
                                    iRazeValue /= 100;
    							}
    						}
    
                            if (GC.getGameINLINE().getSorenRandNum(100, "AI Raze City") < iRazeValue)
    						{
    							bRaze = true;
    							pCity->doTask(TASK_RAZE);
    						}
    					}
    				}
    			}
    		}
    	}
    
    	if (!bRaze)
    	{
    		CvEventReporter::getInstance().cityAcquiredAndKept(GC.getGameINLINE().getActivePlayer(), pCity);
    	}
    }


    That's the thing that leads AI to raze or not cities after conquering.
    "iRazeValue" is a number of reference compared to the RNG (getSorenRandNum is the true name of what we all call RNG) that rolls a number. If the roll is lower than calculated "iRazeValue", the game validates the razing of the city.
    Amongst all conditions that either favor or lower the chance of razing, indeed, AI personalities are included.

    I won't pass through all those conditions, but I pinpoint those for the early game and reassure us there is no chance the AI razes any city at this point.

    Code:
    if (canRaze(pCity))
    	{
    	    iRazeValue = 0;
    		if (GC.getGameINLINE().getElapsedGameTurns() > 20)
    		{
    			if (getNumCities() > 4)
    			
    { blal bla bla}
    
    Those very first conditions represent everything. If the game has not passed over T20, then the whole razing function is not calculated, and the function returns no razing.
    Second condition is even better, the AI has not more than 4 cities (like 5 cities), again, the whole razing function is ignored and the function returns no razing.


    Basically, Noble ultra slow expansion will force the mongols to avoid any razing for a long long time.

    BUT, autorazing function is an independant function and not based on AI decision, which means...UH OH!
    Not all noble AI's start beelining pop2 and a long 20 turns may pass until they get their first worker AT pop1!

    Still, aren't the mongols just at war with us? So why the concern if they are peaceful to other AI's?

    In return, may I ask a question: when will BOTM58 finish exactly?
     
  5. Manco Capac

    Manco Capac Friday,13 June,I Collapse

    Joined:
    Mar 1, 2010
    Messages:
    8,051
    For what purpose? There isn't a city to micro. :confused:
     
  6. DynamicSpirit

    DynamicSpirit Fear him of the pink tie Moderator GOTM Staff

    Joined:
    Dec 23, 2005
    Messages:
    6,133
    Location:
    London, UK
    Thanks for posting the code. Very interesting.

    Have a look at http://gotm.civfanatics.net/. It tells you to the nearest hour how much time there is on each of the open games. If you want to know more accurately than that, I'd surmise that the end time will be exactly on the hour (Assuming you don't live in one of the small number of timezones that differs from GMT by fractions of an hour).

    EDIT: Probably worth making sure you refresh the page to make sure you're not seeing a cached number-of-hours-left from when you last went to gotm.civfanatics.net :) The time it ends should be the point where it becomes 17 October in every timezone. In other words, if there is some timezone somewhere in the world where it's still 16 October then the game will still be open for submissions.
     
  7. Deckhand

    Deckhand Procrastination at its finest GOTM Staff

    Joined:
    Sep 22, 2008
    Messages:
    5,504
    Gender:
    Male
    Location:
    California
    Nope. They are at war with everyone. Takes some of the pressure off us.
    kcd forgot to mention it in intro initially, but has clarified it
     
  8. Mad Professor

    Mad Professor Deity

    Joined:
    Feb 12, 2006
    Messages:
    2,648
    Location:
    Hahndorf, Australia
    hahahahahahaha :lol:

    This just might be the game that gets me playing G/BOTM's again. I like the creativity :D
     
  9. jesusin

    jesusin Ant GOTM Staff

    Joined:
    Aug 26, 2005
    Messages:
    4,135
    Location:
    Madrid
    Thanks for bringing up all that info, Tachywaxon


    My fears are confirmed, then. If Mongols take and autoraze 6 capitals while Russians stupidly wait for any city to become pop2, then the seventh AI will win the game by conquest victory!!!
    I wonder what would happen if Mongols autoraze 6th and 7th capital on the same turn.


    Oh, I'm wrong because complete-kill is required. We could then win a conquest victory without ever having a city? :confused:
     
  10. Mad Professor

    Mad Professor Deity

    Joined:
    Feb 12, 2006
    Messages:
    2,648
    Location:
    Hahndorf, Australia
    Our map maker did promise that such would be impossible. Maybe he's put a unit behind inaccessible range of mountains or something... :p
     
  11. MarkM

    MarkM Cow Herder

    Joined:
    Jan 15, 2007
    Messages:
    681
    Location:
    America's Dairyland
    I believe you're overthinking. It's probably as simple as at less tone of the civs starting on another landmass (meaning you need water transport).

    If what you said was true, you'd actually not just need cities ... you wouldn't be able to win a total kill until paratroopers :)
     
  12. ZPV

    ZPV Short for ZPVCSPLFUIFDPEF

    Joined:
    Jan 16, 2008
    Messages:
    3,930
    Location:
    England
    Just a brief heads up:
    Free wins vs the barbs don't mean what you think they mean. It's still possible to lose, especially if you are redlined and one hit will kill your unit.
    The only effect of having free wins vs the barbs is to change the odds for each round of combat to 90% in your favour.
     
  13. kcd_swede

    kcd_swede Jag är Viking!½ GOTM Staff

    Joined:
    Jun 21, 2007
    Messages:
    7,305
    Gender:
    Male
    Location:
    Stockholm's B.F.C.
    Oh now you tell us.... I wonder how many computers will fly out the window if that happens. :lol:
     
  14. Deckhand

    Deckhand Procrastination at its finest GOTM Staff

    Joined:
    Sep 22, 2008
    Messages:
    5,504
    Gender:
    Male
    Location:
    California
    Thank you. I thought it wasn't guaranteed. Good to know.
    Does this change to 90% occur until you win two battles or just for the first two barb battles?
     
  15. ZPV

    ZPV Short for ZPVCSPLFUIFDPEF

    Joined:
    Jan 16, 2008
    Messages:
    3,930
    Location:
    England
    Until you win two battles. (On Noble, that is)
     
  16. Manco Capac

    Manco Capac Friday,13 June,I Collapse

    Joined:
    Mar 1, 2010
    Messages:
    8,051
    Where did you find the definition of freewinsvsbarbs, ZPV?
     
  17. ZPV

    ZPV Short for ZPVCSPLFUIFDPEF

    Joined:
    Jan 16, 2008
    Messages:
    3,930
    Location:
    England
    I looked through the combat code, in Unit.cpp. The relevant function is getDefenderCombatValues.

    I've tested it to make sure it really can happen, and had a warrior lose to a heavily-promoted modern armour. BUFFY correctly displays the odds of winning as 27% (for 2 vs 152 strength), although a little bit of the accompanying detail is wrong, and frankly it pushes the RNG beyond what it's designed for.
     
  18. Greeder

    Greeder Warlord

    Joined:
    Dec 1, 2010
    Messages:
    164
    Location:
    Poland
    C'mon KCD, give us spoilers :D
     
  19. kcd_swede

    kcd_swede Jag är Viking!½ GOTM Staff

    Joined:
    Jun 21, 2007
    Messages:
    7,305
    Gender:
    Male
    Location:
    Stockholm's B.F.C.
    Impatience is a virtue. Your wish is my command. Spoiler threads posted. :p
     
  20. Lord Civius

    Lord Civius Emperor

    Joined:
    Mar 11, 2008
    Messages:
    1,767
    Location:
    Florida
    Seems you have once again topped your last brilliant game of the month kcd! I am firing it up now should be a fun one.
     

Share This Page