induktio / thinker

Improved game engine features for SMACX.
https://discord.gg/XdFuwWzzku
GNU General Public License v2.0
75 stars 11 forks source link

Zak makes peace, makes a treaty, and then redeclares vendetta in a single action. #51

Closed ByrelMitchell closed 1 year ago

ByrelMitchell commented 1 year ago

I don't know if this is a Thinker bug or a Vanilla bug, and I'm not sure how to distinguish. I have a reproducable save here: Marr of the Usurpers, 2217-pre-conquest.zip

1) Run the probe team from Mir Lab to New Progress, and buy the base. 2) Zak contacts and offers a blood truce. Accept 3) Zak offers a Treaty. Accept 4) The base window pops up 5) Zak declares Vendetta because of my 'meddling'

Edit: I have a theory. I think the colony pods pop out before I properly gain ownership of the base. Their adjacency to my units triggers a 'make peace' conversation. I make peace, and THEN I finish stealing his base.

induktio commented 1 year ago

Yeah that is also reproducible with vanilla game in the same way. I'm not sure yet how to fix the issue, but it's pretty clear what's going on there. When you capture a base, it triggers a hostile diplomatic act which would result in vendetta. Capturing a base can make the AI open diplomatic negotiations at the same time and a truce is possible here. Another possibility is that the adjacent colony pod triggers an "encounter" with your units and opens a separate diplomacy screen. For some reason, when the base screen opens on the same turn, it triggers another hostile act which seems to result in automatic vendetta.

induktio commented 1 year ago

The initial guess seems to be corrent, this issue is related to an event triggered in capture_base which spawns additional escaping colony pods when progenitor factions are involved. When spawned, these units trigger additional diplomacy encounters that occur out of order with the other logic handling the base capture.

It seems there's two options on how to deal with this issue. First one is spawn the colony pods further away, so they won't trigger diplomacy if they're not adjacent to player units. The second is disable this event altogether because it's not that important and in most cases the spawned colony pods would get killed pretty soon anyway if they don't have defenders. In any case the issue should be dealt with one of those patches.

induktio commented 1 year ago

This issue should now be fixed in latest build. I did some notable changes in base capture rules and they are listed in Details.md > Other patches included. Maybe the one thing I didn't mention separately is that if the base has at least 2 pop, it is still not destroyed by capture. Also if aliens/humans fight, larger bases will not instantly become 1 pop but they will still lose pop at an accelerated rate.