[freeciv-dev] Re: When city happiness state changes

  • From: Dean <ddeanbrown@xxxxxxxxxxx>
  • To: freeciv-dev@xxxxxxxxxxxxx
  • Date: Fri, 6 Nov 2020 19:41:13 -0500

I have posted to the forum - put it in the Development - Wishlist section because that's where graf wasili put his post. Deferring to Marko, I removed the line about "simplify the underlying code", and also added a line pointing out that this issue is closely related to graf wasili's post.


On 11/1/20 9:27 PM, Dean wrote:

Since I brought this up, I should volunteer to post something to the forum. Here's my first draft - please comment, criticize etc. In particular - is my example correct? Also - not sure where on the forum to post it, nothing seems obviously right and "General discussion" may be best option.


When city happiness state changes

Background - noticed this in the context of the bug in Issue #885093. Example of that bug - govt is Despotism, city happiness state is Peace, city is working a Buffalo tile, which normally gives 3 production, but is 2 under Despotism. In the city dialog, if you rearrange the worked tiles so that the city should celebrate, the city dialog will now say "celebrating" and the Buffalo tile will show 3 production. Both of those are WYSIWTF - in fact at the turn change you will get 2 production from the Buffalo, and then the city happiness state will change to "celebrating" and the city starts celebrating at the start of the next turn. This behaviour matches what is said on the "Turn" page on the wiki (https://freeciv.fandom.com/wiki/Turn). The bug fix would, with this example, have the city dialog show 2 production from the Buffalo and for the happiness state show "Celebrating (Next Turn)".

However, things are different when the state changes from/to "disorder" - that takes effect immediately. Using the same example, if anything causes the city to fall into disorder, then at the turn change you get no surplus food, no surplus production, 0 science and 0 gold, which is what the city dialog says.

I think it would be better to be consistent about when a city's happiness state changes, and have changes to/from "celebrating" and changes to/from "disorder" happen at the same time, either immediately or at the turn change. This should also simplify the underlying code. Thoughts? Opinions?


On 25.10.2020 00:41, Dean wrote:
Whether all changes of city happiness states should happen at the same
time is a different issue than Issue #885093. I think they should - it
would be more consistent and should make the code simpler. I think
this would be worth having a discussion on the forum.

I agree, it's a different issue.



Other related posts: