Provide Display Resolution inside Simulations

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 319
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Provide Display Resolution inside Simulations

Post 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.
Alt-F4 Author | Factorio Modder
Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2548
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Provide Display Resolution inside Simulations

Post 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.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 319
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: Provide Display Resolution inside Simulations

Post 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.
Alt-F4 Author | Factorio Modder
Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby

grandseiken
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Aug 02, 2023 11:18 pm
Contact:

Re: Provide Display Resolution inside Simulations

Post 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).

Post Reply

Return to “Modding interface requests”