Check out "Game Programming Patterns" by Robert Nystrom and the GDC Vault for technical deep-dives. For HOMM specifically, the VCMI project (open-source HOMM3 engine) has source code that reveals implementation details like their A* pathfinding and combat AI systems.
Thanks. I recalled a series of books called "Game Programming Gems", guess those are good too.
BTW absolutely love VCMI although I never managed to run it without error :/