Run multiple Civs on one PC for MP testing

lemmy101

Emperor
Joined
Apr 10, 2006
Messages
1,064
I've found a massively handy way to debug multiplayer I thought I'd share.

If you install this:

http://www.virtualbox.org/

it allows you to create a virtual pc on your PC. you can create an image file for a HD, and install a version of windows on it. It'll run in a window and can emulate being on a network as well as, get this, DX 9 hardware acceleration support!

Since I've been doing a lot of MP debugging lately, I thought I'd give it a try... and lo-and-behold...

virtualboxciv.jpg


It works! A two player direct-ip multiplayer game of civ running on one machine, that perfectly emulates two different PCs playing eachother! This is massively advantageous to running a pitboss game, as there are various things that can go wrong that won't present themselves on pitboss games. Also the debug logging all gets merged into one file making it very hard to debug. This also allows you to install Visual Studio in the guest OS and debug the DLL of two players at the same time.

(Tip: You need to install a 32bit OS to use DX 9 hardware acceleration. Also put Civ in windowed, it works better. You will probably need a decent amount of memory and graphic card memory to run em both though and I'd recommend putting the HD image on a seperate HD to the host's version of Civ if possible. That all said, the slower running guest OS / Civ will probably be a good thing as it will emulate wildly different spec PCs playing to help lure out those pesky OOS's ;D)
 
The alternative would be to have a shortcut which launches your mod and allows multiple instances.

"C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Civ4BeyondSword.exe" multiple mod=\Fall Further

That one word there allows you to have more than 1 instance of BtS running at a time, and you can set up to play against yourself via LAN.

Windowed mode is of course, advisable.

If you are comfortable with modifications to the DLL, you can set it up so that the debugger filename will include the player's name, then you get a log for each player. Gerike's OOS logger can be similarly modified.

Haven't tried double-debug, but since VS can run 2 instances as well, it should be possible, though confusing, to do that as well without needing the virtual box.

One REALLY nice thing you can do with the virtual which you cannot with the Firaxis method is to test 2 different OS's against one another.
 
Haha well that is marginally simpler. ;D talk about over engineering a solution to a problem. :D thanks for the info.

the virtual box method also makes it easier to test with differing specs, since the guest OS and Civ runs a lot slower than the host version.

I am curious where the log filename stuff is editable though. I searched high and low in the DLL and found no reference to the MPLog or PythonErr etc files which seemed to be handled outside the DLL, and this was my primary reason for looking to this solution since all the Pitboss/game logs were getting merged into one file...
 
Yeah amazing stuff. I did not know that PC emulators were good enough to do what you did. I assumed that they would fall on their sword with graphics driver interactions and that it would not be worth even trying. WOW.
Cheers
 
tbh I've tried both methods now (virtualization and multiple instances) and I found the virtualization to me much easier, purely because conceptually it's a lot easier to debug when you've got two distinct 'PC's. I started using multiple instances after I read this thinking it was the most simple way to do it, and as I had multiple identical apps on my start bar /task manager it was practically impossible to differentiate them and I got mightily confused about it. The one I wanted to debug got a Rev Event. Which Visual Studio instance is that? Attach to process, which one in the Attach to dlg list is it? Outside the game of which you have differing player names, there's literally no way to tell which is which that is consistent and reliable.

With virtualisation I have to just run the game on both the main PC and in the little window, always host the lobby with the main PC version, and from that point on I know exactly which is which. Also having two distinct Log directories is really handy for diffing...

So it very much is a case of one being awesome in that its simple to set up, and one being awesome as it's easier to debug, IMO, which is cool because there are differencing options depending on how much MP debugging you're likely to be doing.
 
On another note, I've been looking for this Gerike's OOS logger you mentioned, but all I've found is another post of you mentioning it and recommending searching for Gerike's posts on this forum, of which there are none. :/ is 'Gerike' his actual user name? any chance of a link, it sounds really handy!

Cheers,

lemmy

EDIT: Found it. Was searching for Gerike instead of Gerikes. Turns out it's pretty much what I have already.
 
Just to clarify Lemmy, you are also able to run two independent VStudio sessions and attach to each BTS process with two instances each running on a virtual PC and debug them both? :eek::cool:

If so, get out of here man that is too much power! :goodjob:
Cheers
 
No, that is too ridiculous to imagine. Ye gods these PC's are starting to become absolute computing junkies with too much time on their hands if that is what they are capable of :) If they are that powerful, why do they not yet think for themselves? :)
Cheers
 
Back
Top Bottom