ID:997339
 
A question about creating instances, when copying and placing multiple turfs at the same time on a map can create a huge lagg spike depending on the map it's copying. Is there any way I can avoid this or is it something I'll have to deal with?
Why exactly do you need to copy huge chunks of turfs? It's poor game design. Now, just copying a small group of turfs shouldn't cause much lag. I've had experiance of the map editor 'skipping' when copy/pasting small groups of turfs but never anything to complain about.
I don't mean copy and pasting within the map editor, I'm talking about on runtime creating a replica of an existing map for instance based dungeons and such. Just wondering if there is a way to avoid the huge lag spikes..
In response to Tyrannicide
OH, sorry. No, I don't know any way to avoid that.
oh :/ I don't want to be really cheap and just limit the amount of instances that can be used at once with a set amount of instances just added to different z levels. I tried using sleep() to delay the creation of each turf, object and mob but it still has a lagg spike just at a shorter duration which obviously takes time to finish the map creation this way.
I suggest looking into Forum_Accounts map instancing library. I tried it out once, and its demo didn't lag at all.
This should probably be posted in "developer help," and you should also include your map-copying code so people can give your more direct advice.

However, one thing that might help is if you use spawn() to prevent the caller of your proc from being "locked up."

proc/MapCopy()

spawn()

do_stuff()
copy_turfs()
and_whatever()


This makes your proc return to the caller while the other stuff underneath the spawn() executes
Though fairly complex, you could also have all of the relevant mobs in the instance invisible, only visible to the players in that "run" of the instance. Only these players can interact with these mobs and vice-versa. Any time a new group of players enters, have it do the same thing with a new set of instance mobs. I'm not 100% sure what the possibility of this would be, but it would completely work past the whole "copy this giant chunk of map" problem.
While browsing libraries, I found one made by Forum_Account that actually could handle my idea quite well

http://www.byond.com/developer/Forum_account/ VisibilityGroups