ReikaKalseki / Reika_Mods_Issues

The issue tracker for all of my mods - RotaryCraft, its addons, ChromatiCraft, and everything else.
46 stars 14 forks source link

Reactorcraft - Control Unit GUI not displaying control rods for individual control, but "all" controls work #1430

Open ranger135xp opened 7 years ago

ranger135xp commented 7 years ago

Hello again, Reika.

I found another issue, this time with Reactorcraft. I have a reactor with 44 control rods as the reactor is 4 blocks tall with 11 on each layer. That should require 45.056 kW of power (unless it falls to the 11 and treats the stacked ones as 1 control rod, please let me know). In a single player test world, the control unit displays the control rods properly and they can be controlled individually. On my server (2 players max), it does not display them properly, but I can retract/insert all perfectly fine. SCRAM also works as expected. I broke and replaced the control unit and it is placed parallel to the top-most layer of the reactor. Any guidance is appreciated. 2017-05-17_20 39 46 2017-05-17_20 39 57

ianleeder commented 7 years ago

I can confirm the same for me. Works in creative singleplayer, doesn't work in survival multiplayer. I'm trying to break into fission reactors at the moment and thought I was doing something wrong. Just testing with a single control rod.

Kobra331 commented 7 years ago

maybe this issue is related: The Reactor CPU Remote control doesn't works on multiplayer servers, sometimes my client crashes if i try to use them. In Singleplayer they works fine.

ReikaKalseki commented 7 years ago

Try in v19; I redesigned the CPU internals.

Killzone271 commented 6 years ago

Anyone still having this issue? It appears to still be having issues on multiplayer, as well as on dedicated servers. Not sure if its just a mod conflict perhaps or server side issues.

Kobra331 commented 6 years ago

I tested it. Same issue for me, but at least the remote control is working now without crashing my client. Extract/ insert all works only the single extraction of the rods are broken.

Killzone271 commented 6 years ago

yeah, its a bit hard to control it when you have a reactor the size of chernobyl's lol. I'm hoping it will soon be fixed as Reika's mods are among the best out there in terms of realism.

Kobra331 commented 6 years ago

I designed my reactors to work with all controll rods out. I want that they work completely automated. I have a 4 layered 48 core plutonium reactor, i dont know how big your reactor is but at least for me it works well. I hope the bug with inserted rods at server restart is fixed.

Killzone271 commented 6 years ago

yeah mine is an RBMK type layout, its about a 20 x 20 area but i managed to stabilize it by just flooding it with a lot of water, meanwhile only having a few control rods always inserted which keeps it somewhat stable, if i want to shut it down i have to remove all the fuel.

ranger135xp commented 6 years ago

@ReikaKalseki are you able to reproduce this on your server? Maybe it's related to FastCraft or COFH Tweaks? I'm just guessing since their changes tend to be the first to cause affects of only server-side issues. I still haven't tested this myself.

ReikaKalseki commented 6 years ago

Noone on my server bothered to build a fission reactor, and I am not able to test this at the moment.

ranger135xp commented 6 years ago

I still have the same result on v19b. Going to update to v19c. I also got a crash client-side while accidentally right-clicking the reactor CPU with a CPU remote in hand: https://pastebin.com/vgR7f3GP

Edit: same result on v19c.

Killzone271 commented 6 years ago

I've also had crashes doing that, although it doesn't happen very often. I also wonder about the control rods stacked if they're as one, or seperate as i build decently tall reactors.

ranger135xp commented 6 years ago

@Killzone271 My reactor is 4 blocks tall. They act as one.

Killzone271 commented 6 years ago

@ranger135xp Ah, thank you much for clarifying that for me. Ive caused so many issues trying to find out if it was or not. Now pretty much im just waiting on the central control fix and ill be good to go.

Thorinair commented 5 years ago

Will there ever be a fix for this one? I just encountered it on my own server as well.

ReikaKalseki commented 5 years ago

I still have no idea what is going on.

Thorinair commented 5 years ago

If it helps anything, I have encountered similar weirdness when coding my own mod, when it comes to differences between running a mod on a dedicated server as opposed to singleplayer. Oddly enough, the communication seems to work differently when on singleplayer even if it internally should run exactly the same (server-client architecture). For example, I have found that when running on a dedicated server, packets used for UI communication get limited to 16 bit integers, as opposed to 32 when on singleplayer.

I have no idea, you might already know this, im just throwing ideas of what it might be, based on my own experiences haha

ReikaKalseki commented 5 years ago

No, I had no idea that was the case, though I doubt it to be at fault here.

Thorinair commented 5 years ago

In case you need a place to test this kind of stuff on, I have a server where I am running my own modpack on (has most of your mods included), and I am in the process of building a fission reactor there. The machine is strong enough that I could clone the pack and have a separate server running just for testing purposes.

OvermindDL1 commented 5 years ago

MC's Single/Multiplayer distinction is... not well thought out...

In Singleplayer it creates both a server and client side, however they share a lot of backend data and they communicate by passing packet-like structures that don't actually get decoded/encoded.

In multiplayer the code is obviously distinct, which can create significant issues in mods that don't account for that, in addition the packets are actually encoded/decoded to/from the network bytestream.

If a mod isn't programmed with these issues in mind it can definitely create a variety of issue. No clue if that is the actual issue here though.

radwilly1 commented 5 years ago

Yeah, I am playing on a server in tech world 2. Making fission reactor and I have the control CPU powered adequately above the 1024 watts per rod and the control rods are not working. They are flashing green and red when i try to retract them @ReikaKalseki

ReikaKalseki commented 5 years ago

Does the same setup work in SSP?

Thorinair commented 5 years ago

In my case, all reactor setups work fine on singleplayer, but as soon as I move the design to a multiplayer server, the rods are no longer interactable (gray in the UI).

ReikaKalseki commented 5 years ago

That clearly indicates some sort of sync issue, yes.

habnabit commented 4 years ago

Yep, same issue here: on single-player but not multiplayer, rods are always gray and can't be individually controlled but the insert/retract all buttons will function correctly. Debugging this now.

habnabit commented 4 years ago

Similar to before, I can only offer a partial explanation—I can tell you what's happening, but not really suggest an alternative.

The GUI display, both in reading and attempting to write, consults the cache on the client side before sending a packet: https://github.com/ReikaKalseki/ReactorCraft/blob/899bf8ff8951fc556bcd0cecd9947cc4dde351bf/GUIs/GuiCPU.java#L102 https://github.com/ReikaKalseki/ReactorCraft/blob/899bf8ff8951fc556bcd0cecd9947cc4dde351bf/GUIs/GuiCPU.java#L125-L126 https://github.com/ReikaKalseki/ReactorCraft/blob/899bf8ff8951fc556bcd0cecd9947cc4dde351bf/Auxiliary/ReactorControlLayout.java#L104

But the insert/retract all buttons unconditionally sends a packet: https://github.com/ReikaKalseki/ReactorCraft/blob/899bf8ff8951fc556bcd0cecd9947cc4dde351bf/GUIs/GuiCPU.java#L68

I haven't tested it, but I suspect that if the client was forced to send the packet anyway, it would work. Clearly, the server is able to resolve these tile entities from the cache.

On the client side, I confirmed the locations of the tile entities are sent to the client in the NBT read by the ReactorControlLayout: https://github.com/ReikaKalseki/ReactorCraft/blob/899bf8ff8951fc556bcd0cecd9947cc4dde351bf/Auxiliary/ReactorControlLayout.java#L222

The tile cache consults the world for each location: https://github.com/ReikaKalseki/DragonAPI/blob/master/Instantiable/Data/Maps/TileEntityCache.java#L163 https://github.com/ReikaKalseki/DragonAPI/blob/master/Instantiable/Data/Immutable/WorldLocation.java#L122-L125

Since the WorldLocation constructor used doesn't set clientWorld, DimensionManager.getWorld is called: https://github.com/ReikaKalseki/DragonAPI/blob/master/Instantiable/Data/Immutable/WorldLocation.java#L193

Unfortunately, this is the point where my understanding ends. In my particular case (and in most cases, I'm sure), the dimension was 0, so the code calls DimensionManager.getWorld(0) and that returned null. I don't know why, or how you'd get the world object in this case. Every call to getWorld(0) I traced returns null. (It's clearly loaded in some sense, because it's being rendered and I can right-click the CPU.) But, if you follow execution back up the stack, a null world means the tile entity cache is populated with the correct keys and all null values.

Hopefully this debugging is enough to go off of, because as before I'm unable to build the project and thus can't really attempt to fix it and submit a PR.