var/list/MapConversions=params2list("\
#592c00=/obj/Block/Wood&\
#663300=/obj/Block/Dirt&\
#009900=/obj/Block/Grass&\
#909090=/obj/Block/Stone&\
#0066ff=/obj/water&\
")
When I save the objects that need more information, such as direction or icon_state, I just add an alpha value to the rgb and "decode" it when it loads. It ends up being very very fast, saving a 300x300 map (90,000 objects) in 1 second and loading that same size map in under 10. I am going to be using huge maps (3,000x3,000 or so) so I am going to need to be able to access all that information quickly.
Here's a little snippet of the map loader:
//"map" is a reference to the image file being loaded
for(var/X in 1 to map.Width())
for(var/Y in 1 to map.Height())
var/T=map.GetPixel(X,Y)
var/turf/TURF=locate(X,Y,1)
for(var/obj/OLD in TURF) if(OLD.x==X&&OLD.y==Y) del OLD
if(copytext(T,1,8) in MapConversions)
var/PATH=text2path(MapConversions[copytext(T,1,8)])
var/obj/O=new PATH(locate(X,Y,1))
SpecialLoadCase(O,copytext(T,8))
It basically just scans over each pixel of the map image, and loads the corresponding object to whatever that pixel is. Making the rgb-object association list is a bit of work, but I think its worth it to have a super fast proc.
Screenshot of the save/load time:
Any comments/thoughts/ideas?