How to reduce pollution at all in Civ3 Conquests

When and where does the restrictiion appears?

I've got not mods with a lot of resources.
I'm dealing with default game: it has 26 resources (in Civ3Conquests)

There are several data structures in the game, where resources-relevant information stores.
Usually it's space corresponds to resource type count (which of course can be greater than 32)
In these cases memory blocks for it's data are allocated dynamically and there are no problems. You get items count, pointer to allocated memory and you can manipulate with the corresponding data.

But I've found at least one data field, which does't depend on resource type count;

In City class, there is a 4 bytes (32 bits) integer, used by City Form to draw available resources when the city has no connection to the capital.

In C3C this data field has offset 0x9C from City class object.
It can be found in 2 ways:
1) Each City class object has 4-char string "CITY" with offset 0x08 from object start. Therefore the value offset from "CITY" is 0x94;
2) City name string has offset 0x1E0 from object start. Therefore the value offset from city name is -0x144

Here is how that value works. The value is 32-bits integer with 1 bit for each resource type. If current city to display on City Form has no connection to the capital city, City Form starts checking the value for available resources. If a resource type has corresponding bit and it is strategic City Form renders it in the resource list or in the appropriate form (when strategic resource count > 8) like this:


I don't know what happens when the resource count becomes > 32 because I don't have appropriate mods to test it.

P.S. City Resources Dialog has only 24 places to render resource type icons.

Antal, the game has a bug with respect to strategic and luxury resources that when you exceed a combination of the two of 32, "phantom" resources that a city is not connected too begin to appear in the City Resource Dialog box. It would appear that the cause of this is the bold-faced comment on coding that I have quoted. Would it be possible to increase that 32-bits integer to a 64-bits or 128-bits integer without major problems?

Second, would it be possible to increase the number of resources that appear in the City Resource Dialog box? That may cause display problems however.
 
Civilizations' limit

Improvements' limit

Max Improvement count are also hardcoded...

Improvements array (offset 0x1C) represents improvements bits. There is 1 bit per improvement: 1 - Improvement was built, 2 - wasn't
it's size is 0x20 bytes. So, there are only 0x20 * 8 = 0x100 (256) available bits for storing improvements.

Now we know why the improvement limit is 256. I wish we could have more though. Good work Antal. :)
 
Would it be possible to increase that 32-bits integer to a 64-bits or 128-bits integer without major problems?

No, it wouldn't. Data variables have fixed offsets and sizes. And it's locations are fixed too.

Second, would it be possible to increase the number of resources that appear in the City Resource Dialog box? That may cause display problems however.

I don't know. Resource Dialog Box's "class" has very complex code.
 
The limit I always wondered about and assumed was hardcoded is the two tile minimum distance from an existing city to building a new one.
And that is possible (I hope it's not raping yet, but it's dirty :mischief: ):
<snipped pic>
:drool: Can ships traverse the narrow strait between two such cities? The tiles would be considered to be land tiles… but if one of them was (pre-)placed on a water tile, I wonder…

East and West Constantinople… I take it we still can't have a city expand over two tiles, but that'd be me getting greedy.
 
:drool: Can ships traverse the narrow strait between two such cities? The tiles would be considered to be land tiles… but if one of them was (pre-)placed on a water tile, I wonder…

I've never targeted that :)

East and West Constantinople… I take it we still can't have a city expand over two tiles, but that'd be me getting greedy.

I think it's possible to fix. That's because the constraints are related to max city neighbours tiles (20). And this constant dublicates in few diffent functions. So why not increase this value up to, let say, 44 (radis is 3)...
 
Would it be possible for two cities to be placed side by side in the Editor as well? I've successfully built a city next to another one in game, but in the Editor there's still the limitation as to where you can preplace cities.
 
Would it be possible for two cities to be placed side by side in the Editor as well? I've successfully built a city next to another one in game, but in the Editor there's still the limitation as to where you can preplace cities.

I haven't investigated the Editor, so I just don't know where the limitation code is located in its exe.
 
My first try... Ta-daam



*Jaw drops*

It's...beautiful...

I haven't investigated the Editor, so I just don't know where the limitation code is located in its exe.

That's fine, no rush. Everything you've done is already amazing. But if you ever do get the chance, it would certainly help the modding community, I'm sure.
 
I've found 9 entries of constant (21) (0x15) which is the constraint of city tile workers limit.
Fixing of them allows full control of extended city area, including auto workers placing when you click on the City Tile.
But the rendering still has constraints too. It's somewhere the city draws it's boundaries.

Resulting imags in City Form is a sum of 3 images:

1) Main Screen Canvas Image

+
2) Units Control Canvas Image

+
3) City Form Canvas Image


Each of them has its own renderer. And I'm gonna fix it too :)

Actually, the constant is used in different asm commands and it has different size. Minimum size is 1 byte in command:
PUSH 15 (opcode is 6A 2D). It is signed byte with maximum value = 127 :) Think about it...

P.S. Maximum radius of calculating neighbour tile coordinates is 9 (Max Tile Index = 80) - it's a full square in affine coordinate system.
 
Back
Top Bottom