# Creating a realistic world map - Countries Borders

From previous questions, I made a nice mass of land, which was enriched up until the drawing of precise coastlines.

But all that nice lands looks a bit empty. In my world, I want to make it alive, and one of the first step, to complete my map is to draw the borders and define the countries.

Is there any alternative, to rewriting the whole of history from prehistoric migrations up until the time where the story takes place?

For a given country, I could follow the steps indicated in this question. But if I have a whole continent available?

Note:

This is part of a series of questions that tries to break down the process of creating a world from initial creation of the landmass through to erosion, weather patterns, biomes and every other related topics. Please restrict answers to this specific topic rather than branching on into other areas as other subjects will be covered by other questions.

These questions all assume an earth-like spherical world in orbit in the habitable band.

See the other questions in this series here : Creating a realistic world Series

• Sorry, I meant this one: youtube.com/watch?v=gtLxZiiuaXs – SJuan76 Aug 31 '15 at 20:17
• I actually watched that video some time ago. But that's exactly my point. It is not trivial to make those distinctions. And just using rivers and mountains aren't enough. – clem steredenn Aug 31 '15 at 20:24
• But do you need that level of detail? Granted, the last examples are spectacular but affect a tiny percent of the world borders and population; and do not appear in anything else than very detailed maps. I think just a few landlocked countries and enclaves and exclaves should do. – SJuan76 Aug 31 '15 at 20:45
• Let me also just point out that sometimes longitude and latitude are used to form borders. Note the border between Northeast Alaska and Canada, for instance. Other examples include Papua New Guinea's west border, the western US/Mexico border, the western US/Canada border, Libya, Egypt, Sudan, Namibia, Guatemala, and others. This is by no means an exhaustive list, nor a particularly common occurrence, but it may be worth adding a few instances of on your map. – Dan Aug 31 '15 at 23:33
• We didn't always use latitude and longitude to navigate, which pre-dates using them to define borders. Maybe your culture uses circles or points at certain places in the world with radial lines coming off at all angles? The possibilities are endless! – CJ Dennis Sep 1 '15 at 8:34

National borders will follow rivers, mountain ranges, large forests, inland lakes and deserts.

Mountain ranges, deserts and large forests will all form buffer zones between nations since these biomes are not well suited to (human) habitation. So you may have two major nations separated by a mountain range, but a minor nations inhabiting the mountains themselves (like the Himalayas).

So think of major nations separated by buffer nations with the latter inhabiting buffer zones featuring more challenging habitability.

Challenging habitability need not mean its impossible or very difficult to live, merely that the population there will be smaller and have to have special skills to live there.

Once these factors have been taken into account, we need to add a second level of fine detail that is based on your worldbuilding the historical linguistics of your world. Decide how ancient peoples in your world migrated, and thus determine the patchwork of distinct language zones in your world. You can then draw more national borders that are based on language that will serve to create border lines in areas that do not feature natural obstacles.

To see an excellent example of such an imagined history of migration you could do much worse than look at Tolkien's work on the three ages of middle earth - here (http://tolkiengateway.net/wiki/Middle-earth). It covers the creation of elves, men, hobbits and dwarves, and if you scour that site above you will find descriptions of the various migration patterns and how that generated the nations in middle earth at the time of the Lord of the Rings.

With specific regard to dutch, it evolved along with various other germanic languages from Low Franconian, which was the language of the Franks.

https://en.wikipedia.org/wiki/Low_Franconian_languages

Then, where you have a single language zone that spans natural obstacles, you can introduce separate dialects/accents of that language.

• This was my starting point, but it isn't necessarily enough. Look at Europe. The Netherlands aren't really bordered by large rivers, mountains, and so on. Germany was split into numerous small territories all practically intependent. And the border between Germany and France follow the Rhine, but only up until one point, and not all the way to the Netherlands. So yes those parameters are certainly important to take into account. But what then? – clem steredenn Sep 1 '15 at 12:17
• Fair point - I have updated my answer... – rumguff Sep 1 '15 at 12:49
• +1 excellent answer. Just want to add that the precise, draw-exact-lines-on-the-map concept of boundaries is very modern, both due to the ability to make and to care about such precise measurements. If there wasn't a clear natural boundary or a reason to care exactly where the boundary was, it could be fuzzy -- claimed by both countries, but without the claim being enforced by either. – LindaJeanne Sep 1 '15 at 14:08
• cheers Linda - and I agree. Tolkien's maps don't feature drawn boundaries at all. – rumguff Sep 1 '15 at 16:18
• Minor rivers often form national borders. Navigable rivers usually form the core of a nation or province unless that region is not well settled. – Oldcat Sep 1 '15 at 19:12

It is quite common that borders go along natural features like rivers or mountains (also called "natural borders"). Basically it's a line that naturally is hard to cross. Therefore it's also harder to conquer land beyond that border than if there's no natural border to begin with. Also, if the border is negotiated, those landmarks are easily recognized, and therefore may prevent future disagreement about the position of the border.

• That depends a lot of the technology at hand, though. If you look at older European borders, you will find that e.g. lakes are not borders, but rather in the middle of nations, as that is where it's possible to travel and transport, whereas areas with only forests are difficult to get through, and are often border areas. – leo Sep 1 '15 at 8:43

Can't believe I missed this question.

Prep Steps

You need to do these before you really get started, you have some done but I am listing everything for future user reference.

1. You need a map

• This map should be geographical down to a regional level (local specifics/peculiarities can and should wait, create them as needed)
• Include major bodies of water, rivers, biomes, mountains etc. This should be the satellite image from orbit level of detail.
2. You need a history

• Drawing political borders is obviously impossible to do without having some idea of what came before now whenever now happens to be in the story.
• Like the map this doesn't need to be the nitty gritty. Think of the level of detail you get in elementary education. Egypt, Greek City States, Roman Empire, Byzantium, Medieval, Renaissance...etc etc etc. This should be the broad sweeps of history. Rough out where on the map these major nations/empires covered and overlapped.

Setting the now

1. Determine a time period. Pick a socio-technical point in time (or create your own, medieval twitter!...ahem anyway) for your now to exist.

• Technology level helps define the shape of borders. As mentioned in other posts you are, for example, not going to have longitudinal borders during the Roman Empire...and if they could you know the Romans would, everyone knows the Romans loved math.
• How much 'open' space is there in your world. For the vast majority of human history much of the world was not part of any political entity, if you're working in the past keep that in mind.

Get to it

Step 1: So between your time period and geographical map you can start plotting obvious places for civilization to start. We all know (or do now) that the earliest civilizations on planet Earth started along rivers. Regular access to fresh, clean water makes life a whole lot easier. You don't need to name these civs or anything like that (though it may be fun to come back and do it later).

Step 2: Apply the rough brushes of history you outlined in the preparation steps (you did do the preparation steps right?).

Step 3: Once you arrive at now, stop. If things look a little too planned out at this point that's perfect. Right where we should be.

Step 4: Fine tune your map.

• Review major historical events, people disasters (wars, migrations, famines etc) and modify the map appropriately. While you are doing this write down why the changes makes sense while you are doing this, you will never remember why later. This can cause strange squiggles across what looks like an obvious border, or set the border at a certain landmark, for example mountains or a river, or a particular city.

This helps give your map more depth.

Always keep in mind that borders are fluid and on a planetary scale they change constantly.

• +1 for "You need a history". So many borders on Earth aren't in optimal locations, because of various historical events. – HDE 226868 May 8 '17 at 17:25

Political boundaries are geography plus populations plus as many other things as you want to add.

1. Draw a map of your continent/world/galaxy/universe. Fill in details like terrain, biomes, topography, geology, vulcanology, resources, etc...whatever details you want to include in your story.
2. Make a list of the people's you want to have in your world. Perhaps the benevolent Empire (heh, when are empires ever benevolent?) or a nation of marauding wanderers. Figure out which groups are stronger than the others and why they are stronger. Maybe one group has a mobility advantage while another has a great economy.
3. Place your weakest nations/tribes/groups first and give them the largest possible area that seems reasonable for their size. Don't worry, they won't hold this much territory for long.
4. Now drop in your stronger nations. They will naturally push back on the weaker nations, shrinking their territory. Pushback will extend until a natural barrier is reached such as rivers, oceans, or mountain ranges. You may lose a weaker nation or two. Make adjustments to their strengths till they can hold at least a little territory.
5. Go back and make some weird boundaries that can't be explained by one nation being stronger than the other. These small boundary changes give you, the author, an opportunity to inject some political back-history. Point Roberts on the boundary between Canada and the USA is an example of this kind of political boundary making. Europe is famous for these kinds of boundary shifts.
6. Make a few adjustments to the boundaries to account for resource allocation on the map. Stronger nations will have more resources available to them or very strong trade routes to get those resources.
7. Designate capital cities as meets your needs. Often capitals are centrally located but not always (ex. Moscow or Washington D.C.).

Discussion

Using this method we can retrospectively see why the Mongols gained so much territory as they had a huge mobility advantage over their peers.

Every extra "layer" of information added to the map will increase the richness of your world but at the expense of complexity. Add as many layers as you can manage then stop. Just adding terrain, resources and population to your map will be enough for a very rich world.

# Introduction and assumptions

Borders clearly aren’t static; they change over years, decades and centuries as countries grow, shrink, and are born and die. As time passes, they may become vague or disputed. Therefore, I’d argue that you do need to create a somewhat detailed history of a region to properly map out where its borders are at a certain time. However, it should be relatively easy to get a decent idea of where a country’s borders lie when it is first formed, assuming certain conditions hold.

I’m going to suggest a way to build a country’s borders from the ground up, starting from a small city-state society with medieval or pre-medieval technology. I want to make a few key assumptions:

• Power is somewhat centrally located, preferably in a city or military fortification. This is the most secure part of the state, and it is easier to control land closer to this location than land farther away.
• Territory is contiguous; you should be able to travel from any one point to another via land while remaining in the country.
• The technology is sufficiently limited such that the above assumptions hold. While naval power may be possible, air travel is not. This should hold for the sort of society we’re talking about, assuming there aren’t significant magical powers.
• Neighboring states have relatively similar strengths. I’ll address scenarios where this isn’t true more at the end.

# Approximation 1: Voronoi diagrams

I’ll hypothesize that the original borders of a city-state, according to what I discussed above, can be approximated by creating a Voronoi diagram. Essentially, given a set of $n$ points (cities) in some two-dimensional space, a Voronoi diagram divides that space up into $n$ regions. The region $r_i$ contains all the points closer to point (city) $c_i$. The lines of the diagrams can be interpreted as the borders of these regions. Here’s an example:

Image courtesy of Wikipedia user Balu.ertl under the Creative Commons Attribution-Share Alike 4.0 International license.

Voronoi diagrams have already been used to model the borders of countries and states; see specifically the work of Jason Davies (images copyrighted, by the way). There are certainly many differences from real-life borders (although in certain parts, like North Africa, things seem to work), but again, this is only a first approximation.

For large $n$, creating such a diagram becomes a little complicated. Brute-force searches work but are obviously tedious; more sophisticated methods like Fortune’s algorithm become useful. For more information, see Easiest algorithm of Voronoi diagram to implement? and How do I derive a Voronoi diagram given its point set and its Delaunay triangulation?.

However, I’d like to deal with a much simpler case, where $n=3$. $n=1$ is obviously trivial, and $n=2$ yields precisely one border - namely, the perpendicular bisector of the line segment connecting the two cities. However, $n=3$ is a little more interesting, although it is certainly simple to solve. All we need to do is find the one vertex where all three borders coincide.

There are several ways in which we can do this, knowing the locations of three cities and assuming that each one is the center of its own city-state. We could use one of the above algorithms, if we really wanted, but those can be time-consuming to implement. Alternatively, we could use the fact that any Voronoi vertex is the center of a circle containing three points, and therefore, given three points, we could find the center of that circle. However, I’d like to use what I think is the simplest option: Determine perpendicular bisectors of segments connecting any two cities, and find the point where they intersect.

Some assumptions (well, just one, for now):

• The three points are not collinear. If they are, then the borders are just parallel lines, and there is no central vertex.

## Mathematics

Let’s have a set $C$ of three cities, $(c_1(x_1,y_1),c_2(x_2,y_2),c_3(x_3,y_3))$. We choose to find the segments connecting $c_1$ and $c_2$ ($\bar{s_{12}}$) and $c_2$ and $c_3$ ($\bar{s_{13}}$). Given that the $\bar{s_{ij}}$ is the set of points equidistant to both $c_i$ and $c_j$, we can set $$\sqrt{(x-x_i)^2+(y-y_i)^2}=\sqrt{(x-x_j)^2+(y-y_j)^2}\tag{1}$$ Simplifying eventually yields the equation $$y=\frac{x_j-x_i}{y_i-y_j}x+\frac{x_i^2+y_i^2-x_j^2-y_j^2}{2(y_i-y_j)}\tag{2}$$ Clearly, this blows up if $y_i=y_j$, but if that’s the case, then the border simply has the equation $$x=\frac{1}{2}(x_j-x_i)$$ which is simple enough.

We do the above for all three sets of points. To find the vertex, we simply find the point where all three lines intersect, which is simple, as we can do it for any two of the lines.

## Code

I wrote a program to do this in Python 3. To simplify things a bit, I’ve assumed that no two cities have the same $y$-coordinate, as that produces a line with infinite slope in $\text{(2)}$. If, for some reason, your setup includes a case like that, simply rotate the coordinate system a little so that all three points have different $y$-coordinates.

Here’s an example, with $c_1=(2,1)$, $c_2=(9,5)$ and $c_3=(4,7)$:

import numpy as np
import matplotlib.pyplot as plt

P1 = [2,1]
P2 = [9,5]
P3 = [4,7]

Set = [P1,P2,P3]

def dist(point1,point2):
"""Returns distance between two points."""
x1 = point1[0]
y1 = point1[1]
x2 = point2[0]
y2 = point2[1]
return np.sqrt((x2 - x1)**2 + (y2 - y1)**2)

def perp(point1,point2):
"""Returns slope and y-intercept of the perpendicular
bisector of the segment connecting two cities."""
x1 = point1[0]
y1 = point1[1]
x2 = point2[0]
y2 = point2[1]
m = (x2 - x1)/(y1 - y2)
b = (x1**2 + y1**2 - x2**2 - y2**2)/(2*(y1 - y2))
return m,b

M1 = perp(P1,P2)[0]
B1 = perp(P1,P2)[1]
M2 = perp(P1,P3)[0]
B2 = perp(P1,P3)[1]
def vertex():
"""Finds central vertex"""
x = (B1 - B2)/(M2 - M1)
y = M1*x + B1
return x,y

"""
This next bit divides each of the lines into a certain number of line
segments by adding a number of points onto the lines, and then removes
those points in the third city's Voronoi cell.
"""
for point1 in Set:
for point2 in Set:
if point2 != point1:
N = []
delta = 0.001
for i in range(0,10000):
N.append(i*delta)
M = [perp(point1,point2)[0]*a + perp(point1,point2)[1] for a in N]
Other_point = [a for a in Set if a not in [point1,point2]]
i = 0
while i < len(N):
x = N[i]
y = M[i]
if dist([x,y],point1) > dist([x,y],Other_point[0]):
N.remove(x)
M.remove(y)
else:
i += 1
plt.plot(N,M,'k')

for point in Set:
name = 'City at ('+str(point[0])+','+str(point[1])+')'
plt.plot(point[0],point[1],'x',label=name)

plt.plot(vertex()[0],vertex()[1],'kx')
plt.legend(loc='upper left')
plt.title('Voronoi cells of three countries')
plt.xlim(0,10)
plt.ylim(0,10)
plt.show()

Here’s the output:

# Approximation 2: Terrain.

Voronoi cells are, I think, a decent approximation. However, they completely ignore the landscape and terrain of the area. For instance, if an edge lies in the middle of a valley surrounded by two high mountain ranges, it seems possible that the border may shift to one of those ranges, as they’re easier to defend. The same thing goes for rivers, cliffs, etc.

I’ll assume that the following objects would cause borders to shift:

• Rivers
• Mountains
• Canyons
• Large bodies of water

I think these objects have been sufficiently justified as limitations (see celtschk ‘s answer).

## Mathematics

Most of these can be approximated with curves of essentially negligible thickness (lakes and oceans aside). Therefore, let’s say that any landform $L$ can be represented as a curve parameterized by a variable $t$: $$\mathbf{L}=\mathbf{x}_L(t)=(x_L(t),y_L(t)),\quad t_0\leq t\leq t_f$$ We can also represent a section of border $B$ as another parameterized curve, given by a parameter $s$: $$\mathbf{B}=\mathbf{x}_B(s)=(x_B(s),y_B(s)),\quad s_0\leq s\leq s_f$$ The challenge, then, is to come up with some iterative algorithm that maps $\mathbf{B}_{n}$ to $\mathbf{B}_{n+1}$. There are probably many options out there. I chose one of the following form:

Divide $\mathbf{B}_n$ into $N$ points $\{p_{1,n},p_{2,n},\cdots,p_{N,n}\}$. For each $p_{i,n}(x_p,y_p)$, calculate the distance to all points on $\mathbf{L}$ and choose the point on $\mathbf{L}$ that is closest, $l_{i,n}(x_l,y_l)$. Move $p_{i,n}$ accordingly. I played around with things and decided on a certain formula: $$dx=\frac{x_l-x_p}{1+a\cdot\text{dist}(p_{i,n},l_{i,n})},\quad dy=\frac{y_l-y_p}{1+a\cdot\text{dist}(p_{i,n},l_{i,n})}$$ $$x_{p,n+1}=x_{p,n}+dx,\quad y_{p,n+1}=y_{p,n}+dy$$ where $a$ is some scale factor and $\text{dist}(\mathbf{a},\mathbf{b})$ is the distance between two points $\mathbf{a}$ and $\mathbf{b}$.

This can be done as many times as possible. I’ve found that in many cases, even one iteration can be enough.

## Code

Here’s my implementation of the above, again written in Python 3. I’ve chosen $a=0.3$:

import numpy as np
import matplotlib.pyplot as plt

scale = 0.3

RiverPath = np.linspace(0,49,1000)
def River(t):
x = np.sqrt(t)
y = t*np.exp(-t)
return x,y

BorderPath = np.linspace(0,7,1000)
def Border(t):
x = t
y = t/4
return x,y

def dist(y,x):
"""
Returns closest point on the target curve to a given
point on the border.
"""
Set = []
for loc in RiverPath:
dx = x - River(loc)[0]
dy = y - River(loc)[1]
distance = np.sqrt(dx**2 + dy**2)
Set.append([distance,loc])
Set = sorted(Set, key=lambda S: S[0])
dR = Set[0][0]
p = Set[0][1]
target = River(p)
return target

def move(Q):
"""Moves each point on the border curve parameterized by Q."""
X = []
Y = []
for q in Q:
x = Border(q)[0]
y = Border(q)[1]
point = dist(y,x)
point_x = point[0]
point_y = point[1]
mag = np.sqrt((point_x - x)**2 + (point_y - y)**2)
dx = (point_x - x)/(1 + scale*mag)
dy = (point_y - y)/(1 + scale*mag)
X.append(x + dx)
Y.append(y + dy)
return X,Y

plt.plot(River(RiverPath)[0],River(RiverPath)[1],'b',label='River')
plt.plot(Border(BorderPath)[0],Border(BorderPath)[1],'k',label='Border')
plt.plot(move(BorderPath)[0],move(BorderPath)[1],'r')
plt.legend(loc='upper left')
plt.show()

It uses the following parameterizations: $$\mathbf{L}=(\sqrt{t},te^{-t}),\quad0\leq t\leq49,\quad\mathbf{B}_n=(s,s/4),\quad0\leq s\leq7$$ Here’s the result:

The new border hugs the river near the left, then shifts roughly halfway between the old border and the new border. More iterations might be desirable, but there’s currently something of a balance.

The formula for $dx$ and $dy$ could use some improvement, but even though it’s imperfect right now, I do think it’s functional. It can be adapted for multiple perturbing objects (i.e. multiple rivers, mountains, etc.) by calculating all the $dx$s and $dy$s, summing them, and then moving the border, not accounting for one landform at a time. You can vary the scale factor if you want, both in general and for specific landmasses. I haven’t yet played around to see how this could affect things.

# Where do we go from here?

The borders of countries still don’t quite match up with these approximations. I’d argue that part of that is because of modern technology. However, a great deal is due to history. Those mountains over there are supposedly uncrossable . . . until a feud between rival kingdoms necessitates a battle, which ends with one king triumphant, ruler of both. Or maybe that river was considered a fairly good border, until holy relics were found on the other side and suddenly the head priest really wants the site inside the country.

At this point, I’d say that James’ answer becomes invaluable. In the end, it is the people of your world who shape it, often more than you, the god-like figure outside it. You can control that history, of course, but those events can and will change the world. All my suggestions are are simply slightly more detailed slates with which to start building countries. After that, it’s up to you.

• I learned about Voronoi diagrams from this post, very interesting. – neontapir Jan 18 '18 at 15:08
• The contiguity assumption has many exceptions in the real world. Ocean transport and the sorts of inheritance laws used by pre-modern Germanic peoples encourage non-contiguous territories. – Jasper Oct 8 '18 at 8:08

Don't focus too much on rivers

Rivers can sometimes be used to mark borders (the Rio Grande being one of the famous ones). However, it's almost always the case that the border would be there regardless, and they simply adjusted it to fit the river so it would provide them both with a bit of defense, and spare each country the trouble of constantly having to cross it.

Here's a map of medieval Europe:

There are few things to keep in mind looking at this:

1) Most powerful nations are based around a river, not divided by one. London, Paris, and Rome all have major rivers flowing through them. This provides a major artery of trade, as well as fertile cropland to feed a large population. Over time, the tribes and cities that expand to form kingdoms tend to be ones with large populations. Therefore, most of your kingdoms will have a fertile heartland containing most of the population and usually the capitol. This core territory will then likely hold dominion over a more rugged hinterland with a much smaller population.

When two of these kingdoms collide, the border usually changes quite often as they fight each other. Usually the line will settle down somewhere in between the two, usually across rugged or less hospitable land that neither one is that interested in fighting for. If one side was in the midst of conquering, say, a fertile valley, they wouldn't agree to stop and draw a new border until they'd taken the whole thing.

The best example of this is Medieval Scotland. The vast majority of Scotland's population lives in the fertile area around Edinburgh, while the Highlands and islands are only lightly populated. In the population map below, notice now the main farming and trading area is packed with people, and formed the core of a kingdom that then expanded outwards. Note that this is a modern map, and the medieval numbers were likely a bit more balanced, albeit with the same general pattern.

2) The map is filled with dependent kingdoms. This was also true in Ancient Roman times. Looking at a map of the Roman Empire makes it seem like one big state, but in reality there were lots of dependent kingdoms within it, who had control over internal affairs, but deferred to Rome in everything else. On the Medieval Europe map above, Bohemia, Croatia, and Moravia fall into this category, along with many others. You may or may not want to include this in your setting, but it was a common historical occurrence. These dependent states often existed on the frontiers of their parent empires, contained a distinct ethnic group, and were used as buffer zones against hostile empires. Late-Medieval Croatia fell into this category. They were ruled by the Austro-Hungarian Empire, but held a lot of autonomy, and were used primarily as a buffer against the Ottoman Empire. These borders will often be very defensible, going along rivers and surrounding rugged of mountainous terrain, as these small dependencies would not be able to hold vulnerable, fertile lands against the encroachment of larger forces.

3) City States are common in areas with large coastlines and rugged terrain. City states simply rule one large city and the surrounding countryside. These states focus largely on trade and rarely build empires in their immediate neighborhood, instead conquering overseas possessions to expand their trade network. The Greeks used this system in the Classical Age, and the Italians had it for most of the Middle Ages. If your world has a rugged/coastal area with rich trade connections, I suspect it would be full of smaller city states, with small (and somewhat unimportant) borders.

4) Undefined Borders are common in vast uninhabited areas. Nobody (except Muammar Qaddafi) cares where a border is drawn across an uninhabited desert. Notice in the Medieval Europe map, how the Eastern European principalities of Kiev, etc, have borders that just sort of fade out into the Steppes. This is common in sparsely populated kingdoms sharing borders with undefined tribal groups. Since the nomadic horsemen will be crossing the border regardless, and the state doesn't have the will or ability to police it, there isn't so much a border as a general understanding that "the stuff over there belongs to them". This also goes for desert borders. Lots of maps of Ancient Egypt show their empire extending out into the Sahara, but it wasn't like you would run into Ancient Egyptian Border Patrol out there. Rather, there was just an understanding that Egypt ruled the Nile Valley, and anybody that came too close would be in trouble. You can draw a defined line for these types of borders, but just know that the reality on the ground would be much more fluid.

5) Disorganized Tribal Groups rule the frontier. In the Medieval Europe map, notice the Cumans, Uzes, and Vlachs in the South East, and the Prussians, Selonians, etc, in the North East. In sparsely populated areas, especially those inhabited by nomads, Kingdoms don't really exist. Instead the area is divided among tribes, clans, and other small entities. On maps these are generally marked together as a single ethnic group (like the Cumans), but are not given a color or borders. Instead, the other borders end, and the white area has the names of said ethnic groups, with the location indicating roughly where they were, and the size of the word often indicating the size of each. So, pre-Genghis Khan, the area north of China would be a blank area with the word Mongols written there, along with a few other nomadic groups. Historically, these groups would often unite and conquer their sedentary neighbors, forming new kingdoms who would be conquered in turn a few hundred years later. The Parthian Empire is a good example of this, as a nomadic horse nation who settled down and was later conquered by the Sassanids, another nomadic horse nation (who were then conquered by Arabs, who were then conquered by Mongols, who were then conquered by Afghans, etc).

Here's what I do when designing a DnD campaign once I have a map:

1. Look for every place that has something that would make people settle there. Minimum would be food and water. Any useful features and resources add bonuses. If the land is recently settled, start at one edge. Otherwise figure that people have been over most of the land (except for areas that you don't want them to be).
2. Make circles (use light pencil). Once you have the settlements, judge based on how much food and resources they have, how big their influence will be (a compass or a pencil on a string will work).
3. Since circles are unrealistic, adjust them for the terrain. If travel is hard, pull it in some and if travel is easy let it out some. Also, if there are natural features (river, cliff, forest edge, desert edge, etc.) near the edge, the edge usually conforms to the natural feature.
4. Overlaps are zones of conflict. The border will generally be within that zone of conflict (often following a natural feature).
5. Assimilation. If one settlement is completely or mostly within the area of influence, decide if it has already been assimilated into the larger power or not. If it has been assimilated, extend the powers influence in that direction by the strength of the assimilated power. If it has not been assimilated, pull the border back in that area. On the first pass, most will be assimilated.
6. Decide which borders might be peaceful and which will have conflict. Neighbors with different resources may be more peaceful toward each other and have trading relationships. Neighbors with similar resources are more likely to come into conflict since they gain less through trade.
7. Adjust for trade or conflict. Widen the borders of powers that have trade agreements and narrow the borders of powers that are in conflict. Repeat 4 through 7 as needed. Some powers may be assimilated and some new zones of conflict may occur. If a border shrinks to "free" a smaller settlement, decide if it breaks away (if not, leave a connection to the larger unit).
8. Fine tune as needed or desired.
9. Back Story. Create as much history describing how things got to the present time as you wish. There are likely many great plot hooks in the evolving map.

You are now at the start of the story or campaign.

How much detail do you need for your story to make sense?

As others have noted, national borders tend to run along coastlines, rivers, and mountain ranges. But there are plenty of exceptions, especially when no convenient river or mountain range was available in the general vicinity of where two nations bumped against each other.

Sure, you could write a history of the world up to this point to explain how your borders came to be. But is that necessary? If in a story a writer says, "Bob was tall and had red hair", he normally doesn't find it necessary to trace Bob's genetic history back to Noah to explain exactly how he came by this traits.

If for some reason you need an unusual national border in your story -- if say, country A is on the west side of the ocean and also control a tiny strip on the east side of the ocean, and country B is then east of that strip -- you might need a couple of sentences of explanation of how that came to be. But if the history isn't relevant to the story, even that probably isn't necessary.

If I'm reading a story set in a ficitonal world, or in some part of the world where I'm not familiar with the geography, I don't recall ever wondering, "Hey, wait a minute! How come the border between Foobar and Plughland runs through the Fwacbar Valley? Didn't the author say that there's a river near here? Why isn't the river the border? What's the history behind that?" Unless the story is about geography and politics, I doubt such a question would even come to the mind of 99.9% of readers.

Borders are a tricky subject. Though most will end due to natural terrain, like rivers or mountains, most borders are set by expanding kingdoms, only stopping when they meet resistance from another expanding kingdom. Because of this, there's no real formula per se.

However, you don't have to write prehistoric histories. Make one kingdom and have fun with. Think about who their enemies are. What do they produce? Maybe they trade with a neighbouring city. Before you know it, you'll have a flourishing kingdom before you. Good luck!

Although rivers are mentioned frequently here, the reason we humans have them as borders is due to transportation of goods, both to a political region and from it.

Most USA citizens do not realize that our States had shooting wars, with people killed, over rights to the water sources and waterways for transporting goods, for irrigation and drinking water. The same goes for natural oceanside ports (or those on big lakes). Water wars (literally wars) are the primary reason our map has weird bumps and extensions, water access, for both consumption and travel, is critical. Barges are far and away the cheapest form of transportation for goods; far, far cheaper than rail, trucks or horse drawn wagons.

Unless a region has a lot of natural lakes, it probably can't grow very much on rainfall alone. Not for agriculture or city life.

Find your glaciers or heavy lakes being replenished by rainfall, Trace your rivers through the valleys, rank each river based on how much "good land" it provides access to, how many other rivers it can join (it's network connections), whether it reaches a coast line. You can probably find the "good harbors" based on some surrounding landscape criteria (and how many rivers can reach it).

The highest-ranking rivers are borders; those are the ones people fought to keep some other political faction (country, state, whatever) from owning entirely. If those borders produce a country too large, sub-divide it using the highest-ranking river that passes through it, and do that recursively.

One alternative to generating the entire story, is generate stuff using Markov Chains based at current year heightmap/border earth data.

First you get an earth height map that has countries borders.

If the pixel of the height map is ocean/border you change its color to A, if its ocean/international land, you change its color B, if its ocean/country land you change its type to C, if its not-ocean/border you change it's color to color D, and if its not-ocean/international land you change to E and if its non-ocean/country land you change to F.

Some program will then get this modified heightmap and analyze it creating an probability table: The chance of some tile X being border, "international land" or "country land", based at what specific tile type their 8 neighbors are and based too the tile itself you are generating is ocean or non ocean.

With that info in your hand, the world map generator program will get a random tile and discover if it is "country land", "international land" or border based at their 8 neighbor tiles and his own type. After find this tile type it will go for the next one and generate it, and then go for the next one, and next one..... until it generate the entire map.

Some important things to make sure this works:

1-You must always generate the not-generated tile with most amount of already generated neighbor tiles, if you don't do that, the world will have some patterns based at how you generated it, as some example generating left to right starting from the first line, create something with an X pattern.

2-The markov chain data must be based at ALL 8 neighbors and must be influenced by the direction of the neighbor tile too.

2.1- An example, If at the top of the ocean tile you are generating there is a ocean/border tile, at the bottom of this tile you are generating there is a ocean/border tile too and you didn't generated the other 6 neighbor tiles but they are all ocean. The "question the program will ask" is something like this: "Assuming this tile is a ocean, the top and bottom tile is ocean/border, and all others are ocean tiles, what is the chance of this tile being a border, what is the chance of this tile being 'international land' and what is the chance of this tile being 'country land'? " Then the program will select its tile type (border, country or international) at random weighted by those probabilities.

2.2-If you don't use this method, most of the time you will have a map that is made entirely out of international area, or made entirely of country area.

3-Points 1 and 2 are based at discoveries I found while trying to map makov chain map. You will find some markov chain map generator ideas at internet that assume the markov chain wont work at generating maps (x pattern or whateaver) because they didnt discovered what caused their problems as assumed the use of markov chain itself was the problem.

You can use Geographic Information System tools to make what you want by creating or using existing data, you can use rasters and vectors staticlly or dynamiclly

• Hi ELMO. Welcome to Worldbuilding SE. It sounds interesting, but could you detail a bit how the tools work? We usually like to have answers a bit more than a link. So that people can evaluate without clicking the link. Links can be modified or disappear and the content of your answer lose its value. – clem steredenn Sep 1 '15 at 10:31