BetterPortals

BetterPortals

1M Downloads

Freezing when entering Nether, but not Overworld

DarianLStephens opened this issue ยท 9 comments

commented

I don't know what info to give with this (World download, maybe?), since the title pretty much explains it.
No matter how many portals I have active, travelling to the Overworld from the Nether is smooth as ever, but even with one portal in the world, going to the Nether will freeze my game for upward of one second.

commented

I don't know what info to give with this (World download, maybe?), since the title pretty much explains it.

Everything which might help me to reproduce it on my machine.
Cause as is, if I hop into a newly generated MC world, build a portal and go through it, I'm having no performance issues at all.

If you know how to do it, you can also get a stacktrace from right when MC is frozen, that'll certainly help.

commented

Please make doubly sure you only have one portal in your world. Having another portal in the nether which links to a completely different part of the overworld would match everything you've described so far.
(Though I guess that could/should probably also be improved by artificially slowing down the transfer of the portal world from server to client (should reduce stuttering in SP and lag in MP).)

commented

It's possible that another portal exists in the area, but none that I know of. I recently created another portal in a remote part of the world where walking through either way is virtually instant.

Even if another portal exists in the Nether, it wouldn't explain why the same situation has no performance loss on travelling back to the Overworld, even in extreme cases where I have 5 portals linking to different parts of the same area (Everything within a 2-chunk area) in both Overworld and Nether.

commented

Yes it would. BP has quite a few optimizations, one of which is that portals which are near each other (64 blocks ignoring Y iirc) share their view of the remote world.
So having 10 pairs of portals near each other is only insignificantly more taxing than having just one (ignoring rendering ofc). On the contrary, having a portal which links to a more distant part of the overworld, will cause that part to be loaded when you enter the nether (causing lag/stuttering) and unloaded once you leave it (no noticeable impact on performance) because recursive portals aren't a thing yet.

commented

The only issue is that all 10 of these portals are extremely close to eachother; I was using them for fast travel between different parts of the base; one original Nether Portal below the floorboards, two vertical portals for shortening the fall to the bedrock mine, and two portals connected to a short corridor in the Nether, also between the main level and the bedrock-level mine. Everything is within a 2-chunk area, in both the Nether and Overworld.

commented

Yeah, that exactly matches what I've described.

So, to sum up, the issue to be fixed is that when a portal which links to an entirely different part of the world (i.e. the portal that you don't know of / the remote end to the one you recently created in a remote part of your world) comes into view distance (e.g. by entering the nether), it loads all its chunks at once which can cause short freezes in SP and/or lag in MP.
Proposed solution would be to just artificially slow down sending of chunks for portals.

commented

I'm pretty sure I've done that before, but I can't remember how, nor have I found much helpful information online.
If it helps, the piechart brought up with Shift+F3 says that root.scheduledExecutables. jumps up by about 5% every time before slowly going down, also only applying to Overworld-to-Nether travel.
The total time taken number rises if you repeatedly walk in and out of the Nether; I've managed to get it as high as 41% before I ended up on the opposite side of the portal somehow.

commented

Could you check whether 0.1.5 has made any significant difference?

commented

I did, and while the freeze may have been ever-so-slightly shorter, it didn't make a huge difference.
I appreciate you attempting to solve this, though.