Skip to content

etorth/mir2x

Repository files navigation

mir2x

GitHub Actions Build Status Coverity Scan Build Status Gitter chat

mir2x is an experimental project that verifies actor-model based parallelism for MMORPG, it's c/s based with various platforms supported and contains all need components for game players and developers:

  • client
  • server
  • pkgviewer
  • animaker
  • mapeditor

Prebuilt binaries

Each push to the repository publishes a rolling latest GitHub release containing Linux and Windows MinGW UCRT64 install trees:

The full release page is at https://github.com/etorth/mir2x/releases/tag/latest.

Notes

  • This repo uses C++ coroutine to implement actor model, requires compiler to support c++23.
  • This repo uses classic v1.45 mir2 as a reference implementation, you can try the original game:
    • Install win-xp to host and run the game server/client, tested on real machine or virtualbox machine.
    • Install server/client from mir2-v1.45.
    • Change screen resolution to 16bit mode to run the game.

Public Server

  • Check the tutorial here for how to run the server with Oracle Cloud as a public server.
  • You can try the public test server 192.9.241.118 by
    client --server-ip=192.9.241.118 # not maintained recently

YouTube links: 1 2 3

vokoscreen-2022-04-09_00-26-06.mp4

An IME for SDL fullscreen mode:

ime.mp4

Building from source

mir2x uses vcpkg manifest mode for third-party dependencies on 64-bit native Linux and 64-bit MSYS2 UCRT64/MinGW. The helper script clones and bootstraps a local vcpkg checkout in the current working directory, configures the CMake build, builds, and installs.

Linux (Ubuntu 26.04)

mir2x is built with GCC 16:

sudo apt update
sudo apt install -y \
    autoconf autoconf-archive automake \
    build-essential cmake curl \
    g++-16 gcc-16 gawk gettext git libtool ninja-build pkg-config \
    python3 tar unzip \
    libgl1-mesa-dev libglu1-mesa-dev \
    libice-dev libltdl-dev libsm-dev \
    libx11-dev libxcursor-dev libxext-dev libxfixes-dev \
    libxft-dev libxinerama-dev libxrender-dev \
    libasound2-dev libdbus-1-dev libibus-1.0-dev libpulse-dev libudev-dev \
    libxi-dev libxkbcommon-dev libxrandr-dev libxss-dev libxtst-dev

Then clone and build:

git clone https://github.com/etorth/mir2x.git
mkdir b_mir2x && cd b_mir2x
python3 /path/to/mir2x/build.py --c-compiler=gcc-16 --cxx-compiler=g++-16 --parallel=10

Windows (MSYS2 UCRT64)

Install MSYS2, then from a UCRT64 shell install the toolchain:

pacman -S --needed \
    mingw-w64-ucrt-x86_64-toolchain \
    mingw-w64-ucrt-x86_64-git \
    mingw-w64-ucrt-x86_64-cmake \
    mingw-w64-ucrt-x86_64-ninja \
    mingw-w64-ucrt-x86_64-pkgconf \
    mingw-w64-ucrt-x86_64-python

Then clone and build from the same UCRT64 shell; the helper selects the x64-mingw-static vcpkg triplet by default:

git clone https://github.com/etorth/mir2x.git
make b_mir2x && cd b_mir2x
python3 /path/to/mir2x/build.py --build-dir=/path/to/b_mir2x --parallel=10

Helper script options

Builds are incremental by default: rerunning the same command keeps <build-dir>/build, including CMake object files, vcpkg_installed, and the default resource clone. Use --fresh only when you want a real clean build: it deletes <build-dir>/build, including vcpkg_installed and <build-dir>/build/assets/mir2x_res, so vcpkg dependencies are reinstalled/rebuilt and default resources are cloned again.

Install-time client/server resource packing always runs. If --res-path is omitted, the CMake build clones https://github.com/etorth/mir2x_res.git to <build-dir>/build/assets/mir2x_res during the build stage. To use an existing resource checkout, pass:

/path/to/mir2x/build.py [options] --res-path=/path/to/mir2x_res

Other useful options:

  • --c-compiler=<cc> --cxx-compiler=<cxx> selects a compiler for both vcpkg ports and mir2x targets (enables VCPKG_CHAINLOAD_TOOLCHAIN_FILE internally).
  • --parallel=<N> controls build parallelism.
  • --verbose shows detailed CMake/vcpkg command output.

First time run

To start the monoserver, find a linux machine to host the server, I tried to host it on Oracle Cloud Infrastructure, it works perfectly with the always-free plan. Click menu server/launch to start the service before start client:

cd b_mir2x/install/server
./server --auto-launch

Start client, currently you can use default account (id = test, pwd = 123456) to try it:

cd b_mir2x/install/client
./client --server-ip=localhost --auto-login=test:123456

Packages

mir2x uses a number of open source projects to work properly, and of course itself is open source with a public repository on github, please remind me if I missed anything.

  • SDL3 - A cross-platform development library designed to provide a hardware abstraction layer.
  • FLTK - A cross-platform C++ GUI toolkit for UNIX®/Linux® (X11), Microsoft® Windows®, and MacOS® X.
  • asio - A cross-platform C++ library for network and low-level I/O programming.
  • g3log - An asynchronous, "crash safe", logger that is easy to use.
  • lua - A powerful, efficient, lightweight, embeddable scripting language.
  • sol2 - A fast, simple C++ and Lua binding.
  • tinyxml2 - A simple, small, efficient, C++ XML parser.
  • utf8-cpp - A simple, portable and lightweigt C++ library for UTF-8 string handling.
  • SQLiteCpp - SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper.

About

open source MMORPG game

Topics

Resources

Stars

506 stars

Watchers

30 watching

Forks

Packages

 
 
 

Contributors