Sponge

From Galacticraft Wiki
Jump to: navigation, search

Sponge

Now that Bukkit no longer exists in recent Minecraft versions, most large multiplayer servers will want to be running Sponge.

Galacticraft 4, versions for Minecraft 1.10.2 and 1.11.2 and 1.12.2, are absolutely Sponge compatible on servers and we aim to keep it that way (we have worked with the Sponge dev team to fix a couple of older bugs in Sponge).

If you follow the tips below, it should be as simple as adding both Galacticraft and Sponge in the /mods folder on the server.


Recommended Sponge version

We recommend the very latest version of Sponge. For 1.11.2, version 1.11.2-2393-6.1.0-BETA-2592 is tested with Galacticraft and should be stable on servers, and any later version is also likely to be OK.

For 1.12.2, spongeforge-1.12.2-2705-7.1.0-BETA-3136.jar is the latest (end June 2018) and works well with Galacticraft - if you have an earlier version of Sponge we recommend updating to this one, because it fixes an issue to do with dimensions when shutting down the server.


IMPORTANT: spawn area generation on first server start

On your new Sponge server's first run, when the server starts it will generate a lot of map chunks around the "spawn location" for the Asteroids, Mars, Moon and Venus, as well as for the Overworld.

It's actually not our intention for the server to do this - players won't be going to these other planets in the first few minutes on a server - but we didn't find a way to stop Sponge from doing this. (It doesn't happen on a standard Forge server so it looks like it's a bug in Sponge.)

Depending on how quick your server is and the number of other mods installed, this spawn map generation could take 4-5 minutes or even longer, the very first time you start your server. The problem? Default server configurations tell a server to time out if any tick takes longer than 1 minute. Spawn generation counts as a tick (seems bizarre but hey). So with a default config, your server will stop and exit after the first minute ... probably somewhere in the middle of generating the Asteroids.

It's not a crash in Galacticraft, it's just a server time out!

You can fix it easily like this: in server.properties set max-tick-time=999999 - that's 16 minutes - or an even higher number if you have a ton of mods and a slow PC. The high max-tick-time setting like this is only needed for this first server start. After the first start you can lower it to 60000 as per the default - that's 1 minute - or even less than that if you prefer.


Known minor issues with Sponge

Some Sponge servers will report a shutdown error with Galacticraft, but it does not seem to break anything - it is simply an error seen in the server log after the shutdown process starts. The map will still have saved and the server will operate normally on next server run. This issue is reported as fixed from Sponge 1.12.2 build 3136, so we recommend updating to that version or later - see recommended version.

If you have teleports enabled from other mods (for example JourneyMap teleport to waypoints) and you teleport between dimensions - for example from a Galacticraft planet back to the Overworld - then sometimes a Sponge server will fail to send the map chunks at the destination to the player, so the world will be invisible when the player arrives. This can be fixed by the player re-logging. It is not a Galacticraft issue, it's an issue between JourneyMap and Sponge - but you are more likely to see the issue with Galacticraft installed, because Galacticraft lets players go to other planets!

Galacticraft's own inter-dimensional teleporting - for example flying in rockets or using the /gchouston command - works properly on Sponge servers.


Known issue with Extra Planets and dimension configs

Sponge handles dimensions differently from a regular Minecraft server - partly this is to allow for spawn worlds, mining worlds and other server plugins, and partly it is because Sponge takes control of some things related to dimensions, so Sponge has separate config settings for each dimension.

Unfortunately, Sponge does not give Forge mods (like Galacticraft) any easy way to access or control its dimension configs or dimension handling, so we end up being in the hands of Sponge and how well the server has been set up.

An uncommon, but known, issue is that Sponge dimension handling seems to break when there are more than about 10 new dimensions added to the game. Exact details of what goes wrong here are unknown (otherwise it would already have been fixed!) This is most likely to be seen if you have the Extra Planets mod running on a Sponge server, because of the large number of dimensions added by that mod. A typical manifestation of the problem is that the Nether seems to become a space dimension with oxygen requirements, etc. Testing has shown that it is caused by Sponge's dimension configs somehow breaking. If Sponge dimension configs are deleted and re-created this may fix the problem, at least temporarily. Further info.


Server performance and the number of dimensions

At Galacticraft our experience is that the number of dimensions does not have any noticeable impact on server performance - if anything on larger servers it actually helps server performance to have your players spread out across many different dimensions. It is chunk and entity ticking which take up server time, not dimension ticking. For example, a dimension which is loaded, but which has no loaded chunks because there are no players and no chunkloaders in that dimension, should take up zero server time.

To explain why it helps performance to have players spread out between dimensions: some parts of Minecraft and Minecraft mods can become slow if there are a lot of players in the same world, due to N squared code efficiency where N is the number of players. For example if a mod has a block that (on average) every player builds one of (N blocks) and that block needs to send an update each tick to every other player in the same world (N players), then you will have N x N updates being sent by the server, each tick. ('World' means 'dimension' - Minecraft treats each dimension as a different world.) Because of this, it can be faster for the server to have its players split up across many dimensions. For example with 40 players online, it is faster for the server to have 10 players in each of four different dimensions (the N squared calculation is 4 x 10 x 10 = 400), instead of 40 players all in the same dimension (the N squared calculation is 1 x 40 x 40 = 1600). 400 updates needs less server time than 1600 updates.

Of course these basic principles can be changed if there are a lot of chunkloaders in the game, keeping dimensions and chunks loaded artificially even when players are not present. Servers with huge player numbers will probably want to limit the number of chunkloaders each player can use, or disable chunkloaders completely.



For info: Galacticraft background mapping: CPU usage

Galacticraft has a background mapping function which is used for Overworld map images on Display Screens and will have additional uses in future.

This background mapping aims to generate a complete map of the Overworld up to around 12000 blocks from spawn in all directions - for Galacticraft's future use - when a server very first starts. The process takes approximately 30 minutes, depending on the CPU speed of your server PC. The process does not generate map chunks on your server. The process takes around 3MB of disk space in your server world's Galacticraft folder, that's all. The process is multi-threaded so it should have no impact on server performance: but it will take up an extra full CPU core on your server PC, for around 30 minutes but only the first time you start the server. For example, if you have a 4-core CPU on your server, the standard Server Thread and Netty networking threads will normally use up around 1 CPU core, so a normal Minecraft server should show up as using "25% CPU" on a 4-core machine - maybe less than that, even, if the server is not heavily loaded. But, in the first 30 minutes of the server's life, while the Galacticraft background mapping process is running, the server will show as taking up 50% CPU because during this time it's using two CPU cores.

This is not a bug: Galacticraft is fully using the second CPU core, in the background, for some intense number crunching to build the map.

What happens if you start your server and shut it down in the first 30 minutes, before the background mapping finished? On a basic Minecraft + Forge server, Galacticraft saves its background mapping progress on shutdown and next time you start the server it resumes where it left off, so it will only need a few more minutes to finish the job. But with Sponge the save somehow gets skipped (probably a bug somewhere in Sponge, maybe linked to this). This means that if you keep on, over and over, starting your Sponge + Galacticraft server and shutting it down after less than 30 minutes from first start - maybe because of crashes in another mod? - Galacticraft will never finish its background mapping. The consequence will be that the background mapping thread will run every time, or at least until you get your server decently stable so that it can run for a full 30 minutes without crashing.

Our recommendation is to set up your server with Galacticraft and other mods, and then when you're ready to go, start the server running for the first 1 hour with no players online. So just start the server running and leave it alone for an hour or so. Even if it's not yet fully stable, it's not likely to crash as long as there are no players online and nobody is doing anything. If you then check the World/galacticraft/overworldMap folder for a file named Overworld1536.bin, you'll know that Galacticraft has finished the background mapping, and as long as that file is there, it won't need to do it again.

(If, after the first server run, you change the configs in a mod like Biomes o'Plenty which makes major changes to the worldgen on the Overworld, then you might find that Galacticraft's overworld map is no longer correct. In that case you could force Galacticraft to recreate its version of the Overworld map simply by deleting the Overworld1536.bin file. But generally speaking, you really need to delete the whole world and make a fresh one in this sort of situation, if you changed mods in a way that changes the actual worldgen on the Overworld.)

Galacticraft's background mapping will also activate to generate a smaller local map whenever a player places a Display Screen in a new region. This takes maybe 2 seconds in the background, and again it's fully multi-threaded so you shouldn't notice any impact on server performance or game tick speed, but your server's CPU usage might temporarily spike up for a couple of seconds while this is happening.


Very old Sponge versions from 2017

There was an issue with some older Sponge versions released between April and July 2017 - this issue has long since been fixed in all 2018 versions so if you have a recent Sponge version you should be OK.

The issue was with any mod which made players change dimensions - like Galacticraft. Before April 2017, the prior Sponge versions which worked OK with Galacticraft (which did not have the issue) were:

   1.10.2   Sponge 2250 + Forge 1.10.2-12.18.3.2254 or before
   1.11.2   Sponge 2244 + Forge 1.11.2-13.20.0.2228 or before

(The issue was that that Galacticraft moon landers did not spawn client-side after rocket flights. Other weird effects were also seen client-side: players could not see rockets newly placed on launch pads, and moon buggy on buggy pads, astro miner in astro miner dock, many things to do with vehicles after changing planets. Sponge created similar issues for other mods and other dimensions, including some issues when players passed through Nether Portals. All issues were fixable by players re-logging.)


Impt.png
Unless stated otherwise, all information contained on this wiki should be considered outdated and might not reflect in-game experiences