Project

General

Profile

Actions

Bug #2087

closed

obsolete buildings only sold off when new tech

Added by Dean Brown about 1 month ago. Updated 19 days ago.

Status:
Closed
Priority:
Normal
Category:
Server
Target version:
Start date:
07/26/2026
Due date:
% Done:

0%

Estimated time:

Description

reported by John Campbell on the forum -

https://forum.freeciv.org/f/viewtopic.php?t=95525

You can make buildings obsolete_by other buildings, but that's only checked and the obsolete building sold off when new tech discovered.


Files

2087.patch (1.38 KB) 2087.patch all branches Dean Brown, 07/27/2026 04:27 AM

Related issues 2 (2 open0 closed)

Blocks Tasks #1631: S3_3 datafileformat freeze (d3f)In ReviewMarko Lindqvist07/29/2025

Actions
Blocks Tasks #2116: S3_3-alpha3NewMarko Lindqvist08/04/2026

Actions
Actions #1

Updated by Dean Brown about 1 month ago

  • File 2087.patch added

Related issue - all req types are currently accepted by obsolete_by requirement vectors
without any checking, and could be nonsensical or could change back, e.g.
type Gov, if Democracy obsoletes a building and it doesn't get sold off before
the Gov changes again, the building becomes not obsolete. I think obsolete_by requirement vectors
should only allow one-way ratchet type req types. Needs a separate issue.

Actions #2

Updated by Marko Lindqvist about 1 month ago

  • Target version set to 3.3.0-d3f
Actions #3

Updated by Marko Lindqvist about 1 month ago

  • Blocks Tasks #1631: S3_3 datafileformat freeze (d3f) added
Actions #4

Updated by Dean Brown about 1 month ago

  • File deleted (2087.patch)
Actions #5

Updated by Dean Brown about 1 month ago

  • File 2087.patch added

Thought about it some more and changed my mind. In the real world "obsolete" is permanent, but in the freeciv world it isn't, a tech can get lost or a building sabotaged, and suddenly an improvement becomes non-obsolete again. So forget about one-way ratchet type req types. And yes some req types are nonsensical for obsolete_by, but there's also plenty of effect types for which some req types are nonsensical and we just silently ignore them. So forget about screening req types for obsolete_by. The nonsensical req types are also not likely to ever get used.

I think it's worthwhile generalizing handling of selling obsolete buildings, beyond just obsolete_by req types "Tech" & "Building". The others I think most likely to ever get used are "Achievement" & "Age". To handle "Age", remove_obsolete_buildings(pplayer) needs to be called every turn. Doing it that way covers all possible req types. That call has to be near the end of end_phase() after everything has happened that could affect obsolete_by reqs.

Actions #6

Updated by Dean Brown about 1 month ago

  • File deleted (2087.patch)
Actions #7

Updated by Dean Brown about 1 month ago

Actions #8

Updated by Marko Lindqvist about 1 month ago

  • Status changed from New to In Review
  • Assignee set to Marko Lindqvist
Actions #9

Updated by Marko Lindqvist about 1 month ago

Just a note (maybe for NEWS), I'm not against the patch:
This introduces a rule change that buildings now provide full benefit still at the turn they are sold (since selling now happens later).

Actions #10

Updated by Dean Brown about 1 month ago

Yes, and also the gold upkeep gets charged.

Thought it would be nice if the selling off could happen before paying for it, but completing a building happens much earlier in the new turn processing, before achievements are checked and turn counter incremented.

Actions #11

Updated by Marko Lindqvist about 1 month ago

Actions #12

Updated by Marko Lindqvist 19 days ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF