diff --git a/.golangci.yml b/.golangci.yml index bb4b23fa..f8d9e85d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,16 +18,22 @@ linters-settings: disabled-checks: gocyclo: min-complexity: 15 + gofmt: + simplify: true goimports: local-prefixes: github.com/OpenDiablo2/OpenDiablo2 golint: min-confidence: 0.8 govet: + enable-all: true check-shadowing: true + disable: + # While struct sizes could be smaller if fields aligned properly, that also leads + # to possibly non-intuitive layout of struct fields (harder to read). Disable + # `fieldalignment` check here until we evaluate if it is worthwhile. + - fieldalignment lll: line-length: 140 - maligned: - suggest-new: true misspell: locale: US @@ -57,9 +63,7 @@ linters: - gosimple - govet - ineffassign - - interfacer - lll - - maligned - misspell - nakedret - prealloc @@ -78,11 +82,19 @@ linters: run: timeout: 5m + tests: true skip-dirs: - .github - build - web issues: + exclude-rules: + - linters: + - funlen + # Disable 'funlen' linter for test functions. + # It's common for table-driven tests to be more than 60 characters long + source: "^func Test" + max-issues-per-linter: 0 max-same-issues: 0 exclude-use-default: false diff --git a/README.md b/README.md index 4e960e3c..32036b1f 100644 --- a/README.md +++ b/README.md @@ -1,113 +1,54 @@ # OpenDiablo2 -[![CircleCI](https://circleci.com/gh/OpenDiablo2/OpenDiablo2/tree/master.svg?style=svg)](https://circleci.com/gh/OpenDiablo2/OpenDiablo2/tree/master) +![CircleCI](https://img.shields.io/circleci/build/github/OpenDiablo2/OpenDiablo2/master) +[![Go Report Card](https://goreportcard.com/badge/github.com/OpenDiablo2/OpenDiablo2)](https://goreportcard.com/report/github.com/OpenDiablo2/OpenDiablo2) +[![GoDoc](https://pkg.go.dev/badge/github.com/OpenDiablo2/OpenDiablo2?utm_source=godoc)](https://pkg.go.dev/mod/github.com/OpenDiablo2/OpenDiablo2) +[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) +[![Discord](https://img.shields.io/discord/515518620034662421?label=Discord&style=social)](https://discord.gg/pRy8tdc) +[![Twitch Status](https://img.shields.io/twitch/status/essial?style=social)](https://www.twitch.tv/essial) +[![Subreddit subscribers](https://img.shields.io/reddit/subreddit-subscribers/OpenDiablo2?label=reddit&style=social)](https://www.reddit.com/r/OpenDiablo2/) + ![Logo](d2logo.png) -[Join us on Discord!](https://discord.gg/pRy8tdc)\ -[Development Live stream](https://www.twitch.tv/essial/)\ -[Support us on Patreon](https://www.patreon.com/bePatron?u=37261055) +[![Patreon](https://img.shields.io/badge/dynamic/json?color=%23e85b46&label=Support%20us%20on%20Patreon&query=data.attributes.patron_count&suffix=%20patrons&url=https://www.patreon.com/api/campaigns/4762180)](https://www.patreon.com/bePatron?u=37261055) -We are also working on a toolset:\ -\ -Please consider helping out with this project as well! +---- +[OpenDiablo2](https://opendiablo2.com/) is an ARPG game engine in the same vein of the 2000's games, and supports playing Diablo 2. -## About this project +The engine is written in Go and is cross platform. -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](https://us.shop.battle.net/en-us/product/diablo-ii) and its expansion [Lord of Destruction](https://us.shop.battle.net/en-us/product/diablo-ii-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. +> The project does not ship with the assets or content required to play Diablo 2. +You must have a legally purchased copy of [Diablo 2](https://us.shop.battle.net/en-us/product/diablo-ii) and its expansion [Lord of Destruction](https://us.shop.battle.net/en-us/product/diablo-ii-lord-of-destruction) installed on your computer in order to run that game on this engine. -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. +If you like to contribute to OpenDiablo2, please be so kind to read our [Contribution Policy](./docs/CONTRIBUTING.md) first. -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. +## Documentation -ALL OTHER TRADEMARKS ARE THE PROPERTY OF THEIR RESPECTIVE OWNERS. +_Stay awhile and listen_ ... -## Status +### ⚡ Project Info -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. +* 👉 **[Current Status](./docs/status.md)** 👈 - what you should focus on +* [Roadmap](./docs/roadmap.md) - Planning ahead +* Design - High-level overview of the OpenDiablo2 org and its projects +* FAQ - Common questions from new people to the project -Much work has been made in the background, but a lot of work still has to be done for the game to be playable. +### ⭐ For Users -Feel free to contribute! +* [Purchase](./docs/purchase.md) - Buy the official game from Blizzard +* [MPQ](./docs/mpq.md) - Locate the MPQ files +* [Install](./docs/install.md) - Install OpenDiablo2 to your system (Linux/Windows/MacOS) +* [Run it](./docs/play.md) - How to play the game -## Building +### 🔥 For Developers -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](https://golangci-lint.run/usage/install/). - -## 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](http://www.graphviz.org/download/) 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](https://user-images.githubusercontent.com/1004323/85792085-31816480-b733-11ea-867e-291946bfff83.png) - -## Roadmap - -There is an in-progress [project roadmap](https://docs.google.com/document/d/156sWiuk-XBfomVxZ3MD-ijxnwM1X66KTHo2AcWIy8bE/edit?usp=sharing), -which will be updated over time with new requirements. +* [Building](./docs/building.md) - Instructions for building the project +* [Development](./docs/development.md) - Instructions for developers who want to contribute +* [Profiling](./docs/profiling.md) - Debug performance issues +* [Debugging](./docs/debug.md) - Common errors and pitfalls ## Screenshots @@ -131,3 +72,11 @@ which will be updated over time with new requirements. * Paul SIRAMY (http://paul.siramy.free.fr/\_divers/dt1\_doc/) * Other Specifications and general info * Various users on [Phrozen Keep](https://d2mods.info/home.php) + +## Legal Notice + +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. diff --git a/d2common/d2datautils/stream_reader.go b/d2common/d2datautils/stream_reader.go index 6244e0e2..619ab2c0 100644 --- a/d2common/d2datautils/stream_reader.go +++ b/d2common/d2datautils/stream_reader.go @@ -85,7 +85,6 @@ func (v *StreamReader) ReadUInt64() (uint64, error) { return 0, err } - return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56, err } diff --git a/d2common/d2fileformats/d2dat/dat_palette.go b/d2common/d2fileformats/d2dat/dat_palette.go index ee669a79..120b444f 100644 --- a/d2common/d2fileformats/d2dat/dat_palette.go +++ b/d2common/d2fileformats/d2dat/dat_palette.go @@ -15,6 +15,16 @@ type DATPalette struct { colors [numColors]d2interface.Color } +// New creates a new dat palette +func New() *DATPalette { + result := &DATPalette{} + for i := range result.colors { + result.colors[i] = &DATColor{} + } + + return result +} + // NumColors returns the number of colors in the palette func (p *DATPalette) NumColors() int { return len(p.colors) diff --git a/d2common/d2fileformats/d2font/d2fontglyph/font_glyph.go b/d2common/d2fileformats/d2font/d2fontglyph/font_glyph.go index 11eda03e..c98d3d2f 100644 --- a/d2common/d2fileformats/d2font/d2fontglyph/font_glyph.go +++ b/d2common/d2fileformats/d2font/d2fontglyph/font_glyph.go @@ -6,12 +6,9 @@ func Create(frame, width, height int) *FontGlyph { // nolint:gomnd // thes bytes are constant // comes from https://d2mods.info/forum/viewtopic.php?t=42044 result := &FontGlyph{ - unknown1: []byte{0}, - unknown2: []byte{1, 0, 0}, - unknown3: []byte{0, 0, 0, 0}, - frame: frame, - width: width, - height: height, + frame: frame, + width: width, + height: height, } return result @@ -19,12 +16,9 @@ func Create(frame, width, height int) *FontGlyph { // FontGlyph represents a single font glyph type FontGlyph struct { - unknown1 []byte - unknown2 []byte - unknown3 []byte - frame int - width int - height int + frame int + width int + height int } // SetSize sets glyph's size to w, h @@ -59,15 +53,15 @@ func (fg *FontGlyph) FrameIndex() int { // Unknown1 returns unknowns bytes func (fg *FontGlyph) Unknown1() []byte { - return fg.unknown1 + return []byte{0} } // Unknown2 returns unknowns bytes func (fg *FontGlyph) Unknown2() []byte { - return fg.unknown2 + return []byte{1, 0, 0} } // Unknown3 returns unknowns bytes func (fg *FontGlyph) Unknown3() []byte { - return fg.unknown3 + return []byte{0, 0, 0, 0} } diff --git a/d2common/d2fileformats/d2font/font.go b/d2common/d2fileformats/d2font/font.go index 7ffd6032..84b1a5c1 100644 --- a/d2common/d2fileformats/d2font/font.go +++ b/d2common/d2fileformats/d2font/font.go @@ -27,11 +27,10 @@ const ( // Font represents a displayable font type Font struct { - unknownHeaderBytes []byte - sheet d2interface.Animation - table []byte - Glyphs map[rune]*d2fontglyph.FontGlyph - color color.Color + sheet d2interface.Animation + table []byte + Glyphs map[rune]*d2fontglyph.FontGlyph + color color.Color } // Load loads a new font from byte slice @@ -52,10 +51,7 @@ func Load(data []byte) (*Font, error) { color: color.White, } - font.unknownHeaderBytes, err = sr.ReadBytes(unknownHeaderBytesCount) - if err != nil { - return nil, err - } + sr.SkipBytes(unknownHeaderBytesCount) err = font.initGlyphs(sr) if err != nil { @@ -149,10 +145,11 @@ func (f *Font) RenderText(text string, target d2interface.Surface) error { func (f *Font) initGlyphs(sr *d2datautils.StreamReader) error { glyphs := make(map[rune]*d2fontglyph.FontGlyph) - for i := numHeaderBytes; i < len(f.table); i += bytesPerGlyph { + // for i := numHeaderBytes; i < len(f.table); i += bytesPerGlyph { + for i := numHeaderBytes; true; i += bytesPerGlyph { code, err := sr.ReadUInt16() if err != nil { - return err + break } // byte of 0 @@ -194,7 +191,13 @@ func (f *Font) Marshal() []byte { sw := d2datautils.CreateStreamWriter() sw.PushBytes([]byte("Woo!\x01")...) - sw.PushBytes(f.unknownHeaderBytes...) + + // unknown header bytes - constant + sw.PushBytes([]byte{1, 0, 0, 0, 0, 1}...) + + // Expected Height of character cell and Expected Width of character cell + // not used in decoder + sw.PushBytes([]byte{0, 0}...) for c, i := range f.Glyphs { sw.PushUint16(uint16(c)) diff --git a/d2common/d2fileformats/d2mpq/mpq.go b/d2common/d2fileformats/d2mpq/mpq.go index 2e191b4f..910a7394 100644 --- a/d2common/d2fileformats/d2mpq/mpq.go +++ b/d2common/d2fileformats/d2mpq/mpq.go @@ -4,6 +4,7 @@ import ( "bufio" "errors" "fmt" + "io/fs" "io/ioutil" "os" "path/filepath" @@ -181,24 +182,26 @@ func (mpq *MPQ) Size() uint32 { func openIgnoreCase(mpqPath string) (*os.File, error) { // First see if file exists with specified case mpqFile, err := os.Open(mpqPath) //nolint:gosec // Will fix later - if err == nil { - return mpqFile, err - } - - mpqName := filepath.Base(mpqPath) - mpqDir := filepath.Dir(mpqPath) - - files, err := ioutil.ReadDir(mpqDir) if err != nil { - return nil, err - } + mpqName := filepath.Base(mpqPath) + mpqDir := filepath.Dir(mpqPath) - for _, file := range files { - if strings.EqualFold(file.Name(), mpqName) { - mpqName = file.Name() - break + var files []fs.FileInfo + files, err = ioutil.ReadDir(mpqDir) + + if err != nil { + return nil, err } + + for _, file := range files { + if strings.EqualFold(file.Name(), mpqName) { + mpqName = file.Name() + break + } + } + + return os.Open(filepath.Join(mpqDir, mpqName)) //nolint:gosec // Will fix later } - return os.Open(filepath.Join(mpqDir, mpqName)) //nolint:gosec // Will fix later + return mpqFile, err } diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 00000000..3304c0dc --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,11 @@ +## 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](https://golangci-lint.run/usage/install/). diff --git a/docs/building.md b/docs/building.md new file mode 100644 index 00000000..2364af98 --- /dev/null +++ b/docs/building.md @@ -0,0 +1,20 @@ +## 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. + +### Windows + +### MacOS diff --git a/docs/buydiablo.png b/docs/buydiablo.png new file mode 100644 index 00000000..2c8a2a44 Binary files /dev/null and b/docs/buydiablo.png differ diff --git a/docs/cdkey.png b/docs/cdkey.png new file mode 100644 index 00000000..191d20e4 Binary files /dev/null and b/docs/cdkey.png differ diff --git a/docs/cdkey2.png b/docs/cdkey2.png new file mode 100644 index 00000000..afbc3def Binary files /dev/null and b/docs/cdkey2.png differ diff --git a/docs/debug.md b/docs/debug.md new file mode 100644 index 00000000..688d5473 --- /dev/null +++ b/docs/debug.md @@ -0,0 +1,7 @@ +## 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](https://user-images.githubusercontent.com/1004323/85792085-31816480-b733-11ea-867e-291946bfff83.png) diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 00000000..5739588e --- /dev/null +++ b/docs/development.md @@ -0,0 +1,15 @@ +## 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. + +We use `golangci-lint` to catch lint errors, and we require all contributors to install and use it. +As of Oct. 26, 2020 we will no longer be accepting pull requests that introduce lint errors. +Installation instructions can be found [here](https://golangci-lint.run/usage/install/). diff --git a/docs/download.png b/docs/download.png new file mode 100644 index 00000000..54dc1f85 Binary files /dev/null and b/docs/download.png differ diff --git a/docs/expectederror.png b/docs/expectederror.png new file mode 100644 index 00000000..22e36646 Binary files /dev/null and b/docs/expectederror.png differ diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 00000000..47b92064 --- /dev/null +++ b/docs/install.md @@ -0,0 +1,53 @@ +# Install OpenDiablo2 + +We currently provide binaries only for [Patreon supporters](https://www.patreon.com/bePatron?u=37261055) to [download and auto-update](https://www.patreon.com/posts/thanks-for-38407582). +If you are not one of those, you need to follow the developer documentation for building the project using Go. + +Once you have an executable/binary of OpenDiablo2 (either provided via Patreon or building your own), then just launch it. + +### Error? It's expected! + +In case there is an error, it's most likely related to MPQ files. +You need to modify `config.json`. + +Run the binary once; it should let your know where the location of this file is. +For example: + +![Error is expected](./expectederror.png) + +In this specific case (MacOS) the file is located at: `~/Library/Application\ Support/OpenDiablo2/config.json` + +Make sure the file looks like this: + +```json +{ + "MpqLoadOrder": [ + "patch_d2.mpq", + "d2exp.mpq", + "d2xmusic.mpq", + "d2xtalk.mpq", + "d2xvideo.mpq", + "d2data.mpq", + "d2char.mpq", + "d2music.mpq", + "d2sfx.mpq", + "d2video.mpq", + "d2speech.mpq" + ], + "MpqPath": "/Applications/Diablo II/", + "TicksPerSecond": -1, + "FpsCap": 0, + "SfxVolume": 1, + "BgmVolume": 0.3, + "FullScreen": false, + "RunInBackground": true, + "VsyncEnabled": true, + "Backend": "Ebiten" +} +``` + +Pay attention to the `MpqPath` directory (you can also change this to whatever location your like). +Now copy-and-paste the MPQ files from you Windows PC into that directory. +Make sure the filenames are matching the ones from `config.json`, + +Now, launch OpenDiablo2 again and this time it should work! diff --git a/docs/installer.png b/docs/installer.png new file mode 100644 index 00000000..36c6d744 Binary files /dev/null and b/docs/installer.png differ diff --git a/docs/installpath.png b/docs/installpath.png new file mode 100644 index 00000000..71b3a330 Binary files /dev/null and b/docs/installpath.png differ diff --git a/docs/lod.png b/docs/lod.png new file mode 100644 index 00000000..bed621f9 Binary files /dev/null and b/docs/lod.png differ diff --git a/docs/mpq.md b/docs/mpq.md new file mode 100644 index 00000000..a81b6611 --- /dev/null +++ b/docs/mpq.md @@ -0,0 +1,8 @@ +# Locate MPQ files + +The MPQ files should be present at your Diablo II installation directory. +The default directory is `C:\Program FIles(x86)\Diablo II` + +![MPQ Directory](./mpqdir.png) + +Once again make sure the you have the `1.14b` version of the game. diff --git a/docs/mpqdir.png b/docs/mpqdir.png new file mode 100644 index 00000000..846be4e4 Binary files /dev/null and b/docs/mpqdir.png differ diff --git a/docs/play.md b/docs/play.md new file mode 100644 index 00000000..ba110aa5 --- /dev/null +++ b/docs/play.md @@ -0,0 +1,5 @@ +## 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. diff --git a/docs/profiling.md b/docs/profiling.md new file mode 100644 index 00000000..31d99f75 --- /dev/null +++ b/docs/profiling.md @@ -0,0 +1,16 @@ +## Profiling + +There are many profiler options to debug performance issues. +These can be enabled by supplying 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` + +In game 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](http://www.graphviz.org/download/) in order to convert the profiler output. diff --git a/docs/purchase.md b/docs/purchase.md new file mode 100644 index 00000000..6adfc9ef --- /dev/null +++ b/docs/purchase.md @@ -0,0 +1,46 @@ +# Purchase the official game + +1. Buy [Diablo II (2000)](https://eu.shop.battle.net/en-gb/product/diablo-ii). + +![Buy Diablo](./buydiablo.png) + +2. Write down your CD-Key and start downloading the game. + +![Get your CD-Key](./cdkey.png) + +3. The Blizzard Downloader works only with Windows. Find a Windows PC and download the game. + +![Download Diablo 2](./download.png) + +4. Save the installer setup executable somewhere temporarily in your disk (e.g. `C:/Diablo II`) and wait until the download is complete. + +![Wait](./wait.png) + +5. When the download is finished the setup will automatically start Diablo II Installer. + +![Install Diablo II](./installer.png) + +6. Begin the installation! Right after accepting the license, it will ask you to insert a name and copy-paste your CD-Key (from step 2). + In case you forgot to save it, there should be already an e-mail at your inbox about it. + +![Paste your CD-Key](./cdkey2.png) + +7. Select a directory to install the game. + Ideally, use the default location: `C:\Program FIles(x86)\Diablo II`. + +![Select installation directory](./installpath.png) + +8. Run the game. + If you are using `Windows 10` you will get a message prompt saying `Run the program without getting help`. + Next, click `Don't show this message again` to avoid future noise. + +9. After the game launches make sure the version is **1.14b**. + + +### Repeat the exact process for Diablo II: Lord of Destruction + +11. Buy [Diablo II: Lord of Destruction (2001)](https://eu.shop.battle.net/en-gb/product/diablo-ii-lord-of-destruction). + +![Buy Lord of Destruction](./lod.png) + +12. Repeat the steps **from 2 to 9** for Diablo II: Lord of Destruction. diff --git a/docs/roadmap.md b/docs/roadmap.md new file mode 100644 index 00000000..c2bbc381 --- /dev/null +++ b/docs/roadmap.md @@ -0,0 +1,3 @@ +## Roadmap + +There is an in-progress [project roadmap](https://docs.google.com/document/d/156sWiuk-XBfomVxZ3MD-ijxnwM1X66KTHo2AcWIy8bE/edit?usp=sharing), which will be updated over time with new requirements. diff --git a/docs/status.md b/docs/status.md new file mode 100644 index 00000000..afb2bdae --- /dev/null +++ b/docs/status.md @@ -0,0 +1,10 @@ +## Status + +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. + +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! diff --git a/docs/wait.png b/docs/wait.png new file mode 100644 index 00000000..d27459bd Binary files /dev/null and b/docs/wait.png differ diff --git a/go.mod b/go.mod index 5e44d96e..6b712405 100644 --- a/go.mod +++ b/go.mod @@ -1,21 +1,21 @@ module github.com/OpenDiablo2/OpenDiablo2 -go 1.14 +go 1.16 require ( github.com/JoshVarga/blast v0.0.0-20180421040937-681c804fb9f0 - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d + github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-restruct/restruct v1.2.0-alpha github.com/google/uuid v1.1.2 github.com/gravestench/akara v0.0.0-20201014060234-a64208a7fd3c github.com/hajimehoshi/ebiten/v2 v2.0.2 + github.com/kr/text v0.2.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.5.0 github.com/robertkrimen/otto v0.0.0-20200922221731-ef014fd054ac - github.com/stretchr/testify v1.4.0 + github.com/stretchr/testify v1.7.0 golang.org/x/exp v0.0.0-20201008143054-e3b2a7f2fdc7 // indirect golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 - golang.org/x/sys v0.0.0-20201028215240-c5abc1b1d397 // indirect + golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect gopkg.in/sourcemap.v1 v1.0.5 // indirect ) diff --git a/go.sum b/go.sum index 305000e3..3498efb3 100644 --- a/go.sum +++ b/go.sum @@ -2,12 +2,11 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/JoshVarga/blast v0.0.0-20180421040937-681c804fb9f0 h1:tDnuU0igiBiQFjsvq1Bi7DpoUjqI76VVvW045vpeFeM= github.com/JoshVarga/blast v0.0.0-20180421040937-681c804fb9f0/go.mod h1:h/5OEGj4G+fpYxluLjSMZbFY011ZxAntO98nCl8mrCs= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2 h1:Ac1OEHHkbAZ6EUnJahF0GKcU0FjPc/V8F1DvjhKngFE= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -33,6 +32,8 @@ github.com/jfreymuth/vorbis v1.0.0/go.mod h1:8zy3lUAm9K/rJJk223RKy6vjCZTWC61NA2Q github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= @@ -49,6 +50,8 @@ github.com/robertkrimen/otto v0.0.0-20200922221731-ef014fd054ac/go.mod h1:xvqspo github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -88,8 +91,8 @@ golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 h1:bNEHhJCnrwMKNMmOx3yAynp5vs5/gRy+XWFtZFu7NBM= golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201028215240-c5abc1b1d397 h1:YZ169h3kkKEXsueizzMwOT9AaiffbOa6oXSmUFJ4vxM= -golang.org/x/sys v0.0.0-20201028215240-c5abc1b1d397/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -106,3 +109,5 @@ gopkg.in/sourcemap.v1 v1.0.5 h1:inv58fC9f9J3TK2Y2R1NPntXEn3/wjWHkonhIUODNTI= gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=