Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4491 closed defect (fixed)

[PATCH] Ex-allies capture points don't recede after declaring war

Reported by: elexis Owned by: mimo
Priority: Must Have Milestone: Alpha 22
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

If an ally has < 50% capture points on an owned, root-territory connected building and war is declared upon him, the capture points are not reduced, while they do recede if it's > 50%.

Reproduce:

  1. Have a gaia building in gaia territory
  2. player 1 and 2 are allies
  3. player 1 adds less than 50% capture points to the gaia building
  4. player 2 adds root territory to that building and consequently receives ownership while keeping capture points of player 1
  5. player 1 and 2 declare war on each other
  6. expected result: player 2 capture points recede, actual result: not

Replay the attached commands_working.txt with r19230 to see it live. Replay the attached commands_not_working.txt to see that the issue doesn't occur if its more than 50% capture points by player 1.

Bug noticed by Hannibal Barca. Similar bug to #4384. (IMO we shouldn't rip out capturing, even if it is and has been broken in various ways)

Attachments (3)

commands_working.txt (12.6 KB ) - added by elexis 7 years ago.
commands_not_working.txt (12.6 KB ) - added by elexis 7 years ago.
ticket4491.patch (522 bytes ) - added by mimo 7 years ago.

Download all attachments as: .zip

Change History (9)

by elexis, 7 years ago

Attachment: commands_working.txt added

by elexis, 7 years ago

Attachment: commands_not_working.txt added

by mimo, 7 years ago

Attachment: ticket4491.patch added

comment:1 by mimo, 7 years ago

I can't test right now, but i'm sure it's just a forgotten diplomacyChanged check and should be fixed by the patch attached.

comment:2 by elexis, 7 years ago

Keywords: patch rfc added
Milestone: BacklogAlpha 22
Summary: Ex-allies capture points don't recede after declaring war[PATCH] Ex-allies capture points don't recede after declaring war

comment:3 by mimo, 7 years ago

The patch indeed fixes the issue reported: both have now capture point recovery. But there is still a discontinuity in the rate of this recovery: when the enemy has more than 50% of the cp, it owns the structure which then undergo a rapid decay (TerritoryDecay.DecayRate=20) while if it had less than 50%, the structure is ours and we have only the slow regeneration (Capturable.RegenRate=0.5). Maybe that fact could be exploited? then it should have its own ticket. Can we have a fast review of such a simple patch here :-), or should i port it to phabricator?

comment:4 by elexis, 7 years ago

Keywords: rfc removed

It's intended that the one with the most capture points receives ownership of the building, so this isn't a bug right? (If it were I'd rather solve it in the same ticket rather than creating a new one) The enemy could then quickly garrison that building or train units there to garrison and keep it, but as that is intended and as the enemy has spent efforts to receive those capture points, it's not a classic exploit.

The changed code appears straight forward. Did test the patch with the attached replays and can confirm that it's working.

So I can only accept the patch, thank you for it and remind you to add the Fixes #4491, reviewed by elexis to the commit message :-)

comment:5 by mimo, 7 years ago

Owner: set to mimo
Resolution: fixed
Status: newclosed

In 19232:

Check the capturePoint state when diplomacyChanged, fixes #4491
Reviewed by elexis

comment:6 by mimo, 7 years ago

Thanks for the review

Note: See TracTickets for help on using tickets.