Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix retreat injured CA taking allied villages #6792

Merged
merged 3 commits into from Jun 24, 2022

Conversation

mattsc
Copy link
Member

@mattsc mattsc commented Jun 22, 2022

There is a comment in the retreat injured CA code that taking ally side villages should be disallowed, with potential exceptions, but apparently I forgot to do that after porting this CA to the default AI. For 1.16, it is too late to do anything other than disallowing this. That part should be done though, in order to make it consistent with previous behavior (and with player expectations). That's the first commit in this PR, which should be backported.

The other two commits, for master only, add a new AI aspect allow_ally_villages which, when set, let's injured units take ally villages, but they will do so with lower priority than using own or enemy villages. I decided against letting only "very injured" units do so in favor of a more clear-cut behavior, and also because there is already an aspect that affects how injured a unit has to be before it retreats. Adding yet another sliding-scale parameter on top of that would be too confusing, in my opinion.

@github-actions github-actions bot added AI Issues with the AI engine, including micro AIs. Schema WFL Issues involving the Wesnoth Formula Language engine and APIs. WML Tools Issues involving WML maintenance tools. labels Jun 22, 2022
@CelticMinstrel
Copy link
Member

The amount of stuff needed to add a single new aspect is kinda crazy though…

(I assume you've already done it before and know you haven't missed anything.)

@mattsc
Copy link
Member Author

mattsc commented Jun 22, 2022

The amount of stuff needed to add a single new aspect is kinda crazy though…

Agreed.

(I assume you've already done it before and know you haven't missed anything.)

I have. I followed what I did in fe316ae, except that I did not add the get_allow_ally_villages() Lua function since that syntax is deprecated.

@mattsc mattsc merged commit 6796ac3 into wesnoth:master Jun 24, 2022
@mattsc mattsc deleted the retreat_allied_villages branch June 24, 2022 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Issues with the AI engine, including micro AIs. Schema WFL Issues involving the Wesnoth Formula Language engine and APIs. WML Tools Issues involving WML maintenance tools.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants