Skip to content

Instantly share code, notes, and snippets.

@fabd
Last active June 13, 2023 22:03
Show Gist options
  • Save fabd/085dced17dd88c4038ee to your computer and use it in GitHub Desktop.
Save fabd/085dced17dd88c4038ee to your computer and use it in GitHub Desktop.
A script I use to center the game window and play at exactly 2x the original resolution to avoid stretching and blurry image.

#Glide Wut ?

After much testing here is what I found:

  • Glide Wrapper upscales graphics so you can have sharper graphics in FULLSCREEN mode.
  • If you play in windowed mode like I do, and resize the window to exactly 1600x1200 (2x) then Glide wrapper's "super sampling" DOES NOTHING. It keeps the graphics sharp, yes, but so does Autohotkey by simply resizing the window when the game runs in software mode.
  • Unfortunately Glide does not upscale 4x, so at 1600x1200 (2x), there is no smoothing, just the sharp pixellated aspect.

TLDR

  • Glide wrapper is only useful for fullscreen, or if you'd like to use Perspective Mode in windowed.
  • In windowed mode, Glide wrapper can enable coloured lighting but it is very hard to see a difference in vanilla Diablo 2

My setup:

  • Diablo II shortcut icon: -sndbkg -w (-skiptobnet if playing on BattleNet)
  • Use the Autohotkey script to get super crisp graphics at 1600x1200
  • Don't need Glide Wrapper
  • Don't set compatiblity mode in Windows 7 x64

It is actually slightly better than Glide wrapper, because with Glide, the window keeps changing size and also it does some weird glitch in the top left of the desktop. With Autohotkey window resize, there is no glitch, and once you use the hotkey to resize the window, it stays that way until you close the game. It also removes the ugly window frame. AND it doesn't switch off Aero when I run the game.

; Diablo II LoD
;
; Instructions:
;
; 1) Start the game in windowed mode (eg. "-sndbkg -skiptobnet -w" options in shortcut).
;
; 2) Press Ctrl Alt f , Ctrl Alt h to set game to 1600x1200 centered on the desktop.
;
;
; Ctrl Alt f Toggle active window title bar.
; Ctrl Alt g Toggle active window borders.
;
; Ctrl Alt h Center Diablo II window and stretch it to exactly 2x size (1600x1200)
; (first remove edges with Ctrl Alt f)
;
; Ctrl Alt b Move and resize current application window (eg. browser), so that it
; fits within the region of the Diablo II window, so when you alt tab
; back and forth to the game there is no distracting window overlap.
;
; Ctrl Alt e Click Twitch chat popout window then use this to move it to top
; right of screen and size for OBS capture.
;
; Ctrl Alt p Type the /nopickup option in-game
;
;
; For a fullscreen windowed game (eg. KingsBounty) : j g k f
;
; Ctrl Alt j Move Twitch Chat Popout
; Ctrl Alt k Enable transparency
;
;
#InstallKeybdHook
#Persistent
#SingleInstance force
;GameWindow = ahk_class Diablo II
; actual window 806 626
w = 1600
h = 1200
;#IfWinActive, Diablo II
;Move Twitch Chat Popout to top right of desktop (+ size for OBS Capture)
$^!e::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
;WinSet, Style, ^0xC00000 ; toggle title bar
;WinMove, , , 2100, -33, 410, 823
WinMove, , , (A_ScreenWidth - 460), -33, 410, 660
}
return
;Toggles Always On Top and Transparency
$^!j::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinMove, , , 2210, 600, 350, 660
}
return
$^!k::
Winset, Alwaysontop, On, A
WinSet, Transparent, 200, A
return
;$^!+p::
; Winset, Alwaysontop, Off, A
; WinSet, Transparent, 255, A
; return
; Quickly enable "nopickup"
$^!p::
Send {Enter}/nopickup{Enter}
return
;Toggle Title bar
$^!f::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinSet, Style, ^0xC00000 ; toggle title bar
WinSet, AlwaysOnTop, Off
}
return
;Toggle Window border
$^!g::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinSet, Style, ^0x800000 ; toggle thin-line border
WinSet, Style, ^0x400000 ; toggle dialog frame
WinSet, Style, ^0x40000 ; toggle thickframe/sizebox
WinSet, Style, -0xC00000 ; hide title bar
}
return
;Centered 1600x1200 window
$^!h::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinMove, , , (A_ScreenWidth - 1600)/2, (A_ScreenHeight - 1200)/2 - 24, 1600, 1200
}
return
;Center and size other application windows so they fit under the game window when Alt-tabbing.
$^!b::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinMove, , , 614, 96, 1334, 1200 ;Set the window size you want
}
return
@Ning0627
Copy link

thank you for replying me sir!
Sorry for my broken English 😅
Please let me explain it
Yes I do play d2-lod
And I run the game in window mode with game graphics resolution:800x600
The problem for me is that game window is too SMALL
My goal is that to find a way to make game window BIG with clear graphic (instead of doubling click window edge)

Now please let me back to my question

So you mean it must be INTEGRAL MULTIPLE?
I mean yours is 1600x1200,its 2X to 800x600
Mine is 960x720,its 1.2X to 800x600,NOT INTEGRAl MULTIPLE,is it the reason that mine doesn't work ?

anyway
thank you very much🥰

@fabd
Copy link
Author

fabd commented Mar 24, 2022

Hya

No if you have glitches that is unrelated, look into your proper installation drivers etc.

The problem for me is that game window is too SMALL

That is what this script is for - however I created it for MY monitor which is 27 inch ( 2560 x 1440 ) so the scripts is configured to use a 1600 x 1200 ( exactly double the original D2LOD res ) , and center it.

For the mouse cursor, I use a small program that "locks" the cursor into the window - and then I also used a slower speed on the Razer mouse (3 different settings) so it was comfortable to play.

...

Now back to the resolution.you can use any setting - that should work. Just that if you do not use exactly 2x or 3x the original 800x600 (eg 2x = 1600 x 1200 ), then it won't look as nice because some columns / lines will be doubled.

Note that you could also set your in game resolution to 640x480 and double that would be 1280 x 960 with the script ... that would give you pixel perfect double , if you can not fit 1600x1200 in your screen.

Other than that maybe post a screenshot I dont know what glitches you are seeing. I have not played D2LOD on Win 11, it was working fine on Win10 with NO compatiblity options or any hacks but you must run the game in "software" mode (256 colors).

@Ning0627
Copy link

Ning0627 commented Apr 1, 2022

640 480 is a good idea

Busy working time has come to me since this month
I think I would have no time for gaming in a long time
thank you so much sir!
you have fun and happiness!
god bless you!❤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment