bugFreeciv - Bugs: bug #21947, is_req_unchanging() vs...

Show feedback again

bug #21947: is_req_unchanging() vs worklist_change_build_target()

Submitted by:  Jacob Nevins <jtn>
Submitted on:  Mon Apr 21 12:00:26 2014  
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalStatus: Need Info
Assigned to: NoneOpen/Closed: Open
Release: Operating System: Any
Planned Release: Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Mon Apr 21 12:00:26 2014, original submission:

(Found while looking at patch #4400; another in the series of not putting off raising bugs until I know how to fix them)

worklist_change_build_target() has a bunch of tests resulting in messages like "[city] can't build [improvement] from the worklist; %s terrain is required. Postponing...", triggered if !can_city_build_now() but can_city_build_improvement_later() due to some unmet requirement.

I noticed that on S2_5, VUT_BASE doesn't have a message, triggering an error (unlike VUT_SPECIAL etc). However, it turns out that this can't be reached, because is_req_unchanging() returns TRUE for VUT_BASE.

Whether these messages can be reached is mediated by is_req_unchanging(). For a bunch of terrain-related requirements, this returns TRUE even though terrain is mutable, with the following excuse:

However, not all terrain-related requirements fall into this category. On S2_5, VUT_ROAD is !unchanging (whereas on trunk VUT_EXTRA is unchanging, so roads have changed category); and on trunk, VUT_ROADFLAG is !unchanging. Is there a reason for this? -- does the AI know how to meet these requirements, for instance?

Seems like some action should be taken to clear up this inconsistency, but I'm not sure what. One or more of the following, I think:

  • Perhaps the AI has learned to meet some of these requirements since the comment was written, and so some of these could become "changing" requirements? (I don't understand the AI well enough to check.)
  • If there's a real reason for the inconsistencies in the terrain-related requirements in is_req_unchanging(), comments should be added explaining this. (Is there some special case for bridges or something that the exceptions are there for?)
  • Failing that, the inconsistencies should be resolved in is_req_unchanging().
  • Once any of the above have been done, unreachable strings should be pruned from worklist_change_build_target(), to reduce translator load, and make jobs like bug #21420 easier.
  • Also: it's annoying if human players' actions are unnecessarily circumscribed by the AI's capabilities -- I'm not allowed to put a building with a terrain-related requirement on my worklist, even if I've carefully planned worker activities so that the special/base/whatever will be ready by the time the item comes off the worklist; I have to wait for the base/whatever to actually exist before I'm even allowed to talk about the building; this increases micromanagement. Could we split the version the AI uses out from is_req_unchanging()? (Or are the other unspecified "historical reasons" still valid?)
Jacob Nevins <jtn>
Project Administrator


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -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 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup