Implement saving game data to file.