awsumben13, on 01 February 2015 - 06:42 PM, said:
I've also done some testing and found that running commands causes a coroutine yield, so by running every command in an individual coroutine you can get some decent building speeds. Not sure if this puts a lot of strain on the server, but running ~100 at a time would be fine I'm sure.
Running setblock in async mode seems to run pretty much instantly, in server terms... so long as the target block is already the same as the requested block, and the default "replace" action is in use.
Spamming actual change requests that
have to be actioned, on the other hand, causes a bit of... stutter, shall we say. A hundred blocks at a time isn't anything to write home about, but I accidentally spammed about 200,000 changes to stone, and it took five or ten minutes before my game's framerate came back up from 2FPM and I could access the computer's interface again...
What surprised me is that the yield protection didn't kill it. In my prior tests I found that async
will trigger yield-related crashes if "miss-used", but in the above example it didn't. I guess the game's tick rate fell as well, and so as far as ComputerCraft was concerned nothing was wrong. The commands would've all been passed to the server side by then anyways...
Speaking of async commands, I did see execAsync when I first looked at the help!... Then promptly forgot about it, as I tried to work out how command blocks work. I've never played much with them, nor with server commands in general, really. Still trying to work out if there's a way to read signs or check chest contents. I get the impression there isn't.
Anyway! I've tightened up the scanning script a bit. Although reading in world data is still quite slow, it can now viably handle much larger structures:
pastebin get pXjdQDf6 worldporter
pastebin get cUYTGbpb package
package get PVu6C3qc
worldporter build BBCastle 54