PDA

View Full Version : MapMod



nikolai1962
11-19-2007, 23:22
MAPMOD 0.02

http://www.mizus.com/files/files/M2TW/mods/MapMod02.rar

This is a WIP mod in a very unfinished state. The reason I want to release it in it's current form is in the hope some peeps might help testing the first draft of my diplomacy system.

Most of the work on the mod so far has been with editing the map to clear path-finding problems that the AI gets stuck on. So most of my testing involves watching the AI factions with FOW switched off, looking for the places they get stuck on the map and also watching for factions that don't expand well and seeing if I can improve their performance. Testing the diplomacy needs a bit more active type testing and preferably by different people with different styles.

I've got the AI expansion speed to a reasonable level (I want to improve it further) so I started on the diplomacy side of things and it would be cool if anyone felt like giving it a try and reporting back.

The second post will try and detail the diplomacy system as it currently stands. I'll keep this first post just for mentioning those non AI/diplomacy things that might look like they're mistakes :)

Non-diplomacy/AI changes:

Map:
1.Many towns are in the wrong place. This is deliberate and for path-finding reasons.

Unit stats:
1. There is a method, it may not be obvious but it's there :) Everything is deliberate except missile stats, pikes and siege artillery which i haven't finished yet.
2. Generals are meant to be weaker.

Unit costs/recruitment:
1. Aim here is to get the AI to build the armies i want them to build and the costs have no relation to realistic costs.
2.The recruitment changes are aimed at the same thing.
3. Plan for the turks to have two reforms which change their recruitment - half-finished so may be confusing (it's a seljuk to ottoman type thing)
4. There's a few bits of AOR which may be confusing - almughavars only recruited in regions next to the pyrenees, varadriati only in bulgaria, transylvanian peasants only in transylvania - i think they're the only ones i did so far.
5. Official mercs/tributary type units e.g kazaks for russia, latinkon for byzies are recruited from town halls in cities now.

Buildings
1. The speed/costings are aimed at getting the AI to keep their cities fully upgraded.
2. The building requirements (mostly in the first two city levels) are meant to get the AI to build the more important stuff (like roads) sooner.
3. Stables can't be built on the small mediteranean islands--so no cavalry. Mainly done to make things trickier when playing byzies.

Start postion
1. Much lower start development in city levels but with more buildings pre-built - helps AI expansion
2. Far more castles to towns - castles are in the more backward areas, towns in the more advanced so towns are more clustered. Helps those factions which produce better units in castles.
3. Can't convert castles to cities till the gunpowder event (simulate economic revival after dark ages and too much of an advantage for the player imo)
4. Can't convert cities to castles at all
5. Castles no siege or cannon buildings
6. Castles only get the first two ports

Those are the deliberate changes - anything else is probably a bug :)

credits:
I wasn't going to include texture type mods because of the d/l size but i always have these three included even when i'm just modding and testing and i don't want to risk deleting them out of the MapMod folder in case i mess up. So credits for...
PlasticFigurine's early generals
Tyre's armoured generals
DisgruntledGoats Byz reskin
Also Grandviz as I studied his campaign AI to get familiar with the format and copied a few of his changes.

nikolai1962
11-19-2007, 23:22
Diplomacy/AI bit

Most of the above changes are either to help the early AI expansion or to suit my personal preferences but the diplomacy bit may be of interest to other players, plus as i mentioned it needs different people with different play-styles to test that aspect thoroughly.

There are a *lot* of numbers that need to be juggled right to get this to work right. But it might be possible to get a decent-ish diplomacy system with a lot of juggling.


Aim:

I think there are broadly three different play styles:

1. Turtle - try to keep the neighbour AI from bugging you while you potter about building up your cities.
2. Cautious expander - expanding, but slow and steady, biting off small chunks at a time then trying to make peace with everyone again before the next bite.
3. Blitzing - i'll call that reckless expander from now on.

So want i want to achieve is:
1. AI profiles that match those three strategies
2. Switching AI profiles when a faction leader dies.
2. A diplomacy system that fits in with those three playstyles.

I'm aiming for the base three types of profile mentioned above with some variations for faction and era. I want an early set which is heavily influenced by religion and a later set where religion is less critical.

So there'll be "early_defensive_catholic", "early_reckless_islam", "late_cautious_orthodox" etc and they'll be switched over time as the faction leaders change.

The mod is currently set up with all the factions using the latest version of early_defensive. The reckless AI will be pretty much the same as the vanilla default AI. The cautious AI will be a hybrid of defensive and reckless so if I can get the defensive working just right then finishing the others will be easy.

Details

1. An alliance isn't an alliance in the normal sense of the word unless it's a trusted alliance. Otherwise it's just a promise to not attack for 12 turns.
2. A trusted alliance is where both allies are at least "reliable" in reputation and where the faction relationship is at least "very good". The system revolves around this.
3. The defensive AI profile is designed around the AI faction being a turtle type player who uses diplomacy defensively to protect their borders. They aim to maintain their global reputation and standing with pope (if applicable) so they can get and maintain trusted alliances for defensive purposes. Expansion is a secondary motive with this profile.

What the defensive AI will and won't do:

Things that stop them attacking:

Rebels are high priority if at peace, mostly ignored if at war.
Won't attack the pope.
Won't attack their protectorate.
Won't attack a trusted ally.
Won't attack a trusted ally's protectorate.
Won't attack a non-trusted ally for minimum of 12 turns after alliance declared.
Won't attack factions they want as an ally.
If they're down to just one settlement they won't attack anyone but rebels.
Won't attack anyone else if they're already in a war.
Won't attack anyone if their reputation is below very reliable.
Won't attack if they have a cease hostilities from the pope.
Won't attack if they've been excommunicated.
Won't attack for a minimum number of turns after a ceasefire (4 if catholic/islam, 6 if catholic/orthodox or orthodox/islam, 8 if same religion)
Papal states don't attack at all unless they have an excommunicated/islam/orthodox neighbour.

If none of the above list applies then...

Things that make them attack:

1. They are very likely to come help a trusted ally.
2. A faction that has a global reputation of very untrustworthy or worse.
3. A neutral faction they have a "poor" or worse relationship with.
4. A non-trusted ally faction they have a "very poor" or worse relationship with.
5. Small random chance to simulate accidental border dispute type wars (only between neutrals not allies)

They'll attack non-trusted allies if the faction relationship is bad enough (case 3) but they'll wait till their global rep is trustworthy so they can take the reputation penalty for attacking an ally.
If they decide to attack they'll only do so if they think they have 2:1 odds on the frontline except if they're aiding a trusted ally in which case they attack with whatever is available.

Things that make them want peace if they're at war:

If they get two enemies at once
If their reputation drops below mixed
If the pope tells them to.
If they get excommunicated (doesn't seem to happen now but might glitch occasionally)
If they think the frontline odds are 2:1 against them.
Random chance to simulate real-life things like running out of supplies/bad weather etc

Exceptions:
Even with the defensive profile, if a faction gets to 12+ regions they will take a few more risks.
1. Chance of ignoring a papal cease fire.
2. Chance of fighting on for a while if they get excommunicated. Will stop and turtle to recover their rep after a while.
3. Will fight two enemies at once for a while (random chance of wanting ceasefire) but won't do it for long.
4. Higher chance of the random border dispute wars with neutrals.
5. Only need a minimum of a "So So" relationship with a neutral and a "Poor" relationship with a non-trusted ally to consider attacking.

Vassals:

Simplified this as i like vassals and don't like to see factions destroyed completely.

AI factions will accept being a vassal when.
1. They are down to one settlement, at war with a neighbouring faction and out-numbered on the frontline 2:1
2. They are down to two settlements, at war with a neighbouring faction and out-numbered on the frontline either 3:1 or 5:1 (still experimenting with the conditions on this but 5:1 is the maximum neccessary)

Vassals are currently only accepted between same religion and catholic/orthodox. This is to stop factions blocking themselves as the AI doesn't usually expand through their own vassals. Will change this if i can figure out a way to prevent the Turks/Moors potentially blocking themselves in.

Allies:

Still experimenting with this but currently it's very simple

1. Muslim factions seek to ally with muslim factions.
2. Orthodox factions seek to ally with orthodox factions.
3. Up to turn 12 the catholic factions seek to ally with any catholic neighbours.
4. After turn 12 they only seek to ally with any catholic faction where their relations are good or above.

note 1. This doesn't stop you allying with them. This just controls who they ask to be an ally.
note 2. The pope doesn't like it if you ally with a non-catholic. I've done the code that drops your relationship with the papal-states but haven't coded the "break alliance" missions yet.
note 3. I want the early defensive profile to be heavily influenced by religion. If the system is working right then in the early game the AI vs AI fighting should be mostly along the religious borders.

I think that's the basic design in words. I'll keep this post edited with anything I've forgotten.

Gameplay aspects.

What I want is for the system to fit the three play-styles so that

1. If you're turtling it is possible (but not too easy) to keep your neighbours from bugging you using diplomacy.
2. If you're slowly expanding it is possible (but not too easy) to get to fight one faction at a time using diplomacy.
3. If you're blitzing the amount of cash from sacking as you go isn't enough to allow you to use diplomacy to stop the other factions all ganging up on you

Critical levels:

Non-trusted allies may attack if your relations drop below very poor.
Non-trusted allies with 12+ regions may attack if your relations drop below poor.
Neutrals may attack you if your relations drop below poor.
Neutrals with 12+ regions may attack you if your relations drop below so-so.
Trusted allies of a faction you are at war with will usually attack you eventually but not if your relations with them are "very good" or above.
Factions may attack you if your global rep is below "very untrustworthy".
Trusted alliances require both parties to have "reliable" reputations or above and at least a "very good" relationship.


I'll use the third post to detail the numbers being used.

nikolai1962
11-19-2007, 23:25
The numbers underneath:

Think of it as levels and points--with each of the labelled diplo names, "mixed", "reliable" etc being a "level". I've set it so each level has an 8 "point" gap. So you need 8 points of global reputation to go from the bottom of "mixed" to get into the "bottom" of "reliable". The faction standing is the same, it's eight points from reasonable to amiable. Most of the elements are in the vanilla game, what i've done is try to make them the driving force behind the "defensive" AI's decisions.

Global rep:
1 point per turn (up to trustworthy)
1 point per ally (up to trustworthy)
Minus 1 per enemy (excluding rebels) (up to trustworthy)

(You start the game with rep set at 0 so it would be 8 turns before you hit reliable if you didn't get any allies.)

Almost everything else you do has a penalty :)

(These may be set too high - AI faction penalties are half the player ones)

Royal marriage +4
Own pope elected +16
Occupying rebel city -8
Occupying faction city -16
Sacking rebel city -16
Sack faction city -32
Exterminate -64
Releasing 80+ prisonoers +1
Releasing 240+ prisonoers +1 (should get the 80+ one at the same time)
Executing 80+ prisoners -4
Executing 240+ prisoners -4 (should get the 80+ one at the same time)
Stealing back settlement -8
Bribing settlement -8
Cancelling alliance -4
Attacking an ally -16
Excommunication -24

So the basic idea is to build up your rep before you make any moves so you can take the penalty and still stay "reliable" so your trusted alliances remain in place. Then build it up again for your next move etc. The more allies the faster it goes back up. Currently have it set so it only goes up to trustworthy to give less room for manouvre. May need to change this.

Faction relationships:

Alliance, +4 when announced, +2 per turn
Marriage alliance, +8 when announced, +4 per turn (2 for the alliance, 2 for the marriage, so even if the alliance breaks later you still get 2 per turn for the marriage)
Allies allies +1 per turn
Allies enemies -1 per turn
Enemies -2 per turn
Enemies allies -1 per turn
Enemies enemies +1 per turn
excommunication -24 with catholic factions and the pope
trade agreement +4
cash +1 per 500 florins (per 1000 for pope)(should be 4000 to go up one level, 8000 with the pope)
giving settlements +a lot, (half normal benefit with pope)

plus all the usual ones for bribing, spying, walking on their land etc - quite a few of them but fed up typing for now :)

Plus, most important bit--region triggers...

Haven't done all of them yet as it is a lot of typing but for each faction I'm giving them a set of regions they "want" and if another faction has that region then it drops their faction standing by 2 or 4 points per turn. Their core regions (usually their starting regions) are 4-pointers and the rest are 2 points.

Currently:

Spain:
Core--Leon, Burgos, Toldeo, Salamanca
Periphery--all the rest of the iberian peninsular plus bordeaux

Portugal:
Core--Oporto
Periphery--Lisbon, Silves

Moors:
Core---marrakesh, Fez, Algiers
Periphery--rest of north africa up to tripoli, plus Cordoba, Granada, Seville, Silves, Murcia, Salamanca, Toledo, Zaragoza, Barcelona, Valencia, Oporto, Lisbon, Palma, Ajaccio, Cagliari, Palermo, Palma

France
Core---Paris, Rheims, Angers, Clermont
Periphery--rest of modern france plus barcelona, bruges, antwerp, metz and bern

HRE
Core--Frankfurt, Nuremburg, Hamburg, Innsbruck, Hohenstauffen, Vienna
Periphery--antwerp, metz, bern, magdeburg, prague, breslau, stettin, thorn, milan, bologna, florence

Denmark
Core--Ribe, Lund
Periphery--Lubeck, stettin, thorn, libau, riga, turku, stockholm, oslo, york

Scotland
Core - inverness, edinburgh
Periphery - dublin, york, oslo

England:
Core--Caen
Periphery--London, Nottingham, Bristol, York, Carnarvon, Edinburgh, Dublin, Inverness, Rennes, Poitiers, Bordeaux, Bruges

...

Haven't done the other factions yet.

Examples.

1. Say you're England and you want to turtle--you have three potential attackers, France, Scotland and Denmark. Both Scotland and Denmark have a trigger on York. France has one on Caen. All 2-point triggers so eventually they'll attack you if you have those regions. So, for example....

You get a marriage alliance with Constance from France. That bumps your relations with France up a lot and gives you +4 points per turn. Subtracting the two for the region trigger on Caen gives you a healthy +2 with France which will easily get you into a trusted alliance quite soon.

You have Cecilia to get into a marriage alliance with either Denmark or Scotland but as you're probably going to attack Scotland eventually best to send her to Denmark maybe, maybe not. If you send her off and get the marriage alliance that would outweigh the region trigger the Danes have on York so you could take York without the trigger preventing your relations improving with the Danes.

However that leaves Scotland. If you get a diplomat and make a normal alliance that is only +2 points per turn towards your relations with them, which would exactly equal the region trigger the Scots have on York so if you take York early your relations with Scotland won't improve to the level needed for a trusted ally. So you have to decide whether to get the alliance first and leave york for a while until your relations with Scotland go up. If you take York after your relations with Scotland have hit "very good" then the region trigger will be cancelled out by the alliance and your relation will stay put at "very good" unless something else happens.

On the other hand if you wait then Scotland might take York--so you have to choose.

2, Say later on you want to attack France but they're trusted allies with Spain and you don't want to fight both. A trusted ally of someone you are fighting won't attack you if their relations with you are "very good" or above so you send your diplomat to spain and give them cash to bump your relationship up then attack France. When you're at war with France your relations with their allies will drop one point each turn but you can still do this to delay the Spanish entry into the war in the hope you can win a region then make peace before the Spanish join in.

CavalryCmdr
11-21-2007, 02:24
I know making such a request is rather unorthodox right off the bat, but..
I am stuck with dial-up and was wondering if there is any way to get just the map (not the .rwm)and descr_strat. I've been reading your research since you first started it on Rome, and belive you have truly got a good thing going with it. I have anxiously been awaiting a copy of your map to be available to try with my AI mod. (http://rtw.heavengames.com/cgi-bin/forums/display.cgi?action=st&fn=9&tn=6425&f=9,,,10&st=175)

nikolai1962
11-21-2007, 06:23
I know making such a request is rather unorthodox right off the bat, but..
I am stuck with dial-up and was wondering if there is any way to get just the map (not the .rwm)and descr_strat. I've been reading your research since you first started it on Rome, and belive you have truly got a good thing going with it. I have anxiously been awaiting a copy of your map to be available to try with my AI mod. (http://rtw.heavengames.com/cgi-bin/forums/display.cgi?action=st&fn=9&tn=6425&f=9,,,10&st=175)

Sure. PM me an email address and I'll zip the map files up with just the strat file. nb the map isn't as good as my previous one. I was after perfection on my previous attempt and when i couldn't get it I uninstalled everything and deleted the lot. This one is just an improvement over vanilla (in terms of path-finding) rather than a massive improvement. Also I went for work-arounds straightaway for some of the recalcitrant problems (like the Helsinki stall) and just moved towns etc to cure them rather than "fixed them".

So the increased movement is important, as for example, some regions where there is a pathing problem I just moved the towns so that they were within one turn's move once roads were built (providing a bit of randomness). So the problems are still there but they get over-ridden by the road-building. I'll leave the descr_character out as the only change I made was to increase move points to 120 but you should know that is part of the fixes.

Also with my strat the factions will all be in the red at start as I increased their start armies a lot but reduced unit costs. Doesn't seem to hurt the AI factions on "Hard" or above, except Portugal which is poorest to start with.