Provide Display Resolution inside Simulations
Posted: Wed Dec 29, 2021 1:56 pm
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.
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.
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.
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.
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.
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.