Factorio World


Mod that changes the world generation to be a real-world map. Two world maps to choose from: "Atlantic" and "Pacific".

Content
2 years ago
0.14 - 1.1
7.12K
Environment

g Map Configuration and setting custom spawns

3 years ago

Firstly, thank you for such a fun mod that allows me to fill my wildest dreams with excel spreadsheets on how to best exploit the world,

Secondly, I've run into problems trying to set my own start location. Unfortunately I wasn't able to find any help on these forums about how to properly scale, set world border and create my own spawn location. I am unfamiliar with modding game files directly, and I thought it was possible to set a custom spawn to any real-world location taking their co-ordinates and using them as a percentage to find the equivalent x and y position to start (I saw from an earlier post the default world map's corners are at -12000, -2200 and 12000, -9000 which was confusing to base cords off of)

Unfortunately, it seems the co-ordinates of factorio cause the world to generate (0,0) wherever you spawn. I'm new to the game but if this has been awnsered somewhere a redirect would be amazing.

TLDR: Using 12 scale world, want to know where world borders are so i can have an enclosed map, how do i spawn myself in Adelaide and not in Sydney?

3 years ago

The coordinates of the spawns are indeed a bit arbitrary. Though they should be scale-independant, so any scale with a set of spawn coordinates should spawn you at roughly the same place in the world.

Here is the list of all the coordinates of the pre-defined spawns: https://github.com/TheOddler/FactorioWorld/blob/master/spawns.lua Maybe you can base your new location of off those?

It's indeed normal that you always spawn at 0,0 in factorio. The spawn location of the mod basically moves the map, but not the factorio world. That way it fakes you spawning in a different location (it's actually the world that moves, not your character).

What do you mean with an 'enclosed map'? You can disable the setting "repeat-map" in the mod settings to not repeat the world (it will generate water to infinity then).

Does that answer all your questions? :D

3 years ago
(updated 3 years ago)

Thankyou for answering so soon!

I'm also currently using the 'water as a resource' mod so while I can disable my world repeating, it unfortunately means in 'calculating fluid area' an infinite amount of ocean leads to some very serious lag. If i can fix my spawn and map borders this should prevent it from buggering out too much to get a reading.

And as for if that helps, i can only plot those places on a chart and overlay a the world map you've provided to get my starting location right. You multiply the co-ordinate by the scale to keep it correct on the map size right?

(no i'm not role playing nestle, I just like putting everything in boxes)

3 years ago

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!

3 years ago
(updated 3 years ago)

Pardon, but by 'tiles' do you mean 32x32 chunks?

3 years ago

No, I mean the actual tiles itself. So there are 32x32 in each chunk.

3 years ago

Well i've figured it out roughly, strange however that the map is upside down and flipped but I suppose it's just the data. Adelaide (or near lake eyre) is at the co-ordinate of (3590, 1320) on a default small world map of 1920x4032 going by guessing where in relation to Sydney and Bao Shan

The co-ordinates change with scale and are automatically doubled using the big map so the way to figure out any location it would be to first take the co-ordinates of the position wanted. In my case, 35 S by 138 E. Given the map is both upside down AND flipped (0,0 would be in the top left corner of a normal map), find the percentage of 'lat and long' per 'sector' of the map (cuz Eg: 35/90 = 38% and 138/180. = 76%. Multiply these percentages by half of the map proportions and then add the other half to get the lat long cords of your favoured spawn.
Using this method I've got my spawn of 3561, 1324

3 years ago

Nice! Maybe some day I'll do the math for you in the mod, but that would break other people's calculations for their coordinates, though not sure how many people actually use it.

Either way, thanks for explaining! Maybe other people will find it and it will be of help to them too :D

Glad you figured it out, happy building!

3 years ago

No worries m8! Honestly you put the thing together and these forums are great for helping people out. Plus editing the lua file helped for cutting off the oceans!

3 years ago

Awesome :D

New response