Closed aaronhowser1 closed 11 months ago
Do you have the logs for your client from when this happened? And is this part of a modpack or just Prefab alone?
https://github.com/Brian-Wuest/MC-Prefab/assets/15698722/27d93fb2-70e9-4211-8641-9d17abb2b8bc
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.
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:
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.
So I can also confirm this as an issue on a not potato pc. https://www.youtube.com/watch?v=ENLaOKxcRO8
``` [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.
![image](https://github.com/Brian-Wuest/MC-Prefab/assets/2972930/940672ce-0c35-48ea-a453-ac0af1edd5b8)
![image](https://github.com/Brian-Wuest/MC-Prefab/assets/2972930/6daaed9f-7dab-4719-8d99-ab661ab23fd9)
![image](https://github.com/Brian-Wuest/MC-Prefab/assets/2972930/7acaff3a-fa1a-476a-855f-4a969a5c1d63)
![image](https://github.com/Brian-Wuest/MC-Prefab/assets/2972930/24f5b3e5-0a13-4f80-b056-72adb99cce31)
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
Botania's largest ghost block structure is like 9 blocks, right? Maybe it's just not great at doing so many blocks
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
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.
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!
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.
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.
So....I took a LOT of time over the weekend and got this in a MUCH better spot.
I was able to essentially double the FPS in my testing on a few of my machines.
I have my main development machine with a 12th GEN i7, 3070ti and the Estate went from ~15 FPS to ~32 FPS when it's rendering everything (aka floating in the air).
I also have what I call my potato machine. It's got an 8th GEN i5 with NO graphics card. The Estate went from ~7 FPS to ~15 FPS
15 FPS isn't great, but at least it's playable.
Examples, you can see the FPS numbers in the upper left-hand corner.
Does it render blocks that wouldn't be visible? Like, if a block in the structure has an opaque block on all 6 sides, does it still add a phantom block? Also, can you see them through real blocks? If not, maybe phantom blocks that would overlap real blocks should be skipped?
Blocks which overlap real blocks (including liquid blocks) are automatically skipped so that's not a problem and wasn't before. The problem was always with Mojang's rendering code. It was inefficient. I had to dig into their code, rip it out and handle a LOT of it myself 😞
This is the class which does all of the rendering and this method which starts the creation of the BakedQuads
. Because I am managing this rendering I am able to do some more efficiencies which Mojang cannot such as storing them in a HashMap so I don't have to re-create them on every render pass which was happening before. This re-creation was very expensive for something like the Estate when you render it in the Air as there are over 31,000 blocks in that prefab!
Those 3 methods, renderModel
, renderQuadList
, and putBulkData
were all taken from the base code and the massaged to be more efficient.
Minecraft Version
1.19.2
Forge Version
43.2.8
Mod Version
prefab-1.9.2.5
Details