Flintlock
Emperor
- Joined
- Sep 25, 2004
- Messages
- 1,215
Interesting idea, but using city size for this wouldn't work since the size is lumped into a category and the categories are fixed to be one of 0, 1, 2, or 3, corresponding to town, city, metropolis, and town with walls. Editing instead the barb player's era index might work, but I think it would be easier to edit the city graphic sprite index directly. The exact formula for that index is:Another approach might be to add another City Size, not for the game, per se, but "simply" to the City Graphics Display, such that "Size -1" are Culture Group specific Barbarians, with (of course) a necessity, however implemented, that these Size -1 Cities be limited in how much they can grow. As you know, I'm decades removed from coding, but perhaps a Variable of "0", for City Size might be used to implement this.
5 * (EraID + 4 * SizeAndWallsCategory) + CultureGroupID
The index gets passed to a Sprite::draw_on_map method. I could intercept that method call and substitute in a pointer to a different Sprite. Barbarians have a CultureGroupID of -1 so the city drawing code will read at index -1 of the city graphics array for ancient era barb towns without walls. That must be why that angry leader pic appears.
It would be possible and in fact relatively easy. What's interesting, though, is that it looks like the game was intended to work this way and it only doesn't because of a bug. There is a game function that recomputes building maintenance from scratch and it *does* skip obsolete buildings, effectively making them maintenance-free. However, that function is not normally called. The way it normally works is each city stores a total maintenance cost that gets incremented or decremented whenever a building is added or removed. Maintenance is only recalculated from scratch when a building granting free improvements is gained or lost. Maintenance is not adjusted when techs are unlocked so the cost of obsolete buildings is never removed from the city's total. However, if you gain or lose a wonder that grants free improvements, all those maintenance costs should disappear.I don't know if this has been discussed previously, but one annoying aspect when playing with my mod, which I had forgotten during the years, is that the obsolete improvements will continue to cost maintenance after their obsolescence... Would it be possible to have a setting where upon an improvement going obsolete, it would also stop costing maintenance?
Anyway, it's straightforward to insert some code that updates the maintenance costs for a player's cities when they unlock a tech that potentially obsoletes some of their buildings. I would probably categorize that as a bug fix not a rule change.
I don't really know what to make of this. As far as I know, no C3X features should break when you exceed the city limit, and the only features that even could break the trade network would be the phantom resource bug patch or city-generated resources. It's possible this is an issue with the base no city limit patch, just one that occurs rarely for some reason (?). I've read conflicting reports of how well the NCL patch works and what problems it can cause. I've been thinking of adding NCL to C3X for some time, except if I'm going to do that, I'm going to do a proper job of it, not something that causes random bugs and crashes. Doing a proper job would require quite a bit of effort unfortunately.Not so long ago, in this branch, one of the users complained about the bug in the game associated with the collapse of the trade network. Ironically, I had an outwardly similar error. The reason why I've a bug with the collapse of the trade network is probably connected with the same damn limit of 512 cities.