bugFreeciv - Bugs: bug #21898, City destruction and...

 
 
Show feedback again

bug #21898: City destruction and "AlwaysOnCityCenter" extras

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Mon 07 Apr 2014 08:23:31 PM UTC  
 
Category: generalSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Assigned to: Emmet Hikory <persia>Open/Closed: Closed
Release: Operating System: None
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)

Fri 23 May 2014 05:53:30 AM UTC, SVN revision 24936:

Remove unsuitable extras when city is removed

See bug #21898

(Browse SVN revision 24936)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Fri 23 May 2014 05:50:46 AM UTC, SVN revision 24935:

Remove unsuitable roads and bases on city removal

See bug #21898

(Browse SVN revision 24935)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Sat 17 May 2014 12:03:27 PM UTC, comment #7:

Indeed, the client is not updated if there are units with vision of the site after the city is gone: my testing involved using Diplomats to preserve vision, and building Settlers to destroy the city. Disconnecting the client and reconnecting updates apprpriately, but there should probably be some vision update happening in remove_city(). I looked about a bit, but couldn't figure out the right call, so am leaving this in an unfortunate state for now (not a regression from prior behaviour, but not ideal).

(file #20752)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Tue 13 May 2014 07:16:54 PM UTC, comment #6:

At least server side works here...

I'm not sure if client side would be updated if there would be unit with vision of the site after the city has gone. In my test I lost the vision completely with the city, and thus I "found out" about loss of road only when I took new unit to re-examine the area.

Marko Lindqvist <cazfi>
Project Administrator
Sun 11 May 2014 05:47:13 AM UTC, comment #5:

Unfortunately, the associated theoretical S2_5 patch didn't actually work in practice (at least for civ1 ruleset, adding a negated requirement for "Terrain", "Mountains", "Local" to Road), either in the editor or on disband from Settler building. Returning to the trunk patch again, with the same test condition (excepting replacing negated with present semantics, and moving the reqs from the road to the extra), it also fails the test.

Emmet Hikory <persia>
Project MemberIn charge of this item.
Sat 10 May 2014 12:37:45 AM UTC, comment #4:

> would the attached patch accomplish that


That's exactly the patch I were about to write. ;-)

S2_5 patch will need to handle both bases and roads (separately).

Marko Lindqvist <cazfi>
Project Administrator
Tue 08 Apr 2014 11:18:08 PM UTC, comment #3:

As an example, do you mean that if a ruleset prohibits Railroad on Mountains, Railroad is AlwaysOnCityCenter, and cities are allowed on Mountains, the Railroad is removed when the city is destroyed if the city is on Mountains, but not if it is on Plains (which otherwise permit Railroad in the ruleset)?

If so, I agree entirely. I'm still catching up on the extras code, but would the attached patch accomplish that, or should it also consider whether the extra was AutoOnCityCenter in the first place?

(file #20500)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Tue 08 Apr 2014 09:54:35 PM UTC, comment #2:

> build a road over a river before one has Bridge Building is a
> bit of a rules hack, and probably ought be disallowed.


In a way yes, but
- It has always been allowed (civ/2, freeciv < 2.5)
- Handling generic case of "player wouldn't be able to build this road now" would be very difficult, and what would be the "correct" rule?
- While the last owner of the city is not currently able to build bridges, (s)he may have been earlier (tech loss), or maybe some previous owner of the city (maybe the founder) was.
- Existing bridges on other tiles are not removed when tech loss occurs or terrain gets conquered by someone who does not know Bridge Building

So I would go by freeciv < 2.5 model that no player specific requirement would be considered, but only the tile's ability to have road/extra would affect if road/extra gets removed.

Marko Lindqvist <cazfi>
Project Administrator
Mon 07 Apr 2014 10:01:25 PM UTC, comment #1:

If anything is removed, only infrastructure that could not exist on that tile if it were not a city (so can't exist once the city is no longer active) should be removed. This matches ancient behaviour. In terms of narrative, it makes sense that the old roads in the city and the old train tracks are still there, and if they are used, are probably being maintained as well as any other roads/tracks/etc. On the other hand, playing with migration, and founding an unhappy city (to be migrated away) to build a road over a river before one has Bridge Building is a bit of a rules hack, and probably ought be disallowed.

Emmet Hikory <persia>
Project MemberIn charge of this item.
Mon 07 Apr 2014 08:23:31 PM UTC, original submission:

Before "AlwaysOnCityCenter" roads/bases/extras were added, patch #3154 removed at that point obsolete code to remove unsuitable roads from the city center tile when city got destroyed.
Do roads/bases/extras existing in tile only because it's city center get removed when city gets removed? Needs confirming.

Marko Lindqvist <cazfi>
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 #20752:  remove-unsuitable-roads-bases.patch added by persia (1kB - application/octet-stream)
file #20500:  remove-unsuitable-extras.patch added by persia (1000B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by persia (Posted a comment)
  • -unavailable- added by cazfi (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.

     

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

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 23 May 2014 05:55:19 AM UTCpersiaStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat 17 May 2014 12:03:27 PM UTCpersiaAttached File-=>Added remove-unsuitable-roads-bases.patch, #20752
      StatusIn Progress=>Ready For Test
    Sun 11 May 2014 05:47:13 AM UTCpersiaStatusNone=>In Progress
    Sat 10 May 2014 12:44:06 AM UTCpersiaAssigned toNone=>persia
    Sat 10 May 2014 12:37:45 AM UTCcazfiCategoryNone=>general
    Tue 08 Apr 2014 11:18:08 PM UTCpersiaAttached File-=>Added remove-unsuitable-extras.patch, #20500
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup