There is a windows setting called Background apps that determines whether apps can continue to run and perform access when they aren’t currently focused on your computer. You will want to make sure this setting is enabled so your game does not close:
- Press the Windows key and type Background apps.
- At the top of the Background apps settings window, make sure the Let apps run in the background is turned On.
- Under Choose which apps can run in the background, make sure your Age of Empires: Definitive Edition setting is turned On.