Metternich Engine

Anything related or not related to the project.
Post Reply
User avatar
Andrettin
Posts: 29
Joined: Sat Oct 12, 2013 2:09 pm

Metternich Engine

Post by Andrettin »

Hello! I am working on an open-source engine to develop games in the style of Imperialism. This is engine is called Metternich, and I am creating this post to share the progress as I develop it.

The engine is written in C++, with Qt being used for the UI. It is still in the very early stages.

Right now I am working on converting (public domain) geodata into game maps, in order to create the first scenario. This allows for maps based on the real world to be created efficiently, and then they can be touched up manually as necessary.

I have already implemented support for using geodata to create province maps for the game. The area of the world represented by the map is completely configurable:

Code: Select all

earth = {
	name = "Earth"
	size = { 1024 512 }
	world = earth
	map_projection = mercator
	min_longitude = -180
	max_longitude = 180
	min_latitude = -60
	max_latitude = 71.675
	province_image_filepath = "earth/provinces.png"
}
I am using a 1024x512 Earth map, which allows as much detail for Europe as in Imperialism, but with the rest of the world also being represented on the map. But if we wanted to have a smaller map, or one representing only a smaller portion of the globe, then we could simply change those fields and the province map would be generated accordingly (for example, if we wanted to have a smaller map covering only Europe as in the original Imperialism scenarios). The map projection can be changed as well.

Here is the province map I have so far:
provinces.png
provinces.png (10.45 KiB) Viewed 359 times
I added province geodata for the Low Countries, as well as much of Central Europe. And for some other parts of the world as well. Then, I did some minor manual touch-ups to the output, to remove province pixels which were only connected diagonally, and to ensure that all provinces have contiguous territories.

This is still a bit rough - German provinces are too large in some cases, for instance (the geodata I had available for it was mostly only for the modern states). But overall, this is much more efficient than manually creating the entire map from scratch.

The Metternich engine is fully open-source. Here is a link to its repository. And here is the repository for the game data.
User avatar
Andrettin
Posts: 29
Joined: Sat Oct 12, 2013 2:09 pm

Re: Metternich Engine

Post by Andrettin »

I have made a good deal of progress since the previous post. I have done a lot of groundwork for the implementation of scenarios, including having added basic support for defining countries and province ownership.

Additionally, I have done some work in implementing terrain, and terrain map data can now be generated based on geodata. A basic view of the tile map is now present, with terrain being displayed (support for transitions between terrain types is not implemented yet however).

Here is the current state of the province map:
provinces.png
provinces.png (12.47 KiB) Viewed 332 times
And the terrain map as it currently stands:
terrain.png
terrain.png (7.83 KiB) Viewed 332 times
It is of course still in a very rough state; geodata is used for mountains, while province land defaults to plains since no other data was present for that. If you look very closely, you can see some individual forest tiles on the map (the only forest geodata I have at present are points, rather than geopolygons).
User avatar
Andrettin
Posts: 29
Joined: Sat Oct 12, 2013 2:09 pm

Re: Metternich Engine

Post by Andrettin »

I have more progress to report. The engine now supports displaying an overview map when selecting a scenario to play:
scenario_screenshot.png
scenario_screenshot.png (51.44 KiB) Viewed 308 times
Other than the Restoration of Europe scenario, the others are not necessarily going to be actually kept (it is important to have multiple scenarios at this stage to test the scenario setup functionality).

As you can see, data for provinces in Italy, Spain, Congress Poland and Switzerland has been added now. Country province ownership for a scenario is determined by a history database, so that defining a new scenario can be as simple as determining a start date for it. Here is an example of a province definition:

Code: Select all

warsaw = {
	name = "Warsaw"
	color = { 65 97 160 }
	capital_settlement = warsaw
	
	history = {
		1477 = {
			owner = poland #part of the Kingdom of Poland c. 1477; Source: William R. Shepherd, "Historical Atlas", 1911, pp. 86-87.
		}
		
		1815 = {
			owner = russia #part of the Russian Empire in 1815; Source: William R. Shepherd, "Historical Atlas", 1911, pp. 158-159.
		}
	}
}
Everything in the "history" field is applied when a scenario is set up, with what is applied depending on the scenario's chosen start date.

As a further note, even though the province map has the whole world depicted in it, it's only possible to see a part of it in the scenario map (the map is scrollable). The map for scenarios set in the real world is 1024x512 tiles, and each tile is depicted as a 2x2 pixel area on the scenario, so that the depicted scenario map is 2048x1024. The space for displaying the map is 1024x512, hence why only a part of it can be seen at any given time. But at any rate, it's possible to see most or all of any of the continents on the map at a single time.

You may also have noticed that I made the Portugal, the Netherlands and Spain (as well as Sweden, but it is not visible on the map yet) great powers. This is for three reasons: first, I wanted country types (great power, minor nation or tribe) to be fixed per country, and those countries are great powers in earlier start dates; since great powers can't become minor nations and vice-versa in the course of a game, it feels more consistent for them to not change in status between scenarios. Second, Portugal, Spain and the Netherlands all had substantial colonial territories in the 19th century, so that the great power gameplay fits them better, even though they were no longer great powers in the real world sense. And third, these are countries which are interesting to play in the 19th century, and which have a realistic shot at becoming one of the stronger powers.

Flavor-wise it would be weird to have so many "great powers" in the game, though. So I am intending to make only the powers ranking 7-8 in score to be termed "great powers" in the game, while the powers ranking lower than that would be termed "secondary powers". This would be a purely cosmetic difference, however.

For random maps, the intention is to keep the traditional amount of powers (i.e. 7). And the idea is to have the map size for random maps to be configurable, with the player being able to choose from the following sizes: Small (128x64) (this is similar to the map size in Imperialism), Normal (256x128), Large (512x256) and Huge (1024x512).
User avatar
Andrettin
Posts: 29
Joined: Sat Oct 12, 2013 2:09 pm

Re: Metternich Engine

Post by Andrettin »

More progress: I've added several more provinces to the map (some in areas not shown on the map below), and I reworked how the scenario map is displayed, so that it has a closer-up scale. Additionally, great powers can now be selected on the map.
scenario_menu.png
scenario_menu.png (68.75 KiB) Viewed 287 times
scenario_menu_selected.png
scenario_menu_selected.png (72.63 KiB) Viewed 287 times
Post Reply