Difference between revisions of "Sponge"

From Galacticraft Wiki
Jump to: navigation, search
Line 3: Line 3:
 
Now that Bukkit no longer exists in recent Minecraft versions, most large multiplayer servers will want to be running 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, are Sponge compatible on servers.  If you follow the tips below, it should be as simple as adding both Galacticraft and Sponge in the /mods folder.
+
Galacticraft 4, versions for Minecraft 1.10.2 and 1.11.2 and 1.12.2, are Sponge compatible on servers.  If you follow the tips below, it should be as simple as adding both Galacticraft and Sponge in the /mods folder.
  
  
Line 9: Line 9:
  
  
We '''recommend''' the very latest version of Sponge.  For 1.11.2, that's [https://repo.spongepowered.org/maven/org/spongepowered/spongeforge/1.11.2-2393-6.1.0-BETA-2592/spongeforge-1.11.2-2393-6.1.0-BETA-2592.jar version 1.11.2-2393-6.1.0-BETA-2592] or later.  This is tested with Galacticraft and should be stable on servers.
+
We '''recommend''' the very latest version of Sponge.  For 1.11.2, [https://repo.spongepowered.org/maven/org/spongepowered/spongeforge/1.11.2-2393-6.1.0-BETA-2592/spongeforge-1.11.2-2393-6.1.0-BETA-2592.jar 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.
  
  
If for some reason you can't use the latest version of Sponge as recommended above, please be aware that there was an issue with some Sponge versions released between April and July 2017.  The issue was with any mod which made players change dimensions - like Galacticraft.  The prior Sponge versions which worked OK with Galacticraft (which did not have the issue) were:
+
If for some reason you can't use the latest version of Sponge as recommended above, please be aware that there was an issue with some older Sponge versions released between April and July 2017.  The issue was with any mod which made players change dimensions - like Galacticraft.  The prior Sponge versions which worked OK with Galacticraft (which did not have the issue) were:
  
 
     '''1.10.2'''  [https://repo.spongepowered.org/maven/org/spongepowered/spongeforge/1.10.2-2254-5.2.0-BETA-2250/spongeforge-1.10.2-2254-5.2.0-BETA-2250.jar Sponge 2250] + Forge 1.10.2-12.18.3.2254 or before
 
     '''1.10.2'''  [https://repo.spongepowered.org/maven/org/spongepowered/spongeforge/1.10.2-2254-5.2.0-BETA-2250/spongeforge-1.10.2-2254-5.2.0-BETA-2250.jar Sponge 2250] + Forge 1.10.2-12.18.3.2254 or before
Line 20: Line 20:
 
Those are versions from March 2017.
 
Those are versions from March 2017.
  
(If you do not use the latest Sponge version, then you may find that Sponge breaks Galacticraft lander spawning client-side after rocket flights.  There are other weird effects seen client-side: the April-July Sponge versions could prevent players from seeing rockets newly placed on launch pads client-side, and moon buggy on buggy pads, astro miner in astro miner dock, etc etc and other issues with other mods, including some issues when players pass through Nether Portals.  All issues of these kinds are fixable by players re-logging, but you don't want to force your players to re-log all the time... so be smart and use a version of Sponge we recommend.)
+
(If you do not use the latest Sponge version, then you may find that Sponge breaks Galacticraft lander spawning client-side after rocket flights.  There are other weird effects seen client-side: the April-July Sponge versions could prevent players from seeing rockets newly placed on launch pads client-side, and moon buggy on buggy pads, astro miner in astro miner dock, etc etc and other issues with other mods, including some issues when players pass through Nether Portals.  All issues of these kinds are fixable by players re-logging, but you don't want to force your players to re-log all the time... so it's best to use either the latest Sponge versions or the pre-April 2017 versions mentioned above.)
  
 +
 +
 +
====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 for "performance" reasons, 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 it adds.  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, so that if Sponge dimension configs are deleted and re-created this may fix the problem.  [https://github.com/micdoodle8/Galacticraft/issues/3206 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 takes 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 dimension (''N'' players), then you will have ''N x N'' updates being sent by the server, each tick.  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 if players are not present.  Servers with huge player numbers will probably want to limit the number of chunkloaders which each player can use, or disable chunkloaders completely.
  
  
Line 27: Line 44:
 
====IMPORTANT: spawn area generation on first server start====
 
====IMPORTANT: spawn area generation on first server start====
  
On your new Sponge server's first run, when the server starts it will generate some map chunks around the "spawn location" for the Asteroids, Mars, Moon and Venus, as well as for the Overworld.
+
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.)
 
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?  Defaul 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.
+
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!
 
'''It's not a crash in Galacticraft''', it's just a server time out!
Line 46: Line 63:
 
Galacticraft has a background mapping function which is used for Overworld map images on Display Screens and will have additional uses in future.
 
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 visual map of the Overworld - 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 2-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 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 if the server is not heavily loaded and there are not too many players online.  But, in the first 30 minutes while the background mapping process is running, the server will take up to 50% CPU because during this time it's using two CPU cores.
+
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 2-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 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 if the server is not heavily loaded.  But, in the first 30 minutes while the Galacticraft background mapping process is running, the server will take up to 50% CPU because during this time it's using two CPU cores.
 +
 
 +
This is not a bug: Galacticraft is actually fully using the second CPU core 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).  This means that if you keep on, over and over, starting your Sponge + Galacticraft server and shutting it down after 1-29 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.
+
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 [https://github.com/micdoodle8/Galacticraft/issues/2864 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 30 minutes to 1 hour with no players online.  So just start the server running and leave it alone for an hour or so, or overnight.  If you then check the World/galacticraft/overworldMap folder for a file named Overworld1536.bin, you'll know it has finished the background mapping, and as long as that file is there, it won't need to do it again.
 
'''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 30 minutes to 1 hour with no players online.  So just start the server running and leave it alone for an hour or so, or overnight.  If you then check the World/galacticraft/overworldMap folder for a file named Overworld1536.bin, you'll know it has finished the background mapping, and as long as that file is there, it won't need to do it again.
  
(The background mapping will also activate to generate a smaller local map whenever a player places a Display Screen.  This takes maybe 2-3 seconds in the background, and it's fully multi-threaded so you shouldn't notice any impact on server performance or tick speed, but your CPU might temporarily spike up from 25% to 50% while this is happening.)
+
The background mapping will also activate to generate a smaller local map whenever a player places a [[Display Screen]].  This takes maybe 2-3 seconds in the background, and it's fully multi-threaded so you shouldn't notice any impact on server performance or tick speed, but your CPU usage might temporarily spike up from 25% to 50% for a couple of seconds while this is happening.
  
  

Revision as of 12:31, 18 April 2018

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 Sponge compatible on servers. If you follow the tips below, it should be as simple as adding both Galacticraft and Sponge in the /mods folder.


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.


If for some reason you can't use the latest version of Sponge as recommended above, please be aware that there was an issue with some older Sponge versions released between April and July 2017. The issue was with any mod which made players change dimensions - like Galacticraft. 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

Those are versions from March 2017.

(If you do not use the latest Sponge version, then you may find that Sponge breaks Galacticraft lander spawning client-side after rocket flights. There are other weird effects seen client-side: the April-July Sponge versions could prevent players from seeing rockets newly placed on launch pads client-side, and moon buggy on buggy pads, astro miner in astro miner dock, etc etc and other issues with other mods, including some issues when players pass through Nether Portals. All issues of these kinds are fixable by players re-logging, but you don't want to force your players to re-log all the time... so it's best to use either the latest Sponge versions or the pre-April 2017 versions mentioned above.)


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 for "performance" reasons, 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 it adds. 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, so that if Sponge dimension configs are deleted and re-created this may fix the problem. 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 takes 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 dimension (N players), then you will have N x N updates being sent by the server, each tick. 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 if players are not present. Servers with huge player numbers will probably want to limit the number of chunkloaders which each player can use, or disable chunkloaders completely.


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.



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 2-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 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 if the server is not heavily loaded. But, in the first 30 minutes while the Galacticraft background mapping process is running, the server will take up to 50% CPU because during this time it's using two CPU cores.

This is not a bug: Galacticraft is actually fully using the second CPU core 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 30 minutes to 1 hour with no players online. So just start the server running and leave it alone for an hour or so, or overnight. If you then check the World/galacticraft/overworldMap folder for a file named Overworld1536.bin, you'll know it has finished the background mapping, and as long as that file is there, it won't need to do it again.

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



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