Prefab

Prefab

12M Downloads

[Bug]: Previews cause incredible lag when being looked at

aaronhowser1 opened this issue ยท 14 comments

commented

Minecraft Version

1.19.2

Forge Version

43.2.8

Mod Version

prefab-1.9.2.5

Details

commented

Do you have the logs for your client from when this happened? And is this part of a modpack or just Prefab alone?

commented
javaw_2023-06-18_16-21-07.mp4

There wasn't much in the log, and by nothing much I mean literally the only thing in the log is that I spawned them in.

Relevant log text

[18Jun2023 16:20:46.258] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: [1aaron5: Gave 1    [Windmill] to 1aaron5]
[18Jun2023 16:20:46.258] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] Gave 1    [Windmill] to 1aaron5
[18Jun2023 16:20:46.863] [Server thread/INFO] [net.minecraft.client.server.IntegratedServer/]: Saving and pausing game...
[18Jun2023 16:20:46.964] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/minecraft:overworld
[18Jun2023 16:20:46.995] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/minecraft:the_nether
[18Jun2023 16:20:47.001] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/ftbschools:school_night
[18Jun2023 16:20:47.006] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/compactmachines:compact_world
[18Jun2023 16:20:47.011] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/ftbschools:school_day
[18Jun2023 16:20:47.016] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/minecraft:the_end
[18Jun2023 16:20:47.022] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/ae2:spatial_storage
[18Jun2023 16:20:47.681] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] Right-click on any block in the world to remove the preview.
[18Jun2023 16:20:47.681] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] The yellow outline is the block you clicked on.
[18Jun2023 16:20:53.758] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: [1aaron5: Gave 1    [Advanced House] to 1aaron5]
[18Jun2023 16:20:53.758] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] Gave 1    [Advanced House] to 1aaron5
[18Jun2023 16:20:56.764] [Server thread/INFO] [net.minecraft.client.server.IntegratedServer/]: Saving and pausing game...
[18Jun2023 16:20:56.828] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/minecraft:overworld
[18Jun2023 16:20:56.854] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/minecraft:the_nether
[18Jun2023 16:20:56.857] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/ftbschools:school_night
[18Jun2023 16:20:56.860] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/compactmachines:compact_world
[18Jun2023 16:20:56.862] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/ftbschools:school_day
[18Jun2023 16:20:56.868] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/minecraft:the_end
[18Jun2023 16:20:56.870] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[Flat Dev]'/ae2:spatial_storage
[18Jun2023 16:20:59.185] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] Right-click on any block in the world to remove the preview.
[18Jun2023 16:20:59.185] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] The yellow outline is the block you clicked on.

commented

From the looks of that F3 screen, I highly suspect this is more of a hardware/client-side issue than anything to do with Prefab as a mod. That, or something with the large modpack:

  • According to that log, you're playing an FTB pack with only 4 GB allocated for memory. Those are really big packs. Even when you're not looking at the preview, you're hitting almost 90% utilization. 4 GB is the minimum, yeah, but good FPS happens at 6 GB+ allocations
  • Your GPU is also at a high utilization before getting the lagspike. It's at 85% when you're looking away, and hitting 95%+ when looking at it. Prefab is likely just pushing it over the limit.
  • You have the FPS set to 120 with vsyncfancy. The game is going to try and render each ghost block as pretty as possible with that.
  • You're using Oculus, which could also have an effect on how the ghost blocks are rendered.

With just Prefab installed, I've run Minecraft on a 2060 Super RTX graphics card with no problems. So there's not much I can suggest as a fix beyond turning down some of your settings.

commented

So I can also confirm this as an issue on a not potato pc. https://www.youtube.com/watch?v=ENLaOKxcRO8

My relevant log:

[18Jun2023 21:02:35.284] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: [Hadn69: Gave 1    [Advanced House] to Hadn69]
[18Jun2023 21:02:35.297] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] Gave 1    [Advanced House] to Hadn69
[18Jun2023 21:02:37.367] [Server thread/INFO] [net.minecraft.client.server.IntegratedServer/]: Saving and pausing game...
[18Jun2023 21:02:37.398] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld
[18Jun2023 21:02:37.407] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether
[18Jun2023 21:02:37.408] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/ftbschools:school_night
[18Jun2023 21:02:37.410] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/compactmachines:compact_world
[18Jun2023 21:02:37.410] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/ftbschools:school_day
[18Jun2023 21:02:37.411] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end
[18Jun2023 21:02:37.412] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/ae2:spatial_storage
[18Jun2023 21:02:38.762] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] Right-click on any block in the world to remove the preview.
[18Jun2023 21:02:38.762] [Render thread/INFO] [net.minecraft.client.gui.components.ChatComponent/]: [System] [CHAT] The yellow outline is the block you clicked on.
[18Jun2023 21:02:42.817] [Server thread/INFO] [net.minecraft.client.server.IntegratedServer/]: Saving and pausing game...
[18Jun2023 21:02:42.850] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld
[18Jun2023 21:02:42.857] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether
[18Jun2023 21:02:42.858] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/ftbschools:school_night
[18Jun2023 21:02:42.858] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/compactmachines:compact_world
[18Jun2023 21:02:42.859] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/ftbschools:school_day
[18Jun2023 21:02:42.859] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end
[18Jun2023 21:02:42.860] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'ServerLevel[New World]'/ae2:spatial_storage

Notably smaller structure previews do not have much if any affect on my frame rate.

Large Structure FPS

image

Slightly Smaller Structure FPS

image

Even Smaller Structure FPS

image

Tiny Structure FPS

image

commented

Is Botania's ghost blocks having the same problems?

The preview function was copied from that mod (with credit in both the CF description and the mod code). But if Botania is fine, there must have been some update to it that I'll need to go take a look at and bring over to Prefab

commented

Botania's largest ghost block structure is like 9 blocks, right? Maybe it's just not great at doing so many blocks

commented

Prefab's an older mod. I think Botania was the only one around at the time that had ghost blocks, but I could be wrong. It's entirely possible there were problems to begin with that were just not noticeable.
We'll likely be revamping Prefab's preview function in the future, it's on the rather long todo list
But development is kind of paused at the moment, so it's not likely going to be something that will be fixed any time soon

commented

This mod is no longer under active development and the crew which was going to work on was not able to due to real life responsibilities. Closing issue.

commented

Alrighty, so we are back and while we DO know this is an issue. There isn't much we can do about it at the moment. There is a LOT of rendering which occurs here and that is a particularly large building so there is a lot to show.

We have done the best we can to reduce how much we create as well as reduced the looping we have to do as a part of our processing but when you have to dynamically render that many blocks, it affects performance.

It's something we will continue to work through though!

commented

In the time since making this issue, I've run into a similar problem with one of my own projects lol. I was spawning a single Block Display Entity per block of a structure, which ended up being quite a lot of entities. Is that roughly what's happening here?

I fixed it by making a single entity that had the whole model, but that was a long and annoying process lol, so I don't necessarily recommend it.

commented

Yeah, that is pretty much what is happening with this except this isn't working with block entities but he actual graphics engine to render those blocks on every frame.

For things like the manor (or even worse the estate) that's tens of thousands of blocks.