1. Firaxis celebrates the "Asian American and Pacific Islander Heritage Month", and offers a give-away of a Civ6 anthology copy (5 in total)! For all the details, please check the thread here. .
    Dismiss Notice
  2. We have selected the winners of the Old World random draw and competition. For the winning entries, please check this thread.
    Dismiss Notice

Hanging issue on AI's turn

Discussion in 'Civ4 - Planetfall Mod' started by Quibblesome, Dec 5, 2009.

  1. Quibblesome

    Quibblesome Warlord

    Joined:
    Nov 8, 2009
    Messages:
    231
    Got the latest patch so im now on v12f (love the new interface btw).
    Been playing a very interesting game as Miriam. However i'm stuck as the the game appears to hang on the AI's turn. The game is still "usable", I can still scroll around the map and click on things but the AI's turn never ends.

    I can only assume that someone is stuck on an infinite loop somewhere. How would one debug this scenario? I'd attach a save but unfortunately i'm too thick to find the save games......
     
  2. Maniac

    Maniac Apolyton Sage

    Joined:
    Nov 27, 2004
    Messages:
    5,588
    Location:
    Gent, Belgium
    The latest patch is g.
    When you save a game, I think you can see the folder where it's saved. First test if the problem persists with patch g. If it does, please attach a save - without one I can't do anything.
     
  3. Quibblesome

    Quibblesome Warlord

    Joined:
    Nov 8, 2009
    Messages:
    231
    Ah yes, sorry it was 12g I was running. I attach the save:

    My last few actions have mainly been revolving around spreading Edenism to both Lal and the University. I just convinced the University to switch to Edenism. My intention is to attack Lal once i'm finished with Deadrie.

    I've also been at war with Deadrie for AGES.
     

    Attached Files:

  4. Maniac

    Maniac Apolyton Sage

    Joined:
    Nov 27, 2004
    Messages:
    5,588
    Location:
    Gent, Belgium
    Thanks. I can confirm the problem.
     
  5. Maniac

    Maniac Apolyton Sage

    Joined:
    Nov 27, 2004
    Messages:
    5,588
    Location:
    Gent, Belgium
    Problem found: I'll try to release a patch today.
     
  6. Quibblesome

    Quibblesome Warlord

    Joined:
    Nov 8, 2009
    Messages:
    231
    What was the issue? I'm a dev so bugs always intrigue me. :)
     
  7. Maniac

    Maniac Apolyton Sage

    Joined:
    Nov 27, 2004
    Messages:
    5,588
    Location:
    Gent, Belgium
    Well that part of the code is a rather complex mess. I don't have a clear understanding of it myself. Basically a unit checks what plot is the best one to move to, and in the process checks if it can move to that plot at all. Then when it has decided what plot to move to, it tries to actually move there and checks again if it can move there. The problem is sometimes certain variables are different in all those different checks. In this particular case a unit's AI thought it could move to a certain plot, tried to move there but then on a second different check noticed that it couldn't move there after all. So it went back to the AI code to see what's the best plot to move to. The result was the same, so it tried again to move to that same plot, but couldn't... etcetera. This led to an infinite loop. The cause was the restriction on capturing native life infested bases that I added.
     
  8. Quibblesome

    Quibblesome Warlord

    Joined:
    Nov 8, 2009
    Messages:
    231
    Nice one on the debug, quick turn around. I got another for you though. Last game I played had Miriam with a base that was 31555 turns away from finishing its drone riots.

    Its proximity to a signed 16 bit integer's max value (32767) is probably of note. Save attached.
     

    Attached Files:

  9. Maniac

    Maniac Apolyton Sage

    Joined:
    Nov 27, 2004
    Messages:
    5,588
    Location:
    Gent, Belgium
    I'd need a save of just prior to the riot to know the cause of the riot. Nevertheless, I think I can guess the cause of this issue. Could drawing a SorenRandomNumber from a negative number result in this?

    I'll release a patch with this small fix.
     
  10. Panopticon

    Panopticon Utilitarian

    Joined:
    Aug 4, 2007
    Messages:
    1,454
    Location:
    Ireland
    Well spotted all.
     
  11. ozymandyus

    ozymandyus Chieftain

    Joined:
    Nov 6, 2001
    Messages:
    30
    Just a heads up, I am experiencing the hang in between turns with my version 13k saved game. Basically it goes to "waiting for other factions", I can still scroll around the screen, but nothing happens even after 30 minutes or so.

    I'm playing a Morganite faction, and am involved in a largish war with Miriam at the moment. Saved game file attached. Edit: attached recent auto-saves as well.
     

    Attached Files:

  12. ozymandyus

    ozymandyus Chieftain

    Joined:
    Nov 6, 2001
    Messages:
    30
    Just a last quick follow-up, in case anyone is curious. I've had this happen in three different games now, and have narrow down the parameters. This invariably happens later in standard-sized maps, and always exactly two turns after I go to war with Miriam's Believers faction. Not sure why it's them in particular, but there it is.

    I've fought larger battles, and later in games, against Yang, Lal, and the Spartans with various factions. It's always war with Miriam that causes the problem.
     
  13. Maniac

    Maniac Apolyton Sage

    Joined:
    Nov 27, 2004
    Messages:
    5,588
    Location:
    Gent, Belgium
    I seem to have missed your post on 12 July. Too late to investigate that save now. If this happens under patch l too, please attach another save.
     
  14. GeoModder

    GeoModder Deity

    Joined:
    Nov 29, 2005
    Messages:
    7,512
    This might have been the same thing as with the Peacekeeper save I forwarded to you last week. IIRC I was at war with Miri too then.
     
  15. Maniac

    Maniac Apolyton Sage

    Joined:
    Nov 27, 2004
    Messages:
    5,588
    Location:
    Gent, Belgium
    Your loop was caused by something else.
     
  16. ozymandyus

    ozymandyus Chieftain

    Joined:
    Nov 6, 2001
    Messages:
    30
    Will do, Maniac. Gives me a good excuse to fire up a new game and try out the l patch. :)
     

Share This Page