Edit tribes

2. I explain to you how to modify thr pad by yourself :) but you must know hexadecimal, if that's ok

Ok let's explain a little bit for this one:
First thing to know is that the compression goes backwards: it starts at the end of the byte sequence, and rolls up to the beginning
Second thing is that compression is directed by 2 instructions: "copy as-is" (B2) and "fill-in" (B0):

  • "copy as-is" (B2)
  1. this sequence "starts" (so, at then end) with byte B2, followed by a 2-byte integer value (short), in little endian format. I show an example below highlighted in red:
$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_ a_ n_ ._ ._ ._ ._ ._ ._ ._
24 00 24 00 4A 43 65 73 61 72 37 0B 00 B2 00 19 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0

You see that first occurence is "0B 00 B2" and second is "05 00 B2". For the first occurence, the 2-byte little-endian value is "00 0B" (in fact it is "0B 00" but swapped because it is little-endian, which mean "little end first"). "00 0B" is hexadecimal value for "11" (eleven), so this instruction means "copy as-is the next (i.e. previous) eleven bytes".
You see that the "next (i.e. previous) eleven bytes" are clearly the following (highlighted in purple):

$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_ a_ n_ ._ ._ ._ ._ ._ ._ ._
24 00 24 00 4A 43 65 73 61 72 37 0B 00 B2 00 19 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0
11 10 09 08 07 06 05 04 03 02 01

Same for the second occurence, which has length "00 05", the "5" bytes to copy as-is are the following ones:

$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_
._ ._ ._ ._ ._ ._ ._ R_ o_ m_ a_ n_ ._ ._ ._ ._ ._ ._ ._
24 00 24 00 4A 43 65 73 61 72 37 0B 00 B2 00 19 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0
11 10 09 08 07 06 05 04 03 02 01 .. .. .. .. .. .. .. 05 04 03 02 01

So when uncompressing, those bytes will simply be copied "as-is" to the uncompressed data, while the compression instruction (0? 00 B2) will be removed

  • "fill-in" (B0)
This sequence "starts" (so, at then end) with byte B0, followed by a 2-byte integer value (short), in little endian format, followed by a single byte. I show an example below highlighted in blue:
$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_ a_ n_ ._ ._ ._ ._ ._ ._ ._
24 00 24 00 4A 43 65 73 61 72 37 0B 00 B2 00 19 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0
You see that first occurence is "00 19 00 B0" and second is "00 0D 00 B0". For the first occurence, the 2-byte little-endian value is "00 19" (in fact "19 00") which is hexadecimal value for "25, and the single byte value is "00", so this instruction means "fill in the next (previous) 25 bytes with '00'".
Same for the second occurence, which has length "00 0D", hexadecimal for "13", and byte "00", which means "fill in the next 13 bytes with "00"

  • uncompress
So when we combine both instructions, we see they cover all the compressed content:

$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_ a_ n_ ._ ._ ._ ._ ._ ._ ._
24 00 24 00 4A 43 65 73 61 72 37 0B 00 B2 00 19 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0

When uncompressing, this gives the following result, keeping purple color for uncrompessed B2 sequences, and green color for B0 uncompressed sequences (remember, always goes backwards):​

Compressed
$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_ a_ n_ ._ ._ ._ ._ ._ ._ ._
24 00 24 00 4A 43 65 73 61 72 37 0B 00 B2 00 19 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0

Uncompressed
$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_ a_ n_ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._
24 00 24 00 4A 43 65 73 61 72 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 6F 6D 61 6E 00 00 00 00 00 00 00 00 00 00 00 00 00

  • manual char padding
If you want to free more chars, because the optimal compressed sequance left more chars for modding, here we can for example use 1 more char for Ceasar's leader name, we will add a "2" at the end (hex value for char "2" is "32").
We must take precautions for 2 things:
Make the B2 sequence 1 char longer, so the hex value will be "00 0C" instead of "00 0B"
Make the "preceding" (i.e. "following") B0 fill-in sequence 1 char shorter, so the hex value will be "00 18" instead of "00 19"​
Here is the result, comparing before and after (changes in yellow):

$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_ a_ n_ ._ ._ ._ ._ ._ ._ ._
24 00 24 00 4A 43 65 73 61 72 37 0B 00 B2 00 19 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0

$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ 2_ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_ a_ n_ ._ ._ ._ ._ ._ ._
24 00 24 00 4A 43 65 73 61 72 37 32 0C 00 B2 00 18 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0

You see the modified compressed byte sequence is indeed 1 char longer, but uncompressed sequence will be the same length in the end:

Before
$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_

24 00 24 00 4A 43 65 73 61 72 37 0B 00 B2 00 19 00 B0 52 6F 6D
$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_
24 00 24 00 4A 43 65 73 61 72 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 6F 6D
11 10 09 08 07 06 05 04 03 02 01 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01

After
$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ 2_ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_

24 00 24 00 4A 43 65 73 61 72 37 32 0C 00 B2 00 18 00 B0 52 6F 6D
$_ ._ $_ ._ J_ C_ e_ s_ a_ r_ 7_ 2_ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ ._ R_ o_ m_
24 00 24 00 4A 43 65 73 61 72 37 32 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 52 6F 6D
12 11 10 09 08 07 06 05 04 03 02 01 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01

Hope this helps !!
 
Last edited:
THANKS @darkpanda

If you don't mind, I prefer to insure with the first option, I'll try the second option.

1.
J C e s a r 7 =+1
L i n c o l n 8 9 =+1
A l e x a n d e r 0 =+2
N a p o l =+3

2.
I think I have more or less understood it but when I went to try Trade's technology to add a character, it eats words from other technologies.
Only valid for civilizations and names of leaders?
 
Last edited:
THANKS

I think I have more or less understood it but when I went to try Trade's technology to add a character, it eats words from other technologies.
Only valid for civilizations and names of leaders?

I need more technical details to help you with that, but something must be noted: the start position of each string must not change (in uncompressed), since this is the fixed address used by CIV.EXE internally to refer to the string.
 
THANKS @darkpanda

If you don't mind, I prefer to insure with the first option, I'll try the second option.

1.
J C e s a r 7 =+1
L i n c o l n 8 9 =+1
A l e x a n d e r 0 =+2
N a p o l =+3

There you go !

Code:
$  .  $  .  C  a  e  s  a  r  .  .  .  .  .  .  .  R  o  m  a  n  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  H  a  m  m  u  r  a  b  i  .  .  .  .  .  .  .  B  a  b  y  l  o  n  i  a  n  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  F  r  e  d  e  r  i  c  k  .  .  .  .  .  .  .  G  e  r  m  a  n  s  1  .  .  .  .  .  .  G  e  r  m  a  n  .  .  .  .  .  .  .  .  .  .  .  .  .     .  .  .  R  a  m  e  s  s  e  s  .  .  .  .  .  .  .  E  g  y  p  t  i  a  n  .  .  .  .  .  .  .  .  .  .  .  .  .  A  b  e     L  i  n  c  o  l  n  .  .  .  .  .  .  .  A  m  e  r  i  c  a  n  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  A  l  e  x  a  n  d  e  r  .  .  .  .  .  .  .  G  r  e  e  k  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  M  .  G  a  n  d  h  i  .  .  .  .  .  .  .  I  n  d  i  a  n  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  7  .  .  $  .  $  .  S  t  a  l  i  n  .  .  .  .  .  .  .  R  u  s  s  i  a  n  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  S  h  a  k  a  .  .  .  .  .  .  .  Z  u  l  u  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  N  a  p  o  l  e  o  n  .  .  .  .  .  .  .  F  r  e  n  c  h  .  .  .  .  .  .  .  F  r  e  n  c  h  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  M  o  n  t  e  z  u  m  a  .  .  .  .  .  .  .  A  z  t  e  c  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  M  a  o     T  s  e     T  u  n  g  .  .  .  .  C  h  i  n  e  s  e  .  .  .  .  .  .  .  C  h  i  n  e  s  e  .  .  .  .  .  .  .  .  .  .  .  .  .  E  l  i  z  a  b  e  t  h     I  .  .  .  .  .  E  n  g  l  i  s  h  .  .  .  .  .  .  .  E  n  g  l  i  s  h  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  G  e  n  g  h  i  s     K  h  a  n  .  .  .  .  .  .  .  M  o  n  g  o  l  .  .  . 
24 00 24 00 43 61 65 73 61 72 0A 00 B2 00 1A 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0 01 00 01 00 18 00 0A 00 48 61 6D 6D 75 72 61 62 69 11 00 B2 00 17 00 B0 42 61 62 79 6C 6F 6E 69 61 6E 00 00 00 00 00 00 FF FF FF FF 01 00 1C 00 0E 00 46 72 65 64 65 72 69 63 6B 00 00 00 00 00 00 00 47 65 72 6D 61 6E 73 31 00 B2 00 09 00 B0 47 65 72 6D 61 6E 06 00 B2 00 0A 00 B0 01 00 FF FF 01 00 20 00 12 00 52 61 6D 65 73 73 65 73 12 00 B2 00 18 00 B0 45 67 79 70 74 69 61 6E 08 00 B2 00 0C 00 B0 01 00 15 00 07 00 41 62 65 20 4C 69 6E 63 6F 6C 6E 11 00 B2 00 15 00 B0 41 6D 65 72 69 63 61 6E 08 00 B2 00 08 00 B0 FF FF 00 00 01 00 13 00 05 00 41 6C 65 78 61 6E 64 65 72 13 00 B2 00 17 00 B0 47 72 65 65 6B 05 00 B2 00 0D 00 B0 01 00 FF FF 1A 00 0C 00 4D 2E 47 61 6E 64 68 69 10 00 B2 00 18 00 B0 49 6E 64 69 61 6E 06 00 B2 00 0A 00 B0 FF FF FF FF 00 00 1F 00 11 09 00 B2 00 37 00 B0 24 00 24 00 53 74 61 6C 69 6E 0A 00 B2 00 1A 00 B0 52 75 73 73 69 61 6E 07 00 B2 00 09 00 B0 01 00 00 00 FF FF 19 00 0B 00 53 68 61 6B 61 0F 00 B2 00 1B 00 B0 5A 75 6C 75 04 00 B2 00 0C 00 B0 01 00 00 00 00 00 16 00 08 00 4E 61 70 6F 6C 65 6F 6E 12 00 B2 00 08 00 B0 46 72 65 6E 63 68 06 00 B2 00 0A 00 B0 46 72 65 6E 63 68 06 00 B2 00 0A 00 B0 01 00 01 00 01 00 17 00 09 00 4D 6F 6E 74 65 7A 75 6D 61 13 00 B2 00 17 00 B0 41 7A 74 65 63 05 00 B2 00 0D 00 B0 FF FF 01 00 14 00 06 00 4D 61 6F 20 54 73 65 20 54 75 6E 67 00 00 00 00 43 68 69 6E 65 73 65 1F 00 B2 00 09 00 B0 43 68 69 6E 65 73 65 07 00 B2 00 0D 00 B0 01 00 1D 00 0F 00 45 6C 69 7A 61 62 65 74 68 20 49 00 00 00 00 00 45 6E 67 6C 69 73 68 1D 00 B2 00 09 00 B0 45 6E 67 6C 69 73 68 07 00 B2 00 0B 00 B0 01 00 00 00 1B 00 0D 00 47 65 6E 67 68 69 73 20 4B 68 61 6E 14 00 B2 00 14 00 B0 4D 6F 6E 67 6F 6C 06 00 B2 
$  .  $  .  J  C  e  s  a  r  7  8  .  .  .  .  .  .  .  R  o  m  a  n  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  H  a  m  u  r  a  b  i  .  .  .  .  .  .  .  B  a  b  i  l  o  n  i  o  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  F  r  e  d  5  .  .  .  .  .  .  .  A  l  m  a  n  s  .  .  .  .  .  .  .  A  l  m  a  n  .  .  .  .  .  .  .  .  .  .  .  .  .     .  .  .  R  a  m  s  e  s     I  I  .  .  .  .  .  .  .  E  g  i  p  c  i  o  .  .  .  .  .  .  .  .  .  .  .  .  .  L  i  n  c  o  l  n  8  9  1  .  .  .  .  .  .  .  A  m  r  i  c  o  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  A  l  e  x  a  n  d  e  r  0  1  2  .  .  .  .  .  .  .  G  r  e  c  o  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  M  .  G  a  n  d  h  i  .  .  .  .  .  .  .  I  n  d  i  o  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  7  .  .  $  .  $  .  S  t  a  l  i  n  7  .  .  .  .  .  .  .  R  u  s  o  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  S  h  a  k  a  .  .  .  .  .  .  .  Z  u  l  u  e  s  .  .  .  .  .  .  .  Z  u  l  u  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  N  a  p  o  l  1  2  3  .  .  .  .  .  .  .  F  r  a  n  c  s  .  .  .  .  .  .  .  F  r  a  n  c  ?  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  M  o  n  t  z  u  m  a  .  .  .  .  .  .  .  I  n  c  a  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  M  a  o     T  s  e     T  u  n  g  .  .  .  .  .  .  .  C  i  n  o  .  .  .  .  .  .  .  .  .  .  .  .  .  I  s  a  b  e  l     I  .  .  .  .  .  .  .  I  n  g  l  e  s  e  s  .  .  .  .  .  .  .  I  n  g  l  e  s  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  G  e  n  g  h  i  s     K  h  a  n  .  .  .  .  M  o  n  g  o  l  e  s     .  .  .  .  .  .  M  o  n  g  o  l  .  .  . 
24 00 24 00 4A 43 65 73 61 72 37 38 0C 00 B2 00 18 00 B0 52 6F 6D 61 6E 05 00 B2 00 0D 00 B0 01 00 01 00 18 00 0A 00 48 61 6D 75 72 61 62 69 10 00 B2 00 18 00 B0 42 61 62 69 6C 6F 6E 69 6F 00 00 00 00 00 00 00 FF FF FF FF 01 00 1C 00 0E 00 46 72 65 64 35 1F 00 B2 00 0B 00 B0 41 6C 6D 61 6E 73 06 00 B2 00 0A 00 B0 41 6C 6D 61 6E 05 00 B2 00 0B 00 B0 01 00 FF FF 01 00 20 00 12 00 52 61 6D 73 65 73 20 49 49 13 00 B2 00 17 00 B0 45 67 69 70 63 69 6F 07 00 B2 00 0D 00 B0 01 00 15 00 07 00 4C 69 6E 63 6F 6C 6E 38 39 31 10 00 B2 00 16 00 B0 41 6D 72 69 63 6F 06 00 B2 00 0A 00 B0 FF FF 00 00 01 00 13 00 05 00 41 6C 65 78 61 6E 64 65 72 30 31 32 16 00 B2 00 14 00 B0 47 72 65 63 6F 05 00 B2 00 0D 00 B0 01 00 FF FF 1A 00 0C 00 4D 2E 47 61 6E 64 68 69 10 00 B2 00 18 00 B0 49 6E 64 69 6F 05 00 B2 00 0B 00 B0 FF FF FF FF 00 00 1F 00 11 09 00 B2 00 37 00 B0 24 00 24 00 53 74 61 6C 69 6E 37 0B 00 B2 00 19 00 B0 52 75 73 6F 04 00 B2 00 0C 00 B0 01 00 00 00 FF FF 19 00 0B 00 53 68 61 6B 61 0F 00 B2 00 0B 00 B0 5A 75 6C 75 65 73 06 00 B2 00 0A 00 B0 5A 75 6C 75 04 00 B2 00 0C 00 B0 01 00 00 00 00 00 16 00 08 00 4E 61 70 6F 6C 31 32 33 12 00 B2 00 08 00 B0 46 72 61 6E 63 73 06 00 B2 00 0A 00 B0 46 72 61 6E 63 3F 06 00 B2 00 0A 00 B0 01 00 01 00 01 00 17 00 09 00 4D 6F 6E 74 7A 75 6D 61 12 00 B2 00 18 00 B0 49 6E 63 61 04 00 B2 00 0E 00 B0 FF FF 01 00 14 00 06 00 4D 61 6F 20 54 73 65 20 54 75 6E 67 14 00 B2 00 14 00 B0 43 69 6E 6F 04 00 B2 00 10 00 B0 01 00 1D 00 0F 00 49 73 61 62 65 6C 20 49 0E 00 B2 00 08 00 B0 49 6E 67 6C 65 73 65 73 08 00 B2 00 08 00 B0 49 6E 67 6C 65 73 06 00 B2 00 0C 00 B0 01 00 00 00 1B 00 0D 00 47 65 6E 67 68 69 73 20 4B 68 61 6E 00 00 00 00 4D 6F 6E 67 6F 6C 65 73 20 00 B2 00 08 00 B0 4D 6F 6E 67 6F 6C 06 00 B2
 
It seems that it gives errors in my translated version but in the original version everything is perfect. I'll have to take a look at it since it's clear that the problem lies only in my version.

Sin-t-tulo.jpg
 
Last edited:
I'm about to send you the translation if you want to look at the problem. What I know is that my trick is to blame.

I enabled more cells of the ascii code (control) to insert more letters for the font and I think that's the problem.
 
Last edited:
What program do you use to decompress civ.exe? I want to know if the byte compression is different in my version. Something tells me that the problem may be in the compressed bytes (00) are not the same for my version.
 
Last edited:
We use something called UNP.EXE, but it's probably alreayd linked somewhere in those forums, and I am pretty sure tupi made a post about it to you, in one of your previous posts...

It must be run inside the DOS environment where you run CIV, and you must be very careful to backup your CIV.EXE because, byt default, UNP.EXE overwrites the uncompressed file !

Anyway I posted it zipped attached to this post (because cannot attach EXE files).
 

Attachments

I do remember that Tupi already told me about him at the time, but I wanted to make sure.
I'll have to take a look at it but I think it's going to be too much for me.

Thank you.
 
I think I've already been able to fix the problem and now I don't have that error anymore.


Sin-t-tulo.jpg
 
Back
Top Bottom