Project

General

Profile

Actions

Bug #2496

open

ai: doesn't disband ferries causing unhappiness

Added by Sweet Tea Dorminy 11 days ago. Updated 11 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
11/22/2026
Due date:
% Done:

0%

Estimated time:

Description

resolve_city_emergency() disbands the units causing unhappiness when rearranging citizens does not help, but only those with passenger == 0 -- presumably meant to spare a loaded boat. But unfortunately this isn't the right way to check: dai_ferry_init_ferry() sets passenger to FERRY_AVAILABLE (1) on every boat, loaded or not, so no boat is ever disbanded. Thus the AIs attempt to switch to republic/democracy can topple into anarchy all the time - I had a game where the six AI nations averaged 2 overthrows per 3 turns each once they tried to be democracy...

This hurts classic: Republic or Democracy, trireme etc. -- or late-game carrier.

It actually also has implications for civ2civ3: the check is for anything treated as a ferry, which a civ2civ3 helicopter is. Inversely, a Submarine with missiles aboard is not currently considered a ferry, and could be disbanded.

We can't just check FERRY_AVAILABLE either -- a boat which has no passenger-in-control is still FERRY_AVAILABLE, even with many passengers, so we need to check occupancy.

For main and S3_3 the patch factors out dai_ferry_in_use() for it; for S3_2 it is the minimal change in daicity.c.


Files

Actions #1

Updated by Sweet Tea Dorminy 11 days ago

(I don't know if this is a bug worth fixing on 3.2, or instead a improvement not suitable for a stable release,, but I figured the cost of providing a patch is low, I don't mind either way.)

Actions

Also available in: Atom PDF