Server targeting a 2d sidescroller with shrooms.
shroom-metacontains meta data for the game like Ids or Field datashroom-proto95contains the packet stucturesshroom-datacontains the actual persistence layer(database stuff to load/save stuff)shroom-srvis the actual core server logic for tick handling and other stuffshroom-scriptsscripts-libare the actual scripting libraries, the first contains the actual script api code and the lib crate handles the reloading and provides the glue code to the actual gameshroom-loginis the login servershroom-gameis the game servermonois the actual server, which combines all of the crates to produce a functional server
- Server uses tick based scheduling with groups, fields/maps are essentially the scheduler groups, each client is attached to a group
- Tick rate is 50ms for now
- Avoid any I/O in the game logic handlers
- Based on
tokiowhich also adds good message passing features - A World to manage all field/groups and client
- Scripting is done in rust, but scripts are built as shared library(dll/so) and reloaded when the library changes
- Service-oriented design for data
- Strongly typed for several concepts like Ids
- Scripts are placed into
crates/script-lib/scripts/src cargo install cargo-watchto automatically rebuild them if they are updated- To watch and rebuild:
cargo watch -w crates/scripts-lib/scripts/src -x 'build -p scripts' - Right now hot-reloading is abit quirky never edit scripts when there's an active script(will be handled later)
- Scripts have access to the
shroom-metacrate which implements plenty of the game logic already
- Skill data is generated in the meta crate which strongly typed buff types, to ensure the compiler can check It
- Those are then applied in the
shroom-gamecrate - Passive skills are still missing and summons need to be redesigned
- A client with patched IP checks and disabled Shanda Encryption(You can lookup Hendi's Client and my DLL for that)
- Latest Rust Stable compiler(For windows you also need vc++ build tools)
- Git
- Clone the repo
- Init the submodules(
git submodule initgit submodule update) - Build scripts
cargo watch -w crates/scripts-lib/scripts/src -x 'build -p scripts'(Use an extra terminal for this) - Build and run the server
RUST_LOG=info cargo r -p mono - Launch the client(Hendi's localhost for 95.1 4gb is recommended)