Alright, that makes sense.
I checked the code again, been a while since I worked on it, but the base is the small map, if you're using the big map everything is multiplied by 2 (but that's done by the code, so shouldn't make a difference for your coordinates).
The small map has a height of 1920 tiles, and a width of 4032. So that's essentially the size of the world you have to use in your calculations. The map is then moved around so your chosen coordinate is at 0,0 in Factorio.
With that and your spawning coordinates you can figure out the bounds of the map.
Alternatively, in the code (file control.lua
) there is a line stating: local out_of_map_code = "o"
, the "o" is my code for deep water (or ocean, that's why it's o). You can change that to `local out_of_map_code = "_"
and it should instead generate "out-of-map" tiles. This does require code changes, as it's not a setting that I expose.
I do indeed multiply the coordinates with the scale (and again with 2 if you use the large map, since it has twice the resolution in each direction).
Hope that helps!