[2.0.9] LuaPlayer::zoom very limited compared to 1.1

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
aaargha
Filter Inserter
Filter Inserter
Posts: 333
Joined: Wed Dec 07, 2016 8:35 am
Contact:

[2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by aaargha »

My Infinizoom mod uses the zoom API to allow players to zoom in or out as much as the engine allows far beyond what is possible in vanilla 1.1. In 2.0.9 (only 2.x version I've tested) the API no longer allows zooming beyond the vanilla limits.

I can't find anything explicit about this in the change log so it might be an unintended consequence of some other change?

To test compare the results of
/c game.player.zoom = 0.05
in 1.1 and 2.0

While the rendering was pretty broken when approaching the limits of the engine, the functionality still has been useful enough when placing very large blueprints.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3078
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by boskid »

Moving to modding interface requests.
aaargha
Filter Inserter
Filter Inserter
Posts: 333
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by aaargha »

I did a quick search on the mod portal and the (undocumented) API-change seems to break about 5-10 mods, though in some cases only partially. Going by download numbers for the "pure" zoom mods, this affects something like 30k users.
StrangePan
Factorio Staff
Factorio Staff
Posts: 131
Joined: Fri Dec 07, 2018 3:41 pm
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by StrangePan »

Yes, zooming in the game has changed; it's essentially been completely rewritten and moved to game state. Now that 2.0 is released and the features have stabilised, I plan to go back and reintroduce a formal modding API for manipulating player zoom levels and zoom ranges.
curiosity
Filter Inserter
Filter Inserter
Posts: 482
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by curiosity »

StrangePan wrote: Wed Oct 23, 2024 2:37 pm Yes, zooming in the game has changed; it's essentially been completely rewritten and moved to game state. Now that 2.0 is released and the features have stabilised, I plan to go back and reintroduce a formal modding API for manipulating player zoom levels and zoom ranges.
And reading zoom level, surely? Since it's now part of the game state.
aaargha
Filter Inserter
Filter Inserter
Posts: 333
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by aaargha »

Interesting! I figured there'd be changes brought on by the remote view etc. but not that they were that comprehensive.

I'll look forward to reworked API (or perhaps even configuration?) support for zooming. As I've been hacking around the limitations of the current API since 0.14, I'll try to be patient :D
User avatar
Wiwiweb
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Sat May 08, 2021 2:36 am
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by Wiwiweb »

This also affects the Jetpack mod.
In 2.0, changing controller resets the zoom. Since LuaPlayer::zoom is write-only, we cannot read the original value to reset the zoom back to how it was before the controller change.
zerwiport
Inserter
Inserter
Posts: 31
Joined: Sat Mar 09, 2024 11:03 pm
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by zerwiport »

At least to me it would be enough to extend support of some LuaPlayer.set_controller(...) parameters instead of limiting them only to cutscene.

character: start_zoom, chart_mode_cutoff
remote: start_position, start_zoom, chart_mode_cutoff
leopoldkabouter
Burner Inserter
Burner Inserter
Posts: 10
Joined: Tue Oct 03, 2023 6:46 am
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by leopoldkabouter »

StrangePan wrote: Wed Oct 23, 2024 2:37 pm Yes, zooming in the game has changed; it's essentially been completely rewritten and moved to game state. Now that 2.0 is released and the features have stabilised, I plan to go back and reintroduce a formal modding API for manipulating player zoom levels and zoom ranges.
That is good news, thank you.
User avatar
Kuxynator
Inserter
Inserter
Posts: 33
Joined: Wed Sep 23, 2020 5:02 pm
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by Kuxynator »

_and please make LuaPlayer.zoom readable. _
to make things depends on zoom.
- scan area of the field of view
- walking speed
The approach I have had to use for years is somewhat imprecise and there are undesirable side effects.
User avatar
Game4Lols
Inserter
Inserter
Posts: 23
Joined: Sun Jan 28, 2018 9:30 am
Contact:

Re: [2.0.9] LuaPlayer::zoom very limited compared to 1.1

Post by Game4Lols »

+1 to having LuaPlayer.zoom readable. Would be very nice for implementing parallax zooming in one of my mods.
Post Reply

Return to “Modding interface requests”