A separate free tool that repairs corrupted diplomacy relations in Age of History II / Age of Civilizations II saves. If your diplomacy screen starts showing broken or nonsensical relation values, or the AI behaves as if relations are scrambled, this is usually the cause — and this tool fixes it.
Download and instructions on the project's GitHub page.
Age of History II stores how every civilization feels about every other civilization as a huge list of numbers. Under some conditions these values can become NaN ("not a number") — a corrupted state that isn't a valid relation value. Once that happens, the diplomacy system reads garbage: relations display incorrectly, and diplomatic behavior can break. Because the values are buried in a binary save file, there's no in-game way to fix them.
The tool scans the relation data in your save and resets any corrupted (NaN or infinite) values back to a valid number, leaving all the healthy relations untouched. It runs alongside the game and repairs saves so you can keep playing without the diplomacy system misbehaving.
The tool, instructions, and full source are on GitHub: github.com/Bat0oo/aoh2-diplomacy-fix. It's free and open source. If you hit a problem, open an issue there.