Leaving area of energy importer unselects variable card
MrSpencerRecor opened this issue ยท 24 comments
Issue type:
- ๐ Bug if I leave the area of an energy importer, it turns the importer red and unselects the variable card.
Short description: If i have a variable card in the "import energy slot" either blank or always set to true, it'll unselect if I go far away and no longer send energy from the energy battery.
1.set up a battery with importer and logic cable on the battery and power going to the battery.
2. tp far out/over 140 blocks away
3. come back to the spot of battery, notice the importer is red and not working/drawing out power. The varible card is no longer selected.
...#### Expected behaviour:
I figured that setting the variable card to true would fix the problem, but instead it didn't fix anything. Even a blank card didn't work.
Versions:
- This mod: IntegratedTunnels-1.12.2-1.6.2
- Minecraft: 1.12.2
- Forge: 14.23.5.2808
Log file:
I haven't seen this problem in a long time. This means that the part somehow got corrupted. I don't see anything indicating in your logs, so I don't have any clue at the moment what would be causing this.
Can you reproduce this problem consistently? If so, can I send you a dev build that outputs additional debug logs in a couple of days to help me debug the issue?
I haven't seen this problem in a long time. This means that the part somehow got corrupted. I don't see anything indicating in your logs, so I don't have any clue at the moment what would be causing this.
Can you reproduce this problem consistently? If so, can I send you a dev build that outputs additional debug logs in a couple of days to help me debug the issue?
Oddly enough; i've tried multiple times, and cant replicate it in any world. One of the weirdest bugs i've ever experienced. So i'm not sure if it's even fixable on your end. I can break all the blocks and replace and it still happens. I can spawn in the blocks needed and it still happens. But only in this world. It's strange.
Perhaps I should rephrase my question more clearly:
In your current test world, can you make the bug appear consistently when unloading/reloading the chunk? If so, can I send you a dev build that outputs additional debug logs in a couple of days to help me debug the issue?
Hey there, I would be interested to help tracking down this problem. Yesterday I encountered a similar behavior in my Enigmatica 2 Expert world when some of my networks got "corrupted". This happened a few times before, but I could never determine what actually caused it. Yesterday for the first time I actually saw the "Network corrupted" message, before that I can only remember seeing the red borders on the tunnels. Removing the variable card and re-inserting it sometimes fixed it, other times I had to remove all the components. Most of the networks were really small: simple transfer of energy, items and fluids over a few blocks inside a chunk.
Is there anything I can do that would help "after the fact"? I might still have a backup from yesterday when I encountered the corrupted network state. Or is it necessary to catch the corruption "in the act"? In that case I couldn't find any errors in the standard debug log, but I could use a debug version of the mod that might output additional information.
@tommyTT Thanks for being willing to help! :-)
I'll send you a debug version soon.
@MrSpencerRecor Bump. Would love to fix this issue.
Ok, the seems to be that somehow parts become corrupted.
In fact, I already built in a workaround for this, which is why you may be seeing things like this in your logs:
A corrupted part state was found at, repairing...
However, it looks like the repair job fails sometimes.
In order to figure out where these things are occurring, I've added a stack dump each time such a repair job is being performed.
@tommyTT @MrSpencerRecor Could you try out the latest dev build of Integrated Dynamics (See maven link in README) and share the full Forge logs with me once a corruption occurs?
Thanks in advance!
It is possible that you'll have to update to the latest dev builds of CyclopsCore, CommonCaps and IT as well
I'm able to reproduce this now with only the Integrated Dynamics and Tunnels mods as well as their dependencies installed. I updated my testing instance with the newest builds from the repo and I see the mentioned statements in the debug log:
The way I reproduce it:
- Start a new world and go outside the spawn chunks.
- I have used a setup like in the following picture.
- Now go away, so the chunk can unload (about 150 blocks should do it).
- Return (if you remember where your setup was :)) and the tunnels show the red outline.
Here is a video that shows this process.
Paste.eePaste.ee - View Paste xQ9Vs
@tommyTT It looks like you were too quick to download the dev build, it was still being built appartently, my bad.
Can you try again with build 1301? That one includes the stack traces.
The stacktraces were less useful than I hoped. I've prepared a new build that prints some more information. @tommyTT Could you share your log again with the following build? https://www.dropbox.com/s/9bvs64igk8a9d86/IntegratedDynamics-1.12.2-1.0.7-DEV.jar?dl=0
DropboxShared with Dropbox
@tommyTT Here is a new build that may fix the issue: https://www.dropbox.com/s/8mt2bk4eawt7k7s/IntegratedDynamics-1.12.2-1.0.7-DEV-.jar?dl=0
In case it does not fix the issue, I've included some more debug output to figure out the next step. In case the problem isn't solved for you, can you share your logs again?
(I'm off for today btw)
DropboxShared with Dropbox
Seems good so far. I will test a bit more and report back. Thanks for your efforts.
After more testing there is still an issue. The tunnels don't show the error state any more but they still stop working. Taking the variable card out and putting it back in helped "restarting" the network before, that no longer works. Instead I have to remove a part of the network and replace it - in my case a cable.
This is my testing setup now (again, way outside the spawn chunks):
https://imgur.com/a/Bm9sg1w
The left chest is filled with blocks, the right one is empty. The exporter has a blank variable card for "Export all", the stack size is reduced to 1 and the tick rate of the tunnel increased to 20 ticks.
Here is the correpsonding log. However I don't see any debug info from the mod.
Post with 1 views. Minecraft Screenshots
@tommyTT Is that testing setup in an environment with only ID+IT? If so, could you share that world with me?
Yes, here is a world that is prepared for you:
https://cp.sync.com/dl/706ba3490#ijfqnmgy-4kunnmnq-g5ndppmd-zk49zmp3
On spawn you should see a command block that teleports you a 1000 blocks away where the setup is located. The command block you find there teleports you another 1000 blocks away, where you find one more command block that teleports you back again.
Steps to reproduce it:
- Take the variable card out of the exporter. (You might need to break a cable also)
- Re-insert the card and the items should transfer.
- Use the command block to teleport or go out of distance of the setup, so the chunk unloads.
- Teleport back or move back and load the chunk again.
- The item transfer should have stopped.
Yesterday I tried a bit of debugging in a dev environment and it looks to me, that on chunk reload, the inventory of that tile does get restored, but the network is never rebuilt (org.cyclops.integrateddynamics.core.part.PartStateActiveVariableBase#onVariableContentsUpdated is never called). But not knowing the rest of the code and some weirdness with IntelliJ and Lombok didn't allow me to get further.
Best of luck!
Sync
Great, thanks a lot @tommyTT! That should definitely allow me to properly resolve the issue.
I won't be able to look into this before next week though.
A quick look at the recent changes, I found this commit that would explain the behaviour. Before the change, the variables were read from inventory, which is correctly deserialized. Now it only reads the variable cache but that is never re-initialized after reloading the chunk. Maybe this information is helpful.
Indeed, that's definitely related to the problem. In the dev build I have to you I added a variableContainer.refreshVariables
call before the variable cache loop in case it was empty. Unfortunately, it does not seem to resolve the problem completely, so there is something else (possibly related) going wrong somewhere.
@tommyTT For reference, I just pushed a commit that includes the (partial) fix that you have in your dev build. If you're feeling adventurous, feel free to experiment further with the code related to that. I'll try to get back to this next week.
The fix wasn't too complex after all. Thanks a lot for your help @tommyTT! This helped a lot :-)
Feel free to try out the latest ID dev build.