quiqueck / BCLib

A library mod for BetterX team mods, developed for Fabric, MC 1.16.4+
https://modrinth.com/mod/bclib
Other
25 stars 24 forks source link

[Bug] Generation Datapacks With BCLib Cause Major Lag In Generation #81

Open PolyframeX opened 1 year ago

PolyframeX commented 1 year ago

What happened?

Basically, if you have BetterNether/BetterEnd Installed with another mod such as Geophilic or terralith, the game will have terrible performance with loading chunks. Both of these mods are datapacks, which means most likely it is a datapack issue.

BCLib

2.1.6

Fabric API

0.75.1

Fabric Loader

0.14.17

Minecraft

1.19.2

Relevant log output

I cannot provide logs at this time,

The logs do not display any useful information anyways, as this is all datapacks.

Other Mods

I've tested the issue with Terralith, Geophilic, and Spelunkery, all mods have been tested independently w/ optimizations mods and without optimizations mods. No change in output. and specifically tested in fabric.
PolyframeX commented 1 year ago

It may also be linked to the fact they both use vanilla generation code.

grundyboy34 commented 1 year ago

This is for sure still a very annoying problem. I did notice that it's basically not existent on the 1.19.3 versions, however that's not really practical yet with so many mods still only updated to 1.19.2.

grundyboy34 commented 1 year ago

Worth noting, this may not be entirely BCLib's fault. Although I couldn't get exact numbers, in just a world with terralith, fabric, and spark profiler, and testing in the same biome in 1.19.2 and 1.19.3, 1.19.2 couldn't generate terrain faster than I could sprint fly in creative, but 1.19.3 could (albeit, barely).

PolyframeX commented 1 year ago

This most likely is a BCLib issue though, maybe not entirety at fault but definitely one of the culprits of it. all of the mods have something in common: they use vanilla generation code to generate chunks. Most of the mods I listed suffer with lag when used with BCLib, this obviously means that BCLib somehow is affecting vanilla generation code, in one way or another, it should be to note these mods also use data packs for generation. So hence I made the issue.

I have also contacted the terralith developers and they stated that it is not an issue on there part, and if it is they cannot fix it without rewriting terralith entirely. Which obviously is not a option necessarily for them I can confirm that when removing BCLib with Terralith performance is significantly increased.

For reference I made a list of mods that gave the same output of lag.

Mods confirmed to be incompatible: Terralith, Causes Game To Almost Be Unplayable.

Additional Testing Required: Spelunkery, Heavily Shows Same Effects As Terralith. However Spelunkery Also Caused Numerous Issues Alone, So Take It Will A Grain Of Salt. Geophilic, Does Show Small Increase In Lag, Only Noticeable In Creative. Not A Serious Issue. Biome Makeover, Same Effects As Geophilic.

quiqueck commented 1 year ago

Hm, that is an odd one. BCLib does not change anything related to the overworld.

The only code that could potentially change data of the overworld is related to our surface-rule registry, and that will only do something when a datapack would register new rules with BCLib for the overworld (which BE/BN do not).

@grundyboy34 mentioned that it performs better on 1.19.3. That version configures Nether Features a bit differently. Namely it added some "in-biome"-checks. So maybe that is the source for the speed up. In order to test this, I have built a test-version of betternether for 1.19.2 that uses the same "in-biome"-checks. It would be great if you could test wether or not that will improve performance.

better-nether-7.1.4-inBiomeChecks.jar.zip

PolyframeX commented 1 year ago

I cannot test it on the specified version because it requires BCLib 2.1.7 which does not exist and any other version higher than that isn't 1.19.2, its 1.19.4.

jitterdev commented 1 year ago

i seem to be having this issue as well. i tested on bclib 2.1.7 on 1.19.2 but i still seem to be having some problems https://spark.lucko.me/YTXn0tMjlh