Making an In-Game Level Editor: How to Save Maps?

Surely somebody out there? I’m completely stumped by this and am out of ideas…