Diablo II Resurrected Library

Related tags

Miscellaneous libd2r
Overview

Diablo II Resurrected Library

A Diablo II Resurrected library for core and simple client functionality, written in Rust for performance, safety and re-usability.

This effort is very much WIP, so it is not available on crates.io yet.

If you are interested in Diablo II and/or Rust, this might be fun!

Goals

  • cross platform without runtime/VM requirement
  • provide game internal data structures and utility functions
  • savegame load/save support (for e.g. character editors, armory-style webpages)
  • implement the network protocol as fully supported as possible (i.e. however much is known publically)
  • reproduce game state as accurately as possible/needed

Milestones

  1. network protocol support
    • D2GS (plain)
    • D2GS (compressed)
    • BNCS (It if is used in D2R at all)
    • MCP Realm Logon
  2. Game State Data Structures.
    • Items and Buffers (Ground, Inventory, Stash, Cube, Belt)
    • Players (WIP)
    • Players Quest Progression
    • NPCs (WIP)
    • Party/Hostile
    • Game Quest Progression
    • Maps (generate from game seed, take from d2bs)
    • Pathing(?)
  3. Client object
    • shadow client (packet listener w/ game update loop WIP)
    • active client / protocol state machine

How to Build

Linux

cargo build --release

Mac Os

cargo build --release (not tested yet)

Windows

You will need to install npcap and additionally download the WinPcap Developers Pack as per the libpnet build instructions for Windows. Then point your user environment variable LIB (create if nonexistent) to the folder where to find Packet.lib i.e. WpdPack/Lib/x64/ from the WinPcap Developers Pack you just downloaded. Then cargo build --release This should get the project building but the executable crashes while querying the available network interfaces on my machine (maybe need to adapt code for windows).

At this early stage i haven't created any bindings, but Python/JS would be useful to many people I guess.

Usage

One simple use case that is supported now is launching a listening client/connection to sniff d2gs packets:

use libd2r::Client;

fn main() {
    let mut client = Client::new();
    client.start()
}

Plase note that it does not fill any internal game data structures as of now (state update handling is still WIP). It will just filter, decode and print packets.

Contributing

This is quite the challenge so any help is appreciated!
There is quite a bit of awesome code out there, but scattered across various sources.
Maybe you want to help translating this d2r savegame utility from go?
Or help with the map generation from game seed? It exists in several projects (d2bs, opendiablo, opend2, ...) and shouldn't have changed for D2R.

Disclaimer

Little of this works yet and most probably never will. Unless you feel like contributing, which is welcome, it is mostly an exercise.
Here are some great resources on the original game:

You might also like...
A library and tool for automata and formal languages, inspired by JFLAP
A library and tool for automata and formal languages, inspired by JFLAP

Sugarcubes is a library and application for automata and formal languages. It is inspired by JFLAP, and is intended to eventually to be an alternative to JFLAP.

librdkafka - the Apache Kafka C/C++ client library

librdkafka - the Apache Kafka C/C++ client library Copyright (c) 2012-2020, Magnus Edenhill. https://github.com/edenhill/librdkafka librdkafka is a C

Rust library for emulating RISC-V rv32imac

This library can execute instructions against any memory and register file that implements the required primitives in the traits lib_rv32::traits::{Memory, RegisterFile}. This is to encourage usage with whatever frontend you desire.

Yet another ROS2 client library written in Rust
Yet another ROS2 client library written in Rust

RclRust Target CI Status Document Foxy (Ubuntu 20.04) Introduction This is yet another ROS2 client library written in Rust. I have implemented it inde

An example of Brainf*** JIT-compiler with only the standard library.

jit-compiler An example of Brainf*** JIT-compiler with only the standard library. Prerequisite Rust(1.56.0-nightly or later, but it must work kind of

A boiler plate code to create dynamic link library in rust.

🔭 rust-dll-bp This is a boiler plate code that will be generated as a dll binary. I personally cache this here for me but if you're intend to create

Rust telegram bot library for many runtimes

Telbot Telbot provides telegram bot types and api wrappers. Specifically, telbot now supports: telbot-types: basic telegram types / requests / respons

Strongly typed Gura library for Rust

Serde Gura This crate is a Rust library for using the Serde serialization framework with data in Gura file format. This library does not re-implement

An asynchronous Rust client library for the Hashicorp Vault API

vaultrs An asynchronous Rust client library for the Hashicorp Vault API The following features are currently supported: Auth AppRole JWT/OIDC Token Us

Owner
null
Simple library to host lv2 plugins. Is not meant to support any kind of GUI.

lv2-host-minimal Simple library to host lv2 plugins. Is not meant to support any kind of GUI. Host fx plugins (audio in, audio out) Set parameters Hos

Cody Bloemhard 11 Aug 31, 2022
Extreme fast factor expression & computation library for quantitative trading in Python.

Extreme fast factor expression & computation library for quantitative trading in Python.

Weiyuan Wu 22 Dec 8, 2022
Demo for the swash font library

Demo for the swash crate See the swash repo or crate for the actual project. This is a chunk of very rough code.

Chad Brokaw 28 Nov 29, 2022
Agent library for Internet Computer, in Dart

An agent library built for Internet Computer, a plugin package for dart and flutter apps. Developers can build ones to interact with Dfinity's blockchain directly.

null 87 Dec 31, 2022
Totally Speedy Transmute (TST) is a library providing a small, performance oriented, safe version of std::mem::transmute

Totally Speedy Transmute An evil spiritual successor to Totally Safe Transmute What is it? Totally Speedy Transmute (TST) is a library providing a sma

John Schmidt 19 Jun 7, 2022
📜 A pci.ids-compliant library for getting information about available PCI devices.

aparato A pci.ids-compliant library for getting information about available PCI devices. Usage Add the following to your project's Cargo.toml file: ap

Aziz Ben Ali 22 Nov 14, 2022
Notion Offical API client library for rust

Notion API client library for rust.

Jake Swenson 65 Dec 26, 2022
Rust library for program synthesis of string transformations from input-output examples 🔮

Synox implements program synthesis of string transformations from input-output examples. Perhaps the most well-known use of string program synthesis in end-user programs is the Flash Fill feature in Excel. These string transformations are learned from input-output examples.

Anish Athalye 21 Apr 27, 2022
Ointers is a library for representing pointers where some bits have been stolen so that they may be used by the programmer for something else

Ointers is a library for representing pointers where some bits have been stolen so that they may be used by the programmer for something else. In effect, it's a small amount of free storage

Irrustible 8 Jun 4, 2022
SE3 Rust library for Robotics

Algebraic Robots A small Rust Library for SE3 Supported: Twist Screw SE3 Group se3 algebra Adjoint SE3 Twist Chains Wrenches Future plans: Jacobians V

Pau Carré Cardona 4 Jul 18, 2021