Thread:FixSRwiki/@comment-46261745-20200903015444/@comment-26544499-20200909122828

I know nothing about the algorithm for how the AI deploys troops, but the algorithm for determining what moves it takes in the overworld drove me crazy. Somehani and I (mostly Somehani) made a good attempt at documenting it, but as you can probably tell by reading it, I rage quit when trying to double-check his work and cover the bits that he missed. I'm not looking forward to tidying it up, but it could be a good help for what you're planning. The main thing that needs patching out, particularly for higher difficulties, is that exploitable rule that stops everyone attacking if you lost twice during the end of a turn.