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

Specific Bug Reports

Discussion in 'Civ4 - Better AI' started by Iustus, Jan 25, 2007.

  1. TheOnlyDJCat

    TheOnlyDJCat Warlord

    Joined:
    Dec 31, 2006
    Messages:
    112
    Location:
    Germany
    I get a reproducible crash at end of turn in a DirectIP multiplayer team game (playing with BetterAI 0.8 and BUG4.0).
    By choosing hot seat game and finishing the turn for both players I can avoid the bug. The special thing during AI turn seems to be a new oversea colony vasall.
    Is this a known bug in BetterAI? (save attached if this helps)
     

    Attached Files:

  2. JimMac99

    JimMac99 Warlord

    Joined:
    Jul 11, 2003
    Messages:
    128
    Location:
    Belfast. N.Ireland
    Hey, I have exactly the same problem:
    http://forums.civfanatics.com/showpost.php?p=8413475&postcount=33

    I dont have BUG installed though.

    Maybe there is a mp bug in Better AI 0.80 ?
     
  3. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Thanks for the reports both of you, I'll see if I can track it down.
     
  4. boneys26

    boneys26 BTS Play session tester

    Joined:
    Nov 24, 2005
    Messages:
    839
    Location:
    Coventry, England
    "Holding down SHIFT+ALT and clicking on a leader in the scoreboard toggles your civ's warplan between WARPLAN_PREPARING_TOTAL and NO_WARPLAN."

    scoreboard? the only one I've been using for years is above the mini map but its gone with this mod can anyone tell me where to find the one needed? as for the button/toggle on the mini map its not working.

    Thanks :)
     
  5. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,009
    It is the scoreboard above the minimap. No idea where your's went though.

    Does it show your name/score? If so, click yourself, should make everyone else show back up.
     
  6. boneys26

    boneys26 BTS Play session tester

    Joined:
    Nov 24, 2005
    Messages:
    839
    Location:
    Coventry, England
    not showing anything above the minimap toggles/buttons, scores have gone since i installed this mod :S

    game patched bts v3.19, mod v0.80.

    spec,
    intel quad core P4 2.66GHz
    4GB ram
    geforce 9600GT 512mb Vram
    windows xp home sp3 fully patched,
    no viruses/spyware

    Tried starting new games still no scores above mini-map, cleared cashe, cleaned HDD no other mods running with this, removed my edited files from my games folder. still no scoreboard :S
     
  7. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    There's a button to toggle the scoreboard display, maybe you clicked it accidentally?

    If the rest of the interface shows up fine, just no scoreboard, then something really weird is going on. Turn off HidePythonExceptions in CivilizationIV.ini and start another game, there should be some kind of error message.
     
  8. Tripod

    Tripod Chieftain

    Joined:
    Dec 9, 2007
    Messages:
    32
    Location:
    Germany
    I got a strange bug at the start of the game.
    Just simple downloaded your files and copy them without any changes into the mod Folder.
    But instead of the dawn of man Screen the empty Techchooser appeard.Seems to be a problem with the Sam_Infantry Unit-there is no picture,text or something in the pedia...I checked the XML files by myself but I can`t find any mistakes?
     
  9. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    I just chose an AI player and wanted to manually create an oversea colony -> crash.

    So, even when not under AI control, the game will crash // maybe there is a problem with the new created AI vassal.
     
  10. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    While working on the dune wars mod, which uses BBAI, I ran into this loop. I imagine the result is that this logic is quietly disabled. Not sure if it's a vanilla bug or a BBAI bug. This is in the CvTeamAI::AI_calculateAreaAIType() function. The index iI seems to be a garbage value left over from a team loop.

    Code:
    for (int [COLOR="Blue"]iPlayer[/COLOR] = 0; iPlayer < MAX_CIV_PLAYERS; iPlayer++)
    {
    	CvPlayerAI& kPlayer = GET_PLAYER((PlayerTypes)[COLOR="Red"]iI[/COLOR]);
    	if (kPlayer.isAlive())
    	{
    		if (kPlayer.getTeam() == getID())
    		{
    			if (kPlayer.AI_isDoStrategy(AI_STRATEGY_DAGGER) || kPlayer.AI_isDoStrategy(AI_STRATEGY_FINAL_WAR))
    			{
    				if (pArea->getCitiesPerPlayer((PlayerTypes)iPlayer) > 0)
    				{
    					return AREAAI_MASSING;
    				}
    			}
    		}
    	}
    }
    
     
  11. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Thank you, good find!
     
  12. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    Well I fixed this in the Dune Wars mod, and then I noticed that eventually the AI would go into an endless loop. Maybe it's unwise to fix bugs that pre-date the Civ beta! :lol:
     
  13. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Really?

    The fix is working just fine for me ...
     
  14. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    It probably was an interaction with my code, but be on the lookout for an AI whos turn never ends. It stopped when I un-fixed it.
     
  15. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    @ JimMac99 and TheOnlyDJCat:

    I believe I have fixed the issue causing crashes in your games, I can now continue JimMac99's well past the old crash point. It seemed to be a rare circumstance which wasn't covered in CvUnit::maxCombatStr where BtS didn't properly check if a pointer was valid before using it. The handling of new colonies was recently moved at a Firaxian's suggestion to deal with another bug, my guess is the change of that timing produced the rare circumstance leading the the NULL pointer and crash. The pointer issue is now fixed.

    Let me know if it works for you.
     
  16. JimMac99

    JimMac99 Warlord

    Joined:
    Jul 11, 2003
    Messages:
    128
    Location:
    Belfast. N.Ireland
    Great news jdog :thumbsup:

    I'll not get a chance to get the players together again until next Sunday, (I don’t know any other way of testing) but I will definitely test it out in MP then, and report back. It seems odd that the pointer issue only came to light in multiplayer, but then, what do I know!

    Thanks very much for your work on this; its important to have Better AI in MP.:)
     
  17. TheOnlyDJCat

    TheOnlyDJCat Warlord

    Joined:
    Dec 31, 2006
    Messages:
    112
    Location:
    Germany
    Great!
    I'll also continue the game as soon as my friend comes back from Taiwan... Hope to report soon!
     
  18. stmartin

    stmartin aka. poyuzhe

    Joined:
    Aug 4, 2007
    Messages:
    640
    Location:
    Shanghai
    Hi jdog, I feel obliged to report a bug, because in BBAI you said it's from CAR Mod. I appreciate the credit, so here it is:

    in CvGame::setHolyCity, I believe your code is causing several problems, first it will crash if playing a scenario with preplaced holy city, then it will crash if pNewValue is NULL. I've also revised a little bit to invalidate players attitude toward the old holy city's owner as well.

    Code:
    		// Attitude cache
    		if (GC.getGameINLINE().isFinalInitialized())
    		{
    			for (int iJ = 0; iJ < MAX_CIV_PLAYERS; iJ++)
    			{
    				if (GET_PLAYER((PlayerTypes)iJ).isAlive() && GET_PLAYER((PlayerTypes)iJ).getStateReligion() == eIndex)
    				{
    					if (pOldValue != NULL)
    					{
    						GET_PLAYER(pOldValue->getOwnerINLINE()).AI_invalidateAttitudeCache((PlayerTypes)iJ);
    						GET_PLAYER((PlayerTypes)iJ).AI_invalidateAttitudeCache(pOldValue->getOwnerINLINE());
    					}
    					if (pNewValue != NULL)
    					{
    						GET_PLAYER(pNewValue->getOwnerINLINE()).AI_invalidateAttitudeCache((PlayerTypes)iJ);
    						GET_PLAYER((PlayerTypes)iJ).AI_invalidateAttitudeCache(pNewValue->getOwnerINLINE());
    					}
    				}
    			}
    		}
     
  19. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    stmartin:

    Thanks for the report!

    Which version of BBAI were you reading through? Aside from the isFinalInitialized bit, what you've got there looks just like what's in the latest BBAI (0.81M). I caught a couple of bugs in this block and had to re-release.

    EDIT: Ah, figured it out ... I forgot to re-zip the sourcecode after the change from 0.81L to 0.81M.
     
  20. TheOnlyDJCat

    TheOnlyDJCat Warlord

    Joined:
    Dec 31, 2006
    Messages:
    112
    Location:
    Germany
    I just tried to continue the multi player game with 0.81M. It still crashes when finishing the turn on both computers. The problem with creating colonies seems still to be there :(
    And on a side note - doing one turn in hot seat mode and then continue via Direct IP seems to corrupt the save game permanently :cry:. Afterwards if the client user finishes its turn, there is no wait for other players, instead the game goes OOS...
    This is of course not a problem of BetterAi, but I still hope that you can find the colony bug, otherwise it seems we have to abandon the current game and start a new with vassals disabled:(
     

Share This Page