arkhometha / Historical-Project-Mod

A mod for Victoria 2 - Heart of Darkness 3.04
157 stars 52 forks source link

[BUG] Unreliable neighbour coastal state CB rule #157

Open moretrim opened 4 years ago

moretrim commented 4 years ago

Many state-level CBs such as the bog standard acquire_state include the following rule when it comes to the allowed_states trigger:

https://github.com/arkhometha/Historical-Project-Mod/blob/09afcba51fb953097dbce5b5c424f87e32ac5cc0/HPM/common/cb_types.txt#L3925-L3937

I noticed in a playthrough that German Silesia was ineligible despite bordering a coastal state. After some research I suspect that the rule does not work, or at least it did not work in this case. My methodology was as follows:

As player country Wales, this produced the following tooltip:

tooltip

Results & explanations of the four condition blocks, from top to bottom:

The worst in all of this, though, is that using the shortcut solution in acquire_state does not help. No new state becomes eligible. I'm running out of ideas, perhaps somebody can shed some light on the matter.

Included is the save game in question. I did not check to what extent the situation applies to other states, countries, etc.

arkhometha commented 4 years ago

Hi @moretrim, thanks for the report. Well, for starters, I think I owe an explanation here. The rule is there to avoid some nonsense - namely, a landlocked player being able to take a coastal state far away from him and thus not be landlocked anymore. But to avoid the player only being able to take neighboring states, he can take one state over - 2 states deep inside a country. It's not perfect, but avoids some nonsense.

Second, I was unable to reproduce your problem. As you can see here

image

And here

image

It seems to be working properly. No changes from my end.

moretrim commented 4 years ago

Well, for starters, I think I owe an explanation here.

I find both the neighbour state and neighbouring-of-a-neighbour state rules very sensible myself.

Second, I was unable to reproduce your problem.

Were you testing on Development? In a9e8d42fb889bd520fb7904ea572149d3e486e41 you added the following:

https://github.com/arkhometha/Historical-Project-Mod/blob/da81b5f48631508fc2cd49331181f453bf4dabee/HPM/common/cb_types.txt#L3904

That makes any state valid during a war, but the issue should persist when fabricating. (edit: when starting in 1836 as France, a fabricated acquire_state won’t allow targeting Silesia.)

arkhometha commented 4 years ago

Yes, I was testing in development. I was making changes to avoid CBs being null for countries during crisis but I ended up making previous changes moot. I will have to find another solution, thanks for this. I will test it again.

moretrim commented 4 years ago

At the risk of being off-topic...

I was making changes to avoid CBs being null for countries during crisis but I ended up making previous changes moot.

I've witnessed the incredibly disappointing vanishing CBs during a crisis war, so I can understand.

Would allowed_states_in_crisis be of any help? Does it apply to more than one of the following:

arkhometha commented 4 years ago

It's not off-topic at all, @moretrim. There's quite a few of the CB bugs with the crisis system and I need to hunt them all down.

Anyway, I can confirm your bug. It's not working as intended. At all, for no states. I will try and figure it out but worst case scenario I might have to either remove it or live with it.

Would allowed_states_in_crisis be of any help?

Possibly, but the main problem is not having a save where this is consistently happening for me to test on. That and a list of CBs affected by this. I think adding allowed_states_in_crisis for a few cbs that are missing them, like the acquire_core_state can help.

moretrim commented 4 years ago

@arkhometha I still think that it deserves its own topic to keep things nice and tidy: #164