Resource icon

BtS Color Editor 1.1 2016-10-05

# -*- coding: utf-8 -*-

Copyright © 2010-2012 by James Conrad Shea (Duckstab)
This software is made available under the terms of the Creative
Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
See
http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
for full terms.

########################################
# Description
########################################

BtS Color Editor v. 1.1

This is a simple player color editor for Civ 4 Beyond the
Sword. It allows you to set the primary, secondary, and text
colors for each civ and for the barbs. You can also have it
select random colors, and adjust colors using an algorithm that
tries to make sure each civ's borders are clearly distinguishable.

It will likely work with other flavors of Civ 4 and with various
mods if you set up the config properly. I myself have been able
to use it successfully with BAT, RFC, and Sword of
Islam. However, I can't make any guarantees so if you want to be
safe you should back up your CustomAssets folder first.

########################################
# Changes in 1.1
########################################

* Added "Adjust Selected" function, which moves the selected
colors around slightly to try to make them mutually distinct.
* "Randomize Selected" no longer considers colors of
civilizations which were not selected.
* Changed the color metric for measuring the perceptual distance
between colors. The former one did not work very well with
certain hues (e.g. blues) in practice. The program now uses the
Euclidean distance in Y'UV space.
* Fixed the bug which prevented the color chooser from updating a
color after editing.

########################################
# Installation
########################################

0) Unzip the files to any convenient location.
1) Download and install Python 2.X from
http://python.org/download/. I developed this using Python
2.6.5 and did some basic testing with Python 2.7. I'd
recommend trying 2.7 first.
2) Important: Edit btsColorEditorConfig.py to set the
CustomAssets (output) directory and search path for existing
assets.

########################################
# Running
########################################

1) Run btsColorEditor.py with python.exe. Normally the Python
installer will register python.exe to open Python files so you
can probably just double-click. This will back up your existing
color definitions to CIV4PlayerColorInfos.xml-orig and
CIV4ColorVals.xml-orig, just in case you need to get them
back. Note that CIV4PlayerColorInfos.xml and CIV4ColorVals.xml
are the only files the editor writes.

2) To edit the colors for each civ, just click on the colored
buttons next to their names. When done, click "Save".

3) There are two functions provided for modifying multiple civs'
colors at once. To access these functions, select the
checkboxes and then click the corresponding button.

"Randomize Selected" assigns each selected civ a random color
scheme, attempting, if possible, to make each one visibly
different from the others.

"Adjust Selected" attempts to tweak each selected civ's color
scheme slightly to make it visibly different from those of the
other selected civs.

When you're happy with the result, make sure to click "Save".

4) Start/restart BtS. (Note that the XML files are only read on
startup, so a restart is needed.)

########################################
# Notes
########################################

* The color editor creates new color names for each civ, which is
necessary to make each color separately editable. For example,
England's color is normally the same white that is used as a
secondary color for several other civs. So England's primary
color is renamed to COLOR_EDITOR_ENGLAND_PRIMARY while
America's secondary color is COLOR_EDITOR_AMERICA_SECONDARY.
* The randomization algorithm proved trickier than expected. It
turns out it's pretty hard to find 30-odd colors that are
sufficiently far apart so that any two of them are clearly
distinguishable border colors, although of course this is
somewhat subjective. The program basically generates colors at
random and measures each candidate color's distance from all
other colors. If it passes a certain threshold, it's added to
the set. If not, another color is generated. To ensure the
algorithm terminates the threshold is gradually lowered after a
number of successive failures.

########################################
# Known issues
########################################

* The output XML is not very readable. Surprisingly there are no
good choices in the Python 2.X world for generating
human-readable XML. I tried several and Civ's in-game XML
parser choked on the output of each one.
* The Minor civ is not supported. For some reason it not only
shares the color white with England but the color set name as
well, and this wasn't easy to work around.
* When the leader splash screen pops up you'll see the original
colors for the flag icons. These are actual images not
generated from the XML.

########################################
# Giving feedback
########################################

* Comments, suggestions, and bug reports are welcome. Just send
me a PM on CivFanatics.
  • capture_QaZ.jpg
    capture_QaZ.jpg
    63.6 KB · Views: 152
Author
duckstab
Downloads
675
Views
675
First release
Last update
Rating
4.00 star(s) 2 ratings
Top Bottom