Bavaria (Chaos)

In the year 1255, Bavaria was divided the first time: Lower Bavaria went to , Upper Bavaria and the Palatinate to .
Some years after, who was looking for new allies, made peace with the Bavarian dukes and married Sophie of Wittelsbach. Ludwig II supported him at his election for Roman king in 1273; later in 1291, he'd become Roman king himself.
1275, the Bavarians fought with king Ottokar against and got Styria back for . was divided: Western Styria became part of (thus connecting the ids' possessions), the rest (two thirds) became (Upper) Bavarian.
1301-04, was king of Hungary, but soon left it again.
In 1314, the first big split happened: Lower Bavaria was divided into Bavaria-Straubing, Bavaria-Deggendorf and Bavaria-Landshut (older line each). Now there were five lines. Until 1332, all of those were reunited with Upper Bavaria; but 1359, Bavaria split into the lines of (older line), Ingolstadt (older line), Bavaria-Straubing (younger line) and Lower Styria.
1320, Wittelsbach duke (yes, he was named after Otakar Przemysl) of Upper Bavaria and the Palatinate was elected new Roman king. Until 1328, he had to fight the anti-king . 1334, he was crowned Holy Roman Emperor.
 founded the first university in Bavaria.
1357, the Wittelsbachs had their electorate of the Palatinate confirmed in the Golden Bull.
The maximum of splits (eight) was reached in 1401, when the Palatinate split up into the lines of Heidelberg, Sulzbach and Neuburg. 1408, the elector of the Palatinate supported anti-king Ottokar.
1460, the Hungarian nobles elected Ludwig of Bavaria-Landshut king , after king Karl / had died without an heir.
Of all the smaller German wars subsumed as the , the for (1485-93) was the longest. In the war Bavaria won the biggest chunk around, Salzburg, but had to give Eastern Styria to Austria.
The war had exhausted both participants, at the worst possible moment. In the 1505-09, the invaded Austria, took , restricted the Austrian duke to mountainous Styria and Carinthia. Following that, they also defeated the Bavarian army, taking Salzburg and Bavaria east of the Inn river. In 1511, Bavaria joined the " / Alpenbund" with , and -Carinthia, which was mainly directed against the Seljuks. They fought in the Seljuk Wars at France's side, and in the 1574, they got Salzburg back.
1566-70, Bavaria allied and fought together with - and - (OTL Thuringia and SW Saxony) the Bohemian theocracy in the , annexed the Sudetenland.
In the they fought again at France's side, acquired most of .
1735, , last Wittelsbach duke of the Rhine Palatinate, died without an heir. It was not completely clear whether France or Bavaria should get it. New emperor of Brandenburg let the French unmisunderstandably know that he wouldn't tolerate them taking it. The (1736-42) broke out. Although the German and Swedish-Dutch armies couldn't defeat the French armies, when and threatened France, peace was made. The Palatinate went neither to France nor Bavaria, but to a grandnephew of the king of Hungary. In case he and his brother would die without an heir, the Palatinate would fall to Bavaria, which eventually happened.
In 1765, Duke (also Roman king) died. - and - made claims, since the appointed successor didn't descend in direct male line from the Wittelsbachs. He managed to defend his lands in the short (1766/67), though.
1768, Bavaria built the first telegraph in a German state.
In the same year, the began. After the , they lost the Palatinate in the ; after the 1793, Bavaria was turned into a French satellite, the . This situation lasted until the big in 1818, after which Bavaria became a part of united .