I understand your concerns (note that I didn't delete the code for the 10-turn lag, I just commented it out). The tradeoff is that while preparation time is less certain, you're guaranteed to have an ally who goes to war with you, whereas with the old system, the AI would not prepare a sneak attack operation to invade their enemy, often leaving you alone. And if one of you, say, gets caught and the AI demands you move your troops or the other player declares war on you, your ally will go to war with you immediately rather than just leaving you to the wolves. It's essentially an "Offensive Pact", and with the changes I've made the AI should be utilizing it more effectively as well.
The intention is that you will still have the 10 turns of preparation, and I'm looking at modifying the code so that the AI will not declare war before the 10 turns are up. But if war happens before then, the exploits and issues associated with the asynchronous war state won't happen. I feel a firm commitment to declaring war, which could allow for alliances of > 2 people or coop war VS coop war situations (which to me sound interesting), is worth the tradeoff of removing the guaranteed 10-turn delay, and the risk makes it interesting because all of the choices are meaningful and you have to weigh them carefully.
Remember that not agreeing to declare war is a valid option, and while the AI will be upset, they won't be nearly as upset as if you back out of a war agreement. If it's really unpopular the change can be reverted (I kept the "coop war time" statement code), but it helps the AI a lot, eliminates exploits (like the war weariness issue) and I think it'll be appreciated. We'll see.
Edit: Keep in mind that all you're committing to doing is declaring war. If war happens before the 10 turns end, having a bunch of troops there isn't required. Although making an Offensive Pact against your neighbor carries obvious risk factors.![]()
Most of my issues are negated by the sentence I've bolded . Now the instigator loses his option to jump in early, but gains a guaranteed ally. And the second party will have time to get ready in most circumstances.
Even if you don't manage to hard-code a 10-turn wait for both parties, if that's the intent, the other benefits make the changes worth it, in my opinion.
Thanks for the very helpful, comprehensive response.