New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: allow limiting zoom level of NewGRF-provided sprites #8604
Conversation
I think this case could be handled with a warning, when maximum zoom level is increased, and not all base/newgrfs provide sufficient zoom level graphics (which, to my understanding, would be almost all the time), and a general UI scaling factor
this use case should imho be guarded by "newgrf developer tools" being enabled, rather than an exposed setting which most people wouldn't really understand. |
I'd prefer not to have a warning and keep this as just a setting which players can change if they desire. Reasoning:
I think the newgrf developer case is very much a mild secondary benefit, although there is definitely justification for this setting being in the "advanced" options to avoid too many spurious bug reports of, "why is my game low res even after I downloaded zBase?" |
The default maximum zoom level is 4x, so that proposed warning would be generated frequently even without NewGRFs. I think there may be some misunderstanding of the use case. This isn't fixing a problem, rather I see it as an enhancement to allow players to force extra-zoom NewGRFs to match the resolution of regular-zoom base sets and NewGRFs. As one of the players who doesn't use regular-zoom and extra-zoom NewGRFs together (but also doesn't complain about said sets existing 🙂), I would eagerly use this feature. |
I think there are some problems with the wording used in both this PR/comments, and possibly the menu text. Instead of talking about "zoom level" of sprites, perhaps call them "high resolution sprites" instead? |
8d6a79c
to
2be2340
Compare
I think this is a great addition, but I would like to ask: on servers, is every player able to set this setting for themselves? |
Yes, this is a client-only setting. (You can tell because the setting definition in settings.ini includes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost done! Let's get this in for 1.11 :)
ef89127
to
4da5d9b
Compare
4da5d9b
to
902bfa9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there are no further comments :)
Motivation / Problem
Some players find the combination of sprites from sets with and without 2x/4x alternative sprites visually jarring, to the point of unplayability in some cases. Although display of mismatching sprite resolutions can be prevented by limiting the overall maximum zoom, this can bring its own challenges when playing on small or high resolution screens where the extra zoom levels are necessary for fine placement of infrastructure.
This PR adds a setting to globally limit the maximum resolution of sprites in game, meaning extra zoom levels will be drawn using the in-game scaler rather than drawing higher resolution alternative sprites. It means players can choose to have greater visual consistency when mixing NewGRFs with/without high resolution sprites, without losing the ability to zoom in to 4x.
A secondary use case is for checking alignments and sprite details of 1x zoom levels in extra zoom sets; while this can be done by taking screenshots and expanding them in a paint program or changing the screen scaling and/or resolution settings, it would be convenient to temporarily zoom in while still seeing the normal zoom sprites.
Description
The GRF spriteloader already has a setting for checking zoom levels declared in a NewGRF are valid for the current version of the game. This can be extended to check against a configurable setting, so only the relevant zoom levels are loaded to the sprite cache.
As a version 2 NewGRF is the only vector by which an extra-zoom sprite could enter the game (even for base sets, I've tested this against zBase), this is sufficient to limit sprite zoom to the user's chosen zoom level, and allow them to choose whether to see extra zoom graphics or limit all sprites to the same resolution across multiple sets.
Limitations
If the user changes the setting in-game, sprites will not change until the window region becomes dirty. (This could feasibly be fixed by force-marking the entire window dirty when the setting is changed, I chose not to initially as players will typically alter the setting rarely, and dirtying the entire window may have other side-effects)Changing this setting marks the entire window dirty, this is needed to avoid a mixture of different resolution sprites staying on screen until their area of the screen becomes dirty.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.