Domum Ornamentum

Domum Ornamentum

26M Downloads

massive memory usage from inefficient 3d models leading to lag and crashes

Himkey opened this issue ยท 15 comments

commented

the block models are really really inefficient, timber frames have so many sides that need to be rendered it's insane and unnecessary. my game literally crashes after only placing 600 cross frames, it ran out of the 8GB RAM i gave it on a superflat world. the save can't even be loaded anymore.

most other blocks are like that too, just not quite to the same degree.

commented

DOs block can have thousands of faces. It does not explain the behaviour you are seeing. They are all rendered in the static world geometry and not in the CPU memory.... So i don't know what you are on about.

In your test with the walls did you use the same wall block over and over again? Or did you randomly place a couple thousand of them?

commented

Just test this:
image

I am going to want to see your claims before we will continue on this discussion.

commented

Sorry wrong button.

commented

This is not memory related at all.......
This is vertex buffer related....

commented

here you can see the double-cross block rendering textures inside itself.
image

Yeah, you can not occlude rotated objects properly like that.

commented

i updated windows, all my drivers, i re-installed java and it still crashes and renders save files unusable when there are between 400~1000 models loaded in, both when i use /fill or when i place them manually.

here's my latest crash report,
crash-2022-01-01_12.38.11-client.txt
and the video of when it happened.
https://youtu.be/SgaLjP0Ba4s

here you can see the double-cross block rendering textures inside itself.
image

here you can see the lack of culling next to a solid, regular block.
image

and here you can see how the barrel is badly put together.
image

commented

This is not memory related at all....... This is vertex buffer related....

my bad, i assumed it would be a memory issue because that's usually what it is with 3d objects in my experience.

Yeah, you can not occlude rotated objects properly like that.

you can, however, make that part of the UV invisible, so it doesn't have to render it's own texture inside itself when there is no reason to.

these models can't cull blocks, but they can be culled by blocks. so when one is next to a solid block like oak planks, the face that is towards the oak planks doesn't render, but the side of the oak planks facing the model does. one-sided culling is a small thing, but it's real easy to do and there is no reason not to do it.

commented

you can, however, make that part of the UV invisible, so it doesn't have to render it's own texture inside itself when there is no reason to.

That is not possible, the vertices will still be rendered, and as such added to the buffer....

commented

That is not possible, the vertices will still be rendered, and as such added to the buffer....

that really doesn't matter, the models are still really inefficient. i remade and optimized some of them, and instead of being able to place ~700 double-cross blocks without crashing i can now place ~7000.
the line count in the current double-cross block's .json file is 2,168, and it has 232 vertices, while my identical looking version has 159 lines, and 120 vertices.
and it's not good habit to put textures where they can't be seen, even if minor, it strains the GPU for no reason and it can add up.

commented

It's open source for a reason, PR it =P

commented

That's weird, I'm 100% sure we got 1000s of frames in our colonies and it doesn't run out of 8gb RAM.

commented

@Himkey Where you able to reproduce this with just DO?

commented

yeah i just tested it, i was using 1.18 version before, but i also tested it on 1.17.1 and it's the same. the problem doesn't lie in my ram, my version of forge or what other mods i would be using, the models of this mod are just badly put together.

part of the reason is that the 3d model renders textures inside itself, where they can't be seen without going into spectator mode. there is also absolutely no culling on the blocks, so making a wall out of them doesn't just render 2 sides per block, it renders all 6, for the entire wall. even if they are next to a non-special block like oak planks.

every model is like this, they're put together in such strange and inefficient ways, like how a barrel has to render 252 faces instead of just 122. and those 122 faces are still less faces than what a single double-cross block has to render right now, which is 174.

in comparison, vanilla minecraft's most complex block, the dragon egg, has 36 faces. and you don't build out of that.

i'd argue to just remove (or at least reduce) the 3d models and replace them with models without depth.
so much depth and detail on a single block doesn't fit in with the rest of minecraft, even modded. but that part is just my opinion. although it would help if the double-cross block had 6 faces instead of the current minimum of 86 faces, or if the barrels only had 10 faces instead of 122.

TL;DR, there are currently roughly twice the number of faces per model than there needs to be. and even if you optimise the models, you'd still be stuck with regular building blocks that take double the computation of vanilla's most complex item.

even if you still stick with 3d models, please give us an option to use 2d blocks for MineColonies buildings, whether that be a new 2d variant of Domum Ornamentum blocks, or just vanilla blocks.

commented

Hi everybody,

I'm experiencing the same problem, with a very good configuration (and 16 GB of RAM dedicated to Minecraft). There are many buildings (about 20) from Minecolonies mod using Domum ornamentum blocks, and when I look in their direction, my FPS drop drastically. I just need to look at the ground, the sky or another direction where there aren't almost all of the buildings for my FPS to become very good.

Himkey, could you share your modified file with me, please ? So I can see if it fixes anything with my game ? (I'm on 1.18)

Thanks for the mod and the feedback !

commented

Improved.