• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Using CivAssist II on an Intel Mac

AlanH

Mac addict, php monkey
Moderator
Hall of Fame Staff
GOTM Staff
Supporter
Joined
Jan 9, 2003
Messages
29,706
Location
England
Warning: Geeky-long-post alert!!!

Parallels Desktop
I've been doing some experiments with Parallels Desktop on my new Mac Pro. This is the modern equivalent to Virtual PC for Intel Macs, it's $80 online, and I'm using the free 14 day evaluation license to check it out.

Multiple OS's on one desktop
I was able to set up two virtual machines running Linux and Windows 98se in OS X windows. At the bottom of this post is an F9 Exposé screenshot showing this. Click the image for a full size version. Look carefully and you can see an Ubuntu desktop in the top left window, running OpenOffice.org, Firefox, and the Linux file system browser. Top right is the Windows 98se desktop, with CivAssist II displaying status of a Civ3 game file on my Mac Pro, plus Windows Explorer in all its glory. I also have Civ3 and Civ4 running as OS X native apps. There are Finder, Safari and iPhoto windows to show this really is OS X - nothing up my sleeve. And you can see the Activity Monitor and Temperature Monitor windows as well. Note how the core temperatures shot up about 20 degrees C as I fired up Civ4 :eek:

Why CivAssist II?
One option, as shown above, is to run CivAssist II (CA2) in a Windows virtual machine to monitor Civ3 running in OS X. CA2 is a remarkable piece of software constructed by Ainwood and his mate. It monitors your autosaves and warns you about cities about to riot, Civs with new goodies to trade, cities with high flip risks and much more. It also does calculations of combat odds, corruption, cost and benefits of changing government ... The bad news is I haven't ported it to OS X :(

Can we put it all together?
You can access OS X files from the Windows virtual machine using Windows sharing in OS X. So it ought to be easy to set CA2 up to watch over your Mac Civ3 game. However, it turned out there were a couple of issues to overcome to get CA2 to do its thing.

CivAssist II needs to have access to Civ3's Art files if you want to see the map display. And it needs access to the Civ3 Saves directories to analyse your saved games and tell you about events. Unfortunately these files are not stored in the same locations on a Mac as they are on a PC. That's what's giving rise to most of the issues with porting Civ3 mods to the Mac, and it hits CA2 as well. CA2 is doubly challenged, as Windows sharing in OS X normally ony supports access to your home folder, so CA2 can't even see the global Applications folder where a lot of us keep Civ3.

Crash Dummy to the rescue
I overcame this set of problems by creating a dummy folder structure in my ~/Documents/ folder. It is just a few folders, configured to look like the Civ3 folder structure on a PC, but containing symlinks (Unix shortcuts) to the various real folders in the /Applications/Civ3/ and ~/Documents/Civ3/ directory areas. I imagine Mac OS aliases would work the same. I pointed CA2 at this folder, and it was completely fooled into believing it was reading a PC Civ3 installation :)

Here's a shot of the dummy folder structure I created. It's called Civ3 Crash Dummy, as I didn't expect it to work first time! I've marked it up to show the actual folders pointed to by the aliases. To avoid too many arrows I've used the ellipses to show groups of aliases that are linked to items of the same name in a folder.

1156607247.jpg

So, CivAssist and Parallels, anyone?
In the interests of keeping this post to a reasonable length, I've glossed over a lot of stuff here, such as how to get Parallels working, how to configure Windows to get CivAssist working, and how to set up Windows file sharing in OS X. I'm not even sure if this o interest to anyone else but me :hmm:, but if anyone wants more details, please ask. If the Civ3 Dummy structure is too obscure I'll consider building a little installer that will create it for you.

Next, please
Now to try to solve the other issue, which is that CivAssist will only monitor your autosave folder if it knows you are running Civ3. But it doesn't know that Civ3 is running on the Mac side of the fence, so it ignores your new autosaves.

 
AlanH, this is intensely interesting. Please post in excruciating detail, or at least link readme's for all the details you've left out. And be sure to post all your further experiments. I'm also wondering if the "dummy folders" solution would work for our more general Mod problems.
 
Blue Monkey said:
AlanH, this is intensely interesting. Please post in excruciating detail, or at least link readme's for all the details you've left out.
I thought someone might say that, but didn't want to do the work if it was of no interest. I'll put some more stuff together. I'm in discussion with ainwood about the "game running" problem. Not sure if or when we'll get a solution to that one. I *could* try to hack something up to spoof a process running on the Windows virtual machine that looks like Civ3, but I'm not familiar with that environment, so it would be hard going for me.

And be sure to post all your further experiments. I'm also wondering if the "dummy folders" solution would work for our more general Mod problems.
Yes, I did wonder that myself as I was doing it. You may observe that my Crash Dummy includes much more spoofing than is strictly required for CivAssist II, as I think it only references the various Art folders. I included the Scenario folders as they may contain Art themselves (however, see more on Scenarios below), but I think Text and Sounds would only be required to support a mod solution.

The main issue with mods should be fixed when (when?) the patch materialises - rumour has it that could be next week. After that, let's see what's required.

If there's still a problem after the patch then mods will present an interesting challenge. Aspyr have split Scenarios between the ones installed with the game and those you install yourself. The latter are supposed to be put in the appropriate Scenarios folder in your ~/Documents/Civ3/ path. So the dummy folder system will need to find a way to merge the two separate sets of Scenario folders. I'm wondering if Smart Folders are a way to deal with this, as they can potentially merge multiple folder contents, but I haven't tested this yet.
 
Alan, will an Intel Mac with Parallels run the Windows Civ3Complete editor without major programming work?
 
Yes. It runs here just fine ... once you get Parallels to install a Windows virtual machine.

You have to install the whole of Civ3 Complete for Windows so that it has all the terrain graphics and such. I can't run the actual Civ3 game software, as it falls foul of the CD detection software and claims I'm running a "debugger". Research in Google indicates that this is a problem with Cedega on Linux as well.
 
Here are some more details of the fun and games I had getting the above to play. First the Parallels and Windows installations ...

For Mac Pro users only
If you have a Mac Pro then you first need to set it for legacy 32 bit operation, as Parallels can't handle a 64 bit system. I found the following command on the Parallels forum, copied and pasted it into my Terminal, entered my password, and rebooted.

Command:
sudo nvram boot-args="-legacy maxmem=2048"

Download and Install Parallels Desktop
Download it here. It's a simple installer, doesn't even need a reboot. You need an activation key the first time you launch it. I recommend getting the two-week evaluation key to try before you buy. Either get one on the site or use the onscreen button to register for it. It arrives by instant email, in the time-honoured way. Copy/paste it into the activation screen and you're in business.

There's a good PDF manual as part of the installation, but here are the key steps I went through. If you are an impatient speed reader/page turner, like me, you may miss things like the need to capture the mouse and keyboard ...

Configure a new Virtual Machine
To create a new virtual machine select File/New window, and click New VM in the bottom left. Follow the wizard and tell it you want a Windows VM with teh version of Windows you have an installer for. Let it create a new directory. Make sure it's configured to use your optical drive. Click the link to CD/DVD-ROM 1 and make sure it's Enabled, and set to Connect at startup. The VM will have a default setup with 256 MBytes of RAM and 8 GBytes of your hard drive earmarked.

Install Windows
Insert your Windows installer CD. Click the green arrow to "power up" your new Windows machine. It should start the normal installation process for your version of Windows, formatting its "hard drive" (slightly scary, but it's not affecting any of your Mac's data.). Since you will need to interact with the installer, this is the time to learn about "capturing" and "releasing"the keyboard and mouse. When you Click inside the window area of the virual machine your mouse and keyboard become attached to it and you can click buttons and type into text boxes on the virtual machine's screen. To release the mouse and keyboard you press Control-Alt (you can alter this hot key combination if you wish, but this is the default).

During my installation of Windows 98 the Windows system rebooted several times. Each time, the virtual machine crashed :(. However, by persistently restarting it I was able to get through the installation. I don't know whether this was due to Windows 98, or my Mac Pro, or an error on my part. YMMV.

Eventually you should reach a Windows desktop, probably in a 640 x 480 window. Now you need to introduce Windows to the hardware it's running in so that it can use more screen pixels and colors, hook up to your ethernet interface to talk to your Mac, and work better with your mouse and keyboard.

Install Parallels Tools
While the VM is running, select the VM/Install Parallels Tools… menu option to install the magic drivers that will connect Windows to your Mac's bits and pieces. This will launch Windows own hardware driver install wizard to do the work, and at the end Windows should prompt you to reboot to activate the new drivers. You should then have a high res screen image, and better control all round.

I recommend making a backup copy of the VM at each major milestone for ease of rolling back to a known state as you try new things. It's a folder in ~/Library/Parallels containing the .pvs file that contains the config, and a .hdd file that is the machine's disk drive image.

Next episode ... Installing CivAssist II ... coming soon to a thread near you.
 
Installing CivAssist II
There are several steps to achieve this ...

Network Your Windows VM
Your Windows VM is set up by default to bridge to your Mac's ethernet interrface. This means that it appears to be another computer on your ethernet local area network.

I have an ADSL router, and that provides DHCP services to any machine on my local ethernet and wireless LANs. My Mac gets its ethernet IP address this way, and my Windows VM also gets its own unique IP address. It all "just works" in this mode. I've seen some agony posts on the Parallels forum about networking issues, but I haven't experienced any of them in my simple environment. I was able to fire up Internet Explorer and reach Internet sites, and I can reach my Mac's Windows sharing (see below) with no difficulty.

If your Mac uses Airport to communicate to the rest of the world then you will have to do some research in order to modify your VM setup to use the Airport interface instead of ethernet. There's information on the Parallels forum about wireless networking that should get you going.

If you don't have a router acting as a DHCP server on your local network then you will have to set everything up using fixed IP addresses. If you need help with this, PM me with the details of your system and your current Internet connection, and I'll try to help.

Upgrade Windows
I had fun with this bit, as the M$ site threw an error when I tried to use Windows Update to bring my Win 98se up to date. I'm not sure whether this is because Win98 is no longer a supported product, or due to some oddity with Parallels, but I had to do things the hard way. Here's the breadcrumb trail that I had to follow to get the bits I needed, and this doesn't address all the critical security updates that may also be required. If you have a more recent Windows then you shouldn't have all this pain ...

Working backwards from our goal:

- CivAssist II requires .Net Framework version 1.x in order to run. I used v1.1. (Note: It won't run with .Net v2.x). If you don't have the correct .Net already you will need to download it and install it.

- The .Net Framework requires Internet Explorer version 5.5 minimum. If, like me, you have an older version you need to download and install IE version 6.

- Internet Explorer v6 requires Windows Installer v2. If, like me, you don't have it, you have to download and install it.

All of the above are available on M$ site, you just need to track them down for your version of Windows.

Set up your Mac for Windows Sharing
CivAssist II will need to be able to see your Mac's Civ3 files. To do this I strongly recommend that you ensure that you have a Windows user account with the same short user name as your Mac account, and do everything on both the Mac and the PC using this account name.

Open System Preferences and select Sharing. Tick the box next to Windows Sharing. Note the warniing that you have to permit specific user accounts to be able to use it. Click the Accounts ... button in this screen and tick the box next to your account name to allow yourself to log on from Windows. Close System Preferences.

Build the Civ3 Crash Dummy structure shown in the first post. This will give CivAssist the file structure it expects to see.
(BTW, 'Crash' is actually an acronym for 'Complete Replication And Simulation Hierarchy :) ).

Log the Windows VM into the Mac
Select the Windows VM window, open Settings/Control Panel in the Start menu, and double click System. Click the Identity tab and make sure that the Windows machine is in a Workgroup called 'WORKGROUP'. That's the default workgroup name that is set up in the Mac.

Now open Network Neighborhood (95/98 versions) or My Network Places (2000/XP versions). If everything is in order you should see your Mac as a network resource. Double click it, enter your Mac account password, tell Windows to remember it, and you should see a Windows screen showing the files and folders in your home directory on the Mac.

Install CivAssist II
When all the above prerequisites are in place you can download and install CivAssist II. Get it and read about it here. Download it directly to the Windows VM and run the installer. If any of the above items have not been installed correctly it will complain.

Connect CivAssist II to Mac Civ3
Launch CivAssist II.
Click the Options/About button.
Click the '…' next to the Game Files Location' field.
In the file dialog that opens, navigate to [your Mac]/[your account]/Documents/ and highlight the Civ3 Crash Dummy folder.
Click OK.
Click the File button and you should see a listing of the saves in your C3C and PtW Saves and Autosaves folders.
Select one you want to look at and click OK.
CivAssist II should then open it, and you can then make full use of its analysis features.

To Do
I have not been able to find a way to fool CA2 into thinking that Civ3 is running, so it can only operate in Manual mode. Ainwood has accepted the challenge of adding an option to force it into scanning mode, so I hope this will be possible soon.

Please let me know if you spot any errors or omissions in these posts. If there's more detail needed in specific areas, say so. If there's a reasonable demand for an installer script to automate the creation of Civ3 Crash Dummy I'll do it.

Most of all, please give feedback on whether this sort of information is interesting and/or useful.
 
AlanH said:
To Do
I have not been able to find a way to fool CA2 into thinking that Civ3 is running, so it can only operate in Manual mode. Ainwood has accepted the challenge of adding an option to force it into scanning mode, so I hope this will be possible soon.

The code to set the auto / manual mode wasn't written by me - its a bit more advanced than my level of programming expertise.

That said, I can follow how its done, and can hopefully get it working - maybe over the weekend. Failing that - I can always plead with Tomas to do it!
 
did this die? i would love to us civassist with my mac...
 
No work was done on automating it as far as I know. You can still use it to check your saves manually.
 
so i could just close the reopen civ assist right? every few turns? that makes sense no?
 
You don't need to close CivAssist, just select the new autosave or manual save each time you want to check your situation, using the File button
 
Hi Alan,

I have been running CivAssit II under Parallels (v3.0) on a second screen (22") while CIV3 runs on a 24" iMac (Ali) under Leopard (10.5.1). Apart from having to re-select the file to check each move it works a dream.

Not sure what I did to see my Mac folders but its wasn't complicated (hence I can't remember) , probably something around setting network sharing which you will want to do anyway.

Note that PtW does not do window mode properly (you get the dialog and can select up to the full screen resolution) but it just grabs both screens anyway, blanking the 2nd screen.

One issue with CIV3 is I do not get the full range of screen sizes to choose from when selecting window mode on the main screen !?
 
Hi Alan,

I have been running CivAssit II under Parallels (v3.0) on a second screen (22") while CIV3 runs on a 24" iMac (Ali) under Leopard (10.5.1). Apart from having to re-select the file to check each move it works a dream.
Glad you are able to use it.
Not sure what I did to see my Mac folders but its wasn't complicated (hence I can't remember) , probably something around setting network sharing which you will want to do anyway.
Parallels sets things up so that everything is shared by default, so there's nothing much needed. The only worry with that is the extent to which a hostile program on the Windows side could damage your Mac file system.
Note that PtW does not do window mode properly (you get the dialog and can select up to the full screen resolution) but it just grabs both screens anyway, blanking the 2nd screen.
Works OK for me. I run PtW on one screen and see my OS X windows on the other screen just fine. If its window is smaller than the screen I can also see OS X windows behind it. Same as with C3C. Have you patched it to the latest version?
One issue with CIV3 is I do not get the full range of screen sizes to choose from when selecting window mode on the main screen !?
Which ones are you missing? Mine shows:

1024 x 768
1152 x 768
1280 x 854
1280 x 960
1280 x 1024

I also have 1440 x 900, but it's greyed out, as my screens are only 1280 x 1024.

If you want it to go bigger than that for your super duper screen, you could try editing the width and height values in the com.aspyr.civ3conquests.plist file. You really need a plist editor - the one Apple supplies with the Developer Tools, or BBEdit will do it.
 
Alan,

On both my iMac screen and my external 22" screen I get a similar list with the 1440 possible due to the bigger screen widths.
1024 x 768
1152 x 768
1280 x 960
1280 x 854
1280 x 1024
1440 x 900

However, the iMac screen can display 1920 x 1200 native plus 1344 x 840, 1280, 800 etc. The Samsung Syncmaster does 1680 x 1050 native plus 1600 x 1000, 1360 x 768, 1344 x 1008 etc.

Is there method to the choices provided or can they be changed ? Full 1680 x 1050 on the second screen would be nice - with CIVII in a window on the main screen.
 
I expect the choices were set according to the screens that Brad was aware of when he released the software. Not having your kind of screen real estate, I've no idea whether they could be added to, or whether the software is even capable of dealing with a larger window size.

I already suggested a way you might try to set your own resolution by editing the ~/Library/Preferences/com.aspyr.civ3conquests.plist file.
 
Back
Top Bottom