city setup destroyed when growing

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

city setup destroyed when growing

Post by meynaf »

Hi,

Something annoys me in current Freeciv, that did not happen in old versions (e.g. 1.12.0), nor in original games (at least civ1).

Any time a city grows, workers are completely recomputed.
Usually this causes no trouble.
But under some situations it's a pain in the a$$.

Say, when it's of size 12 and we don't have Sanitation yet. Will squirm every turn.
Or when it's real big and gets +1 population due to celebrating. Next turn, all Elvis turned into research and city stops celebrating.
Or when production goes too high and the city starts to pollute.
Or in any case where default choices are inadequate.

I don't want to use the Governor, I want full control on what happens. I'm not a guy who hates micromanagement at all.

Is there an option somewhere that would make it behave more like ancient games ?
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: city setup destroyed when growing

Post by Corbeau »

I'm having the same problem. I'm trying to disband a city by using Migrants, but the moment city bilds one and shrinks, it automatically redistributes workers on tiles, produces extra food and grows IMMEDIATELY. (The ruleset has a smaller food storage)
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: city setup destroyed when growing

Post by meynaf »

For disbanding a city with migrants (in order to rebuild it at another, better place) i've found the solution : reduce drastically the amount of food it produces (go largely negative). Bothersome, but it works.

But it's not only this.

City has 8 population, waits for Aqueduct. Or 12, waits for Sewer System.
Population set as researchers to boost tech.
Now barbs come.
Suddenly, +10 food, no more research, city squirms it can't grow.
Barbs take their time, city setup destroyed every turn.

Every time barbs come, I lose my tech production, cities grow too much and end up wasting their resources with entertainers to keep them from revolting. They stop building anything because they look for food first (or, worse, resume polluting because when large enough they look for production !).

For very large cities (>40), it more or less always ends up with 25,000 iterations and ultimate failure of finding something valid (and me wondering why the game has suddenly become a cpu hog). Btw. In this case, Governor setup for max food fails miserably but doesn't say a thing about it.

Setting citizens as entertainers, taxmen or scientists is becoming completely useless. Wanna optimize a city ? Forget it. You can't. It won't last for more than a few turns.

This is becoming rank #1 annoyance in that game. Nerve-picking, to say the least.
No other Civilization game I know of, has this problem. Not even older Freeciv versions.
Please do not take that lightly, games have lost players for less than this.
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: city setup destroyed when growing

Post by GriffonSpade »

I would say the 'proper' functioning would be to:
Save the setup the last time the player altered it, including number of non-worker special population of each type.
When growing, save the unworked tile (or special population type) that would be best to the setup (Even if it's currently invalid).
When shrinking, reassign the remaining workers only on the saved setup worked tiles (or special population type).
When saved setup worked tiles become invalid, reassign invalid tile workers elsewhere (including as special population).
When saved setup worked tiles become valid again, reassign invalid tile workers that were elsewhere (including as special population) back on the saved setup worked tiles.

That sound about right?

The City: Famine Watch (The turn a city starts losing food rather than gaining, not every turn food is being lost?), City: Famine Feared, City: Civil Disorder, or City: Insufficient Unit Upkeep (for next turn), the player should get a message (I don't think the losing food and losing unit next turn with setup currently have messages). (There also needs to be a 'restore defaults' for messages? And probably some looking at which messages should be popups by default.)
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: city setup destroyed when growing

Post by meynaf »

That sounds good.

But, after second thought, it's not strictly necessary to save anything. It can be made simpler than that.

It would be sufficient that the worker on the occupied cell goes elsewhere.
The player could of course receive a message if this has nasty effects.

If the city grows, assign the new worker on the best available cell.
If the city shrinks, take the worker that has the less impact.

The big problem here isn't a minor change, it is : everything gets rebuilt any time something changes.
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: city setup destroyed when growing

Post by GriffonSpade »

meynaf wrote:That sounds good.

But, after second thought, it's not strictly necessary to save anything. It can be made simpler than that.

It would be sufficient that the worker on the occupied cell goes elsewhere.
The player could of course receive a message if this has nasty effects.

If the city grows, assign the new worker on the best available cell.
If the city shrinks, take the worker that has the less impact.

The big problem here isn't a minor change, it is : everything gets rebuilt any time something changes.
True. I think the only issue is that it might choose a random/predetermined worker to remove when shrinking, rather than the least desired. Hence the need to save.
Probably a way to have it determine which would be the 'least desired' as projected when removing with some work, though.
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: city setup destroyed when growing

Post by meynaf »

It could be like this :
- Do the total of the 3 productions. Select the smallest value.
- Then, other things being equal, choose trade rather than production, and production rather than food.
- If still equal, choose at the random.
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: city setup destroyed when growing

Post by GriffonSpade »

meynaf wrote:It could be like this :
- Do the total of the 3 productions. Select the smallest value.
- Then, other things being equal, choose trade rather than production, and production rather than food.
- If still equal, choose at the random.
That's the exact opposite order of priority I would choose on the three outputs. :P

But yeah, I suppose that /would/ be a fairly simple and effective process. Not perfect, but effective.

...And you should probably be checking your cities without governors when they shrink anyway. :P
User avatar
meynaf
Hardened
Posts: 155
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: city setup destroyed when growing

Post by meynaf »

GriffonSpade wrote: That's the exact opposite order of priority I would choose on the three outputs. :P
Then perhaps i didn't express myself clearly enough.
The point wasn't to keep these three in that order, but to remove them, i.e. remove tiles with most trade first, then ones with the most production, then food. But indeed, it could look not at what to remove, but what to keep : keep food first, then production, then trade.
So perhaps our order is in fact the same. ;)
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: city setup destroyed when growing

Post by GriffonSpade »

meynaf wrote:
GriffonSpade wrote: That's the exact opposite order of priority I would choose on the three outputs. :P
Then perhaps i didn't express myself clearly enough.
The point wasn't to keep these three in that order, but to remove them, i.e. remove tiles with most trade first, then ones with the most production, then food. But indeed, it could look not at what to remove, but what to keep : keep food first, then production, then trade.
So perhaps our order is in fact the same. ;)
Indeed. :ugeek:

How specifically would you handle barbs leaving?

It's notable that simply waiting for all tiles to be valid can be blocked for other reasons, like other cities working them.
Post Reply