User avatar
loki100
AGEod Guard of Honor
Posts: 2401
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

Dynamic Diplomacy

Wed Jan 22, 2014 1:58 pm

In a way this is the holy grail of PoN and of course a huge challenge to code and set up. We don't want endless wars breaking out but we do want both a more opportunistic AI (ie if a chance comes to grab something it really wants, then it will do so) and one that plans more for its goals.

The latter I fear is a matter for the code, but the first is possible to script.

Here's an idea for Italy (I'll start with this as I have some feel for what it should be trying to do).

Until the Po provinces (Lombardia and the Veneto) it has a key enemy - Austria. In reality, Piedmont made an alliance with a powerful backer to gain the military power to challenge Austria and then happily signed up with a different power to attack Austria when it was distracted. My view is if those two had failed, it would simply have carried on with the same strategy till it worked.

So, for Italy, I suggest we add an event that works on this logic:

if Wien is not Austrian controlled and Lombardia and Veneto are not Italian controlled, it will declare war. After 1900 I'd add Udine, Trieste and the Tirol to that test. We can do a force pool judgement if needed (I'll try to produce a formal event later today), but this is a very simple yes/no test that captures a key part of Italian opportunism.

It could be expanded to say Austria war with Russia or Germany (ie something seriously distracting) will trigger an intervention - with probabilities and maybe only a fixed number of instances, so an Austrian player has to be cautious but another player can't operate with certainty?

At worst this could tip Italy into a war it can't win, but given the rules for war ending the worst it would suffer is reparations for a short period.
AJE The Hero, The Traitor and The Barbarian
PoN Manufacturing Italy; A clear bright sun
RoP The Mightiest Empires Fall
WIA Burning down the Houses; Wars in America; The Tea Wars

User avatar
Jim-NC
Posts: 2981
Joined: Wed Feb 25, 2009 4:21 pm
Location: Near Region 209, North Carolina

Wed Jan 22, 2014 6:23 pm

I like the theory. The events will be the true test of if this is a good idea or not.
Remember - The beatings will continue until morale improves.
[SIGPIC][/SIGPIC]

User avatar
Kensai
Posts: 2712
Joined: Mon Sep 19, 2011 4:54 pm
Location: Freiburg, Germany

Wed Jan 22, 2014 6:29 pm

Good idea. There are many evaluation commands that can be used to portray most of the situations you need, including regional ownership, balance of power, etc. These events, if good enough, could potentially be used as templates for all nations. Dynamic diplomacy (events generally) is a very very nice idea for the appeal of a long campaign.
Care to unify Germany as Austria? Recreate the Holy Roman Empire of the 20th Century:
Großdeutschland Mod
Are you tough enough to impersonate the Shogun and defy the Westerners? Prove it:
Shogun Defiance Mod (completed AAR)

User avatar
loki100
AGEod Guard of Honor
Posts: 2401
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

Somebody captures Vienna

Wed Jan 22, 2014 10:22 pm

This is the easy bit, if its before 1900, either Lombardy or Venetia are not Italian and someone takes Vienna, then Italy will pounce. I've not added any probability as here I am assuming that Austria is in real trouble. As ever it only applies to an AI Italy, I guess the inspiration is seeing the outcome in Crixdax's AAR.

I have had written two versions as to my understanding we can't use an either/or syntax for PoN events (ie I'd want this to trigger if either of the Veneto or Lombardy were still Austrian). The reason I'd appreciate a view on this as I'll then do a post-1900 variation that includes Trieste, Udine and the Sud-Tirol as trigger provinces. Anyway, here we are, this makes a small start at making countries persue their core goals if a real opportunity comes up.

SelectFaction = $ITA
StartEvent = evt_nam_ITA_Italy takes revenge_1|2|1|NULL|NULL|$Null|NULL

Conditions
SelectFaction = $ITA

CheckAILevel = 1
MinDate = 1855/01/01
MaxDate = 1900/01/01
EvalRgnOwned = $Lombardia;NOT
EvalIsAtPeaceWith = AUS;NOT
EvalDiploItem = AUS;$diDefensiveTreaty;NOT

Selectionfaction = $AUS
EvalRgnOwned = $Oesterreich;NOT

Actions

SelectFaction = $ITA
AddDiploItem = AUS;$diWar;CURRENT

EndEvent

SelectFaction = $ITA
StartEvent = evt_nam_ITA_Italy takes revenge_2|2|1|NULL|NULL|$Null|NULL

Conditions
SelectFaction = $ITA

CheckAILevel = 1
MinDate = 1855/01/01
MaxDate = 1900/01/01
EvalRgnOwned = $Venetia;NOT
EvalIsAtPeaceWith = AUS;NOT
EvalDiploItem = AUS;$diDefensiveTreaty;NOT

Selectionfaction = $AUS
EvalRgnOwned = $Oesterreich;NOT

Actions

SelectFaction = $ITA
AddDiploItem = AUS;$diWar;CURRENT

EndEvent
AJE The Hero, The Traitor and The Barbarian
PoN Manufacturing Italy; A clear bright sun
RoP The Mightiest Empires Fall
WIA Burning down the Houses; Wars in America; The Tea Wars

User avatar
loki100
AGEod Guard of Honor
Posts: 2401
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

taking advantage of a war

Wed Jan 22, 2014 10:33 pm

Here I'm trying to create the same possibility if Austria is engaged in a major war. I've picked the only 2 powers that are a distinct threat (in most games) of Germany and Russia, I think this could be made to trigger off Austria being in any war but I wanted it to reflect a serious diversion of attention rather than a war of no real distraction to the Austrians. Again there are two seperate events reflecting the and/or question above. My understanding is if I include both triggers that is akin to saying only work if Austria is at war with both.

Note here I've put in a probability and its fairly low. So a player of one of Germany or Russia may well expect Italy to try to intervene but you can't rely on it. Here for simplicity, I've made the Veneto the trigger province, I assume that its unlikely that Italy will have regained that but not Lombardy?

SelectFaction = $ITA
StartEvent = evt_nam_ITA_Italy takes advantage_Germany|2|1|NULL|NULL|$Null|NULL

Conditions
SelectFaction = $ITA

CheckAILevel = 1
MinDate = 1855/01/01
MaxDate = 1900/01/01
EvalRgnOwned = $Venetia;NOT
EvalIsAtPeaceWith = AUS;NOT
EvalDiploItem = AUS;$diDefensiveTreaty;NOT

Selectionfaction = $AUS
EvalIsAtWarWith = GER
Probability = 05

Actions

SelectFaction = $ITA
AddDiploItem = AUS;$diWar;CURRENT

EndEvent

SelectFaction = $ITA
StartEvent = evt_nam_ITA_Italy takes advantage_Russia|2|1|NULL|NULL|$Null|NULL

Conditions
SelectFaction = $ITA

CheckAILevel = 1
MinDate = 1855/01/01
MaxDate = 1900/01/01
EvalRgnOwned = $Venetia;NOT
EvalIsAtPeaceWith = AUS;NOT
EvalDiploItem = AUS;$diDefensiveTreaty;NOT

Selectionfaction = $AUS
EvalIsAtWarWith = RUS
Probability = 05

Actions

SelectFaction = $ITA
AddDiploItem = AUS;$diWar;CURRENT

EndEvent


I know the basic syntax works as I've used a similar event in my own current game to give GB an interest in joining in a major war.
AJE The Hero, The Traitor and The Barbarian
PoN Manufacturing Italy; A clear bright sun
RoP The Mightiest Empires Fall
WIA Burning down the Houses; Wars in America; The Tea Wars

User avatar
Kensai
Posts: 2712
Joined: Mon Sep 19, 2011 4:54 pm
Location: Freiburg, Germany

Wed Jan 22, 2014 10:51 pm

I personally like the basic recipe. Obviously, in order to make the scripts bulletproof and avoid crashing the engine you need to add an evaluation for allies cause if you force a declaration of war between allies it might give you an error.

All in all, I think the best course of action is this you already follow: small, to the point scripted events but with strong evaluation clauses to fire only under conditions you really want them to fire. If you find it working pleasingly, report it here so we can morph a general template out of this work.
Care to unify Germany as Austria? Recreate the Holy Roman Empire of the 20th Century:
Großdeutschland Mod
Are you tough enough to impersonate the Shogun and defy the Westerners? Prove it:
Shogun Defiance Mod (completed AAR)

User avatar
Christophe.Barot
Posts: 1138
Joined: Fri Jan 26, 2007 10:55 pm
Location: Paris (France)

Thu Jan 23, 2014 2:03 pm

The principle seems absolutely OK to me - I have done a few scripts already posted who do not create a war declaration but shift diplomacy (for Italy, Russia but there will be others) - for example Italy will close with germany if 1880 France beats her to tunis, but not witgh Austria if Austria still has venetia (or Lombardia)

ditto reacting to agressor's move in one "sphere of protection" (US monroe, Austria/german minors, austria/principalties, russia/ serbia, Britain/russia / weak france after german unification) are "in the cooking", but I'm waiting a feedback about austrian reactions - actually, as it seems I can't propose peace, I should go through options and agents, like for the principalties reactions

once this is ok, I'll script them, but those are DEFENSIVE moves - we don't have the opportunistic OFFENSIVE moves you propose still (yet)

trhe coding of events, historically accurate, can be done, as we have the tools - I intended to post principles with geopolitical areas, criteria, method, stuill, what we haven't is coding time (we in general, as we three don't have the competences either). this thread remains planned, but I was a lot AFK this week. will be based on defining homogenous theater of operations (tgey're perfectly structurted in my head), objectives, levels of success, potential allies/foes on each theater, and hierarchizing them. can be coded, really, BUT .... will last months and I don't think we'll get months of free diplomatic coding

the holy grail, perfectly in reach, believe me, needs an investment ...

costly !

I'll still propose those TOO , method and so on, as it is a basics to build strategic/diplomatic AI and history-like crisis imho, can be a help for us scripters too, and can even guide a player (strategies, based on a nation interest, which are good for AI, are good for a player too)

but actually, much will have to be scripted by us I'm afraid

and, besides time, yhis has another inconvzenience - huge scripting could load the game (more factorsz to read)

but that's the best we can do


for your scripts :

agree for choice of Prussia and Russia - France can be an ally, but is an early ally, would risorgimento fail, chain is broken ,and France has no comlmon borders with Austria
Napoleonic schemes are complex to reproduce naturally (Latin union, revisionnism (so conservative powers are the target, revisionist prussia is not considered conservative) , swaps of provinces, influence on Italy, liberal block with britain, expansion in alps (with italy agreement - swap), in belgium (contradiction with good relations with britain) and in germany (contradiction with (revisionist) prussian understanding, even if blindly not perceived - Bismarck helped a lot too) by simple geopolitical conditions so better hardcode it in script (coding with objectives driven game would be simpler, you reflect this by updating the objectives and refining them - evalallycontrolled to add, incorporate it in AI reasoning - but presently, we don't have that)

"OR" doesn't works - if an event is triggered in 2 cases, we have to describe and script the two cases, leading to same event

without adding too complex conditions, I'd check for caution that Austria is not allied to FRA GBR GER in case of AUS/RUS war, RUS GBR FRA in case of AUS/GER war. Else it could plunge Italy in a very very difficult situation, you can pull off, but AI perhaps won't
so adding http://www.ageod.net/agewiki/EvalDiploItem will avoid Italy getting a war with Britain or France on the hands
for example
SelectionFaction = $AUS
EvalDiploItem = FRA;$diDefensiveTreaty;NOT
EvalDiploItem = RUS;$diDefensiveTreaty;NOT
EvalDiploItem = GBR;$diDefensiveTreaty;NOT

and of course, as kensai tells
EvalDiploItem = ITA;$diDefensiveTreaty;NOT

while the latter seems rather unlikely ;)


(but is to balance with drawbacks of immobilism, presently, with system, losing a non scripted war has very limited consequences it seems)

I wonder if setting a current war provokes the same than declaring (seems not but not 100% sure, could Philippe Philippe (Pocus) or Fernando confirm ?
[color="#FF0000"]- (ordnance) Your Lordship, sorry to awake you, but The french are at our door !

- Alarm, alarm, how did you let this happen and not awake me ! repel them, counterattack at once !

- err, your Lordship, ahem... French are our allies, Marshal de St Arnaud is expected to attend to a conference with you !

- ahem, well, .... very well ..let them in !

(charge of the light brigade movie)
[/color]

User avatar
loki100
AGEod Guard of Honor
Posts: 2401
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

Thu Jan 23, 2014 2:47 pm

Kensai wrote:I personally like the basic recipe. Obviously, in order to make the scripts bulletproof and avoid crashing the engine you need to add an evaluation for allies cause if you force a declaration of war between allies it might give you an error.


I'll update the scripts later today with several more checks - no peace Italy-Austria (ie they haven't just been to war in the last year) and no defensive alliance Italy-Austria (exceptionally unlikely but it may be a problem)

Christophe, I can confirm a scripted war evades all the alliance and local support agreements. Not sure if this is WAD but I had local support for Serbia and I had no invite or prestige loss so I'm pretty sure it is the case.

The thing we need to watch for is elegance of design. Its too easy to forget what we all know - that every event script adds to the processing load and PoN doesn't need slowing down. Even in the simple instance of Italian opportunism with Austria I seem to have ended up with 4 events, and really need more for post-1900 to incorporate Trieste etc into the triggers.

So to me this is a crude way to capture a few of the more obvious instances, where states had such contradictory interests that bad luck for one meant a real opportunity for another. I don't think there were that many. Even Alsace-Lorraine, if I understand was a rather marginal issue in German nationalist politics. Only the real outliers who dreamt of the entire Volk from west of the Rhine to the east of Ukraine being re-united saw it as an essential part to a new German empire. Bismarck as ever, was being opportunistic in his use of the issue?
AJE The Hero, The Traitor and The Barbarian
PoN Manufacturing Italy; A clear bright sun
RoP The Mightiest Empires Fall
WIA Burning down the Houses; Wars in America; The Tea Wars

User avatar
Christophe.Barot
Posts: 1138
Joined: Fri Jan 26, 2007 10:55 pm
Location: Paris (France)

Fri Jan 24, 2014 12:51 am

about Alsace-Lorraine actually, it was not a popular German demand before war erupted, but once Bismarck had succeeded triggering a war by successfully "provoking the gallic Bull" with Ems Dispatch, there was a popular demand of outraged heated nationalism for the Annexation of Alsace and Lorraine, with Strasbourg as obvious symbol. had Bismarck wanted, he could hardly have resisted this popular demand - and certainly he didn't want :

a) because Alsace-Lorraine was prize, symbol, cement of popular unity - satisfying people, showing princes germany was "forever safe" was a way to keep them under Prussian wing

b) because there were economic and strategic reasons to keep Alsace and Lorraine, as a source of iron, coal, potassium, and as a military buffer

c) because nationalism - and hatred - was heated to an incredible pôint - moltke (and some circles in the court) wanted openly "to exterminate the French people", as "Godless" and not respecting order -compared to Moltke, the King and nationalist circles, Bismarck was almost a moderate. also German definition of nation was based on "natural belonging", defined by language - you spoke german, you were german, period, while French one was based on will to belong to the same nation
(more or less, as Savoy - which didn't need it, and Nice plesbiscites were rigged, still there were plesbiscites, at least for show) - there is no doubt for me Napoleon would have annexed german lands had France won, probably with same disrespect of population feelings (Alsace and Lorraine had been annexed by Louis XIV, but was 2 centuries ago, before nationalism cristallized, and French revolution had happened since, so population felt french..

had peace lasted for 2 centuries, Alsace and Lorraine would possibly have been assimilated into German Empire (especially adding a sizable part of population emigrated to "inner France" in order not to live under foreign (german) rule, while some immigrants came from German Empire. but 43 years (1871-1914) were definitely too short for such things to happen.

So wound never cicatrized (and how could it has been, it was age of nationalism, provinces had been taken by force, population rattached against her will (elected protesters til 1914), and , in spite of some temporary attempts to adopt a more lenient policy (especially unde rmanteuffel), was treated as second rate citizens (and, let's face it, militaristic Prussian German Empire wasn't quite the exemplary democratic Bundesrepublic)

so enmity crystallized, and, while not seeking war, and, while not being locked by the situation (realistically assessing she had no chance isolated France built a colonial empire meanwhile) France did neither forget nor forgive and prepared long term to be able to take the revanche (and lost provinces back) when opportunity for an equal fight would arise (which Wilhelm II uncleverness would provide). relations with germany could be tense or more relaxed, they would never be friendly- germany ("LE Prussien") had became a structural enemy - an hereditary one - and so was it on the other side of the "Vosges blue line"

so, imho, French - german relations could get similar treatment (with reservation was more prepared by France). Alsace-lorraine are treated as one shot condition of German Unity (even if in themselves, they are not the alpha and omega of german goals, they are a necessary condition to unity, which is ..)

then, once lost, recovering them as soon as circumstances allow, is the paramount goal of french policy, so we have two phases, "german watch" where neutral powers prevent germany, for balance sake, to wage a preemptive war, and "diplomatic revanche", helped by Wilhelm II attitude, wherre France efficiently isolates back Germany and prepares for the unavoidable

Russian (because of panslavism) - Austrian (and Turk) relationships were also structurally bad, not that Balkan rivalry prevented any compromise (it make it hard to reach, but casually some temporary agreements happened) but because Russian support to "slavic orthodox brothers" was structural, and that enmity of serbia and austria was structural too, and worsened by same irredentist scenario as Italy.

but this i guess (Bulgaria and other balkanic revolters) can be treated by recurent revolt events while we can set a chain of ireedentism leading to world war I (that's where Panslavism and pangermanism naturally led)
[color="#FF0000"]- (ordnance) Your Lordship, sorry to awake you, but The french are at our door !

- Alarm, alarm, how did you let this happen and not awake me ! repel them, counterattack at once !

- err, your Lordship, ahem... French are our allies, Marshal de St Arnaud is expected to attend to a conference with you !

- ahem, well, .... very well ..let them in !

(charge of the light brigade movie)
[/color]

User avatar
Jim-NC
Posts: 2981
Joined: Wed Feb 25, 2009 4:21 pm
Location: Near Region 209, North Carolina

Fri Jan 24, 2014 3:24 am

On the scripts, should it they only fire once? For example, of Italy fights a war against Austria and loses, would they still want to go to war again in the future? Would the base conditions need to change?
Remember - The beatings will continue until morale improves.

[SIGPIC][/SIGPIC]

User avatar
loki100
AGEod Guard of Honor
Posts: 2401
Joined: Sun Aug 14, 2011 4:15 pm
Location: Caithness
Contact: Website Twitter

Fri Jan 24, 2014 9:53 am

Jim-NC wrote:On the scripts, should it they only fire once? For example, of Italy fights a war against Austria and loses, would they still want to go to war again in the future? Would the base conditions need to change?


updated the events. There is now a test for peace with Austria - the reference really being to a peace treaty and for a defensive alliance with Austria (which will stop these events). Have altered it so each can feasibly fire twice - think that is enough for most plausible games of PoN over the period 1855-1900, it would assume either a player of Germany or Russia regularly attacking Austria or incredibly bad luck with the fall out of diplomatic crises.

Since if we can sort out the German unification chain, odds on there will be one Austro-Prussian war, that gives an AI Italy at least the chance to grab one of the two Po provinces in a typical game.

from some observation, the AI is good at getting out of a war with no obvious gains to be made (at least when that evaluation is clear). I guess this is best seen as a crude attempt to add in something missing. ideally we'd need some evaluation of success but that is already in the game (Italy has a permanent CB for these provinces) and as we're seeing in Crixdax's AAR, even when Austria is utterly beaten, the diplomatic AI makes no move. So for the moment, I'd suggest this is safe enough - it creates some chance of Italy taking a risk to get something it really wants and that is missing at the moment
AJE The Hero, The Traitor and The Barbarian
PoN Manufacturing Italy; A clear bright sun
RoP The Mightiest Empires Fall
WIA Burning down the Houses; Wars in America; The Tea Wars

User avatar
Christophe.Barot
Posts: 1138
Joined: Fri Jan 26, 2007 10:55 pm
Location: Paris (France)

Fri Jan 24, 2014 1:19 pm

loki100 wrote:
Since if we can sort out the German unification chain, odds on there will be one Austro-Prussian war, that gives an AI Italy at least the chance to grab one of the two Po provinces in a typical game.



agree

about unification chain, if we retain the proposed modifications to german/Austrian peace treaty, Italy gets Lombardia venetia and udine in many cases, provided :
- Austro Prussian war erupts at all(NGF can happen without war if regional decisions are optimized, and prussian player may choose to dispense of this war, or AI my be too passive)
- wardoes not end with a "draw", which is very much likely if Prussia or/and Austria are AI played

else, holding Königraetz and Moravia (at gates of vienna) fires the Nikolsburg peace - modified version gives Italian provinces to Italy (didn't test Italy alliances, a French Prussian Italian consensus is assumed)

and if Austria has upper hand and don't make peace before holding Berlin and Silesia, Italian provinces are aprt of transfer (same "consensus" assumption)

still, even in this case, Trent, Trieste and Dalmatia remain target of Italian irredentism, so your event keeps all his sense
[color="#FF0000"]- (ordnance) Your Lordship, sorry to awake you, but The french are at our door !

- Alarm, alarm, how did you let this happen and not awake me ! repel them, counterattack at once !

- err, your Lordship, ahem... French are our allies, Marshal de St Arnaud is expected to attend to a conference with you !

- ahem, well, .... very well ..let them in !

(charge of the light brigade movie)
[/color]

User avatar
Kensai
Posts: 2712
Joined: Mon Sep 19, 2011 4:54 pm
Location: Freiburg, Germany

Fri Jan 24, 2014 3:26 pm

Has anyone pinpointed what exactly goes wrong with the German or Italian unification chain? Because if it is the events, we can fix them. If it is AI passivity, as I had noticed in the Italian once, I don't think much can be done.

Regarding the German unification chain: have you seen for example the Prussian AI NOT play the unification cards in time to start it in the North (Hannover, Holstein, etc)?

A long term project could be to write alternate reality events as "backup unification attempts" or "partial unification endings". For example, to allow Italy form without the Southern part (Two Sicilies) or Germany without Bavaria, etc. Obviously in that case some more modding work might be needed to enrich the nations that survive or silence events of the partially unified country that do not make sense.
Care to unify Germany as Austria? Recreate the Holy Roman Empire of the 20th Century:
Großdeutschland Mod
Are you tough enough to impersonate the Shogun and defy the Westerners? Prove it:
Shogun Defiance Mod (completed AAR)

Return to “Help improve PON”

Who is online

Users browsing this forum: No registered users and 2 guests