As far as I know Antal1987 is the only one who actually hooked into the actual game exe with new code.
I think messing with the c3c AI would require two very difficult (or worse) things:
- Understand what the code does / how to change it
- Understand what "memory" for the AI there is in the save file
Or maybe those two things are hopelessly intertwined.
I used to assume the AI had no memory and just happens to appear cohesive because the game doesn't change a lot from turn to turn, but now I think it clearly can follow some sort of plan or direction for quite a few turns. And in fact when I realized the "they refuse to speak to your envoy" counter appears to be a countdown timer that triggers again after they make peace, I think this is actually a cool-down timer to prevent the AI from breaking or making peace over and over again.
But beyond that I have no clue where it's "this ship is headed for an attack on <civ>'s core" memory would be.
I know I looked for the AI attitude, but there doesn't seem to be a furious/annoyed/cautious/etc. value; it seems that there is a huge diplomacy table that counts past attitude-influencing actions, and the "furious/annoyed/cautious/etc." must be a value derived from those and not stored directly in the data.
So no telling where other AI strategic memory would be or what it would look like. Well, mostly; it's *probably* in the LEAD section.
But now that I think of it...clearly sometimes the AI intends to attack but hasn't declared yet. Sometimes an experienced player can spot this by suspicious troop movements and an unnaturally friendly attitude for the situation. (Polite Zulu or Mongols, anyone?) And I've definitely recently seen a civ target a particular city for a "sneak" attack with multiple unstacked units several turns in advance. So that means I should look for unit IDs, city IDs, and leader/civ IDs showing up in the LEAD section (or anywhere else an "AI memory" might be). *If* I were to try to figure that in particular out, which I'm not sure is something I'd actually do.
On the other hand, maybe I'm thinking too big. If we could just make the worker AI not stupid, that would have a huge impact on the game. I hadn't really given the worker AI much thought, but now that I am, it may have some form of memory, too. I don't recall all AI workers heading for the same tile, so they must remember their current target and avoid stacking if there is much to do, and that should be in the SAV somewhere, probably in a UNIT section? (rhetorical question)
Edit: I should add that—in my mind—the SAV file data is just a serialized dump of the in-memory data, so knowing where it is in the SAV kind of leads you to where it is in memory and vice-versa. I could be wrong. I don't think the in-memory is in the same serialized structure and offset, but some translation should be possible I think.