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

Well, I got plenty of OOS errors without simultaneous turns when I used to play MP with a friend. So they can obviously happen when not using it.
I can't stand simultaneous turns, to think that my victim may move away just before I release the right mouse button to attack it so that I waste my units turn by making a move I didn't really want to do goes against so much of what I like about a TBS game.

Other annoyances is when enemy units shows up late in a turn after I've moved anyone who could have reacted to it that turn. Or that I don't notice a criminal unit sneaking out of one of my cities late in the turn long after I've already concluded that there are no criminal units around my cities to deal with. One has to always reevaluate the state of the turn in case something changed in an area you already had evaluated, and hitting end turn is something you don't want to do long before the other human players in a simultaneous MP game.
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.
 
Attaching logs from one else OOS (forgot to grab autosave before it was rewritten)
 

Attachments

  • Logs - player1.7z
    3.7 MB · Views: 64
  • Logs Player0 2607 1728.7z
    3.6 MB · Views: 62
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.
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.
 
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.
 
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.
 

Attachments

  • 28072020 Player0 LogsSave.7z
    3.5 MB · Views: 102
  • 28072020 Player11.7z
    1.6 MB · Views: 81
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.
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:
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.
 
Wrong models happen if you have Animations Frozen selected in game options (vanilla graphics settings)
 
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...
 

Attachments

  • Worldmap.CivBeyondSwordSave
    2.8 MB · Views: 70
This one is really interesting
The same. OOS after loading an autosave. Save file and logs are attached. Can be reproduced multiple times.
 

Attachments

  • Logs Player0 BC30748.7z
    881.1 KB · Views: 73
  • Logs Player1 BC30748.7z
    880.2 KB · Views: 58
  • AutoSave_BC-30748.CivBeyondSwordSave
    3.4 MB · Views: 59
Looks like "Animations Frozen" option is disabled...
View attachment 564485
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.

The same. OOS after loading an autosave. Save file and logs are attached. Can be reproduced multiple times.
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.

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...
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.
 
Another OOS logs (Player1 said that one of his captured animals was destroyed).
 

Attachments

  • Logs Player0.7z
    4.1 MB · Views: 66
  • Logs Player1.7z
    4.2 MB · Views: 2,507
  • AutoSave_BC-28173.CivBeyondSwordSave
    3.4 MB · Views: 1,001
  • AutoSave_BC-28221.CivBeyondSwordSave
    3.4 MB · Views: 68
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.
 
Interesting... I didn't know that was a threat but do avoid floating point math outside of direct UI interactions.
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;
}
 
Spose I can't imagine any benefit to using a square root but yeah cool. That's just my math undereducation I suppose.
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.
 
Another OOS: Player0 and Player1 play in different teams. Player0 is building "Pergamon Altar"; when Player1 tries to build it OOS occurs.
 

Attachments

  • AutoSave_August 11, BC-2467.CivBeyondSwordSave
    5.5 MB · Views: 55
Another OOS: Player0 and Player1 play in different teams. Player0 is building "Pergamon Altar"; when Player1 tries to build it OOS occurs.
That's one of the ones I warn about. If another player tries to build a wonder in production by a player already it will do this. Long known about this but really don't know how to fix it.
 
Top Bottom