Ticket #57666

civ2civ3: Infantry cannot build fortresses as advertised

Open Date: 2024-04-16 02:44 Last Update: 2024-05-31 06:01

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

Details

Default civ2civ3 ruleset was supposed to allow infantry units to build forts/fortresses. It worked when I tested it on v3.0, but it is no longer working on v3.1 because the unitflag "Settlers" is now a hardcoded requirement of the action enabler to build bases.

I tried to fix it by giving this "Settlers" flag to infantry, instead of the current flag "Fortress", and to use another unit flag to forbid all other actions except build bases. In that case, it works for the human players, but it breaks those units for the AI, that will stop moving them. AI will still recruit infantry with "Settlers" flag, but will never move them in my tests with freeciv 3.1.0.

I'd suggest to either remove the hardcoded requirement of "Settlers" flag for the action "build base" (and maybe others too, if you want them to be used by modders in ways different to civ2). Or maybe to fix the AI so it does not use the presence of this "Settlers" flag to decide to handle the unit as a settler, but the unit role of the same name.

Ticket History (3/21 Histories)

2024-04-16 02:44 Updated by: bard
  • New Ticket "civ2civ3: Infantry cannot build fortresses as advertised" created
2024-04-16 03:00 Updated by: cazfi
Comment

This has been an mistake in converting worker enabler effects to action enablers. Unlike other extra building activities, base building has never been an activity that autosettlers do, and thus there has not been implicit requirement of "Settlers" flag. Yet the explicit requirement has now been added. I don't think AI builds bases either way (unless you give them also some tile production bonus)

2024-04-16 03:01 Updated by: cazfi
  • Component Update from Rulesets to General
2024-04-16 03:14 Updated by: bard
Comment

Btw, I have been testing for a month the modding capabilities of the new action enablers from 3.1.0 and this is one of the few bugs/issues I have found. They are really well implemented and use to work as expected.

All the problems I have found so far are related to AI being somehow unable to handle them, but that is understandable for such new feature.

2024-04-19 14:27 Updated by: cazfi
Comment

Ticket about changing ruleset format in S3_2: https://redmine.freeciv.org/issues/474

Keeping this ticket for fixes we can still do in S3_1.

2024-04-20 05:33 Updated by: bard
Comment

This is a key feature for my modpack that I plan to release soon, and I made a patch for 3.1 to be able to continue my testing game.

I see you already did it for 3.2, thank you. I upload mine here because it includes the related change to README.actions, in case it is useful.

But I don't understand why this fix can't be made for 3.1. As I see it, it doesn't change the ruleset format: any ruleset working before the patch will continue working after the patch exactly the same; it just fixes a feature that did work in 3.0 and stopped working with 3.1.

The default ruleset for 3.1 was supposed to include this feature (infantry that can build bases) and the info is already included in the readme and the helptexts. My custom _earth modpack includes this feature since 2.6 and it worked fine in 3.0. When I use the rule-up tool to upgrade the ruleset from 3.0 to 3.1 the infantry stops being able to build bases with no warning (that I know), and there is no mention about the issue in the tutorial how to update ruleset from 3.0 to 3.1.

This patch would fix all that without affecting other rulesets, why does it break this "keep ruleset format" rule?, I see it as a fix that just stops enforcing this unit flag.

(Edited, 2024-04-20 05:50 Updated by: bard)
2024-04-20 05:42 Updated by: bard
Comment

Btw, OSDN is continually failing for me (504 Gateway Time-out), and comment previews do not use to work, can I use redmine again to report bugs?

2024-04-29 08:26 Updated by: cazfi
Comment

Reply To bard

Btw, OSDN is continually failing for me (504 Gateway Time-out), and comment previews do not use to work, can I use redmine again to report bugs?

And it seems my earlier reply has not got through to osdn... Please don't use HRM, but you may use the in-progress self-hosted redmine at https://redmine.freeciv.org/projects/freeciv, which we are setting up just because of osdn issues. Neither osdn or the new redmine is perfect at the moment, so the policy is that either can be used for the time being - which ever works better for you.

2024-05-05 03:59 Updated by: cazfi
Comment

Step towards one possible solution (I'm just not sure if that route brings fruit soon enough, or do we need some other, temporary, solution): https://redmine.freeciv.org/issues/553

2024-05-05 08:33 Updated by: bard
Comment

Reply To cazfi

Step towards one possible solution (I'm just not sure if that route brings fruit soon enough, or do we need some other, temporary, solution): https://redmine.freeciv.org/issues/553

Thank you, I'll test the patch.

If I understood, it means that I can give the unit flag "Settlers" to infantry units and the AI will not handle them as Settlers, unless they have the "Settlers" role. If that is correct, and it works for 3.1.2, it is good enough to me.

About civ2civ3 default ruleset, the feature to allow infantry to build forts was not enabled in 3.0, so people is not going to miss it in 3.1. I think the simpler solution would be to fix it for 3.2, where it'd just require to add a new action enabler:

[actionenabler_fortress]
action        = "Build Base"
actor_reqs    =
    { "type",          "name",         "range"
      "UnitFlag",      "Fortress",     "Local"
    }
2024-05-09 09:00 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.1.2 (closed)
Comment

Reply To cazfi

Step towards one possible solution ... https://redmine.freeciv.org/issues/553

And then attached untested patch should help with the issue in S3_1 (while the patch should be good for S3_2, it's not really needed for this particular issue there any more)

2024-05-09 09:04 Updated by: cazfi
Comment

Well, I guess we still need another ticket to add "Settler" flag for "Fortress" units in S3_1.

2024-05-10 23:52 Updated by: cazfi
Comment

Reply To cazfi

Well, I guess we still need another ticket to add "Settler" flag for "Fortress" units in S3_1.

-> https://redmine.freeciv.org/issues/583

2024-05-12 19:20 Updated by: bard
Comment

I'm having troubles to register on redmine.freeciv.org, so I'll answer here:

If you simply add the "Settler" flag, those infantry units will be able to perform all kind of settlers action (irrigate, mine, etc). In order to allow them to build only forts/fortress, I had to use another unit flag, added as requirement for all infrastructures/extras (except forts/fortress).

I find it odd to require this change only for 3.1, and then to have to change it again for 3.2, where the issue will be fixed. That is why I suggested in my previous posts to either backport to 3.1 the patch that do not enforce the "Settler" flag, or to wait for 3.2 to allow infantry to build fortresses. It was disabled in 3.0 and people won't miss it in 3.1. (It is my _earth version of the ruleset where this feature has been working since 2.6 and I find important to keep it).

2024-05-12 19:21 Updated by: bard
Comment
(This comment has been deleted)
2024-05-22 22:44 Updated by: cazfi
Comment

Reply To bard

I'm having troubles to register on redmine.freeciv.org, so I'll answer here:

freeciv.org has problems in sending emails. I activated your pending account manually.

2024-05-24 03:08 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed
2024-05-31 06:01 Updated by: None
Comment

Reply To cazfi

freeciv.org has problems in sending emails. I activated your pending account manually.

Thank you. It is working now. I tested the patch and I commented it there.

Edit

Please login to add comment to this ticket » Login