
Medieval Fantasy City Generator - BerislavLopac
https://watabou.itch.io/medieval-fantasy-city-generator
======
DanAndersen
One thing I would love to see in a city generator like this is a simulation of
_time_ and how gradual evolution shapes a city.

There's a picture book called "Barmi: A Mediterranean City Through The Ages"
by Xavier Hernandez and illustrated by Jordi Ballonga. It illustrates a
fictional city from Neolithic settlement to Roman outpost to medieval town to
modern city. Some images can be seen at
[http://jordiballongaen.blogspot.com/p/baronia.html](http://jordiballongaen.blogspot.com/p/baronia.html)

In this book, you see how a Roman amphitheater decays during the Dark Ages,
and the structure is partially used and cannibalized to create a circular set
of apartment buildings, which then influences the later layout and design of
the city in modern eras.

Procedural generation unfortunately tends to try to generate everything at
once, as if a medieval city was created _ex nihilo_. It would be interesting
to see what it would look like if such designs incorporated evolution over
time.

~~~
arethuza
Split in Croatia is a great example of this - where a part of the layout was
based on the Emperor Diocletian's Palace:

[https://en.wikipedia.org/wiki/Split,_Croatia](https://en.wikipedia.org/wiki/Split,_Croatia)

Maybe Edinburgh and volcanoes as well...

[https://en.wikipedia.org/wiki/Edinburgh_Castle#Geology](https://en.wikipedia.org/wiki/Edinburgh_Castle#Geology)

~~~
Maultasche
That was one of the most interesting cities I've visited. The city was a mix
of medieval architecture and pieces of a Roman palace. There were the brick
walls of buildings built between Roman columns and there was a Roman-era
mausoleum on one side of the street. It was clear that it used to be quite an
open layout that was filled in by buildings in later centuries.

It must have been interesting in the early days of the city with a bunch of
people occupying an old palace, fortifying it, and building houses for
themselves within the grounds.

I wondered what Diocletian would have thought to see his old palace
transformed in such a way.

------
thom
I love this sort of thing, but the far more interesting challenge to
procedural games is engaging the player emotionally and intellectually, and
giving them a sense of long term narrative progression. I'm mainly thinking of
RPGs here, but it's a problem that surfaces up to this day in things like No
Man's Sky. Even in non-procedural games that nevertheless allow you to
continue playing in a world after all the storylines are concluded (e.g. GTA,
Assassin's Creed), you still have this sense of emptiness when you realise
these houses don't really have anyone in them, and there's just a city full of
mostly silent people walking aimlessly around. Accumulating money or equipment
isn't interesting anymore because there's nobody left to fight.

Dwarf Fortress puts in a lot of work to keep worlds and interactions rich.
Even games like Football Manager are fundamentally role play, and the
constantly evolving rivalries and personnel involved keep things fresh well
into the game. Honestly think small but rich villages would be more
interesting than massive but realistic looking cities, but this is still
impressive stuff.

~~~
AnIdiotOnTheNet
The difficulty is that it is relatively easy to generate patterns that follow
rules because computers are really good at it, but it is incredibly difficult
to make an algorithm be creative. What we really want when we say we want an
infinity to explore and interact with is that we want infinitely many new and
interesting experiences, which procedural generation has been, thus far,
unable to provide. This is not surprising, even most human beings aren't very
good at it.

~~~
indigochill
>What we really want when we say we want an infinity to explore and interact
with is that we want infinitely many new and interesting experiences

Agree.

> which procedural generation has been, thus far, unable to provide

Disagree.

I think Dwarf Fortress (and to a lesser extent, EVE Online) has shown how to
do procedural generation that does result in interesting interactions. There
are four important factors in successful procedural games:

1\. Granular modulation (you don't just punch a dwarf, you punch out a dwarf's
left eye).

2\. Diverse interactions (lava can be used to smith weapons. Or burn invaders.
Or mixed with water.)

3\. Persistent state as a result of the above. In a game like GTA, you can
stage a one-man stand against overwhelming military force, but when you return
to the site of your last stand, not a trace is left. In Dwarf Fortress, even
if you lose you leave behind traces that can be revisited in future games.
This is also the magic of EVE Online's alliance endgame (establishing player
structures in contested space and seeing your alliance people flying there),
without which I think the game loses its luster.

4\. Environments small enough to build up a history. You can remember sites of
memorable conflicts in Dwarf Fortress because your play space is constrained
to a single tiny piece of the larger world. In Minecraft, Starbound, or No
Man's Sky, your play area is so large that you never build up memories of any
particular place (Starbound offsets this somewhat by having set pieces, but
loses that sense of location outside of those pre-crafted zones). In EVE
Online alliances settle for months or longer at a time in a particular region
of space so that they develop an emotional attachment to it.

~~~
Retric
EVE Online gains most of it's value from PVP interactions even if they are
remote. The random world generation is kind of meaningless backdrop to the
human drama involved.

~~~
Ntrails
The only thing that makes eve online engaging is players interacting with
players. Especially at scale. The market/economy is incredible, the high-
consequence pvp is both boring as hell and occasionally exhilarating. The
metagame is nuts.

It's a cool as hell set of concepts which would never make it into a modern
game imo, but that's the strength of it and what keeps it ticking

------
cissou
Awesome! This is by the maker of Pixel Dungeon[1], the best rogue-like on
Android. Anyone who's played it can testify that (s)he knows all there is to
know about procedurally generated maps.

[1] [http://pixeldungeon.watabou.ru/](http://pixeldungeon.watabou.ru/)

~~~
LoSboccacc
[http://dwarffortresswiki.org/images/thumb/c/c2/Town_map_43.p...](http://dwarffortresswiki.org/images/thumb/c/c2/Town_map_43.png/300px-
Town_map_43.png)

The wiki is well organized for that kind of resources. It’s important to note
that some of those irregular area are zones, not building. Actual building are
simpler with the exception of some special cases.

~~~
codetrotter
I think perhaps you replied to another comment than the one you intended to
reply to.

Seems like the one you wanted to reply to was
[https://news.ycombinator.com/item?id=17931944](https://news.ycombinator.com/item?id=17931944)

------
_Microft
If you like procedural generation and maps, you _definitely_ need to follow
this high-quality series here:

[http://heredragonsabound.blogspot.com/](http://heredragonsabound.blogspot.com/)

It's ranging from generating city icons to picking appropriate names and
placing ocean labels. Really, check it out if you're even slightly interested
in such stuff.

~~~
srt19170
Thanks for the mention, I appreciate the feedback!

~~~
_Microft
You're welcome! How did you notice?

------
Animats
Procedural city generators are finally getting decent. See this one.[1] Not
only does it fill a city with marginally reasonable buildings, every room in
every building can be entered. The rooms even have furnishings.

[1]
[https://www.youtube.com/watch?v=n1eZOV8r_g4](https://www.youtube.com/watch?v=n1eZOV8r_g4)

~~~
presscast
It seems like they were downright crappy only a few years ago. What's changed?

~~~
duiker101
A wild guess: more computing power means more content that can be processed
and the need for more content can be addressed by computer generation. For
example, just a few years ago open world games were just a handful and
required a lot of work. Nowadays even a simple game can have a large
procedurally generated world.

~~~
blackbrokkoli
Adding to this, more computing power at everyones desk. Very good computers
were probably capable of generating good maps five years ago, but if everyone
can play around with generators and models as a weekend project there is a lot
more innovation and development!

------
lbriner
Serious application for these tools: crowded countries like the UK often talk
about building new towns rather than annoying everyone is existing towns by
more and more building work.

Unfortunately, new towns tend to be rather formulaic and dull. With tools like
these, you could start with a medieval city generator and use algorithms to
apply changes that would have happened over 500 years and then build the new
town based on the result, something more organic and natural than something
designed from scratch.

They should have a competition for it!

~~~
gonzo41
One problem. Cars!

Unless you can lay down some serious infrastructure as a constraint first
hand. Driving in these types of places is always insane. Just look at Italy.

It'd be an easy problem to solve by pushing for a carless city or smaller car
city paradigm. But folk will want their cars.

~~~
ivanhoe
Medieval cities were limited by the size of the fortification walls, so
streets had to be as narrow as possible to save the valuable space. You don't
have such limits with this, so you can turn all streets into boulevards if you
like...

~~~
131012
please no :(

~~~
baud147258
Boulevards can be very nice if you put separated bike lanes and wide walkways
(perhaps with trees to provide some shade during summer).

------
anonytrary
This is officially the coolest project I've seen on HN since
[https://github.com/fogleman/primitive](https://github.com/fogleman/primitive)

~~~
Svoka
I think you would also like
[https://mewo2.com/notes/terrain/](https://mewo2.com/notes/terrain/)

~~~
samstave
Wow that is awesome.

------
GistNoesis
It looks nice. What I like about procedural generation is the great freedom in
design. It's a great opportunity to tackle the problem of managing complexity
in a visually rewarding way.

There is the top down approach where you start laying out the road networks,
it defines neighborhoods, which you split up into individual houses. It can be
made as nice as the programmatic time you are willing to invest, ultimately
it's realistic, but quite repetitive and boring.

There is the scoring based approach where you get points when certain type of
building are near other type of buildings. Then you optimize more or less.
Quite often it's not as repetitive and boring, but not very realistic, so you
can add some statistic matching penalties to make it more realistic
(eventually using neural networks like GAN).

There is the more ambitious and computer-intensive bottom-up approach, where
you start defining the rules of the game (like a sim-city generator) and have
your city evolved by playing the game eventually from the point of view of the
various agents in the game. The city will have a more organic feel and look.
By defining the right rules, you can even witness some emergent behavior. You
have less control but it'll give you a world deeper than it looks.

------
toomanybeersies
This reminds me a lot of the work Tarn Adams has done in city generation in
Dwarf Fortress [1]. I seem to remember that he generated some similar looking
maps as png files in his dev log somewhere, but I can't find them now.
Obviously in-game they're all rendered as text.

[1] [http://bay12games.com/dwarves/](http://bay12games.com/dwarves/)

------
dang
A couple of small discussions that agree on triangular buildings:

[https://news.ycombinator.com/item?id=14410768](https://news.ycombinator.com/item?id=14410768)

[https://news.ycombinator.com/item?id=14407996](https://news.ycombinator.com/item?id=14407996)

~~~
n4r9
Interesting about the overhang being due to taxation laws. I could swear they
told us in school that it was because people often thew their dirty water out
of second storey windows, and this way it could go straight into the gutter in
the middle of the street where no one walked.

------
ez15972
He even wrote an accompanying 3d visualizer: [https://watabou.itch.io/toy-
town](https://watabou.itch.io/toy-town)

------
lloydde
Semi-related, I really enjoyed the discussion and resources shared about a
month ago in the
[https://www.dungeonstome.com/](https://www.dungeonstome.com/) HN comments
[https://news.ycombinator.com/item?id=17704557](https://news.ycombinator.com/item?id=17704557)

------
jschuur
And this lets you fly/walk through a 3D visualization of towns made with it:
[https://watabou.itch.io/toy-town](https://watabou.itch.io/toy-town)

------
mrec
PSA: be very wary of clicking on the "overworld" link in the bottom left of
the city map. It showed a continent-scale map, but then locked up the whole
machine, swapping like crazy, for about 10 minutes before I finally managed to
kill it. No idea what it was doing but it even managed to break Ctrl-Alt-Del
on one attempt, which I'd never seen before, and was eating over 6Gb memory
when I finally got Task Manager open.

------
CalRobert
This is great! Would love to see it used by city planners too - turns out a
lot of medieval cities/towns are really pleasant places to walk, and just be.

~~~
shusson
> turns out a lot of medieval cities/towns are really pleasant places to walk,
> and just be.

minus the poop I'm assuming

~~~
CalRobert
and plague, and increased risk of murder, etc.

But the towns _now_ are wonderful. Beautiful architecture and fantastic for
walking, or sitting and enjoying a meal, coffee, wine, or beer while taking it
in.

Growing up I wished we had real towns like the ones in kids movies set in
medieval Europe. I couldn't fathom that they do indeed exist - after all, why
would you stop building them?? I still don't really understand why we stopped,
to be honest. It's easy to say "cars" but I think there's more to it than
that.

The first time I visited the Alsace I was blown away that places like this are
real.

[https://previews.123rf.com/images/freeartist/freeartist1609/...](https://previews.123rf.com/images/freeartist/freeartist1609/freeartist160900005/64897672-most-
beautiful-villages-of-france-riquewihr-in-alsace.jpg)

~~~
mywittyname
Costs.

Replicating that beautiful masonry and hand-milling the timber would be
outrageously expensive today. Plus, I doubt the raw materials are nearly as
abundant, especially the old growth trees. Then there's modern building codes.

I agree that these are stunning cities, but more modern European buildings can
also have similar charm, I think.

~~~
CalRobert
Fair enough - I used to work under a board that was about 20" by 20" by 30
feet. It was crazy to me that it's now rare to ever see a tree that tall and
straight on this entire island any more, but once it was just a normal piece
of building material in an old grain mill.

There were also markings on the wall about max weights in hundredweight (cwt)
- I think the building was from the mid-19th century.

------
erikb
I think this stuff is interesting but not heavily moving. Every few years
someone shares a tool like this. But why not have such a tool connected to
something useful like a flight simulator or openstreetmaps, or in a format
that game engines can use as foundation for a game? Then people could actually
do something with it instead of just looking at it.

~~~
leanthonyrn
Agreed. The Map is a great start. If this content could be exported to another
type of game such as Elder Scrolls Morrowind or Thief. Even OSS games like
Battle for Wesnoth , 0 A.D., and SuperTuxKart would be interesting.

~~~
erikb
or Unity or RPG Maker. Think about you want to build your own game and have
tools like the Dwarf Fortress World generator as a starting point. This way it
becomes much easier to create a lively world.

------
stevoski
A lot of European medieval cities are built on top of an ancient Roman city.
You can usually perceive a very straight broad North-South street and a
straight (but not so wide) East-West street, which have been kept from the
earlier Roman city. The rest of the streets, however, seem to be in random
order.

------
fapjacks
I play a fork of his Pixel Dungeon called Shattered Pixel Dungeon literally
every time I have a free minute (e.g. waiting in line at the bank, using the
restroom, laying in bed trying to sleep, etc). It does not surprise me in the
least to see something like this from him.

------
brandonjm
Pretty cool!

Does anyone else get strange clumps of 'Gates'? Surely a city wouldn't need a
whole block of gates, or am I misunderstanding something?

Edit: Just realised they are always around gates in a wall if the wall is
enabled. ie. they are sections of the town that flank the gates.

------
DonHopkins
I like how you can drag the wall control points in and out in alternation to
make a star fort, like Naarden!

[https://www.google.com/maps/place/Naarden/@52.295444,5.15800...](https://www.google.com/maps/place/Naarden/@52.295444,5.1580074,1846m/data=!3m1!1e3!4m5!3m4!1s0x47c613855ca1cf47:0xe92284db2cf48fbe!8m2!3d52.2952549!4d5.1604238)

[https://en.wikipedia.org/wiki/Bastion_fort](https://en.wikipedia.org/wiki/Bastion_fort)

------
crashdown
Reminds me of this
[http://mewo2.com/notes/terrain/](http://mewo2.com/notes/terrain/)

------
shezi
I have seen this a while ago in a thread about procedural map generation. If
you liked the link, here is more of that stuff:
[https://twitter.com/ptychomancer/status/980968298002006016](https://twitter.com/ptychomancer/status/980968298002006016)

------
ahje
I suddenly feel like playing D&D again.

------
KirinDave
I didn't see links to the actual algorithm and how this is constructed. Does
anyone have source material?

------
skvj
If you can't seem get enough of procedural generation, 'procjam' has even more
great past entries
[https://itch.io/jam/procjam2017#entries](https://itch.io/jam/procjam2017#entries)

------
midasz
Ok I'm impressed, this is cool.

------
bencollier49
The large cities in particular are really impressive. There's a great fantasy
map generator which I followed on Twitter for a long time (can't find it right
now, sadly) which would be a magnificent companion tool.

~~~
BerislavLopac
Possibly Uncharted Atlas, though they don't do cities.
[https://twitter.com/unchartedatlas](https://twitter.com/unchartedatlas)

------
stankot
Is this by any chance open source? I would love to see the code.

~~~
wackro
> Made with Haxe + OpenFL, the source code is available here
> ([https://github.com/watabou/TownGeneratorOS](https://github.com/watabou/TownGeneratorOS)).

~~~
stankot
I missed that completely, thank you!

------
geokon
I really like the aesthetic of the maps. A kind of old map style. Is this done
using some library or is it custom for this application?

------
Kagerjay
ah this is very cool. I see many applications of this

reddit r/worldbuilding type applications. For building video game scenes to
tell stories, or to write fiction & fantasy novels.

------
ralphael
Absolutely brilliant! I love hackernews for these kind of gems.

------
SilverSlash
Is this open source? If so where I can find the source code?

------
selimthegrim
Haha I wonder what David Macaulay makes of this

------
w0ns88
D&D heaven xD

