Page 1 of 1

[2.0.69] map_gen_settings width height not work

Posted: Sun Oct 12, 2025 9:53 am
by Xeon257
I am not able to write in English myself, so I am using ChatGPT for help. Please excuse any awkward phrasing.

I’m trying to limit the size of a planetary surface that I’m developing.

To do this, I set the width and height values in the planet’s map_gen_settings.
However, when I check in-game, it seems that these values have no effect at all.
10-12-2025, 18-47-46.png
10-12-2025, 18-47-46.png (44 KiB) Viewed 292 times
10-12-2025, 18-47-54.png
10-12-2025, 18-47-54.png (274.94 KiB) Viewed 292 times

All other members besides width, height, and seed seem to be applied correctly in my code. So I wondered if these values simply aren’t applied at the prototype stage. I tried setting width and height again during the on_surface_created event, but I got the same result.

10-12-2025, 18-49-59.png
10-12-2025, 18-49-59.png (36.27 KiB) Viewed 292 times

How can I set the width and height of a surface? I have checked the documentation, but I haven’t been able to figure out how to do it on my own. If this is a technical limitation of Factorio, I would greatly appreciate any guidance or help.

Re: [2.0.69] map_gen_settings width height not work

Posted: Sun Oct 12, 2025 10:32 am
by Klonan
Xeon257 wrote: Sun Oct 12, 2025 9:53 amI tried setting width and height again during the on_surface_created event, but I got the same result.
You need to write the modified map gen settings back to the surface

Code: Select all

local settings = surface.map_gen_settings
settings.width = 50
settings.height = 50
surface.map_gen_settings = settings

Re: [2.0.69] map_gen_settings width height not work

Posted: Sun Oct 12, 2025 11:22 am
by Xeon257
Ah, thank you very much for your answer. Could you explain why the above variables can only be set at runtime? If this is intentional, I would also be curious to know the reasoning behind it.

Re: [2.0.69] map_gen_settings width height not work

Posted: Sun Oct 12, 2025 11:52 am
by Rseding91
Those variables are part of the map generation settings that the player controls when making a new game and so the values from the GUI are used to make all planets runtime.

Re: [2.0.69] map_gen_settings width height not work

Posted: Mon Oct 13, 2025 10:46 am
by Xeon257
Ah, it seems that the user-defined map settings are being overwritten by the Lua object, which makes it look like they aren’t working. Thank you for the clarification!