jarcionek wrote: ↑Sun Mar 24, 2019 11:28 am
This sounds really weird. How would the application know what to display when the map is open, if it didn't have coordinates? If I open a map and hold D, why do I see an eastern part of the map, rather than northern? Why do I see anything at all? You are already capturing the position of the map, in one form or another. The only question is how easy it would be to make it modding-friendly?
The game of course has access to it. Lua is not the game engine, and it has to be deterministic. I think you don't quite understand the concept of what determinism means for Factorio. Not deterministic means: In multiplayer,
your game does not know at what position some
other player has the map open and how zoomed in they are, because that information is not transferred between the different parties. It does not need to know it, it would just be useless data. To "make something deterministic" the information has to be transferred -> the inputs are transferred, or rather in most cases the resulting action is transferred, like placing an entity etc. The replay that you can enable when playing saves exactly those actions and then simply replays them when you watch it. Lua has to be deterministic because: Anything that a mod does has to be the same for all players (anything else would be a
desync), so it cannot have access to information that not all players have access to.
To make it "modding friendly" as you say, whatever data you are looking for would need to be deterministic, or be made deterministic. In this case it is not deterministic currently, as explained above, and adding an action for every single movement and zooming on the map would be a lot of data to transfer (and save for replays), which is completely unused in the base game, so it is not feasible.
Ah, this one. That would be just changing game.player.zoom. Multiplying or dividing existing value by a constant (sensitivity), right?
You cannot multiply or divide the zoom, you can only write a number to it. You cannot read player.zoom. This is why I asked how you were going to deal with exactly that.
By the way, if you really want to implement something, how about making sensitivity of the mouse wheel configurable and adding a setting at which zoom level the map changes between zoom to world and map?
This is beyond a modding interface request, it is more of balancing change, so not something that I can easily implement. Suggestions like these have a better place in
viewforum.php?f=6. Or just use a mod that allows you to zoom out in the normal view.