Hmm I have an S5 myself. Sounds like you're having connection issues. When you see this happening do you notice your phone switching between 3G / 4G? The only time I notice this happening is when the network changes and it takes the phone a bit to figure out what's going on. Make sure Wifi/Bluetooth off too.
Also make sure you turn as much bloatware off as you can - older phones like this with only 2 GB RAM start showing their age with this game. You'll need every bit of juice you can get.
Very strange it happened AFTER the factory reset, though. Normally a factory reset would be an answer to the problem, not the cause.