[BUG]BULL Destroys Multi-Player

I recommend taking only the r121 changes (or everything up to it) as I just committed a bunch of merged BUFFY code in r122 and beyond that hasn't been thoroughly tested yet. Everything before r122 should be okay, but r121 contains the entire OOS fix.

Yeah, merging BULL with my SDK is a PITA, so I only grabbed the change to CvSelectionGroup. It was the getActivePlayer() change, right?
 
Yes, that's the change.

BTW, if you have your code in SVN, you can use its merge feature to merge the changes from a range of revisions. It does a diff between two revisions of BULL and applies those differences to your code. Google "subversion merge". As long as you keep track of the revisions you have merged in a text file or notebook, it's pretty easy.
 
1. I installed BAT 2.0 to its default location: C:\Users\Username\Documents\My Games\Beyond the Sword\MODS\BAT Mod 2.0\

2. I installed BUG 4.2 to its default location: C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\BUG Mod 4.2\

3. I then copied the entire C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\BUG Mod 4.2\Assets folder into C:\Users\Username\Documents\My Games\Beyond the Sword\MODS\BAT Mod 2.0\ and told Windows to merge all folders and overwrite all files

4. I then downloaded the DLL from this thread, and copied it to C:\Users\Username\Documents\My Games\Beyond the Sword\MODS\BAT Mod 2.0\Assets\ where there was in fact already a CvGameCoreDLL.dll that I had to overwrite

Using this setup on 2 computers connected to a PitBoss server, Quick Speed, Small Map, 1 AI.

Each of the humans built a city and moved their warriors to attack each other ASAP. Received OOS error immediately. Since the whole setup process for combining the old BAT with the new BUG with the new DLL might be off, I don't know how much salt you want to take with this report.

Also, the text in the combat odds display seemed to be off, like it was displaying string variable names instead of the string itself.
 
Each of the humans built a city and moved their warriors to attack each other ASAP. Received OOS error immediately.

I don't see how this could happen looking at the code. For one thing, there is not network communication in a hotseat game. :confused: I wonder if the same thing happens on a network game.

I must be missing something. BUG/BAT itself wouldn't be the cause of the OOS as they've worked fine for a long time; it must be the BULL DLL.

  1. Other than getting an OOS error, do the two players see the same result or does the game state look mismatched to you?
  2. What happens if one of the players attacks an AI unit on a plot that the other human cannot see?
Thanks for doing these tests. It helps a lot.

Also, the text in the combat odds display seemed to be off, like it was displaying string variable names instead of the string itself.

The text strings are in BULL XML files that you wouldn't have in BAT. It won't be the cause of this problem, just a display issue until you copy the BULL Assets folders to your BAT Assets folder.
 
Using Pitboss to host an internet game with the dll as a standalone mod (oss/assets/*.dll) the oss error persisted, I have simultaneous turns enabled and attacked with a single unit verses the ai... I find the error pretty interesting as the server and game are both being run off my machine (yes i know they are two seperate instances of the game), however i will note that just over christmas my friend and I played a team game with simultaneous turns over LAN vs the AI using the Bat 2.1 without a hitch... pitboss was not used in that game and we played the entire game from ancient to modern with only a minor CTD (happend right after an autosave) troubling us... It was only once we tried to play across the net or using pitboss did the oss rear its ugly head at us..
 
In a team game, can you always see your partner's cities/units? Do you share fog of war? I've never tried playing a team game, so I dunno, I just remember EF saying that the bug required one player to attack the AI in a square the other player couldn't see.

I've been hoping to have a chance to test this myself but the fates have not aligned.
 
Well the error occurs when we played a teamer over the internet, we decided to try using pitboss to see if that would correct it as we thought it was a hosting issue... my main point there was it was a lan where the two computers were right next to each other as opposed to the void that is the internet inbetween...
 
LAN versus INTERNET should be the same since there is a network involved. PITBOSS is a strange creature, and I don't know how it is implemented under the hood. I would think it works just like an INTERNET game except that the PITBOSS server keeps the game active without depending on a player to host the game.

I could see a team game making the OOS go away before my fix, but not after. And you said that you still get the error playing a team game post-fix. I think the only way I'll be able to squash this bug is to hunker down and set up a team game on a single computer . . . or get my old computer up and running again.
 
well the game we managed to play was a fresh install of 2.1, just two humans in a 2v2v2v2v2 game.... after that game we were no longer in position to lan, so we tried the internet play first to no avail, and then pitboss to kinda third party the host to see if that helped the sync issue..

all of this was prior to most of the posting in the thread here (around Dec 20 -Jan 5), i had actually felt pretty defeated prior to finding this thread and seeing the hard work you all put into this project.

As it is now, my friends cant be bothered to help me test any changes but using pitboss by myself, i still knock the game out of sync on the first attack i make.
Hope this clarifies everything Ive stated thus far...

EDIT: I poked around with my friend tonight after posting this and had an interesting idea, I loaded up our save file from the original team game we played pver christmas, it played 100% fine over the internet the two turns we played it, he even took over a city, however starting a fresh game of the map 1000AD (for the easy of attacking on the first turn) caused an oos error right away... I have no clue what would be different between that first game we played and the rest of our attempts... I do have some save files from that game if for some reason you think they might be helpful
 
A friend and I started playing pitboss games with BULL and ran into this problem as well. The behavior we saw was:

- OOS happens the first time a human player attacks an AI unit
- same thing happens both when I attacked (playing on the same machine as the pitboss server) and when he did (playing from a different computer)
- same behavior using both the original BULL dll as well as the dll attached in post #34
- same behavior both when the other human player had vision of the square the combat was on, as well as when he did not
- same behavior both when simultaneous turns are turned on or off in pitboss (does this mean the OOS is between pitboss and the player, rather than between the two players?)

I do have a save file from the turn before this happened in one test game; I'd be glad to host a pitboss game to help others reproduce it if needed.

Aside from this one problem, playing with BUG has been such a great improvement over the default interface; a big thanks for all your hard work!
 
Thanks, Cerecel, for your very thorough report. I went to disable the Safe Move feature entirely to produce a DLL for you to test when I saw this little gem:

Code:
void CvSelectionGroup::checkLastPathPlot(CvPlot* pPlot)
{
	m_bLastPathPlotChecked = true;
	if (pPlot != NULL)
	{
		m_bLastPlotVisible = pPlot->[B][COLOR="Red"]isActiveVisible[/COLOR][/B](false);
		m_bLastPlotRevealed = pPlot->isRevealed(getTeam(), false);
	}
	else
	{
		m_bLastPlotVisible = false;
		m_bLastPlotRevealed = false;
	}
}

Notice the call to getActiveVisible()? This checks if the plot is visible to . . . wait for it . . . the active team! :aargh: Astute observers may remember that I already fixed one active-team bug in this feature, hoping to solve the OOS problem. That fix was on the very next line, yet I missed this one. :cry:

So here's the second fix:

Code:
		m_bLastPlotVisible = pPlot->[B][COLOR="Red"]isVisible(getTeam(),[/COLOR][/B] false);

And I've attached a new DLL. Can you please test this out with your save? Note: I have Fractional Trade turned on. It won't affect this test, but it will affect your game if you use it. If this works, I'll whip up a new normal DLL and do a release of BULL 1.1.
 
hey EF - did you check the next line after that too?
 
I started a new game with this dll and was able to attack the AI normally - very cool, thank you for the quick fix!
 
Yay! What a PITA bug that was, and such an easy fix. Thanks for the testing everyone. Cerecel, you get a gold star. ;)
 
The long-awaited BULL 1.1 release has finally arrived! It is up on SourceForge ready to download. I also put out a new BUG 4.3 to go along with it.

Phew! Loooooong weekend. :whew:
 
Top Bottom