Azgaar / Fantasy-Map-Generator

Web application generating interactive and highly customizable maps
https://azgaar.github.io/Fantasy-Map-Generator
Other
4.51k stars 641 forks source link

Improved Realism for Political Growth #87

Closed thecsapprentice closed 6 years ago

thecsapprentice commented 6 years ago

Description

I've been playing around with your map generator a lot lately and while I have been generally been really impressed with the results, I'm finding myself increasingly less happy with the automatic political boundaries. In my mind, they are simply not respecting the natural barriers on the map as much as I would expect.

Expected behavior

I would love to see the growth rate of borders be more strongly affected by the following physical features:

For instance: fantasy_map_1529698322437

a) This small bit of blue seems out of place. Even if we can justify an invasion or something from the other side of the water, that feels like the exception and something that should be added manually, not auto generated. Unless the goal is to start handling generation of geo-political relationships between countries :smiley:

b) This border could have extended a little further down and made the river a natural boundary between these two countries, which is what often happens in reality. On the right hand side, the border could have joined up somewhere in the mountains.

c) This feels really strange. The light blue country has expanded way far away from it's main landmass. If it had the ability to spread further due to the capital's strength, it seems more likely it would have abutted the other country in that complex river system, not jumped really far away. This might make more sense if the country was, for instance, a sea faring nation. Perhaps what is needed is a per country (or per culture?) expansion method. Some peoples might like land routes, while others like water and this could effect how and where expansion happens more easily.

As a more general note: I would expect countries to try to keep the number of disconnected components as low as possible. Anything that fragments countries, especially on a single landmass, feels out of place and not realistic. If anything, those areas should maybe be marked as contested in someway, to indicate that is region is in a state of political flux.

.map file

fantasy_map_1529699219896.zip

Generator version

Version 0.57b

Azgaar commented 6 years ago

Hi @thecsapprentice,

Thanks for the great description! Political growth is not implemented at all, the currently used algorithm is a variation of weighted voronoi. That's pretty easy and very fast approach, but of course I agree the resulting borders are too far away from being plausible, even there is a sub-algorithm that prevent too much overseas (but not overlake) spread.

I'm planning to change the logic and build a complex growth logic based on flood fill algorithm. This will more or less fix problems 'a' and 'c', but not 'b'. 'B' is much more complex issue as rivers go through cell centers, while political borders are a connection of cell edges. To make a border directly on river course, I need to split each river cell into 2 separate cells. A lot of math required here, as river course is not predictable and there is no build-in way to split a polygon. Tons of calculations are based on current cells system and it will be broken in case of polygons split.

So in general it's not a high priority task (as you can always fix countries manually), but one day I'm planning to fix it.

thecsapprentice commented 6 years ago

Hey thanks for commenting. In terms of the river problem, I figure a partial solution is better than none. Even if the border growth approximately lined up with the river (within cell granularity) I think the results would be improved over the existing state of things.

Honestly, I was going to look at it myself but the fact the script is currently one huge file kinda threw me off. Maybe I should open another issue to modularize the code so its easier for external people to get in and help.

thecsapprentice commented 6 years ago

Thinking about the problem further, maybe contested regions would be potential solution. If the cells containing rivers were marked (maybe alternating diagonal stripes of each country's colors) that would allow the border to extend up to the river with visual cues, but without requiring any complex behaviors like cell splitting.

Azgaar commented 6 years ago

Most of the code lines are UI stuff. I'm planning to re-white it to modules, using vue.js. But it requires too much time.

Cells splitting looks more correct, striped cells will have a weird look.

morphles commented 6 years ago

For what is worth, I actually like the generated features displayed in original post. Looking at in story telling perspective, I find it fascinating to come of with justifications for such generated shenanigans and I believe they give a lot of potential for describing interesting scenarios. I'll put it this why, thecsapprenctice is showing limited imagination :). Lets take his "a)" example, supposedly only way this could happen is by blue launching invasion... but look at the longer time frame, maybe blue have had settlements all around that lake at some point in past, but then red expanded and took over some territory, while cutting off that small blue region so I see little problem with such distribution. Also especially interesting potential appears when you overlay culture and country maps. sample (I'll describe setup here, to make myself more clear; colors are cultures, thick dashed lines are country borders; "Neutral" labels are obviously manual, as program does not do that [and is something I kinda miss]) Looking at such you could imagine how cultures spread long long ago, and then when countries started popping up how they managed to involve more then one culture. Or can suspect certain past wars if country has tiny bit of other culture in it.

Azgaar commented 6 years ago

Hi @morphles,

I agree that any fluctuation can be used as a feature by a story teller. But in general I want to make random maps plausible, so some growth algorithm should be implemented.

As of land fragmentation, I also find it quite interesting, but there is too much of that stuff now. Looking at real-world medieval history we can see very fragmented countries as there were no concept of a nation-state. See Angevin Empire or even Habsburg's lands. But fantasy authors always tend to simplify their worlds and frankly speaking I did not see any fragmented fantasy maps.

morphles commented 6 years ago

That's laziness on fantasy authors part :D . But of course having option for more "normalized maps" is not bad, but possibly "funky stuff" can also remain as alternative.

As for reality, even know certain parts of Europe (and I guess Asia too) have borders that most people would not expect, like half of house on ones countries land and other half on other, and not just one house but whole city like that, CGP Gray did some episodes on that: https://www.youtube.com/watch?v=Vui-qGCfXuA

thecsapprentice commented 6 years ago

Sure, I'll agree that all of these things are true. I guess my complaint is that any borders drawn need to be justified somehow - whether that means they were blocked my natural barriers, stopped by war, or by cultural shifts.

If there was some measure of logistical consistency, I think I'd be happier.

For example, take wars: Wars require logistics and supply trains. As such, unless you are talking about modern warfare where troops can be air dropped easily in isolated areas, border growth usually occurs at fronts that expand from existing fronts. Maybe the expansion occurs in fits and bursts or doesn't follow clean lines due to local conditions, battle results, political issues, etc... But all of those things can be traced.

I'm not really looking for the map generator to do all of this work - that's really hard and frankly better done at the hands of the human making the worldbuilding aspects, but I also feel that if the generator isn't doing a good job at it, the results should be more conservative and simplified so a human can come along and make manual adjustments.

I don't know. I'm probably over thinking this whole thing. The generator is pretty great despite my issues.

morphles commented 6 years ago

Well again, for your "a)" example I gave what I thinks is very plausible scenario regardless of modern or ancient times. Just given sufficient time frame such arrangement is quite possible (also there are plenty of similar situation in history, and during wars maps get seriously wild; and who says that given map is for peace time? :) ).

Azgaar commented 6 years ago

Political Growth is added to the "Ideas" list. See https://trello.com/c/j2xhFvAW/134-implement-political-growth-algorithm

Not in the "To-do" list and this one can wait for some time.