An open source re-implementation of Diablo 2

OpenDiablo2

CircleCI

Logo

Join us on Discord!
Development Live stream
Support us on Patreon

We are also working on a toolset:
https://github.com/OpenDiablo2/HellSpawner
Please consider helping out with this project as well!

About this project

OpenDiablo2 is an ARPG game engine in the same vein of the 2000's games, and supports playing Diablo 2. The engine is written in golang and is cross platform. However, please note that this project does not ship with the assets or content required to play Diablo 2. You must have a legally purchased copy of Diablo 2 and its expansion Lord of Destruction installed on your computer in order to run that game on this engine. If you have an original copy of the disks, those files should work fine as well.

We are currently working on features necessary to play Diablo 2 in its entirety. After this is completed, we will work on expanding the project to include tools and plugin support for modding, as well as writing completely new games with the engine.

Please note that this game is neither developed by, nor endorsed by Blizzard or its parent company Activision.

Diablo 2 and its content is ©2000 Blizzard Entertainment, Inc. All rights reserved. Diablo and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries.

ALL OTHER TRADEMARKS ARE THE PROPERTY OF THEIR RESPECTIVE OWNERS.

Status

At the moment (march 2021) the game starts, you can select any character and run around Act1 town. You can also open any of the game's panels.

Much work has been made in the background, but a lot of work still has to be done for the game to be playable.

Feel free to contribute!

Building

To pull the project down, run go get github.com/OpenDiablo2/OpenDiablo2

On windows this folder will most likely be in %USERPROFILE%\go\src\github.com\OpenDiablo2\OpenDiablo2

In the root folder, run go get -d to pull down all dependencies.

To run the project, run go run . from the root folder.

You can also open the root folder in VSCode. Make sure you have the ms-vscode.go plugin installed.

Linux

There are several dependencies which need to be installed additionally. To install them you can use ./build.sh in the project root folder - this script takes care of the installation for you.

Contributing

If you find something you'd like to fix that's obviously broken, create a branch, commit your code, and submit a pull request. If it's a new or missing feature you'd like to see, add an issue, and be descriptive!

If you'd like to help out and are not quite sure how, you can look through any open issues and tasks, or ask for tasks on our discord server.

As of Oct. 26, 2020 we will no longer be accepting pull requests that introduce lint errors.

We use golangci-lint to catch lint errors, and we require all contributors to install and use it. Installation instructions can be found here.

VS Code Extensions

The following extensions are recommended for working with this project:

  • ms-vscode.go
  • defaltd.go-coverage-viewer

When you open the workspace for the first time, Visual Studio Code will automatically suggest these extensions for installation.

Alternatively you can get to it by going to settings Ctrl+,, expanding Extensions and selecting Go configuration, then clicking on Edit in settings.json. Just paste that section where appropriate.

Configuration

The engine is configured via the config.json file. By default, the configuration assumes that you have installed Diablo 2 and the expansion via the official Blizzard Diablo 2 installers using the default file paths. If you are not on Windows, or have installed the game in a different location, the base path may have to be adjusted.

Profiling

There are many profiler options to debug performance issues. These can be enabled by suppling the following command-line option and are saved in the pprof directory:

go run . --profile=cpu

Available profilers:
cpu mem block goroutine trace thread mutex

You can export the profiler output with the following command:
go tool pprof --pdf ./OpenDiablo2 pprof/profiler.pprof > file.pdf

Ingame you can create a heap dump by pressing ~ and typing dumpheap. A heap.pprof is written to the pprof directory.

You may need to install Graphviz in order to convert the profiler output.

Debugging

Layouts

Layouts can show their boundaries and other visual debugging information when they render. Set layoutDebug to true in d2core/d2gui/layout.go to enable this behavior.

Example layout in debug mode

Roadmap

There is an in-progress project roadmap, which will be updated over time with new requirements.

Screenshots

Main Menu

Select Hero

Select Hero

Gameplay

Inventory Window

Game Panels

Additional Credits

Owner
OpenDiablo2
An open source isometric ARPG engine.
OpenDiablo2
Comments
  • (FreeBSD amd64) OpenDiablo2 can't find path to mpq files

    (FreeBSD amd64) OpenDiablo2 can't find path to mpq files

    Hello,

    I've installed D2/LoD 1.14b with wine and renamed "Program Files" to "Program Files (x86)" to match config.json path.

    It compiles and runs complaining about not finding mpq data files.

    Here is a (small) log about "go run ." and full path to Diablo II folder:

    https://termbin.com/wmf6

    Thanks,

    Nuno Teixeira

  • Running on Pi4/Retropie

    Running on Pi4/Retropie

    i came across this and thought that i would give it a try. i was able to install it with no errors, that i know of. Never used Golang before

    so my questions is 1 can/will this run in command line, Retropie does not have a desktop, but we can use X11

    2 and how do you start it. i look around and cant find how to start. im sure im just missing it

    thanks for any help

  • d2asset.go:88: error loading file

    d2asset.go:88: error loading file

    Describe the bug After changing Language from ENG to DEU or FRA as described on https://opendiablo2.com/#config in config.json, OpenDiablo2 fails to launch. Error message: d2asset.go:88: error loading file /data/local/lng/{LANG}/string.tbl (file not found) main.go:76: file not found

    To Reproduce As described above.

    Expected behavior Launch with desired language.

    Screenshots

    Desktop (please complete the following information):

    • OS: I use Arch btw
    • Version: opendiablo2-git r486.515b667-1 https://aur.archlinux.org/packages/opendiablo2-git

    Additional context Diablo 2 was installed into Wine from CD media including LOD expansion. After that LODPatch_114d.exe was applied.

  • Latest batch of commits lead to poor performance

    Latest batch of commits lead to poor performance

    With the latest batch of commits from today(and probably late yesterday), I get poor performance on map test. When scrolling the map with arrow keys, I get FPS of 5,6,7, wheres on static map it goes to 150-300 depending on the scene.

  • Tooltip refactor

    Tooltip refactor

    Hi,

    this PR refactors tooltips into their own ui element. Before skill_selection_panel and inventory were creating their own version, replicating a lot of code.

    cheers

  • run.sh script fails on arch/manjaro if you have mesa-git installed

    run.sh script fails on arch/manjaro if you have mesa-git installed

    The run.sh script tries to install mesa, but if you are using mesa-git it'll conflict and the script fails. It should have a check if you have mesa-git installed and if so, skip installation of mesa

  • When build:

    When build: "multiple-value uuid.NewV4() in single-value context" on Arch Linux

    Describe the bug Failure when building on Arch Linux

    To Reproduce Steps to reproduce the behavior:

    1. do go get github.com/OpenDiablo2/OpenDiablo2
    2. See error
    $ go get github.com/OpenDiablo2/OpenDiablo2
    # github.com/OpenDiablo2/OpenDiablo2/d2networking/d2client/d2remoteclient
    ../go/src/github.com/OpenDiablo2/OpenDiablo2/d2networking/d2client/d2remoteclient/remote_client_connection.go:43:24: multiple-value uuid.NewV4() in single-value context
    # github.com/OpenDiablo2/OpenDiablo2/d2core/d2map/d2mapentity
    ../go/src/github.com/OpenDiablo2/OpenDiablo2/d2core/d2map/d2mapentity/factory.go:224:27: multiple-value uuid.NewV4() in single-value context
    ../go/src/github.com/OpenDiablo2/OpenDiablo2/d2core/d2map/d2mapentity/map_entity.go:35:23: multiple-value uuid.NewV4() in single-value context
    
    

    Expected behavior it should build normally

    Desktop (please complete the following information):

    • OS: Arch Linux
  • Add basic movement

    Add basic movement

    This pull request adds ability to move around. I added 2 new variables to AnimatedEntity to keep track of target location. Character velocity right now hardcoded in StepToTarget(). Code also depends on d2helper.AlmostEqual function to compare floats func AlmostEqual(a, b, threshhold float64) bool { return math.Abs(a - b) <= threshhold } Tell me if this code gonna be usefull and I'll make pull request for D2Shared.

  • warning: multiple methods named 'center' found [-Wobjc-multiple-method-names]

    warning: multiple methods named 'center' found [-Wobjc-multiple-method-names]

    Describe the bug When first running go run . as in the README, I encounter an error.

    To Reproduce

    $ go mod download
    $ go run .
    

    This is what I get:

    # github.com/go-gl/glfw/v3.2/glfw
    In file included from ../../go/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/c_glfw_darwin.go:8:
    ../../go/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/glfw/src/cocoa_window.m:989:9: warning: multiple methods named 'center' found [-Wobjc-multiple-method-names]
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionViewCompositionalLayout.h:601:19: note: using
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:312:1: note: also found
    

    Expected behavior Something different, I don't know what's supposed to happen.

    Desktop (please complete the following information):

    GO111MODULE=""
    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/Users/tsatke/Library/Caches/go-build"
    GOENV="/Users/tsatke/Library/Application Support/go/env"
    GOEXE=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GONOPROXY=""
    GONOSUMDB=""
    GOOS="darwin"
    GOPATH="/Users/tsatke/go"
    GOPRIVATE=""
    GOPROXY="https://proxy.golang.org,direct"
    GOROOT="/usr/local/go"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
    GCCGO="gccgo"
    AR="ar"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    GOMOD="/Users/tsatke/Development/OpenDiablo2/go.mod"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/xm/r93t594n44v44v33td31nc1r0000gp/T/go-build916672717=/tmp/go-build -gno-record-gcc-switches -fno-common"
    
  • ServerFull Packet Implementation #828

    ServerFull Packet Implementation #828

    New ServerFull packet type as well as handling of this packet server side. Client side we are still generically logging and exiting for these types of packets.

  • Preliminary ECS work

    Preliminary ECS work

    What is ECS?

    ECS stands for Entity Component System, and it's a departure from the typical object oriented class-inheritance architecture. Basically, all game entities are composed of one or more components, and systems only process entities that have components the system is interested in. Usually, Entities are just unique ID's, components are structs (and have little or no methods), and all of the functional aspects of the game/application are carried out by systems.

    Why ECS?

    The ECS architecture should greatly reduce the coupling throughout the code by divvying the functional responsibilities up between systems. This should make the code a lot easier to maintain, refactor, and extend.

    What's an example of how ECS can help us?

    Currently, the way that rendering happens in OD2, everything that can render is in charge of how it renders to the screen. At some point, the game screen Surface is passed to the player's map entity animation. The animation then renders it's own Surface onto the game screen Surface. If you look at the code, you'll see that our Renderer is a dependency in a lot of places, and I think this is the wrong approach.

    All of these rendering calls can be placed into a single RenderingSystem which is interested in entities that have a RenderSurface and Position component, or something similar. In this way, all of the code for rendering is in one system.

    To put this into perspective, think about how big of a refactor it would take to implement a headless game server. Even if it wouldn't require a large refactor effort to implement this feature currently, it would be trivial to omit the renderer from the ECS "world" during initialization; the game would simply run, just without a renderer system.

    What is Akara?

    Akara is the bastardized ECS based on java's Artemis, which is based on another ECS framework called Ash. I had initially tried to use a couple other ECS "frameworks" for go, but there's just not much out there for ECS in golang that was easy to use/understand.

    With a lot of help and guidance from our friend and rival @collinsmith who is working on Riiablo, i was able to slap together an ECS solution that was fairly simple to use and not too complicated. It ended up being generic enough that I felt it deserved its own repo.

    I'm nowhere near done with akara and plan on maintaining it.

    How does Akara work?

    Go look at the Readme for the akara repo.

    What's been implemented so far using Akara?

    • Game Config System - responsible for the initial game bootstrap process. It creates an entity that eventually becomes the loaded (or default) game config. After the game config is loaded, it then sets up the MPQ's from the config file as file sources.
    • File Type Resolver - responsible for determining the type of a file
    • File Source Resolver - responsible for creating "file sources", things that can open files as data streams.
    • File Handle Resolver - responsible for creating (and caching) file handles for file paths by using file sources
    • Asset Loader - responsible for creating (and caching) game assets (dcc, palettes, wav, string tables, etc)
    • Movement System - this is a test movement system, just to illustrate how movement could be done. This is not likely what our movement system would actually look like.
    • TimeScale System - another example, an implementation of our time dilation feature as a system
  • Bump toshimaru/auto-author-assign from 1.3.0 to 1.4.0

    Bump toshimaru/auto-author-assign from 1.3.0 to 1.4.0

    Bumps toshimaru/auto-author-assign from 1.3.0 to 1.4.0.

    Release notes

    Sourced from toshimaru/auto-author-assign's releases.

    v1.4.0

    Dependencies

    Full Changelog: https://github.com/toshimaru/auto-author-assign/compare/v1.3.7...v1.4.0

    v1.3.7

    • deps: Bump @​actions/core from 1.4.0 to 1.5.0 (#49)
    • deps: Bump @​vercel/ncc from 0.29.0 to 0.30.0 (#50)
    • chore: Add standard-version (#51)

    v1.3.6

    • Bump @​vercel/ncc from 0.28.6 to 0.29.0 (#45)
    • Bump @​actions/core from 1.3.0 to 1.4.0 (#43)

    v1.3.5

    • Bump @​actions/core from 1.2.7 to 1.3.0 (#37)
    • Bump @​vercel/ncc from 0.28.5 to 0.28.6 (#41)

    v1.3.4

    This is a bug fix release for v1.3.3. Thanks @​ksinb

    • Use new endpoints released with actions/github v5 #38

    v1.3.3

    ⚠️ This version includes a bug. Please use v1.3.4

    • Bump @​actions/github from 4.0.0 to 5.0.0 #34
    • Build script #36

    v1.3.2

    • Remove required flag and contents: read permission #33
    • Set default value for repo-token #32

    v1.3.1

    • Add new Github permissions to README #31
    • Bump @​vercel/ncc from 0.28.3 to 0.28.5 #30
    Changelog

    Sourced from toshimaru/auto-author-assign's changelog.

    1.4.0 (2021-10-17)

    1.3.7 (2021-08-29)

    Commits
    • 759f5c7 chore(release): 1.4.0
    • 414a1df Bump @​actions/core from 1.5.0 to 1.6.0 (#54)
    • 47865aa Bump @​vercel/ncc from 0.30.0 to 0.31.1 (#53)
    • 7f0f4e5 Spedify patch version of github-action since it doesn't work if it's imcomplete
    • 8323612 chore(release): 1.3.7
    • afd5d2c Add private: true
    • 8a51dcb chore: Add standard-version (#51)
    • f6bb457 Bump @​vercel/ncc from 0.29.0 to 0.30.0 (#50)
    • ea88331 Bump @​actions/core from 1.4.0 to 1.5.0 (#49)
    • 6967f56 v1.3.6
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Fieldalignment lintfix

    Fieldalignment lintfix

    Yo, I found an easy way to fix fieldalignment lint errors an wanted to check what'll happend if I'll fix them all :grinning:. I don't see any great performency improvements, but I suppose that the game should take a bit less memory now

  • Usage of not yet loaded resources or some skills in general causes lag

    Usage of not yet loaded resources or some skills in general causes lag

    Describe the bug Usage of not yet loaded resources or some skills in general causes lag.

    To Reproduce Steps to reproduce the behavior:

    1. Start the game for a character.
    2. Use skill.
    3. Observe the game hanging for a second.

    Expected behavior The skill is cast.

    Screenshots

    Desktop (please complete the following information):

    • OS: Ubuntu LTS
    • Version: 20.04

    Additional context

  • golangci-lint: update config

    golangci-lint: update config

    hi there! there is a new golangci-lint version (v1.40.1) changes:

    • https://github.com/golangci/golangci-lint/issues/1973 was fixed
    • golint was deprecated by golang developers
  • HuffmanDecompress: use BitMuncher instead of BitStream

    HuffmanDecompress: use BitMuncher instead of BitStream

    Hi there, there was a question: what is a difference between d2datautils.BitMuncher and d2datautils.BitStream. I can't see any difference, so I merged them.

This project is designed to be an open source implementation for streaming desktop games using WebRTC
This project is designed to be an open source implementation for streaming desktop games using WebRTC

The aim of this project is develop a WebRTC screenshare designed for streaming video games and accepting remote inputs. There will be ansible instruct

Oct 6, 2022
Engo is an open-source 2D game engine written in Go.

Engo A cross-platform game engine written in Go following an interpretation of the Entity Component System paradigm. Engo is currently compilable for

Dec 26, 2022
Open source of the build infrastructure used by Stadia Games & Entertainment

SG&E Monorepo This repository contains the open sourcing of the infrastructure developed by Stadia Games & Entertainment (SG&E) to run its operations.

Dec 18, 2022
Blunder is an open-source UCI compatible chess engine.

A UCI compatible chess engine written in Golang

Dec 30, 2022
Go implementation of the A* search algorithm

go-astar A* pathfinding implementation for Go The A* pathfinding algorithm is a pathfinding algorithm noted for its performance and accuracy and is co

Dec 29, 2022
An implementation of the popular game Codenames created with Go and React.

OpenCodenames A real-time implementation of Codenames created with React/TypeScript and Golang. You can play the game here! Installation Stack: React

Aug 8, 2021
⛏ 🐹 Minecraft Protocol implementation in Go
⛏ 🐹 Minecraft Protocol implementation in Go

illustration by @talentlessguy Install Go 1.16.x is required to use this library go get github.com/BRA1L0R/go-mcproto Opening a connection client := m

Sep 20, 2022
A go implementation of Conway's game of life

go-life A go implementation of Conway's game of life. The program takes input from stdin. It's recommended to use it as cat input.txt | go-life with i

Oct 20, 2021
Go implementation of 2048 game

Go implementation of 2048 game

Oct 21, 2021
snake game implementation using 2d array in Go
snake game implementation using 2d array in Go

Snake Game Implementation Snake game implementation in Go using a 2-dimensional array. Demo Install download the package git clone https://github.com/

May 14, 2022
a Go implementation of the game of Briscola

BrisGolang BrisGolang is a Go implementation of the game of briscola using the WebSocket protocol for client/server communication. Usage You can play

Sep 15, 2022
Minecraft server implementation using Golang

Deepslate Deepslate is a Minecraft server implementation in Go. Deepslate if WIP and currently not available for installation Goals First implementati

Nov 19, 2021
Implementation of a popular graphics benchmark written on Ebiten.
Implementation of a popular graphics benchmark written on Ebiten.

Ebiten Bunny Mark This is an implementation of the popular graphics benchmark written on Ebiten. The initial benchmark was created by Ian Lobb (code)

Dec 7, 2022
An implementation of Conway's Game of Life.
An implementation of Conway's Game of Life.

Conway's Game of Life From Wikipedia, the free encyclopedia: The Game of Life, also known simply as Life, is a cellular automaton devised by the Briti

Mar 16, 2022
DND-magic-item-Generator - D&D magic item generator like in Diablo

DND-magic-item-Generator D&D magic item generator like in Diablo Legendary items

Mar 28, 2022
SigNoz helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc. 🔥 🖥. 👉 Open source Application Performance Monitoring (APM) & Observability tool
SigNoz helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc. 🔥 🖥.   👉  Open source Application Performance Monitoring (APM) & Observability tool

Monitor your applications and troubleshoot problems in your deployed applications, an open-source alternative to DataDog, New Relic, etc. Documentatio

Sep 24, 2021
An open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developersAn open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developers
An open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developersAn open-source, distributed, cloud-native CD (Continuous Delivery) product designed for developers

Developer-oriented Continuous Delivery Product ⁣ English | 简体中文 Table of Contents Zadig Table of Contents What is Zadig Quick start How to use? How to

Oct 19, 2021
Open-IM-Server is open source instant messaging Server.Backend in Go.
Open-IM-Server is open source instant messaging Server.Backend in Go.

Open-IM-Server Open-IM-Server: Open source Instant Messaging Server Instant messaging server. Backend in pure Golang, wire transport protocol is JSON

Jan 2, 2023
Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.
Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.

Connecting the Next Billion People Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core

Dec 31, 2022
Open-IM-Server is open source instant messaging Server.Backend in Go.
Open-IM-Server is open source instant messaging Server.Backend in Go.

Open-IM-Server is open source instant messaging Server.Backend in Go.

Dec 31, 2022