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.