Make duration of celebration effects consistent

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
GrafWasili
Posts: 5
Joined: Fri Oct 16, 2020 9:17 am

Make duration of celebration effects consistent

Post by GrafWasili »

I want to discuss this issue: https://www.hostedredmine.com/issues/893403

Celebration effects currently have a different duration based on which function they use to query this state.

The function base_city_celebrating() returns true if population requirements for celebration are met now and happiness requirements have been met
last turn. The function city_celebrating() additionally checks if the happiness requirements still hold now.

This leads to the situation that wherever base_city_celebrating() is used, celebration effects last one more turn if population requirements are still met. Most notably this is true for tile outputs calculated by the server via city_tile_cache_update(). Rapture growth and the Lua-API are notable examples of features that instead use city_celebrating() for checking celebration state.

The question remains which behavior should be the base line for a consistent implementation.

---

I think there are multiple perspectives that should be considered when deciding about this:

1. What was the intended behavior? (What would players of freeciv or other civ games expect?)
2. What is more logical from a simulation perspective?
3. What is most fun from a gameplay perspective?
4. What is easier to implement?
GrafWasili
Posts: 5
Joined: Fri Oct 16, 2020 9:17 am

Re: Make duration of celebration effects consistent

Post by GrafWasili »

My opinion concerning these points:

1. Based on the current code and lack of documentation I believe celebrations were never meant to last an additional turn and the server computing tile output in a different way could be considered a bug.

2. Having celebrations "fade out" similar to how they "fade in" as long as they are not disrupted by disorder (which currently overides any tile output anyway) coul be argued to make sense as a way to siumulate inertia of public opinion.

3. I'm happy with each solution.

4. I think making all celebration effects behave like tile output ("fade-out" of cleberations) should be easier than the outer way around, since touching city_tile_cache_update() will likely have other effects on the complicated end of turn processsing done by the server.

So I would lean towards the "fade out" solution. On the other hand that might not be what most people expect and it would also require updating documentation and client feedback to communicate this behavior.
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Make duration of celebration effects consistent

Post by Ignatus »

I would vote for using city_celebrating() in most cases. It should be more easy to end celebrations then to enter them. But yes, some more coding seems to be required, and a test for lurking traps will be necessary...
GrafWasili
Posts: 5
Joined: Fri Oct 16, 2020 9:17 am

Re: Make duration of celebration effects consistent

Post by GrafWasili »

I think implementing the behavior of using city_celebrating() in refresh_city()/city_tile_cache_update() doesn't make so much sense before the rework of update_city_activity() is finished (Feature #771900).

To offer a solution before, it might be possible to add a rule switch for this:
- add new rule switch for end of celebration with options: "default" (leave as is) and "additional turn"
- implement the easier additional turn behavior to offer a coherent solution without enforcing it
- later change "default" to "immediate" when an implementation of it is feasible

But I don't know if this is really worth it... If any ruleset would want to use this option anyway and how long it will take until Feature #771900 comes to a conclusion.
Post Reply