Originally Posted by
GregBrannon
What useless data?
Your Map file appears to be of a well-defined structure that could be read into a 2D array and manipulated as needed and then written to the file when necessary.
I've gotten the impression, perhaps incorrectly, that your design requires frequent reading/writing to the file while the game is being played, perhaps in response to each move by the user. If that's the case, don't do that. Read the game board from the file when the game begins, play the game on the game board stored in memory, then write the game board to the file when the game is over. There's no reason for frequent file reading and writing that I can think of. If you think differently, please explain why it's necessary.
In my case , I have coins that the user collects. I want to be able to, when the user collects a coin, it's place to be replaced by a grass sprite. This is represented by the char "g" in the map .txt file.