Jump to content

Custom Block with many shapes and collision-boxes causes game not to load


FlyingSpaten

Recommended Posts

Hello,

I developed a mod that adds some custom blocks to the game. Two of these blocks have > 200 lines of shapes as well as collision- and selectboxes. While developing the first block the loading time of a savegame drastically increased (like 5 minutes). With the second block a savegame can no longer be loaded. Server-log etc. didnt give any advice on the nature of the underying problem. I suspect that maybe the game cannot handle this kind of complex blocks?

I hope somebody has an idea.

Link to comment
Share on other sites

9 hours ago, FlyingSpaten said:

Hello,

I developed a mod that adds some custom blocks to the game. Two of these blocks have > 200 lines of shapes as well as collision- and selectboxes. While developing the first block the loading time of a savegame drastically increased (like 5 minutes). With the second block a savegame can no longer be loaded. Server-log etc. didnt give any advice on the nature of the underying problem. I suspect that maybe the game cannot handle this kind of complex blocks?

I hope somebody has an idea.

What does a block file look like?

Anyway, it is not recommended to make too many-variant blocks. Using block code (variantgroups prop) to store arrays of dynamic data is very bad practice. This leads to an avalanche-like growth of id, an increase loading a world and a constant consumption of memory for each combination. Use C# and BlockEntity for this.

Link to comment
Share on other sites

18 hours ago, DArkHekRoMaNT said:

What does a block file look like?

Anyway, it is not recommended to make too many-variant blocks. Using block code (variantgroups prop) to store arrays of dynamic data is very bad practice. This leads to an avalanche-like growth of id, an increase loading a world and a constant consumption of memory for each combination. Use C# and BlockEntity for this.

The block is a mining-support beam. I tried to replicate original support structures you can find in an old mine. The support-beams are connectable and can also support the walls next to them. They can also be placed horizontally and vertically... I guess you get the picture.

I already suspected someting like this but I at least wanted to try it without a BlockEntity because I'm new to C# (I have worked with Java for around 15 years now) and it seemed more complex at first. But then I will try to do it with a BlockEntity class.

Thanks for the clarification 🙂

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.