That's...not what I meant.

Oh well. Gift horses and all that.
Running to Stand Still.
Fight for your country that is the best, the only omen!
-Hektor, the
Iliad
With the conclusion of the Peace of Andrusovo in January 1667, the Polish-Lithuanian Commonwealth could return to peace once more. It had been a long twenty years. Bohdan Khmelnytskys revolt back in 1648 had served as a spark for a general conflagration that reached crescendo in the 1650s, as Brandenburg-Prussia, Sweden, Muscovy, and the Ottoman-ruled Danubian Principalities dispatched soldiers to take advantage of the Commonwealths weakness. But slowly, inexorably, Polish forces, led by the implacable Jan II Casimir and his allies, men like Stefan Czarniecki and Paweł Sapieha, clawed their way back from the brink. Sweden was ejected, the Brandenburgers made to heel, and now Muscovy had been ejected from most of Lithuania, though concessions had had to be made. Poland-Lithuania had weathered the deluge, and life could return to normal.
Except, of course, that it couldnt. The ink was hardly dry on Andrusovo before war with the Tatars was renewed, raiding increasing dramatically on both sides. Polish-allied cossacks, after Khmelnytsky had been crushed, were few and far between now, so stopping Tatar raids was harder than ever. And fundamental cleavages within the Commonwealth remained unsolved. The men who had joined Karl X of Sweden and his puppet, Janusz Radziwiłł, remained largely unpunished, and Lithuania still harbored grievances against Poland and vice versa. Admittedly, the deluge had been ended in large part by a patriotic uprising in 1656 but if the Commonwealth needed to rely on the atrocities of its enemies to win a war, it was screwed indeed. Polish-Lithuanian magnates still had the rights of
konfederacja and
liberum veto, both of which severely undermined central authority. While many fortifications were being improved in these years and many Polish military theorists demanded that the proportion of infantry in the predominantly-cavalry army be increased, these demands were ignored on the grounds that the levy system needed to provide such infantry would be a threat to the citizens liberties.
So an exhausted, badly weakened Poland-Lithuania was once more dragged into a war with an enemy with which it could not easily grapple. The Tatars and their Ottoman allies had, as mentioned, stepped up their raiding. Into the mix was thrown one of the chief leaders of the cossacks, Petro Doroshenko, who in 1667 with the reimposition of Polish suzerainty decided that neither the Commonwealth nor Muscovy was a good ally. He sent a request, then, to the Ottoman Sultan, Mehmed IV, for protection from both of his neighbors. In 1669 the Sultan granted his request and began to move troops from Hungary to the Ukraine in preparation for a proper Polish war. His forces would be facing off against the
hetman, Jan Sobieski, a veteran of the deluge. For a victory over a numerically superior force of raiding Tatars and Cossacks at Pidhaytsi in the fall of 1667, Sobieski had been made
hetman by the Sejm, due in no small part to the backing of Jan Casimir. Even though Casimir abdicated in 1668, the new king, the nonentity Michał Korybut Wiśniowiecki, chose not to oppose the appointment, which went ahead successfully.
After months of raid and counter-raid, of border violations and troop buildups, Sobieski finally occupied Right-Bank Ukraine to forestall some of the raiding in 1671. The Crimean Tatar khan, Selim Giray, pleaded for assistance; the Ottomans seized on this as a pretext and declared war. Mehmed IV, deciding that he wanted to play the part of warrior-king, set off with 80,000 men, accompanied by his son Mustafa, his favorite concubine Rabia Gülnüş Emetullah (Mustafas mother), and his Köprülü grand vezir, Fazıl Ahmed Paşa. Their goal was the Polish frontier fortress of Kamianets-Podolskiy, capital of the Podolian province. Its acquisition would allow the Ottomans to tighten their grip on their Danubian vassals, and further demonstrate the ever-expanding Ottoman power. Despite some logistical setbacks, the fortress was captured in the 1672 campaign. Sobieski simply didnt have the manpower to hold onto it, and had to content himself with pinprick attacks against isolated Turkish units and raids against their supply lines.
The fall of Podolia spurred King Michał to agree to a peace treaty with the Ottoman Empire, but even the fractured Sejm refused to give up so quickly. While not substantially reinforced, Sobieski was ordered to recapture some of the Podolian forts around Kamianets to weaken the Ottoman hold on the province. His target was the fortress of Khotyn. To improve his ability to capture the fort, he was not given more men, but instead a secret weapon: Kazimierz Siemienowicz, the engineer, and his rockets, which would hopefully crack open the fortress before Ottoman relieving forces could arrive and/or do the Ottomans serious damage in the event of a field battle. Dependent in large part on the rockets to make up for his deficiency in numbers, Sobieski was caught flat-footed by the weather. Heavy rains prevented the use of Siemienowiczs rockets, and by the time things cleared up, Fazıl Ahmed Paşa and a fresh army were near. Sobieski had to retreat out of Podolia, barely warding off an attack on his rearguard by Doroshenko that added injury to insult, as it were.
During the Khotyn campaign, King Michał had died, of course. This was more dangerous than it seemed. While Sobieski had been a shoo-in before his Khotyn failure, afterwards things didnt look so good. There were now two other main candidates at the free election. Jan Paweł Sapiehas successor at the voivodeship of Wilno, Jan Kazimierz Sapieha, commanded a strong following. Like the late Michał, his status as son of an able war leader lent him credit, and his familys prominence played a huge role as well. The second challenger was the German elector of Brandenburg, Friedrich Wilhelm. Formerly a vassal of the Polish sovereign as duke of Prussia, Friedrich Wilhelm had made Ducal Prussias independence from the Commonwealth a stipulation of the Treaty of Wehlau, made with Jan Casimir during the deluge. He had then entered into the conflict in Western Europe. The Dutch war, launched by Louis XIV in 1672, had already dragged much of the Empire into fighting, and Brandenburg-Prussia had been among the states that had sided with the Dutch. But in 1673 Friedrich Wilhelm had extracted himself from the war by the Treaty of Vassem with France. Due to the poor health of the Polish sovereign, the Elector had stipulated that the French must support a Brandenburg-Prussian candidacy in the next Commonwealth free election. The French ties in Poland-Lithuania were not inconsiderable, and formed the core of the electors bloc of support.
Sobieski, of course, still had his partisans, but he was far from certain to gain the crown, and so appeared at the free election in the spring of 1674 backed up by a few thousand soldiers to try to bludgeon the electors into voting for him. Friedrich Wilhelm planned for that contingency as well. On one hand he persuaded Sapieha to resign his candidacy in return for the promise of increased holdings and nepotistic office-appointments for his supporters, and support for the office of
hetman when it reopened. On the other, he too brought troops: Feldmarschall Georg von Derfflinger at the head of six thousand veterans. After a heated confrontation that nearly turned to violence, Sobieski backed down and dispersed his (illegally gathered) troops. Friedrich Wilhelm was duly elected to the crowns of the Polish-Lithuanian Commonwealth as Fryderyk I.