Giter Club home page Giter Club logo

devilution's Introduction

Build Status Build Status Build status Downloads github stars

Discord Channel Discord Chat Channel

Devilution

Diablo devolved - magic behind the 1996 computer game

Note, Devilution requires an original copy of diabdat.mpq. None of the Diablo 1 game assets are provided by this project. To get a legitimate copy of the game assets, please refer to the GoG release of Diablo 1.

Introduction

While most titles from Blizzard receive years of love and support, Diablo stayed in the shadows. Abandoned in favor of a sequel, it remained full of bugs and unfinished potential. The game was last patched in 2001 before being discontinued altogether, a problem I wanted to fix. I played Diablo extensively as a teenager, but as time passed it became difficult to run the game on newer hardware. The lack of many improvements made in Diablo II also laid it to rest. At first the game appeared to be a lost cause, but thankfully a little oversight in 1997 made it not so.

Diablo's development team moved on to Diablo II while passing the source code down to Synergistic Software for Hellfire. Less known however is that it was also given to Climax Studios to create a PlayStation port. Now Sony has long been known for letting things slide; especially in Japan. Anything from leaking prototypes to entire game source codes and Diablo was no exception. Symbolic information was accidentally left on the Japanese port. Normally used for debugging, a symbol file contains a map of everything generated during compile time. This includes file names, functions, structures, variables, and more! To top it all off a special build is hidden on the PC release in DIABDAT.MPQ -> D1221A.MPQ -> DIABLO.EXE! This build contains debug tools and assert strings further giving away code information.

After months of piecing these mistakes together, Devilution was born. I present to you a reconstructed form of Diablo's original source code! Once more shall the heroes of Sanctuary return to the depths below!

Purpose

Having the source code makes Diablo much easier to update and maintain. For years mod-makers had to rely on tedious code editing and memory injection. A few even went further and reversed most or all of the game. The problem is that they rarely shared their work. Usually being a one-person job, they move on with their lives due to the amount of time required or lack of interest. This brings us back to square one having to do countless hours of work all over again. Devilution aims to fix this by finally making the source code open to the community.

In order to ensure that everything is preserved, Devilution keeps everything as it was originally designed. This goes as far as bugs and badly written code in the original game. With that it serves as a base for developers to work with making it much easier than before to update, fix, and port the game to other platforms.

As a side goal Devilution tries to document the unused and cut content from the final game. Development of Diablo was rushed near the end--many ideas were scrapped and multiplayer was quickly hacked in. By examining the source, we can see various quirks of planned development.

Compiling

Diablo was developed on Windows 95 using Visual C++ 4.20 and later 5.10 and 6 for newer patches. Devilution aims to be compatible with both the original and modern tools, but will adhere to standards used for the original compiler.

Building with Visual C++ 6

  • Open the project workspace Diablo.dsw, choose Debug or Release, and then Build Diablo.exe.

To build a binary with functions compiled as close as possible to the original, use Visual C++ 6 with Service Pack 5 and the Processor Pack (important for proper code generation!) You will also need Visual C++ 5 with Service Pack 3, since the original binary was linked with the older linker from that. Sadly, you cannot use the old linker right out of VC6, so you'll need to link manually or via the MakefileVC in the project root.

Building with Visual Studio 2010-2017

  • Open the project solution Diablo.sln, choose Debug or Release, and then Build Solution.

Make sure to disable Data Execution Prevention. Storm.dll uses dynamic compilation to improve rendering performance but fails to mark the resulting memory page as executable, leading to a protection fault when trying to draw.

  • Configuration options -> Linker -> Advanced -> Data Execution Prevention (DEP).
  • Set this value to: No (/NXCOMPAT: NO).

You will also need the following dependencies installed if you are using Visual Studio 2017. Make sure to enable these when installing (or modify your installation):

  • Requires "Windows 8.1 SDK" (Target Platform)
  • Requires "Visual C++ MFC for x86 and x64" (For afxres.h)
  • Requires "Windows Universal CRT SDK" (For ctype.h)

Building with MinGW

  • Execute make MINGW32=1 for MinGW32 or make for MinGW64. Optionally add debug to build with debug features.

To compile with MinGW64 on different platforms, refer to the respective documentation: Linux | Windows | Mac.

Debug Build Features | Compatibility Matrix | Troubleshooting

Installing

Once compiled, the Devilution binary will serve as a replacement for Diablo.exe. The following files from the original game patched to 1.09(b) need to be present: DIABDAT.MPQ, DiabloUI.dll, SmackW32.dll, Standard.snp, and Storm.dll. If COPYPROT was defined when compiling, the Diablo CD will also be required.

Additionally, Strange Bytes' DirectDraw patch is recommended to help fix compatibility issues and run the game in windowed mode.

Multiplayer

Devilution is functional over both GoG's Battle.net server and IPX using an ipx-wrapper. Additionally if Standard.snp from StarCraft 1.16.1 is used, local UDP play also becomes available. There are programs like ZeroTier to connect UDP globally.

Contributing

Guidelines

Modding

Below are a few examples of some simple improvements made to the game. It is planned in the future to create tools for designing dungeons and graphics.

Example 1: Monster lifebar and item highlighting

Monster lifebar+items

Example 2: New Diablo 2-like trade screen

New trade screen

F.A.Q.

Click to reveal

Wow, does this mean I can download and play Diablo for free now?

No, you'll need access to the data from the original game. If you don't have an original CD then you can buy Diablo from GoG.com. Alternatively you can also use spawn.mpq from the http://ftp.blizzard.com/pub/demos/diablosw.exe version and compile the with the SPAWN flag defined.

Cool, so I fired your mod up, but there's no 1080p or new features?

Devilution aims to keep the original code unaltered, for documentation purposes.

So will you ever add cross-platform support or new features in the future?

Yes! This has been done as a side project, please see DevilutionX.

What about Hellfire?

Hellfire was a bit of a flop on the developer's part. Support may come in the future once the base game is finished.

I think that's about all, but is Devilution even legal?

That's a tricky question. Under the DMCA, reverse-engineering has exceptions for the purpose of documentation and interoperability. Devilution provides the necessary documentation needed to achieve the latter. However, it falls into an entirely gray area. The real question is whether or not Blizzard deems it necessary to take action.

Credits

  • Reverse engineered by GalaXyHaXz in 2018
  • sanctuary - extensively documenting Diablo's game engine
  • BWAPI Team - providing library API to work with Storm
  • Ladislav Zezula - reversing PKWARE library, further documenting Storm
  • fearedbliss - being awe-inspiring
  • Diablodin - providing additional info about the PSX release
  • Climax Studios & Sony - secretly helping with their undercover QA :P
  • Blizzard North - wait, this was a typo!
  • Depression - reason to waste four months of my life doing this ;)

And a special thanks to all the support and people who work on this project to make it possible! <3

Changelog

From the beginning until release

Legal

Devilution is made publicly available and released under the Sustainable Use License (see LICENSE)

The source code in this repository is for non-commerical use only. If you use the source code you may not charge others for access to it or any derivative work thereof.

Battle.net(R) - Copyright (C) 1996 Blizzard Entertainment, Inc. All rights reserved. Battle.net and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries.

Diablo(R) - Copyright (C) 1996 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.

Devilution and any of its' maintainers are in no way associated with or endorsed by Blizzard Entertainment(R).

devilution's People

Contributors

7i avatar ajenbo avatar aperturesecurity avatar bloom7ech avatar boristhebrave avatar falquinho avatar fearedbliss avatar galaxyhaxz avatar glebm avatar heinermann avatar jimmy-cell avatar joankaradimov avatar justanotherguid avatar manuel-k avatar maxdesiatov avatar mewmew avatar mmaret avatar nomdenom avatar pancirno avatar predelnik avatar qndel avatar saibamen avatar sergi4ua avatar seritools avatar serpen avatar sourcecodedeleted avatar squidcc avatar stephencwills avatar sunverwerth avatar ttdonovan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

devilution's Issues

Ubuntu 18.04 build

Hi,

i was able to successfully build and run the devilution.exe with the following commands under Ubuntu 16.04.

sudo apt update
sudo apt upgrade
sudo apt install git build-essential g++-mingw-w64-i686
git clone https://github.com/diasurgical/devilution.git
cp Storm.dll devilution/
cp diabloui.dll devilution/
cd devilution
make

With a freshly installed Ubuntu 18.04 and the same steps from above running the exe under windows is not possible any more as diablo crashes with the following error.log:

------------------------------------------------------
PROGRAM VERSION: 1.0.9.2
COMPUTER NAME: ...
TIME: 06/29/18 19:55:13
INFO: 

Exception code: C0000005 ACCESS_VIOLATION
Fault address:	00B80AAC 00:00000000 *unknown*

Registers:
EAX:00B80FAD
EBX:00B80AAC
ECX:00000000
EDX:000001E0
ESI:00000000
EDI:0D145020
CS:EIP:0023:00B80AAC
SS:ESP:002B:0099F7A0 EBP:0099F860
DS:002B ES:002B FS:0053 GS:002B
Flags:00210216
Call stack:
Address  Frame    Logical addr  Module
00B80AAC 0099F860 0000:00000000 *unknown*

Stack bytes:

Code bytes:
0x00000010: 10 10 10 10  10 10 10 10  10 10 10 10  10 10 10 10  ................

you can find my make terminal output here:
https://gist.github.com/ChaosMarc/9aa8539b754b1fb900dc28a42d9a254d

I think the problem lies in the updated g++-mingw-w64-i686 package and it's dependencies (from 5.3.1-8ubuntu3+17 to 7.3.0-11ubuntu1+20.2build1) but I have no idea how to fix it

Game crashed with memory exhaustion message

While I was playing the game for about 1h 40m, the game only crashed once early one with a memory exhaustion message (I have 16 GB of RAM and the Game was running while memory was at 4 GB load so this isn't the real issue).

"The application has encountered a critical error"
"Not enough memory resources are available to process this command".

Screenshot:
https://imgur.com/SVba19m

Cross-platform support?

I noticed that devilution can be compiled in Linux to run it using wine, but I was wondering if there is any plans to have a native binary for other platforms like Linux or OSX.

Include file dsound.h not found

Hello,

I'm attempting to compile the code in order to get a better understanding of some of the mechanics in the game (how certain data structures are handled etc.). I attempted to compile in Visual C++ 2008 Express, and get the error fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory

Dependencies for Fedora 28

[artur@p50 devilution]$ git diff origin/master
diff --git a/Support/INSTALL_linux.md b/Support/INSTALL_linux.md
index 5add5c2..34ea1e6 100644
--- a/Support/INSTALL_linux.md
+++ b/Support/INSTALL_linux.md
@@ -7,6 +7,11 @@ Arch Linux:
pacman -Sy mingw-w64-gcc mingw-w64-binutils


+Fedora 28:
+```bash
+sudo dnf install mingw32-gcc-c++ wine
+```
+
## Building

```bash

Multiple King leoric bug

I was doing the Skeleton King quest and apparently every time I hit the SK (Or maybe just being in combat with him (him moving)), caused him to duplicate himself and murder me. I have video evidence of this! -_-. @galaxyhaxz says that with his build using his compiler, he doesn't have this bug. I'm using MSYS2/MinGW32 with GCC 7.3.0 to compile it. Other people could try and repro this bug as well.

One thing that may help is that I noticed there was only 1 SK that had the name in Gold with the immunities stats, but all of the other duplicate SK just had a white name that said "Skeleton King", as if they were a normal monster.

Video (Skip to 1:00):
https://youtu.be/zyntA39H-ao

Screenshot:
https://imgur.com/bQsNSAk

directx dependency

In the prerequesites and compile instructions is nowhere mentioniond which directX version should be used or where can the headers obtainedat best.

MinGW seems to contain some dx headers but its dx9 and does not contain things like ddraw.h or dsound.h

Please add some advice and maybe consider to include dependencies to the procject.

Can't compile on Ubuntu 16.04 (and 18.04)

Thanks for the great job.

I installed mingw-w64: sudo apt install mingw-w64 (all deps installed automaticly). Then I created symlink to windres: sudo ln -s /usr/bin/x86_64-w64-mingw32-windres /usr/bin/windres. Now I have a compile error: Diablo.rc:10:10: fatal error: afxres.h: file or dir not found. I founded afxres.h under: /usr/i686-w64-mingw32/include/afxres.h. It seems, that compiler don't see include directory from mingw. What should I do? Thanks :)

To: Banaboy

Stating a simple fact about Diablo is not being a jerk.

to @galaxyhaxz That's not true, check this:
https://us.battle.net/forums/en/d3/topic/20759237493

You can still access and play on the battle.net servers. That means the game is not discontinued. You posted a source of just a random forum support tech agent. That's not proof that the game is discontinued.

In any event, please don't lock the discussion thread. Thank you

(question) Reverse Engineering and DWARF Information

I've a binary file that comes with DWARF information and the RE code is almost fully compilable but it's an ELF32 file, I'm wondering if the odds to achieve something like this is possible having DWARF information and source file names ?

I'm using IDA 7.0 + HexRays to do this.

Document Diablo's bugs

Currently documented bugs: The DSF Buglist for Diablo v1.09 (Lurker Lounge)

The goal of this issue is to document any new bugs we come across while examining the code that are native to the original game. This will help us fix them later on when we make mods/ports.

New bugs discovered (last update 06/24/18)

  • When casting a town portal in a quest level, leaving, and then going down into the dungon, the town portal will be placed in the dungeon. For example, Chamber of Bone is quest level 2, so the portal would appear on dungeon level 2 at the same X/Y coordinate.
  • Diablo is supposed to be immune to the squelch radius, however, the game checks the AI for Diablo's monster type, thus always failing. monster.cpp -> ProcessMonsters

Add inlining to world.cpp

For anyone who examined the source in depth, you've probably seen this file and how hideous it is. It's not as complex as it looks though. World.cpp is responsible for rendering blocks of level CEL files. There are 6 different types of 32x32 CELs. The code rendering these types is repeated in each function. The reason was to optimize the code for speed, since it is responsible for constantly redrawing the game.

The idea here is to have an inlined function written for each 32x32 pattern. We can then use them to change those 2000-line functions into 200-line functions. The cel types are layed out below. 8 is added to the cel type if not lit.
cel garbage
(Courtesy of @mewmew for documenting this in Djavul)

Battle.snp

Would you reconsider implementing Battle.snp so that devilution can support multiplayer via servers? The bnet protocol is already documented at BNETDocs.

Visual Studio 2017

I got the workspace to compile successfuly under VS2017 community using the Windows 10 SDK.
However upon starting the game, it crashes in snd_play_snd.
The call stack seems to be corrupted, however.

Call graph up until crash is:
Winmain -> play_movie -> SVidPlayBegin

Commenting out the videos just makes it crash later in UiTitleDialog.

Do you think it's even possible to make Diablo.exe work with this modern toolchain without recompiling diabloui.dll and storm.dll as well?

Thanks for the great work!

Add building check.

I guess it could be useful to add travis for checking at least compiling of the project.

Crash at EnterCriticalSection

First off great work. I might actually manage to contribute to a D1 project one of these days.

So I managed to compile and link the project. The first time I run it it crashes on startup (probably not that unexpected). I pull out the debugger and find its crashing engine.cpp line 1950. I put in some break points and find that InitializeCriticalSection is not being run for some reason. The struct at engine.cpp:1915 looks like a valid way of initializing the mutex to me, but for whatever reason isn't being run in my setup.

I moved the initialization function out of the struct and call it from start of WinMain. (Note there is already a proto for the function in engine.h). The game now starts. I start a new single player game, and another crash. This time another EnterCriticalSection but in dx.cpp. Same issue. For now I'm going to consolidate all the pre-main init functions, but do you guys have any insight on why this might be? Could it be being optimized out?

Im using Win7, Msys i686-w64-mingw32 (5.3.0 Rev2) to compile.

Reverse Diablo UI

Hello! I have a moderate experience in disassembling DOS games and I want to help with the subj. How can I help?

Secret Cow Level

Any signs of the famous secret cow level?
Any intentions adding one?

Tools for decompiling

hi,
firstable, thanks for sharing this awesome job, its incredible, im a fan of diablo since it was created.

Im doing a similar job with the game Death Rally (https://github.com/dreerally). At this moment I know most file types and menus can be playable, but understand the decompiled exe is a hard task.

What tools do you use to this great job? I use ida7.0+ hex rays for decompiling and debugging.

Thanks for all.

Branch structure for feature improvements / bugfix?

I'm wondering if it is worth standardizing a set of branches that can maintain the original code vs feature improvement/bugfix?

For example moving to OpenGL and improving the lighting, or adding more modern texture AA, etc might be features that are best kept separate from the original code.

Support for accented characters

One of the benefits of devilution for me is that it will be way easier to translate the game to other languages (particularly latin ones such as spanish, french and portuguese) - no more of the hex editing brave translators had to deal with before.

But, well, there was and there is still a problem with some special characters. They don't show up properly.

This may not sound high priority but it doesn't look very hard - I just don't know the right "button" to press and solve it all. It's important to me as a brazilian fan of Diablo and author of a Diablo 2 translation to portuguese, so I'm willing to work hard on this (I've been already), I just need a little guidance.

Here's some of what I have so far:

  • The font files for Diablo 1 (inside the game's .mpq) have 256 slots and do contain the special characters I need, and in a sequence that matches the UTF-8 encoding.
  • However, typing those characters in the game strings from the source code results in "unaccented" versions in-game. For instance, "Coração" becomes "Coracao" (I have to change the encoding of the files with accented characters to ISO-8859-1 for this to happen, otherwise the accented characters are transformed into some weird two-character thing, which is also "simplified" in-game, such as in tis real example: "Ancião" becoming "Ancião" and being shown "AnciAUo" in-game).
  • With all that said, I'm led to believe that somewhere in the process there's something purposefully "simplifying" the characters (maybe doing things like this one: https://stackoverflow.com/questions/4015879/removing-diacritic-symbols-from-utf8-string-in-c ). I suspect that this is happening either on the extremely confusing functions PrintUString and CPrintString, the .bin files for the Diablo font inside the .mpq (hex editing them didn't reveal me anything), or somewhere else entirely (like something in the compiling step).

Anyway, I would be very glad if any of the contributors could help me a little bit. Specially with some insight into the PrintUString and CPrintString functions. I don't have much experience with C/C++ which is also somewhat of a barrier.

Thank you

I hardly understand anything of what you made. What I do know is that what you made is awesome.

As "programmer" (not sure if I should call that seeing your work) and Diablo "fan", I really want to thank you for your work.

Cheers dude!

how to get more involved

Just wondering what are some areas of this project that need help with more contribution? Is one of the goals in this project to have naming conventions of data structures and function similar to what has been defined in https://github.com/sanctuary/notes? For example would the following be refactored in monster.h?

https://github.com/sanctuary/notes/blob/master/data/monster.h

- extern MonsterData monsterdata[112];
+ MonsterData monster_data[112];

- extern UniqMonstStruct UniqMonst[98];
+ extern UniqueMonsterData unique_monster_data[98];

Create classes, constructors, and static variables

This issue will be for creating the relevant C++ parts of the code. The decompiler doesn't have enough information on it's own to do so. The majority of data is currently written to the .DATA section of the executable, instead of .RDATA like the original. Classes will help to declare static/external variables and functions. The PSX symbol defines this for most functions/data.

Constructors should be used for a few files, example engine.cpp:

Class Engine
{
  public:
    gdwRandSeed;
    CelDecodeRaw(blah blah blah);
  private:
    Engine();
    ~Engine();
}
Engine()
//initialize CCritSection
~Engine()
//delete CCritSection

Trojan in released Devilution.exe ???

Shortly after running Devilution.exe, I got firewall poping up seeing unknown process trying to connect cloudflare's IPs.
https://github.com/diasurgical/devilution/releases/download/0.2/Devilution.exe

Found this:
C:\Users\me\AppData\Roaming\vlc\art\arturl\5086e21f5fb9d3801765ab2e30c9f2a5\me_bWU\ \ me_bWU.exe

https://www.virustotal.com/#/file/9d2caeecbe12d527411e6e2b127d3bb8cb5203416b0b3e9f6a8daa75aeeab9da/detection

SHA1: 1953a43a93e3c3cfd358b0a8ef9fbbb7faf07d37

Be careful. If you want to try it, run it in your sandbox VM!!!

diabloui.lib file not recognized: File truncated

Hello,

I'm getting a linker error with MSYS2 on Windows 10.

Here are the last lines from make output:

...
i686-w64-mingw32-gcc -c -fpermissive -Wno-write-strings -o Source/scrollrt.o Source/scrollrt.cpp
i686-w64-mingw32-gcc -c -fpermissive -Wno-write-strings -o 3rdParty/PKWare/implode.o 3rdParty/PKWare/implode.cpp
i686-w64-mingw32-gcc -c -fpermissive -Wno-write-strings -o 3rdParty/PKWare/explode.o 3rdParty/PKWare/explode.cpp
i686-w64-mingw32-gcc -L./ -o devilution.exe Source/init.o Source/drlg_l4.o Source/stores.o Source/diablo.o Source/dead.o Source/encrypt.o Source/error.o Source/towners.o Source/town.o Source/trigs.o Source/drlg_l1.o Source/setmaps.o Source/help.o Source/effects.o Source/inv.o Source/logging.o Source/sync.o Source/missiles.o Source/player.o Source/minitext.o Source/plrmsg.o Source/nthread.o Source/msg.o Source/automap.o Source/fault.o Source/appfat.o Source/cursor.o Source/monster.o Source/lighting.o Source/quests.o Source/mpqapi.o Source/capture.o Source/track.o Source/sound.o Source/engine.o Source/portal.o Source/themes.o Source/palette.o Source/gamemenu.o Source/sha.o Source/spells.o Source/debug.o Source/loadsave.o Source/restrict.o Source/pack.o Source/world.o Source/multi.o Source/wave.o Source/drlg_l3.o Source/msgcmd.o Source/objects.o Source/dthread.o Source/doom.o Source/items.o Source/path.o Source/dx.o Source/textdat.o Source/pfile.o Source/movie.o Source/codec.o Source/gmenu.o Source/tmsg.o Source/mainmenu.o Source/gendung.o Source/control.o Source/drlg_l2.o Source/interfac.o Source/scrollrt.o 3rdParty/PKWare/implode.o 3rdParty/PKWare/explode.o diabloui.lib storm.lib -lgdi32 -lversion -ldiabloui -lstorm
diabloui.lib: file not recognized: File truncated
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:10: devilution.exe] Error 1

I've followed the instructions from Support/INSTALL_windows.md.

$ uname -a
MINGW32_NT-10.0 <HOSTNAME> 2.10.0(0.325/5/3) 2018-02-09 15:25 x86_64 Msys

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/7.3.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-7.3.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/i686-w64-mingw32/include --libexecdir=/mingw32/lib --enable-bootstrap --with-arch=i686 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --enable-libstdcxx-filesystem-ts=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld --disable-sjlj-exceptions --with-dwarf2
Thread model: posix
gcc version 7.3.0 (Rev2, Built by MSYS2 project)

Any ideas?

Create cross-reference spreadsheet

The purpose of this is similar to Sanctuary/notes. The idea is to have a spreadsheet containing a list of all the functions and major structs, and the location of them for each game version. This eliminates the need for offsets in the source code, since one can easily find the location of specific code across multiple game versions.

Instead of documenting every single patch, I'd like to focus on the notable ones:

  • 1.09(b) - PSX: This is already finished as per Devilution
  • 1.00 Debug: Very useful as it contains debug code not found in the release build, possibly other kinky features
  • 1.04/Hellfire 1.01: Useful to document the new features (DRLG)
  • Battle.net Beta: Now this is where things get really interesting. This patch was nearly identical to the final game in functionality, but contained lots of removed code. This includes code for unused spells, items, and more! I'd like to add this code back as a comment, since the devs likely kept it as such
  • Alpha Demo: Only useful for spells like Invisibility, Sentinel, and Blood Boil.

The excel spreadsheet will look similar to a map file. It will have multiple offset columns.

Where to get Visual C++ 5.10

Good day,

I looking for Visual studio 5.10 . I cannot find it anywhere. How are you compiling this back?

I was thinking on loading it in visual studio and trying this thing.

I tried using MinGw (make I think) and I am missing some binaries for compilation.

Butcher doesn't drop cleaver on Single Player

I killed Butcher on lvl 2 on Single Player with my rogue and he didn't drop the cleaver. From what I understand, Butcher always drops the cleaver on SP, and has random drops on MP. I believe this is part of the "Bosses don't drop uniques bug". Not sure if the boss bug is reported already since I couldn't find it, so adding it here.

Heal Depression

Tongue-in-cheek or not, I read your bullet about depression fueling some portion of this work, and I just wanted to reach out and say I hope you're doing alright.

Compiling for Mac?

The original Diablo supported Mac as well. Will there be a way to compile this for Mac or is that a different code base all together?

Map generation bug where some areas are unreachable

While I was on level 4, I noticed that there was an unreachable part of the map that contained a Goat Shrine. I don't remember Goat Shrines generating on lvl 4, but Nitekat from the discord has said they do generate on lvl 4 but it's rare. So we could just look at maybe optimizing/improving map generation if the generation problem doesn't exist in Vanilla D1.

Screenshot:
https://imgur.com/AJxaHbv

Produce byte-identical executable using the same compiler

This issue tracks a very ambitions goal of Devilution, the production of a byte-identical executable to the 1.09b original. To achieve this goal, the exact same compiler has to be used as was used to produce the original executable.

For diablo.exe version 1.09b, this corresponds to Visual C++ 5.10, and for the debug release diablo.exe version 1.00 (1996-12-21) this corresponds to Visual C++ 4.20 compiled in debug mode; as based on PEiD output.

PDiD 109b

PEiD 100 dbg

Edit: reference discussion: https://github.com/galaxyhaxz/devilution/pull/10#issuecomment-396211436

Optimisation breaks game

Could you fix the code, so that compiling with -O2 does not break it (e.g. hangs entering dungeon)?

Add AppVeyor support

When we will have Visual Studio 2013, 2015 or 2017 solution files we can add AppVeyor CI support to build this project on Windows.

Possible collaboration with Freeablo?

Hello!

Not sure if you are aware, but there's a somewhat similar project to this which has been in the works for a while:

https://freeablo.org/

Freeablo is more about reconstructing the game from scratch rather than reverse engineering the original source, but as of this moment, the project is nearly finishing its multiplayer netcode and moreover, it has access to the Beelzebub/Tchernobog mod sources which restore a lot of the missing content in the original game.

Maybe it could be interesting for you guys to collaborate somehow for your future project of cross platform Devilution, since the developer of Freeablo is working primarily working on Linux.

Translate to js.

Do you have plans for porting it into the javascript? I guess it would be awesome to run it in the browser.

Possibility of using ToGL

Hello and thank you for this project. You have done really great work.

I'm not a game developer, so I hope my question isn't too stupid.
And I have read issue #17.
As far as I understand, the main problem of porting Diablo to MacOS and Linux is the dependency of DirectX libraries. So to be runnable on the platforms other than Windows, the game should be ported to OpenGL. So could ToGL project be helpful to port the game to the other platforms?
ToGL: https://github.com/ValveSoftware/ToGL

Fix decompilation of "msgcmd.cpp"

This entire file got hosed in the dumping process, mainly because the types are unknown. I'm putting this here so I remember to fix it later:

.text:00408A0B                 call    msgcmd_send_chat
.text:00408A10                 mov     gbGameLoopStartup, esi
.text:00408A16                 call    DrawAndBlit
.text:00408A1B loc_408A1B:
.text:00408A1B                 cmp     gbRunGame, esi
.text:00408A21                 jnz     loc_40896B
.text:0043F8CC                 push    esi
.text:0043F8CD                 call    msgcmd_delete_server_cmd_W
.text:0043F8D2 loc_43F8D2: 
.text:0043F8D2                                         ; msgcmd_send_chat+20↑j
.text:0043F8D2                 pop     esi // should be returning a value from __thiscall??

stack overflow

.text:0043FA98 ; void __fastcall msgcmd_cleanup_extern_msg(ServerCommand **extern_msgs)
(...)
.text:0043FAB1                 mov     [edx], esi
.text:0043FAB3                 mov     eax, [ecx]
.text:0043FAB5                 mov     edx, [ecx+4]
.text:0043FAB8                 mov     [eax+4], edx
.text:0043FABB                 and     dword ptr [ecx], 0 // overwrites ESP
.text:0043FABE                 and     dword ptr [ecx+4], 0 // ESP+4
.text:0043FAC2 loc_43FAC2:
.text:0043FAC2                 pop     esi // wtf is this???
.text:0043FAC3                 retn

Comments in the code?

Should we add comments to the source code?
Eg:

diff --git a/Source/stores.cpp b/Source/stores.cpp
index 7c43d8b..04d0265 100644
--- a/Source/stores.cpp
+++ b/Source/stores.cpp
@@ -1438,15 +1438,15 @@ void __cdecl S_StartWSell()
 // 6A09E4: using guessed type int stextsmax;
 // 6A6BB8: using guessed type int stextscrl;
 
+// Check if item should be recharged^M
 bool __fastcall WitchRechargeOk(int i)
 {
-       bool rv; // al
-
+       bool rv; // return bool value. 0 - no recharge available. 1 - recharge available^M
        rv = 0;
-       if ( plr[myplr].InvList[i]._itype == ITYPE_STAFF
-         && plr[myplr].InvList[i]._iCharges != plr[myplr].InvList[i]._iMaxCharges )
+       if ( plr[myplr].InvList[i]._itype == ITYPE_STAFF // is item a STAFF?^M
+         && plr[myplr].InvList[i]._iCharges != plr[myplr].InvList[i]._iMaxCharges ) // does STAFF require recharge?^M
        {
-               rv = 1;
+               rv = 1; // require recharge^M
        }
        return rv;
 }
@@ -1515,6 +1515,7 @@ void __cdecl S_StartWRecharge()
                do
                {
                        //_LOBYTE(v3) = WitchRechargeOk(inv_num);
+                       // if item require recharge, add it to the list.^M
                        if ( WitchRechargeOk(inv_num) )
                        {
                                v8 = 1;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.