I've recently upgraded from RPG Maker VX Ace to RPG Maker MZ, and so far I can't seem to fix a certain issue I'm having. I use a Lenovo Legion 5 laptop, and I use the 125% DPI scaling option so that things are roughly the same size as they would be on the normal monitor. I've noticed that RPG Maker MZ seems to also use the scaling, which ruins the pixel art in both the editor and when playtesting. Normally this is fixed by right clicking on the exe and choosing "Properties->Compatibility->Change high DPI settings" and enabling the override, however for whatever reason RPG Maker MZ just doesn't seem to react to this option. I verified that turning off the scaling in Windows 10 settings fixes the issue, but it makes everything except RPG Maker very hard to use. Is there anything I could do to make it look normal again?
Thanks in advance.
Attached screenshots:
1 - how the game looks for me with DPI scaling + a closeup of the pixels
2 - how the game looks when played on a computer with DPI scaling off + a closeup of the pixels
Which exe did you change the settings of, exactly? If you tried it with RPGMZ.exe: may I suggest you try it with nw.exe instead?
<Path>\RPG Maker MZ\nwjs-win\nw.exe
EDIT: never mind, it doesn't help either... hmmm...
I've tried messing with pretty much every single exe I could find, and none of them fixed the issue. The only thing I've noticed is that at one point resizing the game window would make scroll bars appear at the right and bottom of the window for a few milliseconds before disappearing again. In the meantime I set up a Windows 10 VM to use MZ in so I can keep my 125% scale on everything else, but that's a bandage solution and it performs really poorly (about 1/3 of normal game speed).
If you deploy your project then change the settings on that executable, is it any different?
I'm just wondering if it's not something within the browser, rather than the executable itself.
document.getElementById('gameCanvas').style.imageRendering = 'pixelated'
...is probably the fix you're looking for. The canvas smoothing is a browser default, that you were only coincidentally not seeing at 100% DPI scaling. Basically, it's a CSS issue and not a JS or EXE issue, so changing game.css is also an option.
If you're concerned more about the pixelation itself than the slightly increased window size, add these lines to css/game.css, and that will disable the bilinear scaling entirely.
#gameCanvas {
image-rendering: pixelated;
}
I also have an old, unreleased plugin (~20 lines) that does the above and locks the canvas to a 1:1 pixel aspect ratio in fullscreen mode, but I was never entirely sure if enough demand existed to release it.
I just tried setting the manifest to read-only and the editor gave me a warning on save, "unable to write to file package.json". Didn't crash or prevent playtest, though, so it's probably OK.
Note that disabling automatic DPI scaling doesn't stop users from scaling the game in other ways, e.g. by entering full-screen (F4) or manually resizing the window. If you're concerned about how the game is rendered, I recommend following Lone Wolf's suggestions~