Interface Issues after BUG Install

I wouldn't waste too much effort on a new installer unless you really think it's needed. I'm hopeful we can resolve this issue satisfactorily by sacrificing a goat or something simple like that.

Another simple option is to put it in "My Documents\My Games" directly, outside "Bts" or "Civ 4 Complete" rather than in it. This way we never need to know what version of the game they installed. I assume the installer can do that easily enough (put just the .ini file there).

Code:
My Documents
  My Games
    [B]BUG Mod[/B]
      [B]BUG Mod.ini[/B]
      [B]The BUG Mod Help.chm[/B]
      [B]GNU Public License.rtf[/B]
      [B]CustDomAdv[/B]
    Beyond the Sword / Civ 4 Complete
      [B]CustomAssets[/B]
Actually, I kinda like that idea.

Wait a minute . . . where does the installer put the files itself? How does it know the name of the folder??
 
The tricky part with the SGs is that there is still this really random but nasty bug where non-BUG users experience a crash when they open the in-game event log window (ctrl-tab) for a save game from a BUG user. Ruff thought he narrowed it down the SimCutie's Extended Color Table and backed out the changes, but he's seen it happen again since with a saved game from the new release of BUG. :(
Currently, at least 3 of our group of 5 use the BUG mod, including myself (now, thanks again for this awesome tool). I am going to push the others to use it as well, to eliminate any potential conflicts, but there is a catch. We are planning to play these new-fangled SGs on the Strats and Tips forum, and even have "Guest Players" join the fun for future games or even rounds. I would hate to crash them, but I suppose a warning about checking the events log may be enough.

Speaking of the HoF mod, and our own... I haven't played a HoF or GOTM since C3C... what mods do they contain that we don't?
MODs included in the HoF package can be found here. It is also not compatible with Bhruics patch . . . sort of. The HoF mod WILL run with or without the patch installed, but games saved by players with the patch cannot be loaded by those who do not have the patch installed, and vice-versa. There is an assets error message and the game crashes to desktop. I discovered this when I first went to use the MOD. I had the patch installed, and was able to play with the MOD normally for non-GOTM games, but I could not load any of the BOTM saves, nor could I load HoF games that others had submitted to "check them out" (something thats pretty cool to do, those guys play some crazy styles, and use Map-Finder for insane starts, etc). Unloading Bhruic patch was all it took to be able to open both the GOTMs and the games uploaded by other players, but the minute I did that, I could no longer load my own previous saves created when the patch was installed.

Hope that made sense, LOL.
 
The installer now simply users #MyDocuments#\My Games\Beyond The Sword to locate the directory. It doesn't currently pull anything from the actual registry. The options are to define the install directory, pull it from the registry, or from an .ini file.

Looked at the MODs in the HoF... seems like we have everything they have, plus a few goodies. One thing I like is the russian translations! wish we could get some more translations done.:p
 
interesting comments ...

1) the scramble game has been played a number of times. Search for 'concurrent SGs". I started one and others have also played them.

2) the in-game log error is always there. It isn't a random event. Open a game with vanilla BtS that someone has used BUG for and hit Ctrl-Tab - bang!

3) HOF mod contains pretty much what we contain except they haven't been expanded like we have (ie alerts). They do have some additional features (map finder, zoom) that are linked to the DLL.

4) As long as we can find the my docs directory, we could just put the ini file there and be done with it. Getting sick of trying to find everyone's my docs/civ4 directory. Edit: EFool had the same idea - I support that!
 
alright, so you want to put the bugmod.ini file inside the root documents folder?

Also, I can make one installer that has different versions that can be installed from 1 file... It's set up so you have a registered and shareware version, but I'm sure it can be modified to have a standard BTS install and a CIV4 Complete install.
 
I wouldn't waste too much effort on a new installer unless you really think it's needed. I'm hopeful we can resolve this issue satisfactorily by sacrificing a goat or something simple like that.

Another simple option is to put it in "My Documents\My Games" directly, outside "Bts" or "Civ 4 Complete" rather than in it. This way we never need to know what version of the game they installed. I assume the installer can do that easily enough (put just the .ini file there).

Code:
My Documents
  My Games
    [B]BUG Mod[/B]
      [B]BUG Mod.ini[/B]
      [B]The BUG Mod Help.chm[/B]
      [B]GNU Public License.rtf[/B]
      [B]CustDomAdv[/B]
    Beyond the Sword / Civ 4 Complete
      [B]CustomAssets[/B]
Actually, I kinda like that idea.

Wait a minute . . . where does the installer put the files itself? How does it know the name of the folder??
The installer defaults to My Docs\My Games\Beyond the Sword folder.

The My Docs\My Games folder has a folder for each expansion, so there is a My Docs\My Games\Beyond the Sword folder,
a My Docs\My Games\Warlords folder,
AND a My Docs\My Games\Sid Meier's Civilization 4 Complete folder.

The game files themselves are in C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete,

but the expansions are in subfolders of that folder, like this:

C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Beyond the Sword
C:\Program Files\2K Games\Firaxis Games\Sid Meier's Civilization 4 Complete\Warlords

Does that make a difference? There are no BTS or Warlord folders in the My Docs\My Games\Sid Meier's Civilization 4 Complete folder, in fact, I am now wondering if BM or Civ Scale stuck some of these folders in themselves. I do know that when I went to load Blue Marble and Civ Scale I had to tell them where the installation of the Civilization4.exe file was, it did not "find" it on my system.

Hope some of this info helps, and doesnt confuse, since I am pretty clueless about a lot of this stuff. I could get DOOM deathmatches to run on 2400 baud Modems on a 386sx back in the day though! Ah those were the days, 4 MBs of RAM was a LOT, LOL.
 
That was very helpful, Bleys. The directory structure installed using the non-complete versions of Civ4 are exactly the same, except in place of "Sid Meier's Civilization 4 Complete" you see "Sid Meier's Civilization 4" (I think, I installed to "C:\Games\Civ4" cuz that's just how I roll. :p

Since BUG only works with BtS, we could insist that it gets installed in "My Docs\My Games\Beyond the Sword" . . . either as "CustomAssets" or "Mods\BUG Mod". We can do as we do now and keep the .ini and other files inside the BtS folder.

Why were we having such problems with CivComplete? I do remember that initially we wanted the mod to find the .ini file whether it was in the install or "My Docs" folders and as either CustomAssets or a mod -- being too flexible I think. Is there any reason not to limit it to "My Docs" at least? Whether or not we have an option to install it in the mods subfolder is a side issue, but probably a nice thing to do.

Does anyone see any problems with this?

If not, should we go with it or switch to the new outside-the-BtS-folder option Ruff and I just suggested? It would still be inside a folder inside "My Games" -- separate from BtS but not in your face in "My Docs". I see no technical reason to do it; it's mostly Aesthetics (leads to Literature, Drama).
 
Alrighty then... I'm thinking of something here, and want to see what you guys think....

The installer will allow you to have different install versions, (Minimum, Normal, and Full), and those versions can be named whatever you want.

What I'm thinking if have 1 version that is normal BTS BUG. Version 2 will be Civ Complete BUG. Version 3 will be BTS BAT. Version 4 will be Civ Complete BAT.

One installer, ~100kb.

We just have the user download the files needed after the install program is run. The question I have though is where will we store the files? Can we allow direct access to the SVN? Should we have it so the user will download the current SVN build, regardless of it's current working status, or create a secondary directory containing just the current working version...

If not, the option should still work for 2 installers, without downloading. One for BUG that has BTS version and Civ Complete Version, and 1 for BAT.

Suggestions or ideas guys?

edit: Alright I just need to know where we need to install this for Civ4 Complete, that will allow it to work, and if any registry keys need to be changed. If they do need to be changed, what values work?
 
I have come to the conclusion that we can ignore Civ 4 Complete entirely. We should install all files into "My Docs\My Games\Beyond the Sword" (see my previous post).

As for merging the BUG and BAT installs, I am still against it. No sense making someone download BAT if they only want BUG given that BAT is huge and BUG is tiny. Is that still the case?

I don't quite understand your idea about downloading from SVN. The user would download a minimal install program that contains no BUG/BAT files -- just an .exe installer? And then the installer would grab the install files from SVN?

That should be possible, but I would rather not force users to use the bleeding edge. It makes committing to SVN require more safety checks. I much prefer being able to put up minimally-tested code on SVN so others can try it out if they want. SVN access is just HTTP, BTW, so there's no reason we couldn't store the released versions elsewhere (not in SVN please).

But I think we're over-complicating it. The installer should be pretty straight-forward: the user choose to install as CustomAssets or a mod. No need to worry whether or not they have the Complete version. No registry entries are required.
 
actually they can't download from the .svn. I'd have to compile a .bin file.

Just so I got it all right on the dirs... put all "support" files in a My Games\BUG Mod folder. What about the UnitNaming.ini? Shouldn't that be moved to the BUG Mod folder, instead of BTS?
 
Why were we having such problems with CivComplete? I do remember that initially we wanted the mod to find the .ini file whether it was in the install or "My Docs" folders and as either CustomAssets or a mod -- being too flexible I think. Is there any reason not to limit it to "My Docs" at least? Whether or not we have an option to install it in the mods subfolder is a side issue, but probably a nice thing to do.
I think the problem with Complete is in the registry. It does not place a separate entry for "INSTALLDIR=C:\Documents and Settings\Owner\My Documents\My Games\Beyond the Sword\". Manually adding that line in the HKEY_LOCAL_MACHINE\SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword solved all my problems.

Your idea of an install into the My Games folder directly, instead of the sub-folder of My Documents\My Games\Beyond the Sword\ may work, I have no clue.

Heh, I am actually enjoying helping you guys figure this out, so if you have any questions, please ask them. I am getting more and more confident that I actually may have some data that will help you get to the bottom of this.

I do know that Civ IV:Complete is still not widely being used, because its not available over-the-counter in the USA yet. I ordered my copy from an importer named GoGamer, who got the version being sold in England, so the only issue I have seen with it is in the spelling of some words (colour and such). I never purchased a copy of Vanilla, in fact I only started playing Vanilla in November of 07 through a game simulator service called GameTap. After realizing I had likely found something to keep my interest for many many months, I looked for the Complete version, which was only available in Europe at the time. Eventually I was nudged toward GoGamer, and got Complete the last week of January, 08.
.
I am guessing that when Complete releases in the states, you may find that more people will be running into this problem.
 
Would you mind testing the installer for me when we get it all set up Bleys? Will post it here and let you give it a shot to see if it works.
 
Sure, no problem. Should I uninstall everything first? I have already installed Complete, BUG, BM, and CivScale, as well as editing my registry.

Actually, I can try to install it on my Laptop, which only has Complete and HoF on it, no BM, no Civ Scale. I will check its registry to be sure it also has the same lack of INSTALLDIR that the machine I have been having trouble has.
 
I'm leaning toward adding a "BUG Mod" folder to hold the INI and help files. It would be a sibling of the "Docs\Games\BtS" folder. This way all the files that get modified when changing settings will live outside BtS. If they need to reinstall BtS for whatever reason, it would be easier for them recover. Could the installer be set up not to overwrite files in the "BUG Mod" folder -- only those in CustomAssets?

Of course, when it's installed as a mod, it makes more sense to put everything in that one mod folder. Wow, I'm really indecisive today. :confused:

I will look at the code to make sure we can remove all references to the registry. The only reason for it was to locate the actual program installation directory where the EXE and Assets are stored, but we don't need to store anything there, so we should be able to ditch it. That would make the Civ Complete problem magically disappear.
 
Here, take a look at this file. I made it so it will install the BUG Mod Folder, and then when you do Mods it will make 2 Bug MOD folders... on in Mods and one in MyGames. Do we run into the Civ Complete problem when the game is loaded from a Mod, or only from the CusAss directory? If not I can modify it so it will keep the support files with the Bug Mod folder within the Mods directory. I already have it set up now so the .INI files aren't overwritten if they are already there, and can make it so if we make changes to the INI we can have it overwrite again.
 

Attachments

  • BUGMod_222a.zip
    1 MB · Views: 112
I just mucked up CvPath to ignore the registry and only look for files in "My Games\BUG Mod" and it works fine. The files we access are

  • BUG Mod.ini
  • Adv Unit Naming.ini
  • CustomDomAdv\CustomDomAdv.txt
  • Autolog\ (created automatically by Autologger)
The first three should be installed by the installer. It should put them in "My Games\BUG Mod" in all cases (mod and CustomAssets install). KISS

I'll rewrite CvPath and trim the cruft later, but here's the minimally-tested version if anyone wants to play with it. Just replace the entirety of "CustomAssets\Python\Contrib\CvPath.py" with this:

Code:
## Copyright (c) 2006, Gillmer J. Derge.

## This file is part of Civilization IV Alerts mod.
##
## Civilization IV Alerts mod is free software; you can redistribute
## it and/or modify it under the terms of the GNU General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (at your option) any later version.
##
## Civilization IV Alerts mod is distributed in the hope that it will
## be useful, but WITHOUT ANY WARRANTY; without even the implied
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Civilization IV Alerts mod; if not, write to the Free
## Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
## 02110-1301 USA

__version__ = "$Revision$"
# $Source$

"""Implements a collection of utility methods and variables for determining
the location of Civilization 4 components.

The following variables are exposed.

* activeModName: the name of the currently active mod or None if no mod has
  been loaded.
  
  NOTE: activeModName does not currently work in a completely automated 
  fashion.  There does not appear to be a way to determine the active mod 
  programmatically from Python code.  A mod that wishes to export its name 
  to this module must create a Python module called CvModName that contains 
  a string variable named modName set to the name of the mod.  A sample 
  CvModName is shown below.

  # CvModName.py
  modName = "American Revolution"

  Of course, a CvModName Python module should only be used if the mod is 
  indeed installed in the Mods directory, not when it is installed in 
  CustomAssets.  Furthermore, if the value of the modName variable does not
  correctly match the mod directory name, the path variables will not be
  set properly.

* userDir: the user's Civilization 4 directory, typically
  C:\Documents and Settings\User\My Documents\My Games\Sid Meier's Civilization 4
  
* userAssetsDir: <userDir>\CustomAssets

* userModsDir: <userDir>\Mods

* userActiveModDir: <userDir>\Mods\<activeModName>

* userActiveModAssetsDir: <userDir>\Mods\<activeModName>\Assets

* installDir: the Civilization 4 installation directory, typically
  C:\Program Files\Firaxis Games\Sid Meier's Civilization 4

* installAssetsDir: <installDir>\Assets

* installModsDir: <installDir>\Mods

* installActiveModDir: <installDir>\Mods\<activeModName>

* installActiveModAssetsDir: <installDir>\Mods\<activeModName>\Assets

* assetsPath: a list containing all Assets directories that appear on the
  game's load paths.  Typically [userAssetsDir, installAssetsDir] or
  [userActiveModAssetsDir, installActiveModAssetsDir, userAssetsDir, installAssetsDir]

* pythonPath: a list containing all directories that appear on the
  game's Python load path.  The game's Python module loader does not support
  Python packages, so this list includes not only the Python subdirectory
  of each element of the assetsPath but also all non-empty subdirectories.

"""


import os
import os.path
import sys

if (sys.platform == 'darwin'):
	""" Mac OS X """
	def _getUserDir():
		return os.path.join(os.environ['HOME'], "Documents", "Civilization IV")

	def _getInstallDir():
		import commands
		civ4name = "Civilization IV.app/Contents/MacOS/Civilization IV"
		str = commands.getoutput("ps -xo 'command' | grep " + "'" + civ4name + "'")
		m = str.find(civ4name)
		if (m >= 0):
			installDir = str[0:m]
		return installDir
else:
	import _winreg
	""" Windows """
	def __getRegValue(root, subkey, name):
		key = _winreg.OpenKey(root, subkey)
		try:
			value = _winreg.QueryValueEx(key, name)
			return value[0]
		finally:
			key.Close()
	
	def _getUserDir():
		myDocuments = __getRegValue(_winreg.HKEY_CURRENT_USER, 
				r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",
				"Personal")
		return os.path.join(myDocuments, "My Games")
	
	def _getInstallDir():
		subkey = r"Software\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword"
		dir = __getRegValue(_winreg.HKEY_LOCAL_MACHINE, subkey, "INSTALLDIR")
		if (not dir):
			subkey = r"Software\Firaxis Games\Sid Meier's Civilization 4 Complete"
			dir = __getRegValue(_winreg.HKEY_LOCAL_MACHINE, subkey, "INSTALLDIR")
		return dir


activeModName = None
try:
    import CvModName
    activeModName = CvModName.modName
except:
    pass

userDir = os.path.join(_getUserDir(), activeModName)

userAssetsDir = os.path.join(userDir, "CustomAssets")

userModsDir = os.path.join(userDir, "Mods")

userActiveModDir = None

userActiveModAssetsDir = None

installDir = _getInstallDir()

installAssetsDir = os.path.join(installDir, "Assets")

installModsDir = os.path.join(installDir, "Mods")

installActiveModDir = None

installActiveModAssetsDir = None

assetsPath = [userAssetsDir, installAssetsDir]

if (activeModName != None):
    userActiveModDir = os.path.join(userModsDir, activeModName)
    userActiveModAssetsDir = os.path.join(userActiveModDir, "Assets")
    installActiveModDir = os.path.join(installModsDir, activeModName)
    installActiveModAssetsDir = os.path.join(installActiveModDir, "Assets")
    assetsPath.insert(0, userActiveModAssetsDir)
# YAUGM changes begin
#   assetsPath.insert(1, installActiveModAssetsDir)
    assetsPath.insert(2, installActiveModAssetsDir) # now goes after CustomAssets!
# YAUGM changes end

pythonPath = []
for dir in [os.path.join(d, "Python") for d in assetsPath]:
    for root, subdirs, files in os.walk(dir):
        if (len(files) > 0):
            pythonPath.append(root)

# YAUGM changes begin

# Designed for GreatPersonMod, returns absolute path for
# a relative path to Assets dir if and only if fileName is
# found in the location specified.
# see _test() for example.
def getPath(relPath, fileName):
    for filePath in [os.path.join(d, relPath) for d in assetsPath]:
        if os.path.isfile(os.path.join(filePath, fileName)):
            return filePath
    return ""

# Designed for Ruff's Cobbled SG Modpack 1.2b, returns list
# of potential locations for the ini file. This is called by
# CvConfigParser.py. File locations are listed in reverse
# assetsPath order so that userDir\Mods overrides CustomAssets
# overrides installDir\MODS.
# Use like this: files = CvPath.getINIPathForCvConfigParser("RuffMod.ini")
# Note: CvConfigParser.py is no longer used in Ruff's Cobbled SG Modpack 2.0+,
# but this is still useful for many of TheLopez's mod components.
def getINIPathForCvConfigParser(fileName):
    if (fileName != None):
        filenames = [os.path.join(os.path.dirname(dir), fileName)
                     for dir in assetsPath]
        filenames.reverse()
        return filenames
    return None

# Designed for Ruff's Cobbled SG Modpack 2.0.x(w), return the path
# to an ini file which should be located just outside one of the
# directories in the assets path. This is called from RuffModControl.py
def get_INI_File(szINIFileName):
    return os.path.join(userDir, szINIFileName)

# YAUGM changes end

def _test():
    print "activeModName = " + str(activeModName)
    print "userDir = " + userDir
    print "userAssetsDir = " + userAssetsDir
    print "userModsDir = " + userModsDir
    print "userActiveModDir = " + str(userActiveModDir)
    print "userActiveModAssetsDir = " + str(userActiveModAssetsDir)
    print "installDir = " + installDir
    print "installAssetsDir = " + installAssetsDir
    print "installModsDir = " + installModsDir
    print "installActiveModDir = " + str(installActiveModDir)
    print "installActiveModAssetsDir = " + str(installActiveModAssetsDir)
    print "assetsPath = " 
    for dir in assetsPath:
        print "  " + dir
    print "pythonPath = "
    for dir in pythonPath:
        print "  " + dir

# YAUGM changes begin
    print "greatPeopleArtPath = " + getPath("art\\GreatPeople", "Great Person.dds")
    print "RuffMod.ini location: " + get_INI_File("RuffMod_2w.ini")
    configFilePath = getINIPathForCvConfigParser("")
    configFilePath.reverse()
    print "configFilePath = "
    for filePath in configFilePath:
    	print "  " + filePath
# YAUGM changes end

if __name__ == "__main__": 
    _test()
 
Here, take a look at this file.
Is this the one you want me to test, or did you want me to wait. I am not in a hurry to update my laptop with BUG, since I am only planning to use it for write-ups while my stronger desktop actually has the games. As my skill level has improved, so has the length of games, and complexity of the late-game positions, and my poor little 512 MB RAM laptop just chokes. Desktop has 2 gig, and a strong video card, so I am blasting through turns that were taking 3-7 minutes to process before.

So let me know when you feel like you have it solved for Complete, and I will run it. I know my laptop JUST has Complete + HoF.

BTW, you may be getting a few more fans, since a thread I started on another board is seeing a lot of action. I linked back to this thread so folks who run into the problem can resolve it. So far, I am REALLY enjoying this MOD, it would be well worth it even if I had to run is as an actual loaded MOD. Blue Marble is amazing too, its like playing a whole new game, heh.
 
Let's wait for EF to finish the changes to CivPath.py, but once that is done, then yes, BUG should finally be 100% compatible. This installer will give you the option to install into the CA or MODs folder. Also, it has an uninstaller so if you decided you want to undo it, or it doesn't work, it'll be cake to uninstall.

Thanks for the plug in the other thread! Glad you're enjoying using it too... BTW - Whats the other thread?;)
 
I commited your changed Path file after I tested it and got it working. Another perk of this: It will locate the INI file now, no matter if it's loaded from the CA or Mods directory... will make it much easier for Mod Makers to merge now as well.

I think I may have asked before, but anyone a WoT Fan?
 
Top Bottom