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

Multi-Player Bugs and Crashes, v40 & SVN after Oct 2019

Discussion in 'Bugs and Crashes' started by Thunderbrd, Oct 20, 2019.

  1. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,683
    Gender:
    Male
    Location:
    Las Vegas
    I always enjoyed the ability to keep a lot of defenders out of the city while it gets hit by siege attacks and then once those were exhausted, move in the rest of the defense - they don't get as much fortification but they aren't injured either so are usually a lot stronger at that point.

    That and its SO much faster to let the AI do its thing while you're doing your thing.

    Otherwise hotseat cannot get OOS errors.
     
  2. GiantLittleDog

    GiantLittleDog Chieftain

    Joined:
    Jul 31, 2012
    Messages:
    94
    Attaching logs from one else OOS (forgot to grab autosave before it was rewritten)
     

    Attached Files:

  3. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,933
    Location:
    Norway
    You can do that without simultaneous turns (ST) too, it is actually harder to do that with ST because haste and the order you decide to do things in is a factor.
    e.g. Your opponent can make a surprise move at the end of a turn that you can't react to this turn, if that move had been made before you got your turn you could have factored that into what you would do this turn, however your opponent can actually make his second move with the same units before you still have had time to react to the first move, that may be because you are busy selecting what to build in your cities or what tech to do next while your opponent is attacking you with its second move before you have had time to react to their first move. I feel TBS games gets messy when all players do their turn at the same time.

    ST could perhaps work in chess without ruining the TBS scheme because each player only have one move per turn; neither of the players are capable of seeing what the other is doing, and then in a split second both players move for the turn happen on the board simultaneously, what happens when both players move a piece to the same tile in that split second, which one beats the other one? The rules of engagement become strange, e.g. white player always beat black on odd turns while black always beat white on even turns. This example of ST in chess would be a fun twist of the game but it isn't the same type of ST as we have in civ though, for it to be the same the chess players would, regardless of what color they have, be able to wait until the other player makes his move before making their own move and both players would be allowed to make their move before the other one, but one player cannot make more than 1 move more than the other. This would be a frustrating chess game where how fast you are with your hands becomes key so that you can do two moves without the other player making a single one. Civ gets frustrating and messy in a similar way with that latter type of ST, but the former type would be really weird too as that would mean both players map out all their moves for that turn and when both players have hit the end turn button all their decisions happen at once on the map in a flurry of moves and conflicts being resolved.
     
  4. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,683
    Gender:
    Male
    Location:
    Las Vegas
    I agree there are some things one needs to get used to when playing ST that come across as potentially unfair or irritating. Of course, if you are patient, you can pretty much let the AI just go before you take your moves on the main - it doesn't try to maximize on the ST quirks and wait for the situation to resolve in a local sense before deciding what to do with a unit so it just gets in and makes moves assuming its like it always is with timing and is often faster than you, particularly if you just work on review and city management at first in a round. Sometimes you can set yourself up to try to take advantage of getting initiative in a situation but it doesn't always work.

    Once used to it, it's not all bad. But yeah it does change the nature of gameplay a bit.
     
  5. GiantLittleDog

    GiantLittleDog Chieftain

    Joined:
    Jul 31, 2012
    Messages:
    94
    Another OOS - occurs right after loading autosave (Player1's unit is being attacked). Can be reproduced multiple times.
    Logs from both players and save file are attached.
     

    Attached Files:

  6. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,933
    Location:
    Norway
    This one is really interesting, being repeatable as well, here's the only game state difference in the logs:
    Untitled-1.jpg
    The random logger is identical as well.

    I have a theory about there being a NULL selection group in the list for one of the players while the other player has cleaned it out of the list. Player 0 has one more selection group for player 1 than player one has for itself.
    Maybe there's a cleaning spot within a "if ( ePlayer == GC.getGame().getActivePlayer() )"; stuff within such clauses should never alter the game state directly.
     
    Last edited: Jul 28, 2020
  7. GiantLittleDog

    GiantLittleDog Chieftain

    Joined:
    Jul 31, 2012
    Messages:
    94
    Another interesting bug which I haven't seen in v39 multiplayer. After loading a savegame units may be shown with models of other units.
    For example, Exiles may have some indean models.
    Screenshot29 - both Exiles are not selected and have wrong models.
    Screenshot30 - Exile2 is selected/has correct model.
    Screnshot31 - Exile1 is selected/has correct model; Exile2 is not selected and has wrong model.
    Civ4ScreenShot0030.JPG Civ4ScreenShot0029.JPG Civ4ScreenShot0031.JPG

    A couple of days ago animals were shown with wrong models (Screenshot26-28): Black Rhinoceros and Aurochs.
    Civ4ScreenShot0028.JPG Civ4ScreenShot0026.JPG
    Could not reproduce this after loading the same savegame.
     
  8. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,585
    Location:
    Poland
    Wrong models happen if you have Animations Frozen selected in game options (vanilla graphics settings)
     
  9. Faustmouse

    Faustmouse Deity

    Joined:
    Jan 31, 2012
    Messages:
    3,513
    I'm playing a hotseat map with 3 human and 4 AI players, startet a few SVN versions ago and regulary updating it.
    I was able to trade resources pretty much right from the start; even with no visibible trade route on water, nur connected by paths or rivers. Even more strange is it, that while I can trade resources (I.E. China can trade with Sumera), the new found chinese city has no connection to the trade network of the empire, eventhough it is just a short, unblocked and clearly visible trip along the coast. The game is now further advanced, but it was like this long before even raft building was researched.

    On a side note, the AI (Immortal) really seems to struggle. I am surging way ahead of it...
     

    Attached Files:

  10. GiantLittleDog

    GiantLittleDog Chieftain

    Joined:
    Jul 31, 2012
    Messages:
    94
    Looks like "Animations Frozen" option is disabled...
    upload_2020-7-30_13-25-48.png
     
  11. GiantLittleDog

    GiantLittleDog Chieftain

    Joined:
    Jul 31, 2012
    Messages:
    94
    The same. OOS after loading an autosave. Save file and logs are attached. Can be reproduced multiple times.
     

    Attached Files:

  12. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,683
    Gender:
    Male
    Location:
    Las Vegas
    Your system might have temporarily restricted your graphics settings. You said you couldn't reproduce right so I wouldn't expect you would find your settings incorrect now. Sometimes, if you start two games, or something is taxing the graphics memory, it can auto change your settings, though it's been my experience that when that happens you'd have to manually change it back but maybe not now due to something another modder did somehow.

    OOS debugging is a war of its own and I can look deeper in a few months I hope. Thanks for the save though - that will help since its repeatable - as long as we haven't disrupted save compat again by then and I may be looking to here so I might try to solve this before I do that.

    It sounds like someone has refactored trade route establishment and extensively bugged it in the process. I don't think this could be distinctly related to hotseat but maybe? If that's the case then something is wonky in trade in hotseat and it will take some serious digging to figure out how that can possibly be. Again, that would be another whole front of war to address at some point. Thanks for letting us know though.
     
  13. GiantLittleDog

    GiantLittleDog Chieftain

    Joined:
    Jul 31, 2012
    Messages:
    94
    Another OOS logs (Player1 said that one of his captured animals was destroyed).
     

    Attached Files:

  14. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,933
    Location:
    Norway
    Fixed a likely source for OOS today in the influence driven war BUG option.
    It used a lot of floating point values and math, which can give slightly different decimal end results on different CPU's and cause them to round down to different integer numbers in rare cases.
     
    Thunderbrd likes this.
  15. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,683
    Gender:
    Male
    Location:
    Las Vegas
    Interesting... I didn't know that was a threat but do avoid floating point math outside of direct UI interactions.
     
  16. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,933
    Location:
    Norway
    I've seen some OOS logs where the players have slightly different culture values on plots, IDW may have been the cause of that with all that floating point math for culture values.
    I added in an OOS safe sqrt() function called intSqrt in CvGameCoreDLL yesterday that calculates the integer part of a value's root without using any floating point values.

    I find it weird that we didn't already have an OOS safe square root capability in our code base, but now we do. ^^
    Spoiler If you're curious :
    Code:
    int intSqrt(const int iValue, const bool bTreatNegAsPos)
    {
        unsigned int iVal;
        if (iValue < 0)
        {
            if (!bTreatNegAsPos)
            {
                return -1;
            }
            iVal = static_cast<unsigned int>(-iValue);
        }
        else if (iValue < 2)
        {
            return iValue;
        }
        else iVal = static_cast<unsigned int>(iValue);
    
        int iRem = 0;
        int iRoot = 0;
        for (int iI = 0; iI < 16; iI++)
        {
            iRoot <<= 1;
            iRem <<= 2;
            iRem += iVal >> 30;
            iVal <<= 2;
    
            if (iRoot < iRem)
            {
                iRoot++;
                iRem -= iRoot;
                iRoot++;
            }
        }
        return iRoot >> 1;
    }
     
    MattCA likes this.
  17. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    27,683
    Gender:
    Male
    Location:
    Las Vegas
    Spose I can't imagine any benefit to using a square root but yeah cool. That's just my math undereducation I suppose.
     
  18. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,933
    Location:
    Norway
    If you want to extract a value from a base value, that increases slower and slower the bigger the base value becomes, then the square root is your friend.
    In IDW, you want the culture transfer between the players to be bigger when there's a lot of culture there, but you want the percentage transfer to be much less than if there was just a little culture there.
    e.g. in the beginning of the game or with a newly founded city there may be less than 200 culture in the surrounding plots, square root of that is 14 culture which is 7% on combat victory there.
    While a more entrenched culture let's say 10 000 have a square root of 100 culture which is 1%. if it was a static 14 culture transfer regardless of plot culture values then it would take forever to flip it through combat, and if it was always 7%, which would be 700 culture for this plot, then it would take roughly the same amount of combat victories to flip this plot as it would take to flip the 200 culture plot. It should take longer to flip a strong culture through battle but it should transfer more culture as well. Square root is the perfect tool for that.
     

Share This Page