patchFreeciv - Patches: patch #4405, Improve automatic city road/base...

 
 
Show feedback again

patch #4405: Improve automatic city road/base messages ("New hope sweeps like fire...")

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Sat 04 Jan 2014 11:31:01 AM UTC  
Votes:  10  
 
Category: generalPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.5.0,2.6.0

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 13 Apr 2014 09:30:28 PM UTC, SVN revision 24760:

Improved messages about new extra building technologies.
- If there's just one extra type automatically built to city centers, mention
that extra type in the message
- Omit "New hope sweeps..." -message if less than 75% of city centers get updated

Requested by Jacob Nevins

See patch #4405

(Browse SVN revision 24760)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 13 Apr 2014 09:30:22 PM UTC, SVN revision 24759:

Improved messages about new extra building technologies.
- If there's just one extra type automatically built to city centers, mention
that extra type in the message
- Omit "New hope sweeps..." -message if less than 75% of city centers get updated

Requested by Jacob Nevins

See patch #4405

(Browse SVN revision 24759)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Tue 18 Mar 2014 02:00:11 AM UTC, comment #10:

Untested patches.

- Give "new hope sweeping like a fire" messages only if at least 75% of the cities got upgradet
- Mention the extra type if there was just one (all cities got the same upgrade, and nothing more)

Maintaining these things in S2_5 takes far more effort than in TRUNK where both bases and roads are conveniently extras, and not always two separate concepts.

(file #20374, file #20375)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 28 Feb 2014 04:24:58 PM UTC, comment #9:

> So we agree this is not blocking S2_5 dfff in a couple of hours
> (01-Mar, timezone EET = UTC +2)

Agreed. --jtn

Anonymous
Fri 28 Feb 2014 04:07:24 PM UTC, comment #8:

> However, I think it probably is too late to do anything for 2.5
> (I have no candidate patch).


So we agree this is not blocking S2_5 dfff in a couple of hours (01-Mar, timezone EET = UTC +2)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 28 Feb 2014 10:40:47 AM UTC, comment #7:

Mm, it's true that this proposed bit of the script API sticks out like a sore thumb.

However, in general, I'd like to find a sustainable way for ruleset authors to override automatic help text where it isn't helpful or could use more description. I think this has to be in a bit of the ruleset that allows expressive specification of conditions. The two places we have like that are the effects system (which is better suited to specifying combinatorial conditions, rather than transitions like this) and Lua scripting. So this proposal was a concrete example of that sort of thought.

I'm still a bit sceptical that we can come up with automatic text that encompasses both "WOW all your cities have free railroads" from "The two of your thirty cities that happened to be on rivers got free bridges" (the latter doesn't really warrant talking excitedly about new hope sweeping like fire), without it ending up rather specific to our existing rulesets.

However, I think it probably is too late to do anything for 2.5 (I have no candidate patch).

Jacob Nevins <jtn>
Project Administrator
Sun 23 Feb 2014 10:36:46 PM UTC, comment #6:

> If we're to do anything about this for 2.5, it blocks the data
> file format, freeze, I think?


Frankly, the solution you have proposed seems very bad hack to me. I much prefer keeping it as it is in 2.5, at least what comes to datafile format. I think we can improve it for the most common cases (just one kind of roads added) quite easily without touching datafile formats, leaving current messages as fallback for more exotic rulesets where single tech discovery enables multiple AutoOnCityCenter extras. If that's not enough, we have to make format changes in a sustainable way (something that is consistent with our other developments) in future versions.

That's my opinion, don't take it as law. If you disagree, we've got votes 1-1, so other people should say their opinion too.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 23 Feb 2014 12:53:04 PM UTC, comment #5:

If we're to do anything about this for 2.5, it blocks the data file format, freeze, I think?

Jacob Nevins <jtn>
Project Administrator
Sun 05 Jan 2014 03:51:26 AM UTC, comment #4:

> I had not noticed that we'd got rid of free city bridges in the
> classic ruleset by not having AlwaysOnCityCenter, although now
> I see it was discussed extensively in patch #3522 and
> patch #3826. We should remember to put that in NEWS.


Story actually begins from patch #3007, later patches just ported that behavior to new formats (and stripped it from most ruleset when it became possible to control via ruleset)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sat 04 Jan 2014 08:10:13 PM UTC, comment #3:

> another plausible place we should be calling
> upgrade_all_city_extras() is on building wonders

Now covered by patch #4408.

Jacob Nevins <jtn>
Project Administrator
Sat 04 Jan 2014 01:29:58 PM UTC, comment #2:

> Don't know if it matters, but remember that it's not
> necessarily exactly "new tech made one new road generally
> possible".

Indeed, it's not necessarily a tech that triggers it any more (although I think that's all we'll handle at the moment?)
Would probably need to iterate over each road/base type and then cities inside that.

> Even classic ruleset has Bridge Building technology that
> doesn't allow new road types, but one to build existing roads
> on river tiles.

Playing on trunk, I had noticed getting one of these messages when I learned Bridge Building, and wondered why.
I had not noticed that we'd got rid of free city bridges in the classic ruleset by not having AlwaysOnCityCenter, although now I see it was discussed extensively in patch #3522 and patch #3826. We should remember to put that in NEWS.
In fact this is an example of where a ruleset custom message would be really useful -- I can't see it being practical to have the core game engine come up with a sensible description of this.

I'm now thinking a signal like:

bool city_infrastructure_upgraded(extra, reason, cause)

  • "extra" somehow describes which base/road has been enabled. Could be just a string, or we could add bases/roads/extras as first-class Lua types and pass one of those.
  • "reason" textually describes what triggered the upgrade:
    • Techs: similar set to tech_researched, but qualified by "tech_": "tech_researched", "tech_traded", "tech_stolen", "tech_hut" -- allows "discovery" to be distinguished
    • Others: another plausible place we should be calling upgrade_all_city_extras() is on building wonders, to enable a wonder/building tech. (Should this even be limited to the current player? -- this is a new ticket, anyway) We'd have "building_*" (or just "building") reason for that.
  • "cause" is the specific tech, building, etc that triggered the upgrade (this can be a first class Lua type).

So for the classic ruleset our signal handler would go something like:

  • Is reason "tech_*" with cause "Bridge Building": print a new message "Discovery of Bridge Building leads workers to build bridges in all your river cities".
  • Else, if reason is "tech_*", print the traditional "new hope" or "the people are pleased" message, either switching on tech/extra names or just using a default fallback in default.lua which mentions extra names.
  • Else: shouldn't happen (no wonders cause upgrades in default rulesets), so do nothing. (Maybe default.lua does have words for this, however.)
Jacob Nevins <jtn>
Project Administrator
Sat 04 Jan 2014 12:34:43 PM UTC, comment #1:

Don't know if it matters, but remember that it's not necessarily exactly "new tech made one new road generally possible". Even classic ruleset has Bridge Building technology that doesn't allow new road types, but one to build existing roads on river tiles. In theory one could even get Railroad first (by diplomacy or stealing) and then discovery of Bridge Building would give both roads and railroads on river city centers.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sat 04 Jan 2014 11:31:01 AM UTC, original submission:

We used to have:

"New hope sweeps like fire through the country as the discovery of railroad is announced.
"Workers spontaneously gather and upgrade all cities with railroads."

(from upgrade_city_rails())

But now we have gen_roads this message is forced to be the rather more clumsy:

"New hope sweeps like fire through the country as the discovery of new road building technology is announced.
"Workers spontaneously gather and upgrade all possible cities with better roads."

and similar for bases.

If we emitted a Lua signal in this circumstance (AlwaysOnCityCenter/AutoOnCityCenter), rulesets could override the message with a more appropriate one. We could keep the current messages as a fallback in default.lua. (Or possibly messages which mention the base/road name.)

(The existing "tech_researched" signal isn't far off being usable for this, but wouldn't be able to distinguish whether any cities were in fact upgraded.)

Jacob Nevins <jtn>
Project Administrator

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #20374:  FreeExtraMsg.patch added by cazfi (7kB - text/x-diff)
file #20375:  FreeExtraMsg-S2_5.patch added by cazfi (12kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gorb (Voted in favor of this item)
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by jtn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 10 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 19 Apr 2014 05:37:47 PM UTCjtnSummaryMove automatic road/base messages ("New hope sweeps like fire...") to Lua script?=>Improve automatic city road/base messages ("New hope sweeps like fire...")
    Sun 13 Apr 2014 09:30:40 PM UTCcazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Tue 18 Mar 2014 02:00:11 AM UTCcazfiAttached File-=>Added FreeExtraMsg.patch, #20374
      Attached File-=>Added FreeExtraMsg-S2_5.patch, #20375
      CategoryNone=>general
      StatusNone=>Ready For Test
    Fri 28 Feb 2014 11:29:08 AM UTCgorbCarbon-Copy-=>Added gorb
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup