Giter Site home page Giter Site logo

iq-scm / mammoth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from worldql/mammoth

0.0 0.0 0.0 17.91 MB

Scale a single world horizontally across multiple Minecraft servers.

Home Page: https://www.worldql.com/posts/2021-08-worldql-scalable-minecraft/

License: MIT License

Java 100.00%

mammoth's Introduction

๐Ÿชฆ This project is no longer maintained. Check out MultiPaper.

Mammoth: Horizontally scalable Minecraft server

A Spigot plugin demonstrating WorldQL's database and message broker.

What is Mammoth?

Mammoth uses WorldQL to scale a single Minecraft world across multiple server processes. Running multiple Minecraft server processes allows for better core utilization and allows for more players to enjoy a single world. A collection of Minecraft servers using this plugin to sync with a WorldQL server is called a Mammoth cluster.

Mammoth has two modes:

  • Sliced mode: The world is divided on server boundaries. Areas near server boundaries are synchronized. When a player crosses a server boundary they are transferred alonside their inventory, effects, any ridden mobs, or nearby villagers.
  • Seamless mode (experimental): The world is not divided any block changes and player movement are synced.

How to use Mammoth

  1. Set up WorldQL. Download the latest release for Linux from https://github.com/WorldQL/worldql_server/actions and extract it into a folder.
    1. Set up a database using the commands below (change the password):
       CREATE DATABASE worldql;
       CREATE USER dbuser_worldql WITH PASSWORD 'example';
       GRANT ALL PRIVILEGES ON DATABASE worldql TO dbuser_worldql;
    1. Create a .env file with the following contents:
     WQL_SUBSCRIPTION_REGION_CUBE_SIZE=16
     WQL_POSTGRES_CONNECTION_STRING="host=localhost dbname=worldql user=dbuser_worldql password=worldql"
    
  2. Set up redis-server and run it on localhost.
  3. Use https://github.com/WorldQL/mc_provisioner to create your Minecraft cluster. Download the latest version of the Mammoth plugin from https://github.com/WorldQL/mammoth/actions and place it in a plugins folder next to the provisioner executable.
  4. Create the servers with ./provisioner init and run them with ./provisioner start.
  5. The default config will be copied to all servers in the cluster. You can copy it into your top-level plugins folder and edit it to your desired configuration. Once you've made changes to your plugins folder, you can push it to all servers with ./provisioner stop && ./provisioner sync && ./provisioner start.
  6. Create a Velocity proxy server and add all your cluster servers to it with the names mammoth_0, mammoth_1, etc. You can change the server name prefix in config.yml.
  7. Start the Velocity proxy and connect to it. It will be running in sliced mode by default with divisions every 100 blocks for demonstration purposes (you should set this to a value over 1000 for actual servers). Place blocks and cross a server border and watch everything sync.

Features

  • Cross-server TP.
    • /mtp teleports to another player regardless of their server by looking their position up across the cluster.
    • /mtpa sends an Essentials-style teleport request to a player.
    • /mtpaccept accepts a teleport request.

History of Mammoth

  • March 2020: Inspired by large Minecraft events (like Square Garden) and 2b2t, the original goal for horizontally scaling a Minecraft server by splitting the world was realized. I wanted a quarantine project, so I started working on it.
  • April 2020: The first version of Mammoth was deployed and played by about 200 people. Game servers would "claim" chunks via a redis server entry. When a player moved between servers, there would be a visible disconnect+reconnect delay. This was overly complicated and is detailed in this Google Doc.
  • May 2020: I shut the server down and did some analysis on the world files and how optimally the world was split between nodes (not very). The software had a ton of bugs and could be abused to infinitely duplicate mobs (even the Ender Dragon). I also realized that I didn't need a complex world claiming system, and could simply divide the world via a simple mathematical formula.
  • Jun 2020: Released the second version of Mammoth which used a procedural world splitting technique.
  • August 2020: SalC1 ran a server crash stream to test the software. I had a small lobby server designed to forward players to the correct cluster server, which immediately crashed. Regardless, over 600 people were able to connect over the course of the night and the project gained a lot of publicity.
  • September 2020 - July 2021: Conception and initial development of WorldQL. A complete rewrite of Mammoth to use it.

mammoth's People

Contributors

codedredgit avatar dependabot[bot] avatar harvey298 avatar hwgilbert16 avatar jaxkr avatar jojo1542 avatar luludotdev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.