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

OOS problems and how to fix them

Discussion in 'Bugs and Crashes' started by 45°38'N-13°47'E, Jan 20, 2014.

  1. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,833
    Location:
    Just wonder...
    Sorry AIAndy but I'm not sure I get it: are you saying that this was not an OOS, so maybe the OOS root was further down in differences found in the log? Is it correct that I see this kind of difference in the logs and the OOS is somewhere else?


    Great, I can try this one; but have you come to this conclusion from one of the above reports (nevermind, I got it)? If so, I can test the new code and see if that particular OOS log appears again. Thank you. :)
     
  2. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    25,323
    Gender:
    Male
    Location:
    Las Vegas
    He's saying it shouldn't be considered an error. Due to multi-threading (processing never before seen in CivIV but very common on more modern softwares) which uses more than one processing core to get to conclusions faster for the computer, there was a necessity to allow some things that show up on the logs there to take place out of order on each computer. Theoretically, these checks are taking place out of order but each system should be brought back into a synched state. So you'll see those but they don't necessarily mean they represent a real OOS origin point. Particularly when, even though those checks are out of order, they still have the same values and synchronization shows to be solid even after this shuffling takes place.
     
  3. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,396
    Correct :)
     
  4. alberts2

    alberts2 Chieftain

    Joined:
    Aug 16, 2012
    Messages:
    1,724
    Gender:
    Male
    Location:
    Germany
    We should also add this fix to Caveman2Cosmos.
     
  5. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,833
    Location:
    Just wonder...
    Ok, but wait a minute: I get an OOS error, I check the logs and see these differences caused by multithreading scattered all over the place in the Random Log. But after I check all of them, I see no difference aside from their order. So what caused that OOS? If it's not important their order so long as entries have the same values, there should be something else in the random log pointing at the OOS cause, correct? But from what I've seen my logs are identical for both players (beside the order of entries, as I said).
     
  6. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,833
    Location:
    Just wonder...
    Definetely; I'm testing now AND with that fix in multiplayer and we had none so far after about 100 turns (usually we don't go beyond 40 turns without OOS and then it get worse, going OOS almost every couple of turns).

    Edit: to avoid OOS as much as possible, I've disabled multithreading in my current game. Also I'm using AI pathing system under BUG options. I'm not sure but I think that having players units moving in a different way than AI units is causing troubles. Right now 180 turns and only 2 OOS, and one was almost certainly caused by me doing something wrong (i.e. building the same wonder in 2 cities at the same time).
     
  7. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,396
    I committed the change now.

    Was the random seed in the OOS logs actually different?
     
  8. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,833
    Location:
    Just wonder...
    Do you mean Next Map Rand Value or Next Soren Rand Value? No, they were both identical for both players. But they're not always different when the game goes OOS from what I've seen.
     
  9. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,396
    When they are the same then the random log won't help as it will be the same except for the swaps from multithreading.
    But in the OOS log something else should be different then.
     
  10. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,833
    Location:
    Just wonder...
    Sure, here are the differences:

    Code:
    Unit Info:
    ----------
    Player 0, Unit ID: 24577, Worker 1 (St. Petersburg)
    X: 85, Y: 51
    Damage: 0
    Experience: 6
    Level: 1
    Promotions:
    
    Player 0, Unit ID: 16386, Javelineer 2 (Moscow)

    Code:
    Unit Info:
    ----------
    Player 0, Unit ID: 24577, Worker
    X: 85, Y: 51
    Damage: 0
    Experience: 6
    Level: 1
    Promotions:
    
    Player 0, Unit ID: 16386, Javelineer

    And it goes on for a few lines; looks like the name of the city originating units is different (not displayed for either of the players)
     
  11. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,396
    Name differences don't matter as they are local only.
    I guess comparison would be easier if we would not include the names at all but then it is sometimes useful to know which unit it actually was if one is different.

    In other words, ignore the names and look for other differences in the OOS log.
     
  12. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    25,323
    Gender:
    Male
    Location:
    Las Vegas
    I already had in my code so it was destined to be included but looks like it's been committed already. :mischief:
     
  13. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,833
    Location:
    Just wonder...
    So this is to ignore too, I suppose

    Code:
    Player 5, Unit ID: 32779, Javelineer
    X: 26, Y: 40
    Damage: 0
    Experience: 0
    Level: 1
    Promotions:
    
    Player 5, Unit ID: 24588, Worker
    X: 33, Y: 42
    Damage: 0
    Experience: 5
    Level: 1
    Promotions:
    Code:
    Player 5, Unit ID: 24587, Worker
    X: 33, Y: 42
    Damage: 0
    Experience: 5
    Level: 1
    Promotions:
    
    Player 5, Unit ID: 32780, Javelineer
    X: 26, Y: 40
    Damage: 0
    Experience: 0
    Level: 1
    Promotions:
    Then the only different kind of difference in that log is

    Code:
    Player 11 Food Total Yield: 30
    Player 11 Production Total Yield: 12
    Player 11 Commerce Total Yield: 17
    
    
    Commerce:
    ---------
    Player 11 Gold Total Commerce: 0
    Player 11 Research Total Commerce: 13
    against

    Code:
    Player 11 Food Total Yield: 28
    Player 11 Production Total Yield: 14
    Player 11 Commerce Total Yield: 16
    
    
    Commerce:
    ---------
    Player 11 Gold Total Commerce: 0
    Player 11 Research Total Commerce: 12
    But then I wonder why there was no difference in the random log. :confused:
     
  14. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    25,323
    Gender:
    Male
    Location:
    Las Vegas
    Not all OOS errors will show a difference in the random log. What you DO have is an indication that something probably took place differently in the ai on which plot the city decided to work. I've noticed we have an OOS there before. Perhaps start a search through how the AI determines which plots to work.

    If this is a caching issue it's one that's beyond me but I've seen AIAndy fix similar OOS errors previously. I'm sure he'll have more advice there and I'll be watching for it too.
     
  15. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,396
    That looks like the working plot assignment on both computers might have been different which would not have caused any difference in the random log (at least not at once).

    One thing I found that might have something to do with that is that in revision 5843, Koshling added a check if the city screen is up to CvCityAI::AI_updateAssignWork. But city screen up is a local UI state, not a synced state, so this can easily cause an OOS if one human player has the city screen up and the other does not.
    So I will change that so it is only done in single player.
     
  16. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    25,323
    Gender:
    Male
    Location:
    Las Vegas
    As the player that's out of sync is player 11, does this mean that if either player had the city screen up while the AI player (I presume player 11 would be an AI) is making a plot determination then that could lead to the OOS scenario we see here?
     
  17. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,396
    Hmm, actually there is an isHuman check in that line so if player 11 is an AI then there might be another OOS issue hidden in the plot assignment code.
     
  18. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,833
    Location:
    Just wonder...
    a
    Is it this one we're talking about?
    http://forums.civfanatics.com/showthread.php?t=508101

    Edit: mmm, no this must be something else because I've commented out those lines.
     
  19. AIAndy

    AIAndy Chieftain

    Joined:
    Jun 8, 2011
    Messages:
    3,396
    Ah, that was already found but no one bothered to fix it in C2C ...
    So that means another issue in the plot assignment somewhere.
     
  20. 45°38'N-13°47'E

    45°38'N-13°47'E Chieftain

    Joined:
    Jun 7, 2008
    Messages:
    5,833
    Location:
    Just wonder...
    Anyway that thing with cachedTechValues was critical; 223 turns now (with AND), well into medieval era with blitz speed (600 turns total) and yet no OOS. Never gone so far since years (I guess before AND 1.75, which I think is before C2C started). Thank you so much AIAndy. :goodjob:
     

Share This Page