Mystic

A Godot 4+ Massive Multiplayer Online Game (MMOG) Framework

Stars
0
Committers
1

Mystic

Mystic is an MMO game framework for Godot 4+.

Local development

Introduction

In order to work on Mystic and iterate quickly, you will need to have these components running locally:

  • At least 1 game server
  • At least 1 client
  • (Not yet implemented) the whole API services (Database, etc.)

Running these manually can be a huge hassle, especially having to restart the game servers everytime you modify something, debugging is also an issue as you will need a centralized way to see all the servers logs.

In order to solve these issues, Mystic will create a local Kubernetes cluster with support of hot-reload of the servers using Tilt. Each changes related to the server will trigger a rebuild and restart, you'll just have to wait for completion before starting the client.

The following sections will first walk you through the Godot setup (engine version and addons using GodotEnv) and then you'll setup the Kubernetes cluster, API (Not yet implemented) and gameservers in a single command.

Setup

Requirements

Before working on a Mystic project, you'll need to install the following tools:

  1. Install cptl (used to manage the Kubernetes cluster initialisation)
  2. Install Kind (used to setup a local kubernetes cluster)
  3. Install Tilt (used to hot-reload the servers)
  4. Install GodotEnv (used to manage Godot versions and addons)
  5. Install Make using the prefered method for your OS

Setup steps

  1. Clone the repository
  2. Run make godot to setup your Godot version and addons using Godotenv
  3. [ONLY ONCE] Run make dns, to add monitoring.mystic.local to your host file
  4. Run make cluster to setup the Kubernetes cluster and have the monitoring tools deployed
  5. Run tilt up and press space while the process is running to open the web ui (or go
    to http://localhost:10350/overview)

Developing your game using Mystic

Once the setup steps are completed, you are now ready to work on your game. This section will describe how to work with Mystic as your framework and give some examples to implement some features (TODO!)

Inside the Godot editor

TODO: Add godot side of things once done, also add documentation links

Registering, sending and receiving a packet

The end goal is to have a custom protocol file format to easily generate the packets, for now everything is registered manually in your code.

Registering a packet

Each packets are registered automatically when subscribed / sent, you only need to register it's nested types if they aren't on of these types :

byte sbyte short ushort int uint long ulong float double bool string char IPEndPoint

To do so, use Client.RegisterNestedType<YourTypeHere>() in the client and Server.RegisterNestedType<YourTypeHere>() in in the server BEFORE using your packet (otherwise all it's fields will be uninitialized).

Example :

// Server
Server.RegisterNestedType<PlayerInput>();
Server.Subscribe<PlayerInputPacket>(HandlePlayerInput);

// Client
Client.RegisterNestedType<PlayerInput>();
Client.Send(new PlayerInput(), DeliveryMethod.Unreliable);

Servers performance and logs

To explore your servers logs, go here To see your servers metrics (RAM/CPU usage, packets/s, bytes sent/s, etc.) go here

TODO

  • Add a custom packet generator using a packet file definition
  • Allow custom inputs in SyncCharacterBody3D (see todo comment for details)
Related Projects