I understand what you're saying, and I agree that something should be done about the terminology so it's both understandable for "casual" users and doesn't clash with what's "known" by power users. I'll need to think about that.
Hm, "World Map (right) Tiles", "Region Map (middle) Tiles" might work, if there's enough screen real estate for the text (always in short supply).
In order to merge the info to the correct place on the "World" map I need to be able to determine exactly which (technical) World Tiles go onto exactly which "World map" merged tiles. It's preferable to use world X/Y dimensions and screen dimensions (which are readily available) to do that, although it should be possible to read the contents of a "screen tile" for empirical measurement (I know it can be done from Lua scripts, so the same underlying function should be usable from High Level Assembly (a.k.a. C(++)).
I don't need to read the dimensions of the center map, as I've got the logic for what it will be sorted out, so it is computed based on the basics, i.e. world and screen size. If I remember correctly, the logic for where the top left corner of the right map ends up is also in place.
There are two kinds of custom world sizes. The "simple" one is different dimensions for X and Y (I typically use 17 * 129, for instance), and the "complicated" one is whacko dimensions (e.g. 25*42, randomly selected). The first one can easily be generated with the standard advanced world gen interface (as you've seen), as well as using a saved template (with optional PSV data). I'm not quite sure if whacky sizes can be done by modifying the template file, or if you need to use DFHack to change them, but I think a template is enough. I don't think any special handling is needed for differing standard X/Y dimensions, though, as they ought to just follow the normal logic for the appropriate dimension.
Edit: I'm going to make a new attempt at matching World Tiles to the DF World Map. This is what I left behind when I gave up a year ago:
[code]
/* // Attempt to replicate the DF logic for sizing the right world map. This
// code seems to compute the values correctly, but the author hasn't been
// able to apply them at the same time as DF does to 100%.
// DF seems to round down on 0.5 values.
df::coord2d world_dimension_size(uint16_t available_screen, uint16_t map_size) {
uint16_t result;
for (uint16_t factor = 1; factor < 17; factor++) {
result = map_size / factor;
if ((map_size - result * factor) * 2 != factor) {
result = (map_size + factor / 2) / factor;
}
if (result <= available_screen) {
return {result, factor};
}
}
return{16, 16}; // Should never get here.
}
*/
[/code]
Edit 2: The other part from the code:
[code]
/* // Stuff for trying to replicate the DF right world map sizing logic. Close, but not there.
Screen::Pen pen(' ', COLOR_YELLOW);
// Boundaries of the top level world map
Screen::paintString(pen, width / 2 - 5, 2, "X", false); // Marks UL corner of right world map. Constant
// Screen::paintString(pen, width - 30, 2, "X", false); // Marks UR corner of right world map area.
// Screen::paintString(pen, width / 2 - 5, height - 8, "X", false); // BL corner of right world map area.
// Screen::paintString(pen, width - 30, height - 8, "X", false); // BR corner of right world map area.
uint16_t l_width = width - 30 - (width / 2 - 5) + 1; // Horizontal space available for right world map.
uint16_t l_height = height - 8 - 2 + 1; // Vertical space available for right world map.
df::coord2d size_factor_x = world_dimension_size(l_width, world->worldgen.worldgen_parms.dim_x);
df::coord2d size_factor_y = world_dimension_size(l_height, world->worldgen.worldgen_parms.dim_y);
Screen::paintString(pen, width / 2 - 5 + size_factor_x.x - 1, 2, "X", false);
Screen::paintString(pen, width / 2 - 5, 2 + size_factor_y.x - 1, "X", false);
Screen::paintString(pen, width / 2 - 5 + size_factor_x.x - 1, 2 + size_factor_y.x - 1, "X", false);
*/
[/code]
Edit 3:
I think I've found how DF decides to resize the map (haven't tried non standard dimensions, and mostly the Y dimension) (Lua script this time):
[code]
function map_size_of (map_size, available_screen)
local result
local adjustment
for factor = 1, 16 do
result = math.ceil ((map_size - 1) / factor)
if factor == 1 then
adjustment = 1
else
adjustment = 0
end
if result <= available_screen + adjustment then
return result, factor
end
end
dfhack.println ("Failed to find a match")
return 16, 16
end
function map ()
local screen_width, screen_height = dfhack.screen.getWindowSize ()
local upper_left = {math.floor (screen_width / 2) - 5, 2}
local upper_right = {math.floor (screen_width - 30), 2}
local lower_left = {math.floor (screen_width / 2), screen_height - 8}
local lower_right = {math.floor (screen_width - 30), screen_height - 8}
local map_width_available = screen_width - 30 - math.ceil (screen_width / 2 - 5) + 1
local map_height_available = screen_height - 8 - 2 + 1
local x_result, x_factor = map_size_of (df.global.world.world_data.world_width, map_width_available)
local y_result, y_factor = map_size_of (df.global.world.world_data.world_height, map_height_available)
dfhack.println ("Screen: (" .. tostring (screen_width) .. ", " .. tostring (screen_height) .. "), Map Available: " .. tostring (map_width_available) .. ", " .. tostring (map_height_available) .. ")")
dfhack.println ("World: (" .. tostring (df.global.world.world_data.world_width) .. ", " .. tostring (df.global.world.world_data.world_height) .. ")")
dfhack.println ("X Width Target: " .. tostring (x_result) .. ", X factor: " .. tostring (x_factor))
dfhack.println ("Y Width Target: " .. tostring (y_result) .. ", Y factor: " .. tostring (y_factor))
end
map ()
[/code]