I am developing an RPG for Windows Phone 8 using XNA. I have a map screen and a fight screen. I want to use XNA for both to utilize the graphics helpers and because XNA is awesome. My question is, how do I save the map state between the two screens? That is , how do I save the location of the PC and the enemies when I travel back and forth between the two screens?
If you're using some kind of State Management this will just happen automatically. You'd have two states or screens in the case of the Microsoft XNA sample.
We can call this your gameplay screen state which would compromise of a few things but for your case you could just have the map on this screen and other things like input for moving around the map and logic for updating entities on this map. You wouldn't include things that aren't related to your "overworld" or "map" display. Things like a mini-map may go here but the decision is yours on how you separate your logic. Ideally, a menu would be another state but that's another discussion. However, what you should take away from this is no combat takes place inside of this state.
Now, when you need to transit to a battle switch the ActiveScreen but don't dispose of the underlying screen. Your StateManager should have a mechanism for disabling sending input to screens that are not active and not drawing them (optional; maybe you can enable drawing if you need overlay screens). However, the point is your state is preserved.
See this stack:
Now, when the fight is over you would simply pop the FightScreen off the stack and your GameplayScreen would automatically resume!
If you have any other questions, comment and I advise you also check out the RPG Sample for more tips and a working sample that deploys this strategy.