THERA 3 dev log - Screen resolution
The first proper devlog for my game engine (the Ultraviolet Engine, as I call it) in ages~!
So, if you've played THERA 2, you probably noticed the window is locked to 800x600, with both resizing the window and making it go fullscreen disabled. I made that change ages ago, and I never really noticed it until recently, when I replaced my laptop and discovered just how tiny it looks on a screen with a half-decent resolution.
The truth is that older versions of the engine allowed you to change the window's resolution to a number of different presets, as well as going fullscreen, but... well, frankly, it was kind of broken, lol.
Here's what happened: Past!Kyou, in an fevered state of artistic perfectionism, did not want to have to scale the screen or their pixel-perfect sprites by a non-integer factor. With pixel art, scaling up by whole numbers is fine, with a perfectly clean result; fractional scaling (e.g. 1.5x zoom) with the nearest-neighbor scaling method used for pixel art, however, mucks up the lines and edges slightly. It's not really all that noticeable or significant, in retrospect, but past!Kyou wasn't having any of it.
Instead, they opted to bake in a fixed set of supported window resolutions, and for each of those resolutions, have different scaling factors and heuristics for each part of the rendering pipeline—the backgrounds, the isometric map, the portrait sprites, the textbox, etc.—that the engine could use to reposition everything without ever having to scale up the assets by a fractional value. What's more, they wanted to let the player change the screen resolution on the fly while the game was running, whenever the menu was accessible.
In addition to it never reaching a functional state, implementing this idea was very tedious and extremely painful. I won't bore you with the details of how and why it's broken; suffice it to say, I just ended up dummying out the screen resolution options in the options menu and left it at that... until now~
By making use of Love2D's canvas functionality, I've gotten the UV Engine set up in such a way now that it'll draw everything internally as though it's running in an 800x600 window, but will automatically scale everything up to 1200x900 or 1600x1200 depending on the size of the display it's running in when the canvas is drawn to the screen. It was SO much easier doing it this way, and despite the fractional 1.5x scale factor for the 1200x900 window size, all of the graphics look just fine, heheheh~
I'm considering adjusting it to make the exact resolution and level of scaling user-configurable, as well as figuring out a way to leverage this approach to draw the game in fullscreen; but for now, I'm leaving it like this. I still need to finish making assets for THERA 3 proper, after all~