Ok after more investigation I see the problem, and at this point I can only concur with tupi...
In fact, after disassembly in IDA, I had created a data structure for each "AI Leader data", and it shows that plural name can be set, but if no plural is present, then the default behaviour is to simply add an "s" at the end:
So let's try the other solution: add "es" instead of "s".
First, here is the piece of ASM that adds "s" to the Civ name for plural in replay:
When taking a look at the string
as_4, we see it comes just between a 2-byte word storing the replay length, and the victory string "The entire world hails":
Note: all strings require a '00' value at the end, to mark their end.
If we want to add "es" instead of "s", we need to make room for one extra character. It will be hard to touch the CurrentReplaySize value, but maybe we can touch the following string by shortening it, for example use "The
whole world" instead of "The
entire world", this spares us exactly the 1 char needed.
In that case, we can replace: "s\0The entire" with "es\0The whole", those 2 strings have the same length of 12 characters.
If we do this, we also need to modify whichever code is referencing the victory string, which fortunately is only used in 1 place:
Let's see the equivalent ASM using this code:
... and the equivalent HEX for this ASM:
The B8 90 40 instruction should be read:
- B8: move some value into AX register
- 90 40: read as short endian, means 4090h (in decimal it is 16528)
Looking back at the previous view on data, we see that the string "The entire world ..." is in deed located at position "dseg:4090".
We don't need to care about dseg here, because we see that 4090 is the value directly used in the code, so if we push the string 1 byte further, we imply need to change it to 4091, and it should work fine.
Now, I'm always working on the unpacked version of CIV.EXE when disassembling, so we need to find our locations in packed CIV.EXE for patching.
In CIV 474.01 (which is almost same as 475.01):
We see the "s\0The entire" starts at adress 2884Dh.
If we change it, we have initial bytes for our patch:
At
2884Dh:
- 73 00 54 68 65 20 65 6E 74 69 72 65 is replaced with 65 73 00 54 68 65 20 77 68 6F 6C 65
Now for the code modification, which calls the string "The whole world...", luckily enough the data adresses in memory do not change between packed and unpacked version, so we simply need to find the correct hex "B8 90 40" and replace it with "B8 91 40":
More luck here, there is only 1 occurence of this hex, so we are sure this is the correct location, so more bytes to patch:
At
39087h:
- B8 90 40 is replaced with B8 91 40
Now let's test this !
I think it does the trick
BUT, in fact, in
only does the trick
in the Replay !!!
As a matter of fact, the code to append a "s" to the Civ name is duplicated is several places where an "s" needs to be added, in particular at game init time (if you are prompted your civ name) and also when a SCHISM occurs... There could be other places too...
So, indeed, not a simple task !