Modding Civ I - custom Civ colors !

darkpanda

Dark Prince
Joined
Oct 28, 2007
Messages
823
I guess that this hack may get more than a few Civ 1 fanatics as happy as it made me: hereunder is a step-by-step guide to modify your CIV.EXE and change the default colors for any and all Civilizations !

As you may have noticed already, each Civ possesses a pair of color: the light/foreground color and the dark/background color.

The default colors are as below:



When studying the Civ color palettes, especially the color palette from SP257.PIC/.PAL, where the unit icons are stored, we can actually match the default Civ colors with the initial 16 colors in the palette:



You can see that each Civ's colors translate into a pair of color IDs, and quite fortunately, those color IDs are also stored together in an array inside CIV.EXE (offsets below from CIV EN 474.01):

Code:
00026193h: [B]0C[/B] 00 [B]0F [/B]00 [B]0A [/B]00 [B]09 [/B]00 [B]0E [/B]00 [B]0B [/B]00 [B]0D [/B]00 [B]07 [/B]00
000261a3h: [B]04 [/B]00 [B]07 [/B]00 [B]02 [/B]00 [B]01 [/B]00 [B]0A [/B]00 [B]03 [/B]00 [B]04 [/B]00 [B]08 [/B]00

As you can see above, the color IDs are arranged as 16 words (2-byte integers):
  • first 8 words for light/foreground colors, next 8 words for dark/background colors
  • in each of the 8-word arrays, the order of colors is same as the order of Civs: 0 = Reds (barbarians), 1 = whites, 2 = greens, etc...

I wanted to play with them a little, so I look at what colors are available in SP257.PIC's color palette:



Then I changed the values as follows:

Code:
00026193h: 0C 00 [B][COLOR="Blue"]35 [/COLOR][/B]00 [B][COLOR="Blue"]48 [/COLOR][/B]00 [B][COLOR="Blue"]03 [/COLOR][/B]00 0E 00 0B 00 0D 00 07 00
000261a3h: 04 00 [B][COLOR="Blue"]3D [/COLOR][/B]00 [B][COLOR="Blue"]4D [/COLOR][/B]00 [B][COLOR="Blue"]0C [/COLOR][/B]00 0A 00 03 00 04 00 08 00

And the magic worked, as you can see below, giving the Romans an orange flavour, the babylonians a kind of mustard-yellow flavour, and the German a warholesque dark teal/red look:

 

Attachments

  • modcolors1.png
    modcolors1.png
    10 KB · Views: 2,152
  • modcolors2.png
    modcolors2.png
    13.4 KB · Views: 2,753
  • civ_800.png
    civ_800.png
    4.2 KB · Views: 1,376
  • civ_797.png
    civ_797.png
    13.8 KB · Views: 1,837
  • paldef.PNG
    paldef.PNG
    21.9 KB · Views: 1,574
Holy cow darkpanda, you're a genius!
Please continue sharing the knowledge.

I need to get my hands on a hex editor.
 
Yay! Now I don't have to live with that bright pink...

Thanks, darkpanda.

But the palette is a bit limited, as it stands. Is there a painless way of editing the .PAL to contain other colours that we can then choose for the civs?
 
I don't know any painless way *yet* but it could be added to JCivED... Obviously the risk of changing the color of other Civ items unexpectedly. I'll think about it...

Actually, the current dev version of JCivED already supports basic palette edition, I had completely forgotten about this as I implemented it just before going on vacation...

So this means palette edition will be available in the next release of JCivED (0.0.12a), in the coming days or weeks.
 
This seems like an amazing mod, something that I've been looking for. Thanks for the tutorial, although, I'm unable to find the 00026193h and 000261a3h lines.
I think I'm doing something wrong. Could you, please, help me?
 
This seems like an amazing mod, something that I've been looking for. Thanks for the tutorial, although, I'm unable to find the 00026193h and 000261a3h lines.
I think I'm doing something wrong. Could you, please, help me?

I don't know what your problem is, but I believe that any Hex editor will actually show you the lines ending with a '0', so what you would be looking for is rather something like below:

Code:
00026180h: 00 00 00 FF FF FE FF FD FF FD FF 03 00 FD FF 03 ; ...ÿÿþÿýÿýÿ..ýÿ.
[B]00026190h[/B]: 00 FD FF [B][COLOR="Blue"]0C 00 0F 00 0A 00 09 00 0E 00 0B 00 0D[/COLOR][/B] ; .ýÿ.............
[B]000261a0h[/B]: [B][COLOR="Blue"]00 07 00 04 00 07 00 02 00 01 00 0A 00 03 00 04[/COLOR][/B] ; ................
[B]000261b0h[/B]: [B][COLOR="Blue"]00 08 00[/COLOR][/B] AC 00 B4 00 BE 00 C7 00 D1 00 DA 00 E5 ; ...¬.´.¾.Ç.Ñ.Ú.å

Does this help ?
 
I don't know what your problem is, but I believe that any Hex editor will actually show you the lines ending with a '0', so what you would be looking for is rather something like below:

Code:
00026180h: 00 00 00 FF FF FE FF FD FF FD FF 03 00 FD FF 03 ; ...ÿÿþÿýÿýÿ..ýÿ.
[B]00026190h[/B]: 00 FD FF [B][COLOR="Blue"]0C 00 0F 00 0A 00 09 00 0E 00 0B 00 0D[/COLOR][/B] ; .ýÿ.............
[B]000261a0h[/B]: [B][COLOR="Blue"]00 07 00 04 00 07 00 02 00 01 00 0A 00 03 00 04[/COLOR][/B] ; ................
[B]000261b0h[/B]: [B][COLOR="Blue"]00 08 00[/COLOR][/B] AC 00 B4 00 BE 00 C7 00 D1 00 DA 00 E5 ; ...¬.´.¾.Ç.Ñ.Ú.å

Does this help ?

What editor are you using, if I may ask?
 
In CIV version .05 the string can be found here

Code:
26050 : FF FE FF FD FF FD FF 03 00 FD FF 03 00 FD FF [COLOR="Blue"]0C [/COLOR]
26060 : [COLOR="Blue"]00 0F 00 0A 00 09 00 0E 00 0B 00 0D 00 07 00 04 [/COLOR]
26070 : [COLOR="Blue"]00 07 00 02 00 01 00 0A 00 03 00 04 00 08 00[/COLOR] AC

The Freeware Hex Editor XVI32 has a search future the will simplify finding the string you want. That is if it exists in your version of CIV
 
This is so cool.
I've finally given England and Greece an orange color. England was orange in Civ3 too.
The Egyptians are more yellow now, which looks better.

I've given the Mongols/Indians a dirty-green brown color.
Obviously they look the same... so this needs fine tuning :D



The problem however is that there is no purple and brown doesn't look good with the pictures. So there's only so many colors to go by.

Has anyone found good looking playable color combinations?
 
I'm having a hard time finding these strings to change them. I downloaded the program that kirkham suggested and have version 3; not sure if this has anything to do with why I can't find them.

Any suggestions on where to look or search methods?

I've searched by string and by code and nothing :(
 
I'm having a hard time finding these strings to change them. I downloaded the program that kirkham suggested and have version 3; not sure if this has anything to do with why I can't find them.

Any suggestions on where to look or search methods?

I've searched by string and by code and nothing :(

I recommend you use JCivED to patch your CIV.EXE: since the patch above was posted, it has been implemented into JCivED for ease of use.

After you downloaded and launched JCivED, here is how to proceed:
- Open menu Patch
- Select Open CIV executable...
- Select your CIV.EXE
- In the patch list, select CIV1_CUSTOM_CIV_COLORS
- Then press Configure button at the bottom-right of the panel
- Then select your Civ colors
- When finished, press OK
- Finally, press Apply for your changes to be applied to your CIV.EXE

Note that JCivED will not create a backup copy for you, so be careful and create/keep your own backup copies accordingly.

Enjoy!
 
I recommend you use JCivED to patch your CIV.EXE: since the patch above was posted, it has been implemented into JCivED for ease of use.

After you downloaded and launched JCivED, here is how to proceed:
- Open menu Patch
- Select Open CIV executable...
- Select your CIV.EXE
- In the patch list, select CIV1_CUSTOM_CIV_COLORS
- Then press Configure button at the bottom-right of the panel
- Then select your Civ colors
- When finished, press OK
- Finally, press Apply for your changes to be applied to your CIV.EXE

Note that JCivED will not create a backup copy for you, so be careful and create/keep your own backup copies accordingly.

Enjoy!

ill try to redownload jcived then. the copy i have on my computer the 'civ colors patch' is 'greyed out' for my civ.exe file. not sure if it's because it's a version 3 copy of the game or what.

so when home, i'll retry and post a screen shot if i can't get it to work.

thanks for the help panda
 
Top Bottom