FfH2 Bug Thread

I know nothing about the kuriotates, really. In the first game I played them on (Hotseat) the capital, when founded was a permanent settlment, but when I restarted a single player later they founded a city fine. Is there something I'm missing?

Depending on the map size, they can only have 2, 3, 4, or 5 real cities.
 
I know nothing about the kuriotates, really. In the first game I played them on (Hotseat) the capital, when founded was a permanent settlment, but when I restarted a single player later they founded a city fine. Is there something I'm missing?

Were you playing them in a mod?

IIRC, in FfH a multiplayer game forces the first Kurio cities to be actual Cities, to prevent OOS.

In FF and RifE they are instead forced to be settlements, and can be promoted by any unit in the city. Prevents OOS, while allowing better control. The AI will always promote them.


Not sure which method Orbis and Wild Mana use. :lol:
 
This here fixes a few problems with the starting settler (as reported here http://forums.civfanatics.com/showthread.php?t=347639 for example). Also allows to disable AI moving the starting settler via XML (might be interesting for modmodding/ scenarios).

you would have to add an XML tag to worldsize info, all necessary code is in wildmana source.

Spoiler :

begin of CvUnitAI::AI_settlemove
replaces existing added code
Code:
/*************************************************************************************************/
/**	BETTER AI (UNITAI_SETTLE move) Sephi                        	                            **/
/**																								**/
/**						                                            							**/
/*************************************************************************************************/

    //reset values after first city is build
	if (GET_PLAYER(getOwnerINLINE()).getNumCities() == 1 && getGroup()->getNumUnits()==1)
	{
        GET_PLAYER(getOwnerINLINE()).AI_updateFoundValues(false);
	}

	if (GET_PLAYER(getOwnerINLINE()).getNumCities() == 0)
	{
	    if (GC.getGameINLINE().getGameTurn()==0)
	    {
            GET_PLAYER(getOwnerINLINE()).AI_updateFoundValues(false);

            CvPlot* pLoopPlot;
            CvPlot* pBestPlot;
            int iSearchRange;
            int iPathTurns;
            int iValue;
            int iBestValue;
            int iDX, iDY;

            iSearchRange = GC.getWorldInfo(GC.getMapINLINE().getWorldSize()).getAISettlerMove();
            int iRange = 6;


            iBestValue = 0;
            pBestPlot = NULL;

            for (iDX = -(iSearchRange); iDX <= iSearchRange; iDX++)
            {
                for (iDY = -(iSearchRange); iDY <= iSearchRange; iDY++)
                {
                    pLoopPlot	= plotXY(getX_INLINE(), getY_INLINE(), iDX, iDY);

                    if (pLoopPlot != NULL)
                    {
                        if ((AI_plotValid(pLoopPlot)) && canFound(pLoopPlot))
                        {
                            if (!pLoopPlot->isVisibleEnemyUnit(this))
                            {
                                if (generatePath(pLoopPlot, 0, true, &iPathTurns))
                                {
                                    if (iPathTurns<3)
                                    {
                                        iValue = pLoopPlot->getFoundValue(getOwnerINLINE());
                                        if (iValue > iBestValue)
                                        {
                                            iBestValue = iValue;
                                            pBestPlot = pLoopPlot;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            if (pBestPlot != NULL)
            {
                if(atPlot(pBestPlot))
                {
                    getGroup()->pushMission(MISSION_FOUND);
                    return;
                }
                else
                {
                getGroup()->pushMission(MISSION_MOVE_TO, pBestPlot->getX_INLINE(), pBestPlot->getY_INLINE());
                // Teleport other units to this plot
                if (GC.getGameINLINE().getGameTurn()<4)
                {
                    CvUnit* pLoopUnit;
                    int iLoop;
                    for(pLoopUnit = GET_PLAYER(getOwnerINLINE()).firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = GET_PLAYER(getOwnerINLINE()).nextUnit(&iLoop))
                    {
                        if (pLoopUnit)
                        {
                            if (pLoopUnit!=this)
                            {
								if(!at(pBestPlot->getX_INLINE(),pBestPlot->getY_INLINE()))
								{
									pLoopUnit->setXY(pBestPlot->getX_INLINE(),pBestPlot->getY_INLINE());
								}
                            }
                        }
                    }
                }
                return;
                }

            }
	    }

        if (canFound(plot()))
        {
            getGroup()->pushMission(MISSION_FOUND);
            return;
        }

        //haven't found a City after 3 turns?
	    if (GC.getGameINLINE().getGameTurn()>3)
	    {
            CvPlot* pLoopPlot;
            CvPlot* pBestPlot;
            int iSearchRange;
            int iPathTurns;
            int iValue;
            int iBestValue;
            int iDX, iDY;

            iSearchRange = 6;
            int iRange = 6;


            iBestValue = 0;
            pBestPlot = NULL;

            for (iDX = -(iSearchRange); iDX <= iSearchRange; iDX++)
            {
                for (iDY = -(iSearchRange); iDY <= iSearchRange; iDY++)
                {
                    pLoopPlot	= plotXY(getX_INLINE(), getY_INLINE(), iDX, iDY);

                    if (pLoopPlot != NULL)
                    {
                        if ((AI_plotValid(pLoopPlot)) && canFound(pLoopPlot))
                        {
                            if (!pLoopPlot->isVisibleEnemyUnit(this))
                            {
                                if (generatePath(pLoopPlot, 0, true, &iPathTurns))
                                {
                                    if (iPathTurns<3)
                                    {
                                        iValue = pLoopPlot->getFoundValue(getOwnerINLINE());
                                        if (iValue > iBestValue)
                                        {
                                            iBestValue = iValue;
                                            pBestPlot = pLoopPlot;
                                            FAssert(!atPlot(pBestPlot));
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (pBestPlot != NULL)
            {
                if(atPlot(pBestPlot))
                {
                    getGroup()->pushMission(MISSION_FOUND);
                    return;
                }
                else
                {
                    getGroup()->pushMission(MISSION_MOVE_TO, pBestPlot->getX_INLINE(), pBestPlot->getY_INLINE());
                    return;
                }
            }
	    }
    }

    int iNeededPatrol=4;
    if (GET_TEAM(getTeam()).isBarbarianAlly())
    {
        iNeededPatrol=2;
    }

    if (plot()->isCity() && getGroup()->getNumUnits()<iNeededPatrol)
    {
        if (plot()->getOwnerINLINE()==getOwnerINLINE())
        {
            CLLNode<IDInfo>* pUnitNode;
            CvUnit* pLoopUnit;
            pUnitNode = plot()->headUnitNode();

            while (pUnitNode != NULL)
            {
                pLoopUnit = ::getUnit(pUnitNode->m_data);
                pUnitNode = plot()->nextUnitNode(pUnitNode);
                if (pLoopUnit)
                {
                    if (pLoopUnit->AI_getGroupflag()==GROUPFLAG_SETTLERGROUP)
                    {
                        joinGroup(pLoopUnit->getGroup());
                        getGroup()->pushMission(MISSION_SKIP);
                        return;
                    }
                }
            }

            getGroup()->pushMission(MISSION_SKIP);
            return;

        }
    }

    if (getGroup()->getNumUnits()<iNeededPatrol)
    {
        if (plot()->isCity())
        {
            getGroup()->pushMission(MISSION_SKIP);
            return;
        }
    }

/*************************************************************************************************/
/**	END	                                        												**/
/*************************************************************************************************/
 
Were you playing them in a mod?

In FF and RifE they are instead forced to be settlements, and can be promoted by any unit in the city. Prevents OOS, while allowing better control. The AI will always promote them.:lol:

I checked and it was indeed a FF game. Thnx Valk!:goodjob:
 
Ira with Orthus's Axe gains +2 strength after defeating alive enemy unit.
Repentant Angel with Orthus's Axe loses no strength after defeating alive enemy unit.

This is suggestion sample code to fix them.

Modify:
Spoiler :
CvSpellInterface.py:
Code:
def postCombatReduceCombat1(pCaster, pOpponent):
	if pOpponent.isAlive():
		if pCaster.baseCombatStr() > pCaster.getTotalDamageTypeCombat():
			pCaster.setBaseCombatStr(pCaster.baseCombatStr() - pCaster.getTotalDamageTypeCombat() - 1)
			pCaster.setBaseCombatStrDefense(pCaster.baseCombatStrDefense() - pCaster.getTotalDamageTypeCombat() - 1)
			CyInterface().addMessage(pCaster.getOwner(), True, gc.getEVENT_MESSAGE_TIME(), CyTranslator().getText('TXT_KEY_MESSAGE_STRENGTH_REDUCED', (pCaster.getNameKey(), )), '', InterfaceMessageTypes.MESSAGE_TYPE_INFO, pCaster.getButton(), gc.getInfoTypeForString('COLOR_RED'), pCaster.getX(), pCaster.getY(), True, True)

Code:
def postCombatIra(pCaster, pOpponent):
	if pOpponent.isAlive():
		if pCaster.baseCombatStr() < 32:
			pCaster.setBaseCombatStr(pCaster.baseCombatStr() - pCaster.getTotalDamageTypeCombat() + 1)
			pCaster.setBaseCombatStrDefense(pCaster.baseCombatStrDefense() - pCaster.getTotalDamageTypeCombat() + 1)
Add to:
Spoiler :
CyUnit.cpp
Code:
int CyUnit::getTotalDamageTypeCombat() const
{
	return m_pUnit ? m_pUnit->getTotalDamageTypeCombat() : -1;
}

CyUnit.h
Code:
	int getTotalDamageTypeCombat() const;

CyUnitInterface1.cpp
Code:
		.def("getTotalDamageTypeCombat", &CyUnit::getTotalDamageTypeCombat, "int ()")
 
I had an Axeman attack a Spectre (Fear Promotion) but he was afraid as expected. Next turn, I tried again and the Axeman killed the Spectre. Intended or bug? I know when I have a unit with Fear the AI units move away turn after turn. patch j
 
GetInfoType("NO_IMPROVEMENT")
GetInfoType("NO_BONUS")
GetInfoType("NO_FEATURE")

I found these description at Erebus.py cause error when using Debug DLL.

I replaced each to:
ImprovementTypes.NO_IMPROVEMENT
BonusTypes.NO_BONUS
FeatureTypes.NO_FEATURE

Then error doesn't be caused.
 
I had an Axeman attack a Spectre (Fear Promotion) but he was afraid as expected. Next turn, I tried again and the Axeman killed the Spectre. Intended or bug? I know when I have a unit with Fear the AI units move away turn after turn. patch j
Living units that are not immune to fear have a chance to overcome that fear each time they try to attack a unit with the Fear promotion. Because of the random nature of this effect, it is possible for a unit to fail to attack a unit with the Fear promotion 100 times in succession or to succeed in attacking that unit on the first try.
 
I'm a ways into a game (as Basium), and suddenly if I end my turn, the game hangs, waiting for the AI players to finish. I hear the sound effects from their doing a couple of things, then nothing. I poked around in WB a bit, but I don't really know what to look for.

Oh, and I know I tanked my economy. That's beside the point.

Hopefully, this save will help the developers find the bug.

Thanks, and looking forward to the next patch!

Ben
 

Attachments

  • Basium AD-0292.CivBeyondSwordSave
    568.7 KB · Views: 44
Living units that are not immune to fear have a chance to overcome that fear each time they try to attack a unit with the Fear promotion. Because of the random nature of this effect, it is possible for a unit to fail to attack a unit with the Fear promotion 100 times in succession or to succeed in attacking that unit on the first try.

Good info. Thanks.
 
Another example of the summon tiger bug:

http://forums.civfanatics.com/showthread.php?p=8763239#post8763239

Note this is a case where the stack has 6 tigers. The game crashes (not a WoC, a real crash) if there are 4, 5, or 6 tigers in the stack - but eliminating 4 stabilizes the game.

Best wishes,

Breunor

Thanks, Breunor. I went into the Worldbuilder and deleted every single tiger from all the FoL people summoned. It was stable again--for one turn. Then it crashed again when they resummoned them the very next turn. So, I deleted all the tigers again.

Now it seems that the game crashes with ANY summoned tigers. Is this game unplayable? I don't just mean this save game, but the entire game. Every game, there will be at least a few Followers of Leaves, and inevitably they will want to summon tigers. It seems like this bug makes the entire game unplayable.
 
I'm a ways into a game (as Basium), and suddenly if I end my turn, the game hangs, waiting for the AI players to finish. I hear the sound effects from their doing a couple of things, then nothing. I poked around in WB a bit, but I don't really know what to look for.

Oh, and I know I tanked my economy. That's beside the point.

Hopefully, this save will help the developers find the bug.

Thanks, and looking forward to the next patch!

Ben

Ben,

I generally don't try to 'fix' games on huge maps, it just takes too long. As you did, I poked around for 'obvious' issues.

One common bug we have seen if that the game crashes after the Avatar of Wrath appears. I'm not sure if this event has happenend in your game; the AC is at 89, and there are some units in the middle of the map that looks like they have turned barbarian. Conversely, there should be more barbarian units if the Avatar of Wrath appeared and I don't see it on the map.

If you did run into the Avatar of Wrath bug, I've never been able to fix it.

Sorry.

Breunor
 
Thanks, Breunor. I went into the Worldbuilder and deleted every single tiger from all the FoL people summoned. It was stable again--for one turn. Then it crashed again when they resummoned them the very next turn. So, I deleted all the tigers again.

Now it seems that the game crashes with ANY summoned tigers. Is this game unplayable? I don't just mean this save game, but the entire game. Every game, there will be at least a few Followers of Leaves, and inevitably they will want to summon tigers. It seems like this bug makes the entire game unplayable.

This is a very good question. I've fixed many summon tiger games, but I don't know if people played on, ran into the problem again, etc.

For whatever reason, I've never had this in any of my games?!

Best wishes,

Breunor
 
I've only had the "tiger" bug occur in one of my games, and I've played numerous games with AIs summoning Tigers without any problem. I'm not sure what triggers the bug, but it doesn't seem to guaranteed to occur.
 
Here's a crashing Ljosalfar game. Might be because I'm blooming on a rice farm or something, other than that I don't know what's wrong. There's a war between the ai as well.
View attachment 238967

Ok, try this:

This is one of the most frustrating bugs I've ever try to track down. Generally, my technique is to eliminate the minimal number of units to stabilize the game, I don't want to amputate when a band-aid will work.

Here, though it is real wierd. First of all, let's be clear - this bug is almost certainly not from bloom, it is indeed the summon tiger bug. Please look at the city of Vallus - it is virtually surrounded by Kuriotate, Bannor, and Ljosalfar priests of leaves - you are 'asking for it'!

There isn't a single unit or stack that causes/fixes the problem. But the weirdest part is that the terrain seems to be impacting it! So, if I eliminate the units in the stack south of Vallus, which has Ljosalfar and Bannor units, and also eliminate the Kuriotate stack two to the West of Vallus, the game crashes. However, if I ERASE the two stacks (meaning I also destroy the terrain) the crash is fixed.

So I eliminated the two stacks and I eliminate the killer barbarian axeman (level 6) two squares to the South of Vallus. That fixes the crash.

Unfortunately, eliminating other stacks around Vallus also seems to do the trick so it is somewhat arbitrary; you may want to fool with it yourself to see how you want to minimally impact the game.

Best wishes,

Breunor
 

Attachments

  • Randy AD-0240.CivBeyondSwordSave
    235.5 KB · Views: 54
Hi all!

again the annoying me ^^

i am currently playing the Svartalvar (or Dark Elves) and i have a mine under my control that sits atop an Iron resouce, but it is not recocnized by the game ... still telling me, i got no iron ... save game attached, eventually this is a bug ...

i guess the tooltip needs to be reworked, as smelting tech states, that is reveals iron, which it does, but the resource is not shown in the city screen, iron working is being researched right now, but the tooltip does not state, that this tech is required to gain access to this resource ...

anyways, happy new year to every1 ...

regards

HahnHolio
 

Attachments

  • DarkElvesFfH.CivBeyondSwordSave
    580.4 KB · Views: 42
This is a very good question. I've fixed many summon tiger games, but I don't know if people played on, ran into the problem again, etc.

For whatever reason, I've never had this in any of my games?!

Best wishes,

Breunor

Okay, I'll be sure to keep letting you know how things have been going. Thus far, I've had to do 4 tiger deletions this game. I'm saving between every turn, and the last 2 times it's been 2-3 turns between crashes.
 
Top Bottom