Merge pull request #1102 from drpaneas/readme

Redesign the readme
This commit is contained in:
Tim Sarbin 2021-03-26 18:21:24 -04:00 committed by GitHub
commit 26c6dde74d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 235 additions and 93 deletions

133
README.md
View File

@ -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:\
<https://github.com/OpenDiablo2/HellSpawner>\
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 <kbd>Ctrl+,</kbd>, 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.

View File

@ -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
}

11
docs/CONTRIBUTING.md Normal file
View File

@ -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/).

20
docs/building.md Normal file
View File

@ -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

BIN
docs/buydiablo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
docs/cdkey.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
docs/cdkey2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

7
docs/debug.md Normal file
View File

@ -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)

15
docs/development.md Normal file
View File

@ -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 <kbd>Ctrl+,</kbd>, 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/).

BIN
docs/download.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
docs/expectederror.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

53
docs/install.md Normal file
View File

@ -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!

BIN
docs/installer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
docs/installpath.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
docs/lod.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

8
docs/mpq.md Normal file
View File

@ -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.

BIN
docs/mpqdir.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

5
docs/play.md Normal file
View File

@ -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.

16
docs/profiling.md Normal file
View File

@ -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.

46
docs/purchase.md Normal file
View File

@ -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.

3
docs/roadmap.md Normal file
View File

@ -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.

10
docs/status.md Normal file
View File

@ -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!

BIN
docs/wait.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB