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

Add some protection measures for a players alliances #2266

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

blabber
Copy link
Collaborator

@blabber blabber commented Apr 5, 2024

This is a follow-up PR for #2214 and #2239.

Closes #2177.

In games with complex alliance systems, declaring war can have unintended consequences. To protect the user from cancelling alliances by accident:

  • When declaring war would result in an alliance being cancelled, require the user to cancel the alliance first.
  • When declaring war would force one of your team mates to cancel an existing alliance, require this alliance to be cancelled first.
  • When a cease-fire running out would result in an alliance being cancelled, automatically lengthen the cease-fire until the alliance gets cancelled.

blabber added 2 commits April 5, 2024 23:44
In games with complex alliance systems, declaring war can have
unintended consequences. To protect the user from cancelling alliances
by accident:

* When declaring war would result in an alliance being cancelled,
  require the user to cancel the alliance first.
* When declaring war would force one of your team mates to cancel an
  existing alliance, require this alliance to be cancelled first.

AI is a special case:

* The behaviour of AI players wanting to declare war has not changed.
* If the player wanting to declare war has AI players in their team,
  they will break alliances as needed to make the war declaration
  possible. Reasoning: While you can speak with your human teammates,
  you can't coordinate war preparations on team level with them.

Cease-fires running out, might still break alliances.

While here: Fix a comment.
If a cease-fire runs out and this would break existing alliances, extend
the cease-fire without player intervention. The idea is, that the common
allies convince the parties of the cease-fire to extend the pact.

If one of the parties is an AI, the old behavior will be used unchanged.
AI doesn't know how to cancel alliances to enter war if desired, and
might get caught in an eternal cease-fire.

The number of turns the cease-fire will be extended is defined as
`TURNS_EXTEND_CEASEFIRE` in `server/diplhand.h` and is currently set to
`1`.
@blabber
Copy link
Collaborator Author

blabber commented Apr 5, 2024

On Discord at least one voice was cast against these changes: https://discord.com/channels/378908274113904641/857286127165112370/1225396755789512715

In the previous PR, there was still a discussion about whether casus belli still had to be handled in a special way. This discussion was still ongoing and started here: #2239 (comment)

@lmoureaux
Copy link
Contributor

I've likely missed the messages about this, sorry. What was the conclusion of the revert-or-fix discussion? This doesn't seem to be a revert, but a fix in a different way than #2239? Missing some context before reviewing

@jwrober
Copy link
Collaborator

jwrober commented Apr 8, 2024

As part of beta.1 blabber was kind enough to revert an earlier patch. He also closed the PR that was supposed to "fix" the patch. This PR includes the original + fixes.

I think we should look at setting up a game or something to test this out.

@lmoureaux
Copy link
Contributor

Might be good for some LTX game?

@jwrober
Copy link
Collaborator

jwrober commented Apr 8, 2024

I was leaning more towards something small to do a really good edge case test of varying scenarios. Something short and to the point. Kind of like an autogame, but with humans.

@lmoureaux
Copy link
Contributor

We could use Sketlux' Soviet Revolution scenario for that. It has many players that should naturally ally and many players that won't even meet.

@jwrober
Copy link
Collaborator

jwrober commented Jun 19, 2024

I've been playing with this on a local game off and on for the past few weeks. It seems to work as expected. Merging.

@jwrober jwrober merged commit 1fbd767 into longturn:master Jun 19, 2024
21 checks passed
@blabber blabber deleted the feature/protect_alliances_2 branch June 20, 2024 05:35
blabber added a commit to blabber/freeciv21 that referenced this pull request Oct 3, 2024
Documents the changed behavior in diplomatic relations introduced
by longturn#2266.
jwrober pushed a commit that referenced this pull request Oct 3, 2024
Documents the changed behavior in diplomatic relations introduced
by #2266.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn when declaring war would imply cancelling alliances
3 participants