AnthonyBoscia
Emperor
- Joined
- Feb 7, 2010
- Messages
- 1,864
Good to know. It might be that the 32 MB limit only applies to the save decompressor. I'm not surprised that the game data is so highly compressible since it wastes so much space. For example every unit object contains 256 bytes set aside for a queued path of up to 256 tiles. Every one has 56 bytes set aside for a custom name, almost never used. The owning player ID is stored in a full 32 bit integer even though no more than 5 bits will ever be used due to the 32 player limit. Similarly, experience level and leader kind (scientific or military) are stored in 32-bit integers.Compressed manual saves are at about 1.60 MB right now but the uncompressed autosaves are at 34.3 MB (36,039,450 bytes). I haven't noticed any issues with them strangely enough.
Was worried about the units since they get enumerated and C3MT save editor cannot read any newer units past the 15bit, so I suspected the game would start either breaking right now, or after hitting 16bit (65536) value in total amount of units in the world. I find it more curious that "disband units if you can't maintain their upkeep" doesn't seem to be applying to the AIs but who knows what's up with that.
Either that or the botched no city limit patch (from https://forums.civfanatics.com/resources/no-more-city-limit-for-c3c-editor.13028/ ) has undocumented features addressing 32 MB limit.Good to know. It might be that the 32 MB limit only applies to the save decompressor. I'm not surprised that the game data is so highly compressible since it wastes so much space. For example every unit object contains 256 bytes set aside for a queued path of up to 256 tiles. Every one has 56 bytes set aside for a custom name, almost never used. The owning player ID is stored in a full 32 bit integer even though no more than 5 bits will ever be used due to the 32 player limit. Similarly, experience level and leader kind (scientific or military) are stored in 32-bit integers.
Any chance that the unit limits could also be conditional on the type of government?Unit limits means you can cap unit production at a certain number for each type.
Thanks for pointing out this bug.@Flintlock What is the current technical unit limit? I've been keeping tabs on amount of units in the world in my ongoing marathon monstrosity map game, via c3mt editor since it shows numbered list of them, and I've just found out few turns ago I got past the magic 15bit number of 32767, on turn 202. Should I be afraid of some kind of value size overflow or am I good to keep on playing? If I don't do anything the AIs will just keep producing units ad infinite and they don't seem very kin on starting wars against each other.
Once again ... this is gold.Good to know. It might be that the 32 MB limit only applies to the save decompressor. I'm not surprised that the game data is so highly compressible since it wastes so much space. For example every unit object contains 256 bytes set aside for a queued path of up to 256 tiles. Every one has 56 bytes set aside for a custom name, almost never used. The owning player ID is stored in a full 32 bit integer even though no more than 5 bits will ever be used due to the 32 player limit. Similarly, experience level and leader kind (scientific or military) are stored in 32-bit integers.
All the unit enumerations I've seen use 32-bit integers and unit IDs are always stored in 32-bit ints as well so I highly doubt there would be any problem there. Oddly, tile enumerations & tile counts use 16-bit integers for no clear reason. That's why the maximum map size is 362x362 => 65522 total tiles.
The game will only disband at most one unit per turn due to failure to pay maintenance. As long as the AI is producing at least one unit per turn it will continue to gain units even after it can't pay for them. There is a C3X option that addresses this, called aggressively_penalize_bankruptcy. If players can't pay maintenance, it will force sell unprofitable buildings, disband units, and switch cities to building wealth, as many as are necessary to clear the deficit. It might be too harsh on the AI in games like yours.
aggressively_penalize_bankruptcy wont work well for your monstrosity marathon map unfortunately, nor even regular one for that matter - because of 512 cities cap most AIs end up in ballpark of owning 8 to 14 cities, with only few very expansionist civs reaching about 20-26. If you fully limit the AIs to what they can monetarily support, they wont have larger forces than 50 to 100 units. Which is obviously no fun, too little to offer resistance against a player who through very rapid expansion and conquests rakes up a total sum of over 100 cities for himself.Once again ... this is gold.
Activating this functionality will probably eliminate this 32 MB save limit bug. I have to make some tests.
In a few weeks I will report back on this.
The past 2 months I beta test exactly this fact, civilizations go to war easier.aggressively_penalize_bankruptcy wont work well for your monstrosity marathon map unfortunately, nor even regular one for that matter - because of 512 cities cap most AIs end up in ballpark of owning 8 to 14 cities, with only few very expansionist civs reaching about 20-26. If you fully limit the AIs to what they can monetarily support, they wont have larger forces than 50 to 100 units. Which is obviously no fun, too little to offer resistance against a player who through very rapid expansion and conquests rakes up a total sum of over 100 cities for himself.
I would suggest rather finding a way to make AIs more likely to go to war against each other, especially in Marathon version, at turn 204 all the AIs are still in despotism and just keep on stacking spearmen, archers, swordmen, horsemen/chariots without ever putting them to any use. I suspect it might be partially because AI sees there is still free space around it to plant more cities (despite not trying to do so anymore - 512 limit reached) so it doesn't rank expansion through conquest very highly - that it would in case of having no more space left to plant cities and having only option to go to war against each other. Only time I've witnessed AI on AI combat was when French (18~20 cities empire) were taking over poor Dutch (4~5 cities), they wouldn't bother to attack even mildly more sized Spain or Celts. Other factor is not having techs for military alliances/gold for estabilishment of embassies so only I could open up diplomacy with AIs and convince them to do some wars via MA but knowing civ3 AI they will just most likely declare peace to each other after few turns or so.
The AI there doesn't care about combat to such degree that Babylonians consisting of 6 cities are living free from any war despite being squeezed between 20 cities strong Ottomans, 14 cities tall Sumeria and 16 cities of Persian empire. Way too peaceful for them given how much of an easy conquest they'd be, so imagine how passive towards each other larger/similarly sized empires are.
By the way, are you planning to update Marathon map past the 1.0 version? There are some rules bugs/oversights I could report on in the maps thread if you are looking for feedback.
I'm still planning to do a proper no city limit patch at some point. It's an interesting challenge, pretty difficult but it should be doable with enough effort and/or cleverness. But I'll need to address the 32 MB save limit first, otherwise there's not much point.I've ran the game originally without it, just with C3X, until I've reached 512 cities limit (decompressed file size at that time was around 20MB) - 31 AIs on 500x262 map sure do hit the limit cap in no time. Found out renaming modded no city limit executable to civ3conquests and applying your C3X patcher over it does in fact work, only to get disappointed later on that the limit modification is flawed and works reliably only up to 550 cities, with breaking completely at exactly 556th and 557th cities, but hey additional 38 cities are nothing to sniff at so I take those.
Thanks for posting this. I'll look into it soon, when I get a chance.Since another player report that problem, I will make a detailed post about this problem.
...
That would be possible, though it would be awkward. In particular, I'm thinking of how such a rule would be specified in the config file. The simplest way would be something like [Swordsman (Despotism): 5, Swordsman (Monarchy): 10] but then what should be limit be for players in neither of those governments? It could either be zero or unlimited and I'm not sure what's more convenient. This is another case where I wish I had Lua integrated into the program. That way the mod could call out to a Lua script to determine the limits so they could depend on anything you want, government, wonders, techs, traits, whatever.Any chance that the unit limits could also be conditional on the type of government?
They will. Under the hood, the game treats units loaded into armies similarly to units loaded into transports, so they're still in the game, on tiles, in the master list of units, etc., even though you can't select or unload them.I wonder how does this apply to units that have been attached to an army, I assume those will also count towards the limits?
You can do this through the editor, no?@Flintlock Is there a chance of an option to make settlers, empty armies, and great leaders airliftable in the next release?
I guess it could default to infinite, but there could also be a [Swordsman (DEFAULT GOVT): x] setting to override this, perhaps. Could also use -1 for instances where you may explicitly want no limit, e.g. [Swordsman (Feudalism): -1] would allow Feudalist governments to build an unlimited supply.That would be possible, though it would be awkward. In particular, I'm thinking of how such a rule would be specified in the config file. The simplest way would be something like [Swordsman (Despotism): 5, Swordsman (Monarchy): 10] but then what should be limit be for players in neither of those governments? It could either be zero or unlimited and I'm not sure what's more convenient.
This can easily be changed in the Editor.@Flintlock Is there a chance of an option to make settlers, empty armies, and great leaders airliftable in the next release?
I like that. It's what I recently thought about: to restrict units to specific government.That would be possible, though it would be awkward. In particular, I'm thinking of how such a rule would be specified in the config file. The simplest way would be something like [Swordsman (Despotism): 5, Swordsman (Monarchy): 10] but then what should be limit be for players in neither of those governments? It could either be zero or unlimited and I'm not sure what's more convenient. This is another case where I wish I had Lua integrated into the program. That way the mod could call out to a Lua script to determine the limits so they could depend on anything you want, government, wonders, techs, traits, whatever.
I think the default should be unlimited, but that's probably more for people who have hundreds to thousands of types of units in their mods to comment on.The simplest way would be something like [Swordsman (Despotism): 5, Swordsman (Monarchy): 10] but then what should be limit be for players in neither of those governments? It could either be zero or unlimited and I'm not sure what's more convenient.
I have an additional question. Is it possible to combine it with the minus sign?It's also possible to combine the flat and city-dependent limits with a plus sign like so:
unit_limits = ["Heavy Tank": 5 + 3 cities-per]
I guess it could default to infinite, but there could also be a [Swordsman (DEFAULT GOVT): x] setting to override this, perhaps. Could also use -1 for instances where you may explicitly want no limit, e.g. [Swordsman (Feudalism): -1] would allow Feudalist governments to build an unlimited supply.
I think defaulting to no limit makes the most sense since that's already how it works, as in a unit that's not listed at all has no limit. That way if you wanted to limit a unit to a particular government you'd have to set a limit of zero in every other government. That shouldn't be too bad unless you have a lot of governments and a lot of units you want to limit. There are other ways to accomplish this sort of thing. You could add a government-limited building that produces a special resource that's required to produce the unit types you want to limit to that gov't. That's already possible. The only downside is players would have to know to build the special building after switching gov'ts.I like that. It's what I recently thought about: to restrict units to specific government.
For example democratic government doesn't allow to build combat engineers, but authoritarian does. But quantity doesn't really mean a thing to me. So it may look like this:
["Combat Engineer" (Fascism): -1, "Combat Engineer" (Communism): -1]
Despotism and Feudalism (and maybe Monarchy) are too backward to build such complicated stuff, and Democratic and Republican politicians are just against building heavy weapons, however they won't mind if you created it before switching to more liberal government.
I don't think anyone's asked for that specifically. I looked into the logic for war weariness a while back when someone asked about a related bug. (Ultimately I wasn't able to get a clear picture of what the bug even was, never mind fix it.) It would be possible to modify the logic so war weariness is only added when units die not when they are damaged. It's awkward since the WW gets added before the outcome of the battle has been determined, but what I could do is subtract it back off afterward if the unit didn't die. It should also be possible to remove WW when players liberate their cities. I don't now what that would involve exactly, but it would require some care to make sure it's not exploitable.@Flintlock Has anyone asked yet about the possibility of mitigating the accumulation of War-Weariness points? With the AI's increased fielding of bombard-capable units under the patch, WWP can now mount up far quicker than in the stock game, due to the hardcoded +1 WWP for every attack on a friendly unit (of any kind, regardless of whether it results in a kill -- and even if the attacking unit dies), or tile-bombardment.
It would be preferable (IMHO, obviously!) if WWP would only accrue based on actual losses of tile-improvements, units and towns.
(And it might be even better if negative WWP -- so-called "War Happiness" -- could be credited to the victor in the event of (re)capturing towns currently held by the enemy)
You can't combine limits with a minus sign but negative numbers will work. In your examples, -5 + 3 cities-per and 5 + -3 cities-per would work and do what you expect. The reason a minus sign won't work to combine is that the mod sees the "+" sign as a bit of text that separates the limits, it doesn't treat the whole thing like one mathematical expression.I have an additional question. Is it possible to combine it with the minus sign?
- 5 + 3 cities-per (Meaning 18 cities would allow 1 unit of a given type, 21 cities would allow 2 units of a given type, etc.)
5 - 3 cities-per (Meaning that from 15 cities onwards, a given unit would no longer be allowed to be built. This would be very practical for limiting setler production in despotism, for example.)