by Lummox JR
Load, save, and reuse temporary maps for unlimited worlds [More]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://LummoxJR.SwapMaps##version=2

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:


Version 2
Date added: Oct 22 2002
Last updated: Jul 29 2009
41 fans
This library is now available for download through access to digitalBYOND.

Suggestions are especially appreciated.

Version 1.5:
  • Fixed a bug in SwapMaps_CreateFromTemplate()
  • Added SwapMaps_GetSize() to query a map file for size
  • Added chunk load/save capability


AlexandraErin: (Aug 13 2011, 6:33 pm)
I'm not looking for updates... if it still works, I don't think it needs more than that.
Geldonyetich: (Aug 12 2011, 2:32 pm)
Well... the code still works. Although I think Lummox JR has moved on to other things.
AlexandraErin: (Aug 12 2011, 1:34 pm)
Comments from a month ago? Awesome. I was just coming here to make sure this library was current/still functional. :)
Geldonyetich: (Jul 23 2011, 11:16 am)
One thing I've noticed is that it's faster to save or unload swapmaps if you delete the old swapmap file first:

if (fexists("map_[thisSwapmap.GetSwapmapID()].sav"))
fdel("map_[thisSwapmap.GetSwapmapID()].sav") // This is faster than having swapmaps do it.
In tests, it's about four or five times faster, depending on the map size.

I'm thinking the reason for this is probably because Swapmaps is performing some operation on the maps it unloads on if they already exist. If you watch the file while it does that, they deflate slowly before being rebuilt.

(Of course, even a cooler implementation than just flat out deleting the old swapmaps is to back them up first with fcopy() in case your game needs to revert to an earlier version to recover.)
Geldonyetich: (May 13 2011, 8:50 am)
Best library I know of for quickly and effectively managing dynamically generated maps.