3/24/2012

A couple of city examples

I just wanted to keep everyone updated. I'm still dabbling with cities, and their placements. There's progress, and although I'm not satisfied yet, I'm optimistic!

Last addition is some minor adjustment to rivers, more refined city placements, city categorization, and city labels. I still have to make certain that cities of different categories do not come too close to each other, and the different coastal city categories need alot more work.

I'm also going to add more metadata to the underlying map, which will be very beneficial for search & pattern algorithms in the future.

Continent with cities and rivers

Our familiar continent, let's call it Utopia!

3/22/2012

Placing cities. It's fun and annoying at the same time.

I've been trying to place cities lately. And although it's fun and offers me some personal pleasure, it's also quite annoying. First of all, it's quite demanding on those milliseconds. The map has metadata on which pixels are coastal pixels, which pixels are along a riverbank, which pixels are land pixels, and which pixels are water pixels. Beyond that, there's just not alot of metadata (I'm betting good money that I will invest time in improving this!), so we have to search and approximate alot. In trying to weight what would make a good city location, there are alot of magic numbers...

If you didn't know already, I hate magic numbers. They make no sense to anyone except me. Even future-me won't find them very logical. And the thought of that makes me sick. But alas, that's the sad truth at the moment. I need some magic numbers to form thresholds and boundaries. I didn't plan to rant over the source code here, but I'm not proud of this part. Don't get me wrong, the current [in progress] result is OK, but it's not really maintainable in the long run. Uncle Bob, or more formally Robert Martin, would literally cringe if he saw it. So needless to say, I'm going to spend some time refactoring and fixing it. I've tried to keep a focus on performance in this project, and performance doesn't always go hand in hand with clean code (sadly). But I'm going to sacrifice a few hundred milliseconds to clear my conscience. I aim to be a craftsman after all.

And that concludes today's rant...

I'll post some screenshots instead. The icons used for the cities ... You can discuss them, sure. But if you think about it, you'll come to the realization that they aren't the pillar of importance here.

Continent with a dry climate

Island with a dry climate
Continent with a more temperate climate
Island with a more temperate climate


3/09/2012

Blazing ahead - City placement

So, I haven't written anything for a little while. I've been busy. With other pressing matters, kids with the flu, but also with working on my project. I've experimented with several different themes, which except the base geography, creates very different effects. The outcomes are totally unique. I can like that! It means that some of the things that I set out to do are actually coming together. The greatest challenge in many regards is actually finding decent seamless textures! I'm no artist (which is part of the reason I started this project in the first place), so my own sorry attempts don't cut it.

After this "multi theme prototyping phase", I want to take a step back, focus on one theme, and create every map layer for that one theme. The next challenge is... drumroll


City placement

Cities and towns will be a layer of the map that you can choose whether to generate or not. I understand that not everyone will find automatically generated cities useful, - but I would, and as such, I'm doing it!

I'm currently in a phase where I'm trying to come up with a decent algorithm for finding suitable places for cities. I'm probably going to base it on the algorithm that finds river locations, with some modifications of course.

But I need your help.

What describes a good city location? Where are cities normally located? Cities might have different size, - can we generally say the likelyhood that a large city will form in a specific location? Or a small town? What should be the minimum distance between two cities, as a general rule?

These are questions I need help with finding the answers to, to create an algorithm that produces city locations that are believable. Take into account that the maps will seldomly be 21st century maps. Fantasy maps are most often of the  medieval sort, although they don't necessarily have to be.

Update


I want to consolidate some of the major points written in the comments here. I am going to group the points made, into two groups:

  • Geographic
  • Sociological / Demographic 


In the Geographic group lies the most obvious and visible requirements.

  • "Near water" - probably the easiest requirement to check for. At a river mouth, a river fork, a bay, or a coastal point. 
  • "Mountain pass" - most likely not the largest cities, but strategically placed ones. Most likely very secure. 


In the Socialogical / Demographic group lies more indirect requirements that may have a large impact on the bigger picture.

  • "Trade routes" - smaller towns may form naturally along major city trade routes, especially if the area is lush and abundant with food.
  • "Cultural centers" - Harder to implement as an initial requirement, it could be interesting to attempt to plot major cities first, then perform a second algorithm, using the large cities as cultural centers, to sea how lesser cities and trading routes form in their vincinity. Implementing this is quite some way down the road though.


There are more things to consider, but unless someone suggests specific ways to put them into an algorithm, I think I have more than enough to start with. Excited!

3/01/2012

Moving into the water.

I've just added texturing and blending to the oceans. The effects are intentionally subtle compared to those on land, but I still believe they definitely serve their purpose. I'm showing off a continent using the latest effects. The image is 2048*2048 pixels, so click on it to see it in its native resolution.

Generated map

There are exceptionally good cartographers and artists out there, and I am pretty sure computer generated graphics will never be on par with those creations. However, when it comes to creating topology and continental shapes, this is already way past what I would be able to do manually.