The best kittens, technology, and video games blog in the world.

Friday, November 23, 2012

Random campaign scenarios for Medieval 2 Total War

Total War games have somewhat limited replay value, since campaign map is the same every single time, and there are only so many mods you can play.

In my Concentrated Vanilla mod I tried to make things somewhat more interesting by introducing large number of tweakable settings - so for example in one campaign cavalry would be really nerfed and I'd need to play infantry game, some other time mining income was far greater than any other income so a small number of key settlements held key to victory, or I removed distinction between cities and castles and so on. Every campaign slightly different.

That still doesn't get us very far, since campaign map looked the same each time.

Here's the campaign map (it's like vanilla map except a bunch of extra regions added to fill some gaps):



The first thing I've done was add scenario builder to Concentrated Vanilla script, and used it first to make life much more difficult for Byzantium (which also started at war with all its neighbours). It was some serious fun, especially early game.


I could of course keep making new scenarios manually (it's not that hard), but then I got an even better idea - why not assign settlements to factions at random?

I started a campaign and I'm writing AAR as I go (sadly I didn't have much time this week).


I'm playing as Portugal (white with blue borders), which starts in Arhus, Alexandria, and Cagliari. You can get details in AAR.

This is fun and somewhat bizarre experience, but then it's a bit too easy - AI is very confused with its provinces scattered all over the map, and it's too easy to attack AI, take its one province, and then get it to agree to ceasefire since you're not longer neighbours. Rinse and repeat.

So I tweaked the scenario generator. Instead of allocating settlements randomly X% of the time it allocates a settlement next to one already allocated, otherwise (or if none are available), it picks a random one.

75% cluster, 25% random:

67% cluster, 33% random:

50% cluster, 50% random:


These maps are very interesting, and probably won't lead to AI problems like with my AAR.

Technical details


As for some extra details - settlements are neighbours if they have either land link or land bridge, so Denmark is neighbour of Sweden (land bridge), but Cyprus isn't neighbour of anything.

In my AAR playthrough I put minimum number of settlements at number of family members, since I had no other way to deal with them, now they'd just be places somewhere near existing cities.

If faction gets more cities than it had originally, extra cities get filled with some basic units (IIRC I set it to 2 Spear Militia or something similar + 2 basic missile units for all factions).

Muslim and Orthodox factions get more settlements on average, since otherwise it would be too easy for Catholics.

The script can be tweaked to always allocate some settlements to some factions (like Rome to Pope), allocate different units based on settlement size and type, and do other interesting things.

All navies are disbanded to simplify matters.

I could generate correct maps for campaign start menu, but it's better for suspense not to reveal factions' locations there just yet.

There are some bugs to fix (Durazzo gets skipped always, churches should get demolished if faction of different religion gets settlement).

Can it be used it in other mods?


The obvious question is - can you use it in vanilla, or other mods?

In principle it should be possible, as long as the mod is not too heavily scripted (like Third Age).

There would need to be a lot of tweaking for each mod. Things like lists of factions, protected regions and factions (here - Americas, and aztecs/timurids/mongols), what kind of units should factions get, etc. These aren't particularly complicated issues, but each mod needs to solve them differently.

The scenario script is not separate from the rest of Concentrated Vanilla, but if you need some assistance with porting it to another mod, we should be able to sort things out somehow.

I don't see any major reasons why it couldn't be adapted to run on anything from Rome to Medieval 2 to Kingdoms, with some work.

Future possibilities


In theory it would be totally possible to go further with it, and make fully random maps for Medieval 2, with one of random map generating algorithms other strategic games use.

I don't have any immediate plans to go there, but one day, who knows?

When can I play?


I'll release it sometime soon, there are still some bugs to be fixed, and I need to figure out some kind of user interface so non-programmers can run the script.

If you're very impatient just email me and I'll send you what I've got.

2 comments:

hla A said...
This comment has been removed by the author.
hla A said...

Hello,
I am from Germany. I and a few other people would like to make a hotseat with it, but the hotseat mode only came with Kingdoms. Could you all do for the hotseat mode playable?

Kind regards from Germany