Project

General

Profile

Actions

Feature #553

closed

dai_manage_unit(): Use utype advisor cache instead of checking UTYF_WORKERS

Added by Marko Lindqvist 7 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
AI
Target version:
Start date:
05/04/2024
Due date:
% Done:

0%

Estimated time:

Description

Use utype->adv.worker instead of checking UTYF_WORKERS directly in dai_manage_unit(). It will do the right thing also in the future when workerness is not exactly same as UTYF_WORKERS flag.


Files

Actions #2

Updated by Marko Lindqvist 6 months ago

  • Status changed from In Review to Closed
Actions #3

Updated by David Fernandez 6 months ago

First, thank you for solving my registration issue.

I have been testing this patch and it seems to allow AI to handle properly infantry units with Settlers flag.

But I think AI builds those units (infantry with Settlers flag) thinking they are workers, and it hardly builds actual workers/engineers.

In my tests it can be fixed by editing units.ruleset, moving the entries of workers/engineers to the bottom of the file (below the infantry that can build bases). But I'm still not sure if the resultant AI behavior is exactly the same as when I simply patch freeciv to allow infantry to build bases without needing the Settlers flag.

Actions #4

Updated by David Fernandez 6 months ago

Btw, my tests were with the head of S3_1 that also includes the patch AI-Cache-worker-by-unit-s-possible-actions.patch

Actions

Also available in: Atom PDF