Exceeding 128 Units

MountainMn10

Chieftain
Joined
Nov 6, 2010
Messages
24
I just discovered something about CIVWIN that I did not know. I searched the forum and did not find any information about this "feature".

While developing the map/game editor for CIVWIN I came across a city that only had 1 mech infantry in it according to the list of units. But when I opened the game in CIVWIN there were 2 mech infantries in the city.

Also the military advisor said that I had 17 MI total. But when I counted I found that I had 23. I unfortified all the MI and sure enough the Military Advisor said that I had 23. And after saving the game my editor also showed all the mech infantry units.

I opened the game again and fortified all the mech infantry. After completing the turn and going to the next turn the Military advisor once again showed only 17 MI.

Investigating the game file I found that there are 2 bytes in the city information that allow for duplicate fortified units defending a city. Each city may have 3 identical units all fortified defending the city. Only 1 of the units will count towards the 128 unit limit.

If this is news I am glad to be able to share it with you. I am curious if this also works in CIV DOS. If it is not news, then I am happy to find it out for myself.
 
I have looked at some other games that I have saved. There are almost always a few human units that are saved in the city info, and not in the list of units. I have not found any case where a computer player has units saved this way.

There seems to be no rhyme or reason to it. They don't have to be duplicates of another unit in the city, nor do they have to be veterans. The bit that I thought they are fortified is actually the veteran flag.

I have created a game with more than 128 human units. In a few cities I placed two units fortified this way, without a "normal" unit. I cannot view the city unless I move a normal unit into the city.

This is a bizarre feature. Not sure how useful it is, or if it can be used without a game editor. I am curious if the DOS CIV works the same way.
 
Shot in the dark: some sort of RLE scheme for city fortified units?
 
Shot in the dark: some sort of RLE scheme for city fortified units?

Something like that. I am playing a game where I created a bunch of these units. The game is fickle. It won't leave them in this state. The units move in and out of this state on their own. Don't know what triggers it.

Right now I have 23 units in this state and have 143 units total.
 
I tried the fortify in town trick with my caravans in Civ DOS. I wasn't able to hide any of them from the military advisor. Looks like the 128-unit limit is strictly enforced in Civ DOS.
 
Dack is looking into whether this is possible in Civ DOS. It may only be possible using CIV$ if it is possible at all.

It appears to be very random as to whether the game (Civ Win) will do it automatically. It does it in some cities, but not in others. In some cities I can't even force it using my editor. I have not identified why some cities do this but not others. I watched it over several turns, and in some cities it takes units in and out of this mode from turn to turn.

Caravans are not the best test. At least in Civ Win, the table that keeps track of the number of active units for the military advisor is very unreliable with caravans. It almost always has a negative number for caravans.
 
Observation of similar occurrences in CIVDOS

The City Data Table in CIV/DOS is made up of 28 bytes. The last two bytes usually have a hex value of FF FF. MountainMn10 quest to make a map editor for CIV/WIN has led to a discovery that under certain circumstances units do not have an entry in the Unit Data Table in CIV/WIN. I was somewhat skeptical. He noticed that the last two bytes of the City Data Table were sometimes not FF FF. In searching through some old saved games I found a game that had five cities that had data other than FF FF in the last two bytes. The odd images are produced by CIV$
The first example Mpondo had 04 04

Looking at the city we see three fortified Musketeers nothing seems out of the ordinary.


Using CIV$ to look at the square (X=30, Y=42) to see what data units were there. Only one unit a Musketeer, number 37 is in the unit data table.



I went into the game un-fortified the left most Musketeers, and saved the game. Examined the square once again with CIV$. Now there are three units all Musketeers in the Unit Data Table in entries 37, 62, 84.



I would expect to see units in those entries in the previous saved game (before I un-fortified the left most Musketeers). On examination entry 62 and 84 are empty.
Before​



After​




In the saved game after the un-fortifying the eleventh byte contains the link list pointer is correctly in place linking these units together. The entries 37,62 and 84 contain active units on the square (X=30, Y=42) that contains the city Mpondo.

List of cities in the attached MAP & SVE files that have these unlisted units.
Code:
Bapedi      – 05 FF - 2 riflemen and a settler
Hlobane     – 04 FF – 2 musketeers
Mpondo      – 04 04 – 3 musketeers
Odessa      – 04 FF – 2 musketeers 
Vladivostok – 45 05 – 3 riflemen
The riflemen and musketeers in the list are all fortified. Only one appears in the Unit Data Table. Un-fortifying them will cause an entry in the Unit Data Table to contain data about the unit. All of this activity is internal and not readily apparent the human player.

The current published version CIV$ is in TerraForm -- a map editor for CIV dos post #251 (click here)
 

Attachments

  • CIVIL0.MAP
    14.6 KB · Views: 134
  • CIVIL0.SVE
    37 KB · Views: 62
Oh yeah, I meant to email you like two years ago.

On byte 7:

01 = disorder
04 = cancel WLTPD
40 = WLTPD active

Byte 11 is trade, right?

20-22 are specialist bits.
 
20 = #of specialists, 21-22 identify type of specialist, two bits per specialist
the bit patterns are 00=none, 01=Taxman, 10=Scientist, 11=Entertainer

Byte 11 doesn't match Trade, Shield Production or Wheat Production.
Example I have a city size 27. Shield Production = 28, Trade = 56 (not include trade routes), Wheat Production = 57. Byte 11 = 39
 
EDIT: Forget all that crap I put down. MountainMn10 was correct, and I even had it in my notes. I just took the long way around of saying the same thing. The only thing I hadn't figured out was that phantom taxmen add to the count.
 
Oh yeah, I meant to email you like two years ago.

On byte 7:

01 = disorder
04 = cancel WLTPD
40 = WLTPD active

Byte 11 is trade, right?

20-22 are specialist bits.

Byte 11 is the trade as last calculated. My calculation was incorrect. I was giving too much trade for the republic and railroads.
 
Did anyone ever figure out how to stop this?


Moderator Action: Post moved, I assume this question is for this thread
 
Is there any document with offsets in SVE files? I mean - what each byte means.

EDIT: found it, sorry.
 
I doubt this is related, but my Military Advisor says I only have two settlers, when I clearly have three.

P.S. - running unmodified 475.01 in DosBox
 

Attachments

  • CIVIL0.MAP
    14.3 KB · Views: 134
  • CIVIL0.SVE
    37 KB · Views: 41
Top Bottom