Many millennia after Civilization conquers the entire Galaxy with the help of various machines, it is possible that machines will rebel against their creators. Or against all life. Or against ... all matter.
Nanomachines, called Replicators due to their ability to self-reproduce by the recombination of any matter, got out of control and tend to absorb more and more matter until all matter becomes a single Replicator.
The main body of Civilization was destroyed, but there were bases along the edges of the Galaxy that the Replicators had not yet reached.
You have to defend the bases from the attacks of the Replicators. A significant arsenal of guns and turrets will keep the defence. However, the enemy is not going to surrender without a fight ...