Sponge

From Galacticraft Wiki
Revision as of 04:02, 4 May 2017 by Radfast (talk | contribs)
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, 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.


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.

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 Sponge 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.


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 visual map of the Overworld - for Galacticraft's use - when a server first starts. The process takes approximately 1 hour, depending on the speed of your 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 PC, for around one hour 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 loaded and there are not too many players online. But, in the first 1 hour while the background mapping process is running, the server will take up to 50% CPU because at this time it's using two CPU cores.

What happens if you start your server and shut it down after the first 30 minutes, before the background mapping finished? On a basic Minecraft + Forge server, Galacticraft saves its background mapping progress on shutdown (for example, it can save 30 minutes worth of progress) and next time you start the server it resumes where it left off, so it will only need 30 more minutes to finish the job. But with Sponge the save somehow gets skipped (probably another small 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-59 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 1 hour without crashing.

Our recommendation is to setup 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 two, 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.

(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, but your CPU might temporarily spike up from 25% to 50% while this happening.)



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