Developer Diary 9 – Map Making

We used a well known coastline to test our mapping code.

We got an offer we couldn’t refuse… to use this well known coastline for our mapping code tests.

“Hang yourself or don’t hang yourself, you’ll regret it either way” 

— Søren Kierkegaard

Work on the new game is continuing apace, and the time has come to confront our old nemesis – map making. If you’ve been following us long enough, you may remember my protestations about the amount of map making in the original Unity of Command as well. This time around, the mapping situation is both better and worse, depending what you’re looking at. So let me show you what’s new.

The Sheer Size

The good thing about moving away from Russia (at least for the moment) is that there’s much less terrain to cover. No seriously, if you haven’t had to manually assign a terrain value to every hex from Lake Ladoga to the Caspian – you may have missed how ginormous Russia really is. If you have, go look at the map now, it’s huge.

So, less terrain to work on – yay! In fact, the theater is so miniature, by comparison, that we’ve actually had to zoom in a little. The map scale is now 15km/hex, down from 20km/hex. Incidentally, this shortens the duration of the turn from 4 days to 3. It’s easy to work out why – so that distances covered by units in each turn stay the same.

The Coastline

screen2The never-released map editor for Unity of Command already used GIS data to give us a coastline overlay. However, importing this overlay into the game was not automatic. You had to paint every hex of the coastline manually, and then decide whether it’s sea or land. This was not ideal. For example, this lake hex had to be manually made unplayable in every scenario, otherwise units would be able to cross the lake as if it were flat terrain.

To streamline the process, coastline data is now imported into the game directly, so that the map editor knows whether each hex is land or sea. In situations where the coastline cuts accross say, 50% of a hex, such hexes are flagged for manual adjustment. To fix these problematic parts, entire sections of the coastline can then be stretched or squeezed to fit the hex grid, with a map editor tool. Inevitably, keeping the coastline recognizable and fitted neatly into hex grid is going to take some work. The idea behind these tools is to make this easier, both for us, and for community map-makers later on.

The Beaches

For a bunch of different reasons, we’ve also made our lives more complicated this time around. Mostly this is because the land surface is rendered as one giant heightmap. So instead of just drawing the coastline on some flat 2D surface, we now need to apply a sloping profile across it to make it 3D. This is… complicated. It does make for nice plots in Ante’s debugging tool though.

Straight of Messina, we've been looking at you far too long

Strait of Messina, a piece of topography with which we’ve developed a complicated relationship

The sloping coastline does give us the ability to apply a different slope to beaches, as opposed to regular coastline. It makes the beaches look pretty, but it’s also a gameplay element with the amphibious landings mechanic.

The big landings such as Overlord and Husky should naturally appear as set-pieces in the game, more or less fixed at the start of a scenario. However, we are also looking to have improvised landings, such as Patton’s “end-runs” along the northern coast of Sicily.

To make this whole thing work, we need beaches, otherwise you’d be able to land your troops at the cliffs of Dover! Plus, again, the beaches look cool and frankly we just couldn’t resist.

The Sea Floor

It’s not a game element, but we’re also rendering the sea floor into the heightmap. This is for looks only, no excuses this time. Currently the sea floor only shows as a slightly lighter area of water close to the coastline – the water shader is still being worked on. Eventually it will be nicely visible through the water to give an effect of a deep or shallow sea floor, respectively.

I’m signing off with an in-engine screenshot showing the results of all this. I’ve left some gameplay elements on the map so you can get a sense of scale for this thing. You can see from the angle that the engine allows you full rotation (not just facing north) and that the map is nicely readable even when zoomed this far out.

uoc2_mapping

As usual, I hope the post was worth your time reading it. You can let me know what you think in the comments below. Feel free to ask if you have any questions.

Cheers!

 

 

This entry was posted in News. Bookmark the permalink.

19 Responses to Developer Diary 9 – Map Making

Leave a Reply

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