Page 1 of 1

Provide Display Resolution inside Simulations

Posted: Wed Dec 29, 2021 1:56 pm
by Stringweasel
What
Make the display resolution accessable inside simulations. Currently the resolution stays constant (in my case 1017x1920 in window mode). Additionally from what I can see the on_player_display_resolution_changed event is never called.

Why
This is for the Hall of Fame mod. My simulations only look acceptable at very specific zoom levels because I trim down the surface around the visible area to keep the file size low. Therefore if it happens that players for example have widescreens or higher resolution screens than I have, and then see more than they should. For like the image below the player has a wide screen and the fake train stations are visible, and there's no way around this.

Image

In the case of a higher resolution screen it will by default shows way more than it should. I tried to remedy this by adding a mod setting that adjusts the zoom level on an additional zoom modifier. This works, but the player might not know about the setting and it requires some fiddling from the players side. I would love to do this all automatically. Below is an example of what happens if the player doesn't manually modify the zoom level.

Image

This issue will be prevailent on any other mod that uses menu simulations, for example Tiberium Dawn. It would be great to have more fine control over what the player sees. The goal of simulations is to look nice after all :)

Thoughts
Normally the screen resolution is accessed through LuaPlayer. In my simulations the maps always have players in the game.players table, and it also says they're connected. I also noticed though that tips-and-trick simulations do not have any players in the game.players table, so there is then of course no player that can have a display. So I'm not quite sure if this an simple implementation or not.

It will of course be totally fine if it's slightly "hacked" in and raises the on_player_display_resolution_changed event only for game.player[1]. And only if that player exist, otherwise it does nothing.

Re: Provide Display Resolution inside Simulations

Posted: Wed Dec 29, 2021 4:04 pm
by FuryoftheStars
So, not saying that I'd be against your idea of auto controlling the zoom, but I wouldn't want you to auto control the zoom. :lol:

While obviously it'd be ideal to not see the "magic" off to the sides, on ultra-wides, I feel like it'd be less ideal to push the zoom in (auto or manually) far enough to where these sides aren't visible, because then it results in parts of the show being cut from the top and bottom. I already have this issue with regular gameplay... when zooming out, I'm restricted to how far I can zoom based on left and right visibility, making it so I can't see as far up or down.

Re: Provide Display Resolution inside Simulations

Posted: Wed Dec 29, 2021 4:55 pm
by Stringweasel
FuryoftheStars wrote: Wed Dec 29, 2021 4:04 pm So, not saying that I'd be against your idea of auto controlling the zoom, but I wouldn't want you to auto control the zoom. :lol:

While obviously it'd be ideal to not see the "magic" off to the sides, on ultra-wides, I feel like it'd be less ideal to push the zoom in (auto or manually) far enough to where these sides aren't visible, because then it results in parts of the show being cut from the top and bottom. I already have this issue with regular gameplay... when zooming out, I'm restricted to how far I can zoom based on left and right visibility, making it so I can't see as far up or down.
That doesn't change the usefulness of this request and how much more it will allow me to polish this mod. The widescreen support is only affected by half of this request, and I will not remove the zoom modifier anyway. This request is most important for the difference in resolutions, where a simple zoom will be perfect, which I want to automate. But lets continue this discussion on the mod page becuase it's implementation specific.

Re: Provide Display Resolution inside Simulations

Posted: Thu Jan 18, 2024 4:56 pm
by grandseiken
I'd like this as well (assuming the default of zooming the camera in and out based on UI scaling stays as it is).