Ticket #42567

AI: support sea caravans

Open Date: 2021-06-25 07:13 Last Update: 2021-11-17 01:53

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
3

Details

AI tries to get boats for caravans that can propel themselves to other continents. It should not try to give boats to unts that can't be transported by anything.

Tested at an Aviation ruleset version for FC3.0. It was designed to improve support for Merchant Ships and they do move sanely now but for some reason reduced in number of production in the period when Zeppelin Liners are caravans for establishing routes, but they come back after Zeps get obsoleted, probably it's the ruleset's quirk.

Ticket History (3/11 Histories)

2021-06-25 07:13 Updated by: ihnatus
  • New Ticket "AI: support sea caravans" created
2021-09-07 11:28 Updated by: cazfi
Comment

- Style: Some empty lines missing

- Check the logic about not "requiring" a boat when "can't have one". In that case one should consider establishing trade route over sea impossible, not possible even without a boat.

2021-09-15 02:21 Updated by: ihnatus
Comment

Sorry, you mean blank lines out of the patch? I can't find ~:-() No jealousy if you delete what you don't like and commit yourself. Well, the logic seems to me as such: if we can't find a boat, the caravan just tries to go by itself where it can, if it is actually a plane or a ship, it can reach other continents, if it's a camel, it just walks to a neighboring oasis. It worked in my tests with ruleset mentioned, may I have missed some other case?

2021-09-27 09:54 Updated by: cazfi
Comment

Reply To ihnatus

No jealousy if you delete what you don't like and commit yourself.

Ok, I'll make a modified version of the patch as my own proposal.

2021-09-27 10:01 Updated by: cazfi
Comment

First needs to fix compile problem -> #42930 (I assume you have not compiled with --enable-debug as you've not encountered the error. Please test your future patches with that)

2021-09-27 10:48 Updated by: cazfi
Comment

Patch proposal for S3_0 attached. Porting it to S3_1/master with proper civ_map handling would take some effort.

- Changed logic so that if speculated caravan can neither reach the destination by itself nor can it have a ferry for itself, we don't build it at all. Equivalent change for attempts to move existing caravan. - Worked on style (e.g. *added* missing blank lines, more of them than strictly dictated by Coding Style guideline) - Set continent number variable's type to Continent_id

What do you think? So far I've only tested that this compiles....

2021-11-14 20:28 Updated by: cazfi
Comment

Reply To cazfi

Porting it to S3_1/master with proper civ_map handling would take some effort.

Checking it through, we can currently hardcode it to use wld.map. In the attached master/S3_1 version I've done that, and added a comment to uclass_need_trans_between() function header that it cannot be used for other maps. This is not ideal, but should do for now.

2021-11-17 01:53 Updated by: cazfi
  • Status Update from Open to Closed
  • Owner Update from (None) to cazfi
  • Resolution Update from Accepted to Fixed

Edit

Please login to add comment to this ticket » Login