Moondust-Project
Moondust-Project copied to clipboard
[Engine] Make `screen-width`, `screen-height`, and `screen-type` to define the in-game resolution
The engine.ini
has screen-width
, screen-height
and screen-type
options are unused yet internally. Make the sure there are will change in-game screen resolution when launching the game engine with choosing the config pack.
- [x]
screen-width/height
to be able define the in-game resolution - [ ]
screen-type
to switch the resolution mode between fixed or dynamical. In a case of dynamical, the renderable picture will never be scaled, but the in-game resolution will be equal to the in-window resolution.
engine.ini
's Screen-type = dynamic / resizable
, doesn't work either.
Yeah, the sense of screen-type
is choosing the type of in-game scene: let it be fixed-size like it does now, or will be scalable in a dependence on a window size. The second case will don't scale textures and drawing objects, but will allow to change of camera size that will see same square (in pixels^2) as the physical square of the window. (For High-DPI mode, I'll scale the stuff to avoid the crap that PGE Engine had some times ago on macOS).
You would also need to modify the editor to make the minimum (And default) section size the same as screen-height
and screen-width
.
Not sure how this would work under Screen-type = dynamic / resizable
.
Not sure how this would work under Screen-type = dynamic / resizable
.
The windows could scale up to 3840 x 2160
(4K resolution) in some user monitors.
For now the only option looks to have the ability to limit the maximum dynamic resolution.
Even 2d sandbox games have this problem.
This forum link have images of starbound (A game like terraria) with absurd levels of zoom https://community.playstarbound.com/threads/guide-how-to-zoom-out-more-than-game-settings-allow.43009/
It uses a dynamic resolution like you plan with Moondust but you can adjust zoom and you can see at 1x zoom on ultra high resolutions it breaks.
They fixed it by allowing the user selecting zoom levels. But Moondust have the problem that the sectors are finite and at low zoom the camera would going out of boundaries.
If you limit the maximum resolution to the section size and/or a max-height
and max-width
options you could prevent the problem showed you adobe (The links).
The minimum resolution would be screen-height
and screen-width
and the sector size couldn't be smaller than the minimum resolution.
If the window resolution is bigger than the minimum resolution but smaller than the maximum resolution and the sector size is bigger than the window resolution.
It would be useful (But not necessary) to allow the user to select a zoom level like starbound, but with the limits described adobe.
It would be easier for now to just implement screen-width
and screen-height
, for now and implement Screen-type
latter.
PD: More images of how it looks. https://imgur.com/a/44QS5 In the second screenshot you could see how it breaks http://i.imgur.com/mNWTF15.jpg
Edit: A 4k 1x screenshot of starbound Starbound in 4k with 1x zoom probably unplayable.
TL;DR: To make Screen-type = dynamic / resizable
playable at high resolutions the Moondust team needs to limit the scaling to not exceed a maximum resolution setting (This varies per game) and to stay in the room margins.
Example
Maximum resolution = 960 x 540
Section size = 480 x 270
Resolution = 480 x 270 scaled to 960 x 540
Example 2
Maximum resolution = 960 x 540
Section size = 4200 x 8500
Resolution = 960 x 540
This has to be DPI independent.
It would be easier for now to just implement screen-width
and screen-height
for the time being.
You can don't worry to the room size limit as I have made the black zone and alignment to center that will allow to have rooms smaller than screen size, already :wink: The only a limit is minimal screen size to don't squash the thing into too small thing.
On a quick hand, I have added the support for screen-width
and screen-height
values, and they are now working. It's the test I have ran with 1920x1080 in-game resolution (my screen size is two monitors of 1280x1024, therefore image is squashed):
And the 256x224 doubled into 2 to make the resolution be like one of SNES's:
The dynamical resolutions didn't implemented yet, the statical only.
But, be careful! Without of changing of world map setup, the view will suck on a non-standard resolution. So, it's suggested to take world map area in a full screen view and align HUD at top (most of those setup also can be done through engine.ini
).
wait does this unload/reset enemies outside of the screen boundaries? also would lunalua be able to support this?
wait does this unload/reset enemies outside of the screen boundaries?
NPCs are activating once they are appearing on the visible area. Once this visible area was increased, there are more NPCs will appear on the screen and will be activated, or the opposite: when you decreased the size of screen, less NPCs will be activated.
also would lunalua be able to support this?
In Discord that was discussed and LunaLua can't yet.