Skip to content
/ m2rs Public

Cross platform Metin2 MMORPG using Rust + WGPU

Notifications You must be signed in to change notification settings

Sufhal/m2rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M2RS

M2RS is an experimental projet which targets to entierly rewrite the game Metin2 (an old Korean MMORPG) using pure Rust and wgpu.

Why I'm doing this

  • I love Metin2, Rust, Web, graphics programming and performance critical things
  • I was looking for a challenging project
  • Because I can and you've probably already heard « L'impossible n'est pas Français 🇫🇷 »

Features

  • WASM support

  • GLTF support

    • material
    • mesh
    • skeleton
    • animation clip
  • AnimationMixer

    • frames interpolation
    • blend two clips when playing a new clip
  • Character

    • allow characters to control it's own animation mixer (pc/npc basically have more than one "wait" animation, we must play them randomly)
    • dynamic Object3DInstance loading using (main) character position
    • create character controller
    • basic collisions (using 2d algorithms for performance reasons)
  • ThirdPersonCamera

    • third person camera
  • BoneAttachement

    • allow Object3D to be attached to a skeleton bone (hairs, weapons)
  • Terrain

    • parse and generate terrain chunks
    • shader
    • shadows
    • raycast to make characters walk above the ground
    • objects
    • trees
    • water geometry
    • water shader
  • Environment

    • sun light that follow a realistic path between day and night
    • environment colors
    • fog
    • clouds
    • skybox
  • Particle system

    • ???
  • CLI

    • textureset.txt
    • setting.txt
    • areaambiencedata.txt
    • areadata.txt
    • areaproperty.txt
    • property
    • environment

Optimization track

  • GLTF loader currently produces 4 skeletons if there is 4 skinned mesh linked to the same skeleton.
  • Water generation is currently slow due to vertices height comparaison between two planes without being equal in vertices count (HashMap set/get overhead)

Start

To start the game, run the following command and Vulkan or Metal will be used for rendering depending on the platform (Windows, Linux or macOS).

cargo run --bin m2rs --release

Export in the browser (WASM)

In order to export both WASM and JS glue code, you will need to install wasm-pack.

cargo install wasm-pack

Then, you can use wasm-pack command to export the game.

wasm-pack build --target web

Finally, use a live server to serve the content and open index.html on the selected port. I personnally use Live Server VSCode extension.

CLI

A CLI is available if assets need conversion. Currently supported conversions are:

  • textureset.txt -> textureset.json

In the future, this CLI will be used to optimize + encrypt assets.

cargo run --bin cli --release

DDS to PNG

All DDS files should be converted to PNG files. I usually do this with imagemagick:

find . -type f -name "*.dds" -exec mogrify -format png {} +

FBX to GLTF

To convert FBX files to GLTF:

About

Cross platform Metin2 MMORPG using Rust + WGPU

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published