Commoble / hyperbox

A minecraft forge mod that adds a box that's smaller on the outside than it is on the inside
MIT License
3 stars 2 forks source link

Performance issues with lots of hyperboxes #30

Open Mecr0mage opened 3 months ago

Mecr0mage commented 3 months ago

im currently playing on a public modded server and we have been having a decent amount of TPS lag issues for a while, and while i was going around checking observable and spark for problems as i have been from time to time for a while, i noticed while checking tick usage per dimension that the overworld was actually under the 50ms threshold for when tps starts to slow down so i started looking at the other dimensions and saw that along with some of the other dimension, there were 21 hyper box dimensions all ticking on average about 1.8ms to 2.0ms. which means that hyperboles are leaving the rest of the server only about 10ms of ticking time just by existing, and with just 5 more the dimensions alone would cause the tps to start going down from just hyperboxs.

i do have two ideas on how to help with this one that i feel would be easier but not help as much and a second that would prob take a lot more effort but largely improve this issue

one, the dimensions could be made to unload when they are "inactive" which would be when the chunks inside the hyperboxes are not loaded and there are no items/entities in them or some other conditions. this would not help when the people that use hyperboxes heavily are online in a sever as they would be active tho

second is that each hyperbox is not its whole own dimension, and instead, all exist in the same "hyperbox" dimension but are spread out by some X amount of block or chunks between each structure like how AE2 does with its spatial dimensions. this would almost completely remove the loaded dimension overhead but obviously would be a completely different implementation than how the mod is now.

Tux-Prowess commented 2 months ago

There's a feature in the hyperbox where it would loudly echo sounds to players inside the hyperbox from anything nearby the hyperbox block. This is the source of severe server lag because all hyperboxes constantly listen for sounds being played in the vicinity of the block.