GithubHelp home page GithubHelp logo

bolrog / d2dx Goto Github PK

View Code? Open in Web Editor NEW
387.0 16.0 47.0 18.05 MB

D2DX is a complete solution to make Diablo II run well on modern PCs, with high fps and better resolutions.

License: GNU General Public License v3.0

C++ 79.23% HLSL 14.02% C 6.75%
diablo-ii game widescreen integer-scaling preservation modernization diablo2 directx-11 windows-10 anti-aliasing

d2dx's Introduction

D2DX

D2DX is a Glide-wrapper and mod that makes the classic Diablo II/LoD run well on modern PCs, while honoring the original look and feel of the game. Play in a window or in fullscreen, glitch-free, with or without enhancements like widescreen, true high framerate and anti-aliasing.

Version 0.99.529

WANT TO HELP OUT? Take the one-question game version poll: https://strawpoll.com/w4y72p4f6

Update July 2021: I have been too busy to work on D2DX for a while, but hope to resume shortly.

Features

  • Turns the game into a well behaved DirectX 11 title on Windows 10 (also 7, 8 and 8.1).
  • High quality scaling to fit modern screen sizes, including widescreen aspect ratios.
  • High FPS mod using motion prediction, bypassing the internal 25 fps limit. Play at 60 fps and higher! (video)
  • Anti-aliasing of specific jagged edges in the game (sprites, walls, some floors).
  • Seamless windowed/fullscreen switching with (ALT-Enter).
  • Improved fullscreen: instant ALT-TAB and low latency.
  • Improved windowed mode.
  • Proper gamma/contrast.
  • Fixes a few window-related glitches in Diablo II itself.

Video Showcasing Motion Prediction

FPS increase in menus, FPS increase for projectiles, monsters, +more

Upcoming

  • Suggestions welcome!

Requirements

  • Diablo 2: LoD (see Compatibility section below).
  • Windows 7 SP1 and above (10 recommended for latency improvements).
  • A CPU with SSE2 support.
  • Integrated graphics or discrete GPU with DirectX 10.1 support.

Compatibility

Game versions supported:

  • All features: 1.09d, 1.13c, 1.13d and 1.14d.
  • Without resolution switching: 1.10f, 1.12.
  • Other versions are unsupported, will display a warning at startup and exhibit glitches.

For compatibility with mods, see the wiki.

Documentation

This readme contains basic information to get you started. See the D2DX wiki for more documentation.

Installation

Copy the included "glide3x.dll" into your Diablo II folder.

Note that in some cases you may have to also download and install the Visual C++ runtime library from Microsoft: https://aka.ms/vs/16/release/vc_redist.x86.exe

Usage

To start the game with D2DX enabled, just provide -3dfx, e.g.

Game.exe -3dfx

Windowed/fullscreen mode can be switched at any time by pressing ALT-Enter. The normal -w command-line option works too.

Many of the default settings of D2DX can be changed. For a full list of command-line options and how to use a configuration file, see the wiki.

Troubleshooting

I get a message box saying "Diablo II is unable to proceed. Unsupported graphics mode."

You are running the download version of Diablo II from blizzard.com. This can be modified to work with D2DX (Wiki page about this to come).

It's ugly/slow/buggy.

Let me know by filing an issue! I'd like to keep improving D2DX (within the scope of the project).

Credits

Main development/maintenance: bolrog Patch contributions: Xenthalon

The research of many people in the Diablo II community over twenty years made this project possible.

Thanks to Mir Drualga for making the fantastic SGD2FreeRes mod! Thanks also to everyone who contributes bug reports.

D2DX uses the following third party libraries:

  • FNV1a hash reference implementation, which is in the public domain.
  • Detours by Microsoft.
  • SGD2FreeRes by Mir Drualga, licensed under Affero GPL v3.
  • FXAA implementation by Timothy Lottes. (This software contains source code provided by NVIDIA Corporation.)
  • stb_image by Sean Barrett
  • pocketlzma by Robin Berg Pettersen
  • 9-tap Catmull-Rom texture filtering by TheRealMJP.

Donations

D2DX is free software, but if you enjoy the project and want to buy me a coffee, click here.

Recent release history

0.99.529

  • Add motion prediction for 1.09d, complete except for hovering text (it's coming).
  • Fix low fps in the menus for 1.09d.

0.99.527b

  • Add 'filtering' option in cfg file, which allows using bilinear filtering or Catmull-Rom for scaling the game, for those who prefer the softer look over the default integer-scale/sharp-bilinear.
  • Fix artifacts when vsync is off.

0.99.526b

  • Fix motion-predicted texts looking corrupted/being positioned wrong.

0.99.525

  • Fix motion prediction of shadows not working for some units.
  • Fix window size when window is scaled beyond the desktop dimensions.
  • Fix some black text in old versions of MedianXL.
  • Remove -dxtestsleepfix, this is now enabled by default (along with the fps fix).

0.99.521

  • Fix low fps in menu for 1.13d with basemod.
  • Fix low fps for 1.13c and 1.14 with basemod.
  • Fix basemod compatibility so that "BypassFPS" can be enabled without ill effects.

0.99.519

  • Unlock FPS in menus. (Known issue: char select screen animates too fast)
  • Add experimental "sleep fix" to reduce microstutter in-game. Can be enabled with -dxtestsleepfix. Let me know if you notice any improvements to overall smoothness in-game, or any problems!

0.99.518b

  • Fix size of window being larger than desktop area with -dxscaleN.

0.99.517

  • Fix in-game state detection, causing DX logo to show in-game and other issues.

0.99.516

  • High FPS (motion prediction) is now default enabled on supported game versions (1.12, 1.13c, 1.13d and 1.14d).
  • Fix crash when trying to host TCP/IP game.

0.99.512c

  • Add "frameless" window option in cfg file, for hiding the window frame.
  • Fix corrupt graphics in low lighting detail mode.
  • Fix corrupt graphics in perspective mode.
  • Fix distorted automap cross.
  • Fix mouse sometimes getting stuck on the edge of the screen when setting a custom resolution in the cfg file.

0.99.511

  • Change resolution mod from D2HD to the newer SGD2FreeRes (both by Mir Drualga). Custom resolutions now work in 1.09 and 1.14d, but (at this time) there is no support for 1.12. Let me know if this is a problem!
  • Some performance optimizations.
  • Remove sizing handles on the window (this was never intended).

0.99.510

  • Add the possibility to set a custom in-game resolution in d2dx.cfg. See the wiki for details.
  • Remove special case for MedianXL Sigma (don't limit to 1024x768).

0.99.508

  • Fix motion prediction of water splashes e.g. in Kurast Docks.

0.99.507

  • Add motion prediction to weather.
  • Improve visual quality of weather a bit (currently only with -dxtestmop).
  • Don't block Project Diablo 2 when detected.

0.99.506

  • Fix crash sometimes happening when using a town portal.
  • Add motion prediction to missiles.

0.99.505b

  • Fix bug causing crash when using config file.
  • Add option to set window position in config file. (default is to center)
  • Update: Fix tracking of belt items and auras.
  • Update: Fix teleportation causing "drift" in motion prediction.

0.99.504

  • Revamp configuration file support. NOTE that the old d2dx.cfg format has changed! See d2dx-defaults.cfg for instructions.

0.99.503

  • Add -dxnotitlechange option to leave window title alone. [patch by Xenthalon]
  • Fix -dxscale2/3 not being applied correctly. [patch by Xenthalon]
  • Improve the WIP -dxtestmop mode. Now handles movement of all units, not just the player.

0.99.430b

0.99.429

  • Fix AA being applied on merc portraits, and on text (again).

0.99.428

  • Fix AA sometimes being applied to the interior of text.

0.99.423b

  • Fix high CPU usage.
  • Improve caching.
  • Remove registry fix (no longer needed).
  • Updated: Fix AA being applied to some UI elements (it should not).
  • Updated: Fix d2dx logo.

0.99.422

  • Fix missing stars in Arcane Sanctuary.
  • Fix AA behind some transparent effects, e.g. character behind aura fx.
  • Add -dxnocompatmodefix command line option (can be used in cases where other mods require XP compat mode).

0.99.419

  • Fix issue where "tooltip" didn't pop up immediately after placing an item in the inventory.
  • Add support for cfg file (named d2dx.cfg, should contain cmdline args including '-').
  • Further limit where AA can possibly be applied (only on relevant edges in-game and exclude UI surfaces).
  • Performance optimizations.

0.99.415

  • Add fps fix that greatly smoothes out frame pacing and mouse cursor movement. Can be disabled with -dxnofpsfix.
  • Improve color precision a bit on devices that support 10 bits per channel (this is not HDR, just reduces precision loss from in-game lighting/gamma).
  • To improve bug reports, a log file (d2dx_log.txt) will be written to the Diablo II folder.

0.99.414

  • The mouse cursor is now confined to the game window by default. Disable with -dxnoclipcursor.
  • Finish AA implementation, giving improved quality.
  • Reverted behavior: the mouse cursor will now "jump" when opening inventory like in the unmodded game. This avoids the character suddenly changing movement direction if holding LMB while opening the inventory.
  • Fix issue where D2DX was not able to turn off XP (etc) compatibility mode.
  • Fix issue where D2DX used the DX 10.1 feature level by default even on better GPUs.
  • Fix misc bugs.

0.99.413

  • Turn off XP compatibility mode for the game executables. It is not necessary with D2DX and causes issues like graphics corruption.
  • Fix initial window size erroneously being 640x480 during intro FMVs.

0.99.412

  • Added (tasteful) FXAA, which is enabled by default since it looked so nice. (It doesn't destroy any detail.)

0.99.411

  • D2DX should now work on DirectX 10/10.1 graphics cards.

0.99.410

  • Improved non-integer scaling quality, using "anti-aliased nearest" sampling (similar to sharp-bilinear).
  • Specifying -dxnowide will now select a custom screen mode that gives integer scaling, but with ~4:3 aspect ratio.
  • Added -dxnoresmod option, which turns off the built-in SlashDiablo-HD (no custom resolutions).
  • (For res mod authors) Tuned configurator API to disable the built-in SlashDiablo-HD automatically when used.
  • Other internal improvements.

0.99.408

  • Fix window size being squashed vertically after alt-entering from fullscreen mode.
  • Fix crash when running on Windows 7.

A full release history can be found on the Wiki.

d2dx's People

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

d2dx's Issues

Feature Request: Tabbed Diablo 2

If you are still looking for feature requests adding tabs to launch multiple copies would be appreciated. A lot of the private servers allow up to 4 connections. This really helps with muling, enchanting, and glitch rushing your own characters.

https://imgur.com/a/En2Ke

crash on switching resolutions

D2DX Version: 0.99.429
OS: Windows 7 Professional, 64-bit
Game Version: Diablo II: Lord of Destruction, version 1.13C

hi,bolrog

Thank you for your work.I had trouble switching resolutions in the game.

Multiple tests get error code
1:
halt
location: line #883
expression:unrecoverable internal error 6fe1e203

2:
halt
location: line #904
expression:unrecoverable internal error 6ff6be3c

3:
UNHANDLED EXCEPTION:
ACCESS_VIOLATION (c0000005)

FIXED/SOLVED - Suggestion>Update method

Would love to have app or some sort of way to easy update the Wrapper.

Even a script that Downloads something off the web with some curl commands and puts it into the right directory then launch the Diablo II game./Plugy.

Like a Launcher like Slash Diablo with all the updates of the new wrapper and everything.

Crash with Median XL

Using version 0.99.403.
When playing on Median XL, I got an easily reproducible crash, though the crash might be on Median XL's side.

The crash happens at least in fullscreen mode, I couldn't try in windowed since I can't get the game to run in windowed for some reason.

Steps to reproduce are quite easy: talk to Gheed in act 1, choose Gamble, alt-tab out and then back in.

Compiling D2DX Windows Build

Hi tried to compile what does the warning means thanks, how to clear it
Attached also when launching the game not working i got error using the current source.

1
2
Untitled

1.14d Widescreen support

117183607-5130f100-ae0a-11eb-865e-6702d0ff0de5

Hi there
tested this one using SlashGaming-Diablo-II-Free-Resolution and d2dx on 1.14d client since SlashGaming-Diablo-II-Free-Resolution added support for 1.14d will it be nice to add widescreen support as well?

V-Sync issue in 0.99.402

D2 1.13d, Screen Tearing (which I don't think was there before) appears in 800x600 and Widescreen modes, maybe 640x480 too but I'm not 100% sure. I tested with 60FPS screen mode and 75FPS which my screen supports (and is preferable for D2 since it's 1frame per 3 screen refreshes), and 75fps exhibits tearing even more.

Version error in 1.13c

Doesn't work on 1.13c. I get "Unsupported Glide3x.dll Version" error.

Reported via Reddit

Ground Breaking Big Issue

Do you have a Patreon or Ko-fi because I'd love to show my appreciation for the amount of work you've poured into this mod!

Graphical Bug

Greetings I would like to first thank you for your effort on doing this wrapper anyway this is the bug I found on your latest build the first image is that box on the upper right corner and the 2nd one is when I talk to the npc some of the text are messed up when it reaches at the top of the screen for your info just check the images thank you and hopefully it will be fix soon.. by the way this is the setting I used

-3dfx -gx1080 -gxskiplogo

and I havn't installed pluggy and other mods yet by the way all I did was doing fresh install of 1.14d client and test this wrapper :D

hope you could fix it soon :D

bug1
Bug2

MoP: Predict motion of all client-side units.

  • Figure out how to iterate over client-side units. Try going via Room1 struct and traverse units and linked rooms.
  • Figure out how to link draw call to client-side units. Unit ID and type available in CellContext, but the function to get Unit pointer by type/id returns null for many of these. Maybe matching with the "manually" iterated units will work.

Crash on startup 0.99.406

D2DX Version: 0.99.406
OS: Windows 7 Professional, 32-bit
Game Version: Diablo II: Lord of Destruction, version 1.13C

  • I am attempting this on a Windows 7 VMWare Guest machine.
  • I have tried with and without the command line parameter -dxnowide.
  • This is a completely vanilla installation.
  • I do not have ddraw.dll in my Diablo II directory.
    • I do not have CnC-DDraw's ddraw.dll in any of the possible search paths.
  • The file glide3x.dll is in my Diablo II directory and this is the file found in the 0.99.406 release.
  • My Diablo II directory is located at C:\Program Files\Diablo II\Diablo II - LoD\Diablo II - LoD 1.13C D2DX.

When I run Game.exe with the video mode set to Glide, the game crashes immediately on startup. I have attached a screenshot of the error below.
D2DX_Crash

Request: Change command line arguments to an ini file.

Would it make more sense to have an ini file with the various options as opposed to tacking them on to a command line argument? With all the additional features you've added it seems like it makes sense.

However, this is just an idea, I am very grateful for your work!

-dxscale2 not working

With or without plugy 14.02,
I can't get the windowed scaling to work with these params:

Diablo II.exe -3dfx -dxnovsync -dxscale2

Game launches normally and the dx logo is visible so I know it's working. But window scale is 100%.
Monitor is 1440p so it should be be enough for 1600x1200.

I'm using game ver 1.14d, but I'm not using widescreen or anything.

Mouse sensitivity is different from desktop's in non-widescreen

I'm using version 0.99.402.
This happens in fullscreen only.

When running the game in non-widescreen mode (in my case 4/3 on a 2560x1440 monitor), the game cursor is slower than the desktop's cursor. I believe the total amount of "movement" needed to go from the left of the game's window to the right of the window is the same than the entire desktop's width.

In my case, the game's viewport (I mean, excluding the black bars) is 4/3*1440 = 1920px. But what's happening is that I need to move my mouse the same amount that I would need to go from the left end to the right end of my desktop (which is 2560px instead of the game's 1920px). This results in a "slower cursor" feeling. Nothing that makes the game unplayable, obviously, but it can be surprising.

Fresh install - still no widescreen

Installed with 1.12a installers, used 1.13c patch, downloaded 0.99.406, extracted to Diablo directory, added -3dfx to parameter lines to shortcut and I do not get HD res. I have a blank option, 640x480 option, and 800x600 option.

Am I doing something wrong?

Name change needed

I've been alerted that d2gx sounds a little too similar to another project, D2GEx. I can definitely agree there. Thinking of "d2dx" instead.

Feature Request: Project Diablo II Support

Any chance you can make this work with Project Diablo 2? I believe it's a 1.13 mod. A modified version of sven's glide wrapper is included with the mod, but replacing it with yours doesn't allow the game to launch. Even basic support (no widescreen, no motion prediction) would be awesome.

FXAA applies on font dc6

I don't have screenshots atm, but if you need i can provide.

FXAA should not apply on fonts, as this may break some pixel fonts intended display (latin2 or customized one).

If possible, this should be fixed.

Crash on Startup 0.99.412

I was on 408 and it launched perfect. I replaced with 412 and I get the following error.

I'm on Windows 10 with an AMD 3100x and Nvidia 3060TI.
Screenshot 2021-04-11 200845

Distribute license files with releases

The GPL license requires the distribution of the any license files associated with project. For d2dx specifically, this may be something you will want to do to ensure that people know what license is associated with the project.

However, since you are also distributing the AGPL version of D2HD, you must include the license files associated in any release containing those files. Please respond if you have any questions about this.

Display When Launching Always Max Screen

Using D2DX v0.99.505 / Diablo II v1.12, everytime i launch the game it always show max display screen, tried to play with scale = 1~3 but no avail. BTW my Desktop Screen size is 1360x768.
I test also with SlashGaming dll loader, screen seems to be ok set to minimal widescreen.

1
2

With SlashGaming Loader and dlls
1
2
3

XP compat mode/mods

Investigate ways of staying compatible with mods that require being run as admin or xp compat mode.

How To compile

Hey, really loving the project!

I'm not fluent with C++ development, but I set up Visual Studio 2019 Community, checked out the repository and added SlashDiablo-HD into the thirdparty folder. But I can't compile the project, it seems the compiler is unhappy with the comments:

1>Assembling ..\..\thirdparty\SlashDiablo-HD\src\D2HD\D2HDConfigInterception.S... 1>..\..\thirdparty\SlashDiablo-HD\src\D2HD\D2HDConfigInterception.S(1): error A2008: syntax error : / 1>..\..\thirdparty\SlashDiablo-HD\src\D2HD\D2HDConfigInterception.S(2): error A2008: syntax error : *

Do I have to setup a different linker?

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.