Litematica

Litematica

8M Downloads

Failed to Paste Schematic without feedback

vagga2U opened this issue ยท 11 comments

commented

Minecraft Version:
1.15.2/Fabric

Mod Version:
litematica-fabric-1.15.2-0.0.0-dev.20200412.213317
malilib-fabric-1.15.2-0.10.0-dev.20+arne.6

Description:
I attempted to paste in a very large schematic (672x252x688) and it failed (somewhat predictably). However, after initially executing the paste command and receiving the response 'scheduled task added...', nothing seems to happen. The game itself still runs fine, the only difference is that any part of the schematic that wasn't rendered when I pasted the schematic doesn't load. There are no error messages or issues, but after leaving it for an hour, nothing changed. Upon running the command 2 more times, the game finally became unresponsive but didn't crash.

Expected Behaviour:
I would have expected that if there was an issue an error would appear of some kind to work back from, or there would a limit on pasting, or there would a list of chunks waiting to be loaded in the same fashion as when I was initially copying it so that you can see that something is happening or not happening, rather than just being perplexed.

To reproduce:

  1. Save a large schematic. This one was about 40% air and 20% dirt, but otherwise was quite a complex mixture of different blocks,
  2. Load it somewhere, I did it in a separate world with only one layer rendering on as otherwise, I don't think my game would have run overly smoothly.
  3. Run the execute command. You will get the feedback 'scheduled task added...' and then seemingly nothing happens, although upon doing this again, the game seems to get slightly slower every few minutes, approaching the point of being unresponsive.

Screenshot:
I don't know how to get a screenshot into this report.

Hope this is an issue that is worth fixing or already fixed but I didn't see any other issues listed. In the meantime, is there some way to only paste one layer at a time or 10 chunks or something else to get it to load? I'd rather not have to save it as separate schematics, although there would be no issue saving it as separate blocks within the one schematic if that would help me?

Thanks,
vagga2U

commented

Looks like the 1.15.2 version still uses the "direct"/immediate pasting of the entire schematic. I believe the massive lag spike that this causes is mostly caused by the light updates, and the new threaded light engine from my understanding is overall actually a lot slower than the old system, it just tries to hide it by running the updates on a separate thread. So when you do a massive area of millions of blocks, it probably gets massively overburdened and just dies. But I need to actually profile it properly to see what happens. Could you send me the schematic so that I can test with that? If you don't want it publically available you can also DM it to me on Discord (https://discord.gg/scicraft).

In the main development version in 1.12.2 I have already a while back changed the pasting to always use a per-chunk pasting task, similarly to how the schematic is saved. Also the 1.12.2 version support pasting by the currently visible layers, I don't remember for sure but that might also work in the 1.15.2 version? But pasting massive schematics it would also probably be beneficial to just save it as multiple smaller sub-regions, and then you can enable them one by one when pasting.

commented

I left it for 2 hours more and it naturally crashed on its own due to lack of memory so that's probably my problem not an issue with the mod although I feel there should be some warning or way of reducing this?

commented

I don't know how to get a screenshot into this report.

Just drag and drop file into text field. Copy and pasting also works.

commented

Are you moving around into all the chunks that the schematic is in?

commented

it naturally crashed

Also drag and drop crash report file here.

And you really shouldn't just press another paste while it already being pasted. Just wait for one paste to finish.
It does all the pasting in single game tick, so until it finishes - no mobs will try to move and no part that has already been pasted - would actually draw on screen.
@maruohon maybe progress bar? While i don't do something dumb like spamming execute action key, not being able to see how much longer i'll need to wait is pretty uncomfortable for big schematics.

commented

Well, crash was certainly because of not enough memory. You can increase amount of memory minecraft get's in launcher options. Though this wouldn't help with pasting speed, it just wouldn't crash.

commented

Yeah, upon glancing at the log, the first thing I did was increase it to 5GB, still fell short though. But dividing it into 12 separate saves made it work, although as someone above suggested, it would be nice to have a progress indicator of some sort as it can take forever.

commented

I suggested, but @maruohon already said that in lower mc versions it's implemented to paste one chunk at a time.
And it's actually better then progress bar. At lease because progress bar is usually 1-dimmentional.

dividing it into 12 separate saves

You can also make sub-regions in single schematic. If your build isn't one big square - it can help you to not paste unnecessary filler areas.
Sub region creating is under M+S >> Configure (on current selection) and you'll see the button.

commented

I could also implement a progress bar, but it will be on a per-chunk basis, ie. how many chunks are left of the total number of touched chunks. Updating it more regularly would just slow down the pasting process itself.

But as to why the pasting is so damn slow on 1.14+... I'm not entirely sure, but I assume it's because of the light updates. Even moderately small schematics take a relatively long time to paste now, and they freeze the game while doing so (which isn't supposed to happen, as the pasting is supposed to just happen on the server thread...). The pasting is or at least feels like quite a bit faster in 1.12.

commented

You can also make sub-regions in single schematic. If your build isn't one big square - it can help you to not paste unnecessary filler areas.

Yes I am familiar with that. The original schematic was 1 big square and 2 smaller squares, but there were really only 25 unnecessary chunks saved in it, and it was about 50 blocks higher than necessary for the most part, but that still was well over what my computer could handle.