City placement and path rendering

After the generation of the world, the next logical step is the placement of cities of the various factions. The general idea is to have each faction specify its own desired method of placing cities, e.g. at a coast in order to have ports, by a mountainside for dwarves, always at coast for a pirate faction, in the forest for elves, etc.  Cities are placed one at a time for each faction: faction0 city0, faction1 city0, …, factionN city0, faction0 city1 … The reason for this is that if some requirements are more difficult than others, we do get to try to satisfy them for every faction, as otherwise the last faction would have difficulty placing cities in ideal locations. Here is a visualization of cities and routes (sea and land) between them

overworld_render_test 2017-06-09 12-04-41-25

The world starts connected: cities in the same landmass are connected to each other via roads, and ports are connected to each other via naval routes. At the moment the paths are calculated independently, which creates the unfortunate result of almost-overlay of paths which does not make sense:

overworld_render_test 2017-06-09 12-15-09-47

And when we smooth the paths to look pretty from a bird’s eye view, the paths again slightly diverge:

overworld_render_test 2017-06-09 12-15-27-89

So, what needs to be done is that every time a path is calculated, the movecost map is updated to reduce movement cost at areas with a path. This causes coalescing of a big chunk of almost-overlapping paths. Here’s an example result when setting the movecost to 75% on tiles with paths, while calculating more paths, using the same viewpoint as above:

overworld_render_test 2017-06-09 15-14-29-64

A much cleaner result! Here’s a video of the city and path (non-coalesced) visualization:


Another thing that’s in the works is a smooth transition between smooth paths from a very zoomed out view to actual, real, tile-to-tile piecewise-linear, straight/diagonal line paths when fully zoomed-in. The reasoning behind this is that when you’re zoomed in enough, you probably care about the exact, precise path. When zoomed out, you possibly want a more high-level overview, which can be more pleasing with smoother curves. Here’s a video with the dynamic path smoothing in action:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.