Applied Energistics 2

Applied Energistics 2

160M Downloads

Consistent network rebooting using a controller and infinite channels

bk5115545 opened this issue · 7 comments

commented

Describe the bug

I'm running with appliedenergistics2-forge-15.2.13 using the "channels": "infinite", config option. This issue does not happen when only using an energy acceptor instead of a controller.

When there is a controller on my network, the network reboots every time a cable is added or removed. When there is not a controller on the network, there is no reboot.

I want to use a controller because it decreases the passive AE drain.

This screenshot is a small network that exhibits this issue. My real network is much more complex and part of a modpack but I reproduced this issue running only AE2. Additionally, my network does not reboot when I make changes without a controller so I think I've isolated the issue to be related to the controller.

This network reboot issue is causing issues for my friends and I because it resets UIs and stops general auto-crafting until the network reboots. We can mostly work around it by setting pathfindingStepsPerTick to 128 however that causes some TPS lag in our world.

image

How to reproduce the bug

Create a network using infinite channels and add a controller. Add a cable. The network will reboot.

This issue is more obvious with larger networks. You can set pathfindingStepsPerTick to 1 to simulate a 4x larger network than you build.

Expected behavior

The network should not reboot as it doesn't need to without the controller.

Additional details

Optionally, a config option to disable the increased AE drain on controller-less networks would also allow us to work around this issue.

Which minecraft version are you using?

1.20.1

On which mod loaders does it happen?

Forge

Crash log

Does not crash

commented

The network always reboots when nodes are added/removed.

commented

Yeah I noticed that too.. That is just silly and very unfortunate

commented
commented

This code is pretty good...

I believe I've isolated the issue to an assumption in https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/main/src/main/java/appeng/me/service/PathingService.java#L117-L129 that assumes a controller means the network needs to be rebooted even when using infinite channels. A simple fix may be to add && this.channelMode != ChannelMode.INFINITE.

I need to investigate the differences between PathingCalculation vs calculateAdHocChannels to determine if there may be performance issues with leveraging calculateAdHocChannels for massive networks (like maybe PathingCalculation happens iteratively per pathfindingStepsPerTick and calculateAdHocChannels doesn't.