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

FfH2 Bug Thread

Discussion in 'Civ4 - Fall from Heaven' started by Kael, Jan 26, 2009.

  1. Breunor

    Breunor Chieftain

    Joined:
    Jul 2, 2004
    Messages:
    2,388
    Location:
    Earth
    Unfortunately, you have run into the 'Avatar of Wrath' bug. We do know a lot of people post WoC's (the Waiting for Other Civilization goes on forever, an infinite loop at the end of the turn) when the Avatar of Wrath appears. We do NOT know how many games have the Avatar of Wrath come without the WoC error, so I can't tell you if this is very common or a tad unlucky.

    Nobody knows what casues the bug. The 'main theory' probably is that the AC hitting 90 causes half the living land units to become enraged, and there is some small WoC bug with enraged - unfortunatley, with half of the board potentially getting this bug, even if there is a small chance/unit, there is a stronger chance the player will run into it with the units across the board. Or we could just be dead worng and there is a different bug here.

    Worse, my method of fixing files doesn't work for this bug. Deleting units, instead of 'stabilizing' the problem, changes the units that do become enraged as a fixed set of random numbers are now applied to a differnt set of units. In simple terms, my methods don't have a science to them in this case.

    The 'usual' prescription is to reload an auto save, and do SOMETHING different to reset the pattern of random nubmers. Some people have posted success with this tactic. For scientific purposes, if you can get this to work, let us know!


    Good luck,

    Breunor
     
  2. Morkonan

    Morkonan Chieftain

    Joined:
    Mar 7, 2007
    Messages:
    287
    Outstanding! Thank you very much! It was just a "doodle game", trying out several different things. But, it was fun just the same.

    I really need to learn how to use the editor but, I don't know all the bugs to look for that can be fixed with it. :)
     
  3. snarko

    snarko DLLer

    Joined:
    Dec 9, 2003
    Messages:
    1,512
    Location:
    Sweden

    Once again this code is causing WoCs. Kael, I strongly recommend you do not split the group here but instead move the whole group as one. This time I will not post a fix. It's caused by the fact that the group is split up in the first place, then later in some other code decide to group with a nearby unit - the same one they were forced to split from. My first fix will not work here, the problem is that they seperate in the first place.

    ---------------------------------------------------

    More WoCs:
    CvUnitAI::ConquestMove()

    Code:
    if (isHiddenNationality())
        {
            AI_setGroupflag(GROUPFLAG_NONE);
            joinGroup(NULL);
            getGroup()->pushMission(MISSION_SKIP);
        }
    DO NOT JOIN GROUP NULL LIKE THIS FOR UNITS THAT YOU ALLOW TO GROUP!

    HN units are allowed to group with other HN units. This code will make them split up. What does that do? They join the group again, split up and rejoin etc. It's a similar problem as in this thread (the first WoC).


    ---------------------------------------------------

    Useless code:

    CvUnitAI::AI_anyAttack
    Code:
    if (AI_rangeAttack(iRange))
    	{
    		return true;
    	}
    Afaik there are no rangeAttack units in FfH 2, I assume this is something imported by mistake.
     
  4. snarko

    snarko DLLer

    Joined:
    Dec 9, 2003
    Messages:
    1,512
    Location:
    Sweden
    *edit*
    Fixed. The problem is that it's checking if a unit is invisible on it's plot, except the unit has just been created and doesn't have a plot yet.


    In CvUnit::getInvisibleType()

    if (plot()->isOwned())

    The line before this should be
    if (plot() != NULL)



    ---------------------------------------------------

    There's another problem with invisibility in CvUnit::setXY(int iX, int iY, bool bGroup, bool bUpdate, bool bShow, bool bCheckPlotVisible). It's this line:
    if (!isInvisible(pLoopUnit->getTeam(), false))

    Why is this a problem? Because it's checking if we're invisible on the plot we're ON, not the plot we're moving INTO.
    *What if we're invisible on the plot we're moving into but not the plot we're on? We bump the unit, for no reason.
    *What if we're invisible on the plot we're on but not the plot we're moving into? Potential CtD.


    My fix is rather long. CvUnit::isInvisible is called by the exe, we cannot change the arguments. At the same time we need to check pNewPlot... so I made a duplicate of the function.

    Spoiler code :

    CvUnit::setXY
    Code:
    /*************************************************************************************************/
    /**	Tweak					 	   10/04/10									Snarko				**/
    /**																								**/
    /**				This should check the plot we're moving into, not the plot we're on				**/
    /*************************************************************************************************/
    /**								---- Start Original Code ----									**
    									if (!isInvisible(pLoopUnit->getTeam(), false))
    /**								----  End Original Code  ----									**/
    									if (!isInvisible(pLoopUnit->getTeam(), pNewPlot))
    /*************************************************************************************************/
    /**	Tweak								END														**/
    /*************************************************************************************************/
    CvUnit.cpp
    Code:
    /*************************************************************************************************/
    /**	Tweak					 	   11/04/10									Snarko				**/
    /**																								**/
    /**				So we can check the plot we're moving into, instead of plot we're on			**/
    /*************************************************************************************************/
    bool CvUnit::isInvisible(TeamTypes eTeam, const CvPlot* pPlot) const
    {
    
    	if (getTeam() == eTeam)
    	{
    		return false;
    	}
    
    //FfH: Added by Kael 04/11/2008
        if (pPlot != NULL)
        {
            if (pPlot->isCity())
            {
                if (getTeam() == pPlot->getTeam())
                {
                    return false;
                }
            }
            if (pPlot->isOwned())
            {
                if (pPlot->getTeam() != getTeam())
                {
                    if (GET_PLAYER(pPlot->getOwnerINLINE()).isSeeInvisible())
                    {
                        return false;
                    }
                }
                if (pPlot->getTeam() == getTeam())
                {
                    if (GET_PLAYER(pPlot->getOwnerINLINE()).isHideUnits() && !isIgnoreHide())
                    {
                        return true;
                    }
                }
            }
        }
    //FfH: End Add
    
    	if (alwaysInvisible())
    	{
    		return true;
    	}
    
    	if (getInvisibleType() == NO_INVISIBLE)
    	{
    		return false;
    	}
    
    //FfH: Added by Kael 01/16/2009
        if (pPlot == NULL)
        {
            return false;
        }
    //FfH: End Add
    
    	return !(pPlot->isInvisibleVisible(eTeam, getInvisibleType()));
    }
    /*************************************************************************************************/
    /**	Tweak									END													**/
    /*************************************************************************************************/

    CvUnit.h
    Code:
    /*************************************************************************************************/
    /**	Tweak					 	   11/04/10									Snarko				**/
    /**																								**/
    /**				So we can check the plot we're moving into, instead of plot we're on			**/
    /*************************************************************************************************/
    	//The original isInvisible function is used by the exe, so we can't change the arguments to take the new plot into account
    	//Therefor we use an exact copy, only change being we remove the debug/cargo and add the plot
    	bool isInvisible(TeamTypes eTeam, const CvPlot* pPlot) const;	
    /*************************************************************************************************/
    /**	Tweak									END													**/
    /*************************************************************************************************/
     
  5. fish_sticks

    fish_sticks Chieftain

    Joined:
    Feb 4, 2006
    Messages:
    45
    Since we are on the topic of invisibility of units I would point out spiders and such causing crashes. I just wanted to point out that a unit may move into tiles that are visible. However, the tiles may move onto the unit as well due to cultural borders.

    This is moderately common in the early parts of the game from my own experiences. If I get a CtD I usually check the map for spiders that are about to be taken over by cultural expansion.
     
  6. snarko

    snarko DLLer

    Joined:
    Dec 9, 2003
    Messages:
    1,512
    Location:
    Sweden
    CIV4EventTriggerInfos.xml, trigger EVENTTRIGGER_TOXCATL.

    This is a BtS even specific to the Aztecs. I don't know why it's included in FfH 2, it's only supposed to happen for the Aztecs.
     
  7. Broktor

    Broktor Chieftain

    Joined:
    Jun 14, 2010
    Messages:
    16
    Hello all. This is my first post on the forum, and unfortunately I have a very specific reason for signing up and posting.

    I love FfH 2, have for a long time now. I've played it for months with no issues. Suddenly this morning however, after completing the third Lanun scenario, the game crashes every time I try and load a scenario.

    Now, normal games load fine and play well enough. No real issues. This is ONLY with the scenarios, and only since this morning.

    I have not touched any system files or made any changes to the game settings today or any time recently. I am utterly at a loss as to what is causing this. I tried reinstalling the game and the patch, and it did not fix the issue.
     
  8. Sehremis

    Sehremis Chieftain

    Joined:
    Feb 17, 2010
    Messages:
    7
    Location:
    Munich
    Hm, but that would mean I could also fix the bug by radnomly deleting units or by using the "new random key on load" setting on custom games, right?
     
  9. Breunor

    Breunor Chieftain

    Joined:
    Jul 2, 2004
    Messages:
    2,388
    Location:
    Earth
    Maybe. To be honest we just don't know. Look at what Snarko said above, he may have acually found the bug.


    Snarko, AWESOME job. I think you have found the source of the bulk of the bugs reported. Let's hope they get into patch o.

    Best wishes,

    Breunor
     
  10. Sehremis

    Sehremis Chieftain

    Joined:
    Feb 17, 2010
    Messages:
    7
    Location:
    Munich
    Hmm, will a new patch with the bugfix still be able to play this savegame?
    Other than that, I've tried to fix it, and it did indeed work when I finished everyone but the Khazad, but it didn't work if I just finished entire civilizations...:sad:
     
  11. Ratlock

    Ratlock Chieftain

    Joined:
    Jun 3, 2010
    Messages:
    16
    Location:
    Helsinki, Finland
    Don't worry about the game, I can always start a new one (indeed, have done so several times since posting :). The main reason I submitted it was to help you debugging this great game.

    Come to think of it, I also have some game play issues. For example, if you have the Eyes and Ears network, so that you can see what people are researching, the score window can get pretty wide and can go over the unit icons if you have plenty of them. It is very difficult in such cases activate certain units whose icons are completely under the score window. It seems that an obvious fix would be to move the score window to the upper right corner.

    I was also surprised that Lanun's world spell destroyed my Basium installments even though we were allied (I built the gate as Lanun). Then again, it does say that it affects everyone but Lanun, so I suppose this is not a bug.

    Further, I was wondering is there any logic in who gets the holy city or great person if Basium and his parent civilization research together a tech that is supposed to give you one. Is there a way to control this? Does it depend on whose turn it is when the research is completed? If the latter, then it should be possible to use the sliders to make sure you get it, but to do that, but how to do that exactly? In which order are the civs handled?

    Well, there are other issues and suggestions, but this is probably not the correct thread for them, so I'll just stop here for now.
     
  12. DaveGold

    DaveGold Chieftain

    Joined:
    Dec 1, 2009
    Messages:
    1,058
    There's a control to turn off the scores list. You don't need to see it all the time.
     
  13. Lactamaeon

    Lactamaeon Chieftain

    Joined:
    Nov 2, 2009
    Messages:
    13
    After defeating the Infernals I let the Hell terrain remain so I could keep the Nightmares to trade with.
    However, as I completed the Genesis ritual my toads became sheep and all my nighmares became horses again.
    Is that supposed to happen? Does Genesis take away the Hell terrain?

    The real problem in this is that I can no longer contstruct Chariots or Horse Archers, or Knights (other than from upgrading.) It seems the game has decided to stop counting horses as a resource.
     
  14. Calico001

    Calico001 Chieftain

    Joined:
    Jun 20, 2010
    Messages:
    1
    Hi there!

    I just started playing ffh2 about 2 weeks ago and in my first try with the sheiam i run into the Avatar of Wrath bug causing my game to go WoC. tried to reload a couple of times (only about 10 turns back or so), but usally i still get the WoC even when producing other units, placing them elsewhere on the map or having a couple different ones then the previous saves (AC is about 92-94).
    One time i was able to get beyond the turn where most units go crazy but i still got an WoC after that turn... :crazyeye:

    FFH2 really is a great mod, thank you very much for doing all the work with it. Hope you get this soab bug, i'm really afraid playing "evil" know... although i had lots of fun doing so.

    best wishes
    Calico
     
  15. Kael

    Kael Chieftain

    Joined:
    May 6, 2002
    Messages:
    17,401
    Location:
    Ohio
    I checked in the first fix, thanks snarko.

    As for the second, the unit that is being checked isn't moving. The function is looping through all the units in the plot the acting unit is moving into and checking to see if the looping units are invisible in their current plot. So I dont think that fixes anything, let me know if you disagree.
     
  16. clearbeard

    clearbeard Chieftain

    Joined:
    Dec 17, 2004
    Messages:
    691
    Gender:
    Male
    Location:
    Delaware, USA
    Probably the FAQ thread would be a better place for the questions, but there's an easy way to make sure you get the religious techs for the holy city, rather than your team mate. In the diplomacy dialogue, you can select "lets talk about something else" and ask Basium to research something else on the last turn, and he will always switch. If you want him to get it, for some reason, switch your own tech, then ask him to keep researching the religion. Works in any Civ game where you have an AI team mate.
     
  17. mahazel

    mahazel Chieftain

    Joined:
    Mar 19, 2008
    Messages:
    243
    Location:
    Kraków
    CtD in my current game, war with Fearyl, my Shadow vs. svartalfar's tiger, Svartalfar territory:

    When invisible (not HN) unit with subdue animal (maybe with domination etc. too) is on the plot with enemy unit\s (I'm at war with them) and catch animal, then game crash. I think it's because created not hidden unit cannot been on the same plot as enemy unit.
     
  18. clearbeard

    clearbeard Chieftain

    Joined:
    Dec 17, 2004
    Messages:
    691
    Gender:
    Male
    Location:
    Delaware, USA
    I know it generally only comes up in the scenarios that use the "always war" game option, but could we please get Sephi's fix for the AI included in patch "o"? Reference this thread for discussion, though the file links there by Sephi are inactive. Besides, it might be fun to do a good vs. evil team game, with "always war" on outside a scenario setting.
     
  19. cyther

    cyther Lord of the Dance

    Joined:
    Jun 9, 2008
    Messages:
    1,033
    Location:
    Fane of Lessers
    I've been able to clone Immortals by giving one The Black Mirror. When they run out of duration, they just appear in my capital. I can now reduce any army to 10% strength.
     
  20. Lopriest

    Lopriest Chieftain

    Joined:
    Dec 24, 2007
    Messages:
    7
    Location:
    Anaheim, CA
    Yes, I've experienced this bug as well.
     

Share This Page