micdoodle8 / Galacticraft

An advanced Space Dimension Mod for Minecraft
Other
617 stars 334 forks source link

[SpongeForge][1.12.2] [+Extra Planets] Nether being confused for space? #3206

Closed colinrgodsey closed 5 years ago

colinrgodsey commented 6 years ago

Minecraft version: 1.12.2 Galacticraft version: 4.0.1.139

Single player (SSP), Multiplayer (SMP), or SSP opened to LAN (LAN)? Multiplayer

Galacticraft add-ons and other mods installed? ExtraPlanets spongeforge-1.12.2-2611-7.1.0-BETA-2931 (tested a few different version) Void Island Control (I suspect this has something to do with it) Mods from Modern Skyblock 3 pack

Really really weird issue here that took me forever to track down. Basically, users were starting to take periodic damage in the nether, started happening out of nowhere. If they die, it said they suffocated. If you wear a space suite, you take no damage. So, seemed like it was confusing the nether for space. It also seemed to be causing issues going back through the nether portal, so you could not get back to the overworld portal.

I tried every combination of removing mods and whatnot on a new world and couldnt reproduce it, so the issue seemed to be somewhere in the saved game state. If i started a new 'world', the issue would not be there. Eventually I tried to just delete the space stations from the old world- this made the issue stop. The timing makes sense, the issue started after our first person got to space.

Issue is not present if SpongeForge is disabled. Even with sponge enabled, issue doesn't come up until somebody first gets to a space station. The space stations work fine from what we've seen.

No other dimensions have this issue, so i suspect its an interaction between galacticraft, void island control, and sponge. VIC does do something weird to move the nether to a new dimension, so it might be confusing sponge or something.

Files deleted: galacticraft/spacestation.dat_ _DIM_SPACESTATION_

radfast commented 6 years ago

Thanks for reporting.

As a temporary solution, there is a Galacticraft Core config setting you can use on the server, to disable Space Station creation.

Alternatively if you are deleting space station dimensions "manually", you should read this guidance: https://wiki.micdoodle8.com/wiki/Tutorials/Space_Station_for_Server_Admins#Deleting_a_space_station

I do not know the underlying reasons for this issue. If the issue is not present if SpongeForge is disabled, it is likely to be a bug in Sponge. I have worked with the Sponge team in the past to fix a couple of bugs in their dimension registrations, but it is extremely time consuming for me to do that, so I'm afraid it is not a priority. The real problem is that we don't have access to whatever Sponge is doing internally, from inside Galacticraft, and Sponge changes a lot connected with dimensions - they do it to support server plugins which create additional dimensions (e.g. spawn worlds, mining worlds) but in the process they may be breaking genuine Forge mods like ours.

Maybe other server owners have a solution for this, because I don't think everyone is reporting this problem. I have build a small Sponge server in 1.12.2 for testing and that seems fine (but I don't use any server plugins).

Possible some connection with #3185.

Very likely some connection with this so I will have to look at this again some time.

I can't control what action you take, but I suggest do not report it to Sponge devs - they have so many issues. It's more likely to get an accepted solution from Sponge if I report it, because they will know that I have correctly reported bugs and Pull Request solutions to them in the past.

Before I spend a lot of time doing that, please - if possible - try a copy of your server with Galacticraft and Sponge but without Extra Planets. Extra Planets has ... extra issues in Sponge, for reasons which are not yet clear.

MJRLegends commented 6 years ago

Yeah i thought the same with it being similar. yeah it seems the problem is a spongeforge issue and happens to only be highlighted by ExtraPlanets because its like the only mod that adds lots of dimensions. It seems its a problem in 1.12 too and they told me to remake a issue report with information needed to show the issue but i havent had the time atm

colinrgodsey commented 6 years ago

Great, I'll do some more research here and see if i can at least narrow down what exact interaction is causing it. I just updated the issue above, but I suspect this has something to do with Void Island Control, as it also does some dimension moving/renaming somewhere with the nether, and we don't see this issue with any other dimensions in this pack.

radfast commented 6 years ago

Void Island Control, as it also does some dimension moving/renaming somewhere with the nether.

Doesn't sound good. I don't know that mod... Maybe they don't create dimensions as carefully as Galacticraft does. We've been generating dimensions for 4+ years now ... :)

radfast commented 6 years ago

I'm concerned that if you are deleting dimensions manually, you are going to end up with a situation where you have dimension conflicts anyhow. Sponge servers record a whole load of dimension data in Sponge configs, which will still be present even after you deleted the dimension data folders. And even one small thing in a config somewhere can maybe be the cause of a weird problem like this.

See also the link I posted to our wiki, about how server owners can correctly delete space stations - if you are not using all three steps, a space station will leave some "residue" in a Galacticraft save.

If you have the HDD space and patience, I suggest it is best to do all your testing in a freshly created server each time - I mean a totally fresh copy of the whole .minecraft server folder, so that you will have freshly generated configs for Sponge and every other mod, and a freshly generated world.

colinrgodsey commented 6 years ago

@radfast Very true. I'm going to do a bit more "subtractive" testing, then I'll move on to just doing a new server and adding things one by one (and clearing state). I'm just going to update things here as I come across them, I'll sound the alarm if I find anything really useful for you guys.

I did find one additional tidbit that was interesting- seems the space stations are getting registered as dimensionId -1 (according to the TickProfiler mod), which would maybe explain the suffocating.

screen shot 2018-02-27 at 7 34 13 pm

I checked the NBT data for the space stations, they have valid looking IDs from what I can tell, but interestingly they have the same dimension ID stored (NOTE: testing with our real world here, so didnt delete them yet).

screen shot 2018-02-27 at 7 49 18 pm

radfast commented 6 years ago

The dimensionIdDynamic and dimensionIdStatic numbers are correct there. It's a bit confusing, but those are the dimension TYPE id - not the actual number of the dimension.

(If it said -1 there then it would be a Nether type dimension, if it said 0 it would be Overworld type, etc.)

The problem here is not going to be on Galacticraft's side, because there is no bug while players are inside our dimensions. The problem is that Sponge is creating a Nether dimension with dimension type matching one of the Galacticraft or Extra Planets dimensionsinstead of -1 like it should be - that's why the game thinks there is no oxygen there.

(Coding note for MJRLegends and other devs: inside the Forge DimensionManager, the dimension type number should translate into a class extending WorldProvider)

I guess the tests I'm interested in right now are:

MJRLegends commented 6 years ago

The issue lays on the sponge forge side correct

colinrgodsey commented 6 years ago

Ah, makes sense.

I should be able to get to all those tests, I'm just logging my findings here for extra info, and... mostly for my own tracking. I'm just trying to tear down the existing world right now to figure out what on-disk info could be carrying the issue over, or if its some runtime misinterpretation. You can probably ignore me until I find something more final lol

So far with just sponge + galacticraft (and its dependencies, no other mods) and the current world, the space station still ends up at dimension ID -1. So I should be able to start testing the other way and I can get back to you about those results.

EDIT: Same test as above, but i delete all sponge state (any .dat files related to sponge). Now no conflict exists- so something in the sponge state is storing the bad registration. So it has to be some issue with the initial registration, probably conflicting with one of those mods.

radfast commented 6 years ago

something in the sponge state is storing the bad registration

OK good job for finding this out, this is already strong progress.

As you will have seen, Sponge makes .dat files for each dimension, so it might be worth looking at what happens if you delete only the space station's .dat file.

And please can you keep a full copy of the erroring Sponge .dat files in the current world, maybe I can examine them in future and then find a way to prevent the error from occurring.

Just guessing wildly - we know that Extra Planets triggers a bug in Sponge dimension handling (the reason why this happens has not yet been figured out by Sponge + MJR Legends who have been looking at it for some time). Maybe at the point when you install Extra Planets on top of Galacticraft, that triggers the issue and from then on, one (or more) of the Sponge .dat files is put into the wrong state.

colinrgodsey commented 6 years ago

Sorry, still working with the old world data here one more time. I tried loading the bugged world with just galacticraft, galacticraft-planets, dependencies etc, sponge. I delete the level_sponge.dat files from both space station dimensions, and that would fix the world state and i could get to the nether fine. Now this all works fine, until I restart the server. It regenerates the level_sponge.dat files, and that reintroduces the error. So there does not appear to be any 'bad' data stored in the level_sponge.dat file, but the presence of it period seems to throw off the dimension registration when sponge starts with some reference to a space station dimension.

I will move on to tests with a brand new world after this. I honestly still need to figure out how to build a space station from scratch (haven't actually gotten far in this pack yet myself) and get there lol.

Test environment:
GalacticraftCore-1.12.2-4.0.1.139.jar
Nucleus-1.2.0-PR4-S7.0-MC1.12.2-plugin.jar
spongeforge-1.12.2-2611-7.1.0-BETA-2931.jar Galacticraft-Planets-1.12.2-4.0.1.139.jar
MicdoodleCore-1.12.2-4.0.1.139.jar
TickProfiler-1.12-0.0.1.jar

1) Move existing world to test environment (in this case from my bugged world). 2) Delete level_sponge.dat files from all space station dimensions. 3) Load server, verify that nether works totally fine. 4) Go to space station, also verify it works fine. 5) Back to nether, still fine. 6) Restart server. level_sponge.dat files are back at this point (and I verified the content was the same as before, different UUIDs). 7) Verify that the nether is now being loaded with the SpaceStation provider and goes back to the troubled behavior i initially described:

badnetherload

NOTE: I am still using nucleus here, cause I have no idea how to get out of space once I'm there... so haven't been able to rule that out as an option yet.

Here's what's in level_sponge.dat. It regenerates the same, different UUIDs. Everything else looks like it makes sense there tho:

level_sponge

radfast commented 6 years ago

hmmm very strange

You can get into / out of space using /dimensiontp command. To create a space station dimension you'd need to be in Creative mode before using that command. Each player can create only one station.

radfast commented 6 years ago

If it's happening with GC only, then I'm looking to get to a stage where I can reproduce this issue myself. If I can reproduce it on a Sponge server then maybe I can start to look for a permanent solution.

But ... I am not able to reproduce this. On my test server, I'm running:

 Galacticraft 1.12.2-4.0.1.146  (3 files)
 spongeforge-1.12.2-2586-7.1.0-BETA-2875
 TConstruct (with libraries)
 Thermal Dynamics + Thermal Expansion (with dependencies)
 IC2
 AppliedEnergistics2
 Natura

It's a test server that I've been playing on properly for about 8 hours to make sure everything is working. Not quite yet ready to go to space, but I have a functioning base and a lot of machines. Today I've used /dimensiontp to create a space station and visit all Galacticraft planets.

Then I stopped the server, restarted the server. Visited the Nether: the Nether is normal. Visited all our planets again: all are working properly.

BTW, landing on our planets is still awesome, gets me every time. Even though I must have done it 1000+ times.


It's fairly unlikely that there is any relevant difference between Sponge 2931 and Sponge 2875 - and you said already you tested a few different Sponge versions.

The only obvious difference between your setup and mine is Nucleus.

It is also possible you have some messed up Galacticraft or Sponge configs (or messed up Galacticraft space stations data structures) due to some earlier issue. Therefore it seems important that you test on a brand new server folder (clean configs).

radfast commented 6 years ago

Just a thought - to explain why some people are seeing this problem and some people are not seeing it.

It could be linked with JVM optimisations (which will be different on each different machine) and the hacky way that Forge handles registration of a new DimensionType. See https://github.com/MinecraftForge/MinecraftForge/issues/3885

Galacticraft registers all the planet DimensionType in a tight loop during server init phase. If Extra Planets is installed that adds 20+ new planets. Could be 20 is enough on some machines for the JVM to identify the loop as a "hotspot" and start optimising it, which could produce the problem.

This would explain why @MJRLegends careful testing shows that the Extra Planets planet registrations work OK if there are not too many planets, but add one more and it starts to go wrong.

If you're someone with the issue and you're a Java wizard, you can try using some custom JVM startup parameters to switch off or dial down the JVM optimisations, see discussion in the Forge thread I linked. It would be extremely helpful to have real proof that the JVM optimisations are causing this.

radfast commented 5 years ago

We are hopeful this will be fixed in the next build, see discussion on #3775.

radfast commented 5 years ago

Please try build 1.12.2 - 4.0.2.234, this is fixed.