Tab CompletionTab Atkins Jr.firstname.lastname@example.org://www.xanthir.comhttp://www.xanthir.com/2015-06-11T20:18:42+00:00All content is published in the public domain, or optionally may be licensed under the CC0 license.http://www.xanthir.com/b4bb0An Abbreviated History of Al'Kemizri2015-06-11T20:18:42+00:002015-06-10T02:23:31+00:00<p>I love the Civilization franchise for a lot of reasons, but one of the biggest is that it gives me a framework to hang alternate histories off of. AltHist is one of my favorite story types, in any genre or style, and writing my own as I play the game brings me a frankly ridiculous amount of joy. The last game I played ended up with one of my favorite histories ever, so I thought I'd write it up.<p>In several places I'll provide some game-related or meta-commentary on why or how something was happening. When I do, I'll put it in *(parenthesized italics)*. Also, the story will likely be somewhat disjointed snippets, as that's how I think it up anyway; I don't have nearly enough time or skill to knit it into a coherent linear story.<p>If you recognize some city names, it's because I was playing as the Indonesians, just with a custom empire name. I liked the city names well enough to keep them unchanged.<h2>The World, and Kemizri's Founding</h2><p>Our history starts on the super-continent of Eros: two continents, Westeros and Easteros, joined by a long, narrow desert isthmus. Westeros is a large fat rectangle, slightly tilted, so that its north-western corner joins with the northern ice-pack, and its south-eastern corner is hot, wet tropical jungle. The isthmus extends from the northeast corner to meet Easteros, a similarly-sized rectangle that is tall rather than wide, running from the lower arctic to the southern temperate zone. Right below the isthmus, in a bay between the continents, was a continental island, the only one of significance in the entire continental shelf. <br><p>*(Literally, a single tile, the only land in the entire world not connected to one of the two continents. The Indonesian special power is to get unique luxury resources from founding cities on non-origin continents; until I discovered deep-ocean sailing and visited the other continent, this tiny tile was literally the only suitable land in existence, so I settled it quickly. It wasn't the best city location, but the isthmus coast was within range with a <b>bunch</b> of resources, and most of the water was coast rather than ocean, so it wasn't that bad, either.)*<p>The Kemizri civilization was founded in the jungles and rainforests of southeastern Westeros, and quickly spread to the island in the central bay and the isthmal coast north of it. Kemizri civilization developed in two very different directions, almost forming separate civilizations entirely.<p>The western half, the Jakarta region, took a slower, pastoral approach to life. The forests were <i>very</i> fertile, and provided the region with ample food, allowing priest/intellectual/artist classes to form early and strongly influence the culture.<p>The eastern half of Kemizri, consisting of the island of Surabaya, the shallow coastal waters around it, and the isthmal deserts to its north known as the Spice Coast, were significantly different. A strong sailing tradition developed out of necessity: Surabaya was relatively small, but had abundant fish; the Spice Coast had room, but little life to fill it, and made up for it with abundant earth resources. This relationship created a vibrant trading culture that would come to dominate Surabayan life long into the future. Except for some border regions where Kemizri bled into Songhai, most foreigners only contact with Kemizri was with Surabayan sea-traders, leading to the common expression "Where there's coin, there's Kemizri".<h2>Early Religion</h2><p>Archeological evidence suggests Jakarta was actually host to the very first semi-organized religion. The citrus farms of southwest Jakarta led to a fertility-based sun-worshipping belief system. This focus on the sun and astronomical phenomena seems to have helped them plan plantings and harvests, leading to greater yields and increased growth in the area.<p>*(I chose Sun God as my founder belief, for the +1 food on citrus resources, which I had several of in Jakarta's reach.)*<p>This sun-based religion seemed to agree with the Kemizri, for it spread through the civilization, though it mutated significantly as it did. In coastal Jakarta it took on a more philosophical bent, in Surabaya it became a religion of the sea and sky, and the Spice Coast developed an ascetic, divine-vision&endash;based variant (likely aided by the hallucinogenic succulents native to the area).<p>This diversity of belief, while helpful for early spread, was eventually troublesome, as it prevented the Kemizri mystics from forming an organized front as foreign religions began to intrude.<h2>Neighbors and History up to Medieval</h2><p>To the west of Jakarta were several minor states, and the Songhai caliphates. They were largely friendly; a trading relationship quickly sprung up, trading the abundant cotton from the Songhai plains for the rare spices that grew only in Surabaya.<p>To the north of Surabaya, on the northern coast of Easteros, was the fledgling Roman empire. They were much less friendly, frequently rattling sabers over the natural resources of the Spice Coast that Kemizri claimed. The Romans were rather war-like, attempting to invade Jakarta several times but always foiled by the great inconvenience that the isthmus posed to troop movements, enabling Jakartan archers to pick off enemy armies as they trickled in, rather than ever facing a significant force at once. <br><p>Repeatedly foiled in their territorial ambitions in Kemizri lands, they eventually turned their eye westward and attempted an invasion of Songhai over the northern sea. This... went even worse for them. Their troops were routed by Songhai's far more experienced coursers, and then chased back across the bay, where Songhai laid siege to and quickly conquered all of Rome.<p>To the east, in central Easteros, the Mongolian nomads were a minor power. They too held a friendly trading relationship with Surabaya, and being completely unfamiliar with sea-borne combat, never attempted anything hostile. They would have one day competed for space with Rome, but Songhai was not interested in further expansion after the conquest, and Mongolia was not stupid enough to provoke such a power. Instead, Mongolia remained a relatively isolated backwater, occasionally making trouble for its neighboring minor civilizations, but otherwise staying off of the world stage.<h2>The Ascent Of Islam</h2><p>While Kemizri was the first to develop early religion, neighboring Songhai was the first to refine it, turning their traditional beliefs into a coherent system we know today as Islam. They developed a strong proselytizing tradition, with their Sufi nomads spreading the words of their Prophet far and wide.<p>*(The jerks quickly developed their religion twice, grabbing Itinerant Preachers for the second, which greatly expands the range that religion emanates from cities.)*<p>The philosophical traditions of Islam meshed very well with the traditions of Jakarta, and were quickly taken up by the region. Eastern Kemizri resisted much more strongly; the restrictions on commerce were irksome to the Surabayan traders, and the reliance on a clerical class conflicted with the personal revelations of the Spice Coast mystical traditions. In response, Kemizri religion was finally organized, blending together the disparate traditional beliefs of Eastern Kemizri into a semi-cohesive whole known as the Doctrine Of The Heavenly Gate. (The "Gate" referred to the Sun, said to be the gateway to Heaven.)<p>*(In game, I went with Church Property, because duh, and Divine Inspiration, which gives faith per world wonder, because I was really feeling the pinch from Islam and was quite behind in faith generation.)*<p>This effort was, unfortunately, ultimately fruitless. It was around this time that the Roman Conquest happened, and Songhai wasted no time in spreading making its new territories Muslim. With Islam to the west and north, and gradually spreading to the Mongol nomads in the east, Surabaya was forced to give up and officially adopt Islam as well. Heavenly Gate continued in a somewhat underground fashion, but mostly as a "sea religion", spread by and among sailors who rarely if ever saw an imam.<p>*(This gave me the "Converted!" Steam Achievement, for having my religion-founding city convert to a foreign religion. I... never expected to get that cheevo legitimately. Hey, it's a silver lining.)*<p>Of the two halves of the empire, Jakarta had a <i>much</i> more highly-developed artistic community. Most of its art was rooted in its sun religions, though, even after the conversion to Islam, which made it much less attractive to the rest of the continent. Surabaya's considerably less respected art community adapted to the continent's taste much more rapidly, and thus became the face of Kemizri art, to the extreme consternation of Jakartan artists.<p>Near the end of the Medieval era, a new sect of Heavenly Gate appeared and became briefly popular. Drawing inspiration from the dominant Islam, it focused more strongly on religious texts and art, and made a brief breakout in Surabaya and the nearby coastal regions. Islam was at this point unafraid to throw its weight around, though, and within a century Heavenly Gate had been pushed back underground.<p>*(I finally enhanced my religion and picked up Religious Texts, the best for late-game religious domination. There weren't many Follower beliefs left, as I was the last religion in the world to be enhanced, so I grabbed Religious Art for the Hermitage boost and thematic flavor.)*<p>*(For serious, tho, Islam had a <b>bunch</b> of prophets and missionaries hanging around when I tried to develop a stable geographic core for Heavenly Gate. It was so frustrating seeing my progress wiped out in only a few turns. >_<)* <h2>The Kemizri Renaissance</h2><p>After the excitement of the Roman Conquest, life settled down on Eros. Everyone was friendly, trade was plentiful, and the continent was united under a common religion. The Songhai caliphates were the undisputed military power of the region, but they had no reason to <i>use</i> that military. Surabaya developed a moderate Navy around the 1200s to deal with a major piracy problem off the Easterosi coast (several bandit strongholds developed along the central desert coast and severely disrupted shipping for a few decades, suspected but never conclusively proved to be funded by Mongolia), and maintained a presence in the waters all along the coast to ward off further pirate camps from developing.<p>Unsurprisingly, Kemizri was the first to develop deep-water vessels capable of crossing the ocean. Having saturated the markets across the continent, Surabayan traders were desperate for new locales to trade with. They were thus the very first to encounter the considerably more conflict-torn continent of Archeope.<p>Archeope was almost exactly opposite Eros, centered in the southern hemisphere on the opposite side of the world. It was shaped like a broad, fat lambda, with its feet curving around to almost meet on opposite sides of the antarctic pole, its center in squarely in the temperate zone, and a narrow head reaching into the tropics. Because both feet thrust into the antarctic ice-pack, they formed a central ocean separated from the rest of the global waters. (Eros almost had that, with its Northern Ocean, but Easteros's north coast was only <i>barely</i> arctic, and thus was always traversable.)<p>The western leg held the German empire, tilted more towards the center, while the eastern leg spawned the Zulus. The center <i>originally</i> held the Ottomans and Aztecs, but they were both conquered before I arrived.<p>Both the Germans and the Zulu were none too welcoming; while they were happy to see new trade with someone other than each other (having had a bunch of back-and-forth territory exchanges over the centuries), they made it very clear that there was very little land that wasn't considered the property of one or both of them.<p>But very little isn't zero. On the far western edge of Archeope, nestled between the minor nations of Bratislava and Antananarivo, was the glorious and unclaimed Mount Fuji, along with a bit of free coastal land. After establishing strong trading relations with the neighboring minor nations (and the others across Archeope, which were mostly concentrated in the lambda's "head"), Surabaya established the semi-independent colony of Medan.<p>Medan was a jewel. The Pacific Ocean coast, which spawned such terrible hurricanes in Mongolia, was placid and cool off of Medan, due to the antarctic current. The backdrop of majestic Mount Fuji was not only beautiful, but trapped the wet ocean air and kept Medan well-watered with plentiful rains. There were even exotic spices growing there, unknown to the rest of Archeope!<p>*(Woo Indonesian powers!)*<p>Around this time Surabaya organized its trading network into a loose world congress, the League Of Free Trading Nations, intended to help harmonize relations between nations and promote the progress of science and trade. The League's headquarters were, of course, in Surabaya.<h2>The First World War</h2><p>The serenity of the Renaissance did not last very long. The last territorial dispute between the Germans and the Zulus in the 1800s was a decisive victory for Germany, giving them full control of the old Ottoman and Aztec lands and pushing the German/Zulu common border eastward. This nearly doubled the empire's population, and the Germans quickly exported their cleverness and work ethic to the acquired territories. This resulted in them advancing technologically at a frightening pace, and at the beginning of the 20th century early German tanks were massing at the Zulu borders.<p>The war was fairly quick, as wars go. Horses and rifles simply weren't a challenge for armored tanks and machine guns, and the resulting treaties the Zulu were forced to sign were devastating to them - they gave up two thirds of their remaining territory and kept only a small coastal territory.<p>The seemingly effortless success of the war energized the German populace, and the leadership rolled it into an expansive vision of Manifest Destiny, belligerently speaking about the rights of Germany to all of Archeope. Troop movements near Medan in the 1920s revealed their hand, and was only avoided through fevered diplomatic negotiations, which resulted in Kemizri gold funding a final Zulu war (a quick and bloody victory for the German Empire). This "Necessary Bribe" was not popular back home, but in the few years of tense peace it bought, the homelands began throwing together a larger navy. No bribe could put off the inevitable, though. In 1935, Germany officially declared war on Medan, claiming it as ancestral territory of the German people.<p>Germany was a great power at this point. Its military tech and overall army were far beyond even the Songhai caliphates. It had an entire continent of well-developed cities churning out units, to throw at a single small territory, of a militarily weak nation, whose main territory was half the world away. Victory seemed a foregone conclusion, the war declaration almost an afterthought. "We will be greeted as liberators", their politicians proclaimed, "and free them from the Islamic tyranny. German Christendom über alles!"<p>What they did not count on was the strength of the trading ties Surabaya had established over the world, nor the geographic hazards the Medan/German border brought into play. Zululand was mostly easy plains and light hills, trivial for tanks to roll through. Medan sat on a coastal protuberance, exposing relatively little of its face to the continent, and Fuji sat right in the middle of that, leaving only two narrow coastal pathways to the north and south. Any army attempting an invasion would have to split itself in half, greatly limiting the force that could be brought to bear at a time.<p>*(It was pretty perfectly placed - 3 of its surrounding hexes were ocean, and Fuji was right in the middle of the three land hexes. There was a single hex to the northeast and southeast to approach the city from, meaning at most two attackers at once.)*<p>As well, Medan's neighbors, the minor nations of Bratislave and Antananarivo, declared fiercely in their defense, vowing that no German troops would be allowed through their territory (which Germany would have to pass through to reach Medan) without a fight. Germany began its assault of Bratislava, and the war was on.<p>*(This was the other perfect piece of the war. There was technically one tile of direct Medan/German border that they could have sent troops through, but Germany <b>could not resist</b> attempting to invade the minor nations. Whenever it tried to send troops around the north, they'd get diverted and try to take Bratislava. When it tried to send troops to the south, well, Antananarivo was <b>right there</b>, they can't <b>not</b> try and take it, right? And Bratislava especially was <b>super</b> defensible, with only a single adjacent land hex, which Germany often filled with a machine gunner (a ranged unit, incapable of actually taking a city). Without them repeatedly taking the brunt of the invasion force, I'd have lost this war quickly.)*<p>The war went on for over a decade, with the Germans bogged down in the Bratislavan hills. The Surabayan navy provided desperately-needed fire support, bombarding troop formations near-constantly. Bratislava and Antananarivo both fell repeatedly to German troops, but the bravery and skill of Surabayan sailors liberated them each time, causing further delay for the German offensive. Through all this, German troops only even set foot on Medanese soil <i>once</i>, during a protracted retaking of Bratislava where the way was clear for a few years. In the nick of time new fleets arrived from the homeland, tho, and they were fought off.<p>The strength and bravery of the Surabayan navy, and the sacrifices and stubbornness of the Bratislavans and Antananarivans in defending their trading partner, was holding off the German advance. But the stalemate couldn't last forever. Germany was remembering that it wasn't just a land power, and the new ships coming out of the Ottoman coast were frightening steel destroyers, overpowering the outdated Surabayan wooden frigates. Cannons really weren't a match for sea-borne artillery, and the war seemed to be turning back to Germany's side.<p>*(I retook Bratislava three times, and Antananarivo twice, liberating them back to independent countries each time. They were amazing.)*<h2>Resurgence of Heavenly Gate</h2><p>Throughout this World War, there was one notable participant missing. The Songhai caliphates had made a token war declaration in support of Kemizri, but other than a single weak fleet which held back merely to monitor the war's progress, the caliphates didn't lift a finger in defense. The unity of Dar al-Islam was suborned by geopolitics, as Songhai prepared itself for the inevitable German domination of the Archeope continent.<p>This, understandably, caused great consternation among the religious communities of Medan. Muslims were supposed to stand together in common defense! Especially when religion was so explicitly used as a justification for the war - Germany alleged that Medan's Christian communities were being oppressed by the Muslim majority, as one of its cassus belli.<p>There were also unpleasant racial overtones mixed into this debate. Both Germany and Songhai, centered in cold temperate climates, were predominantly white nations. Kemizri, being a tropical nation, was predominantly black (and much of Medan's population was from Kemizri immigration, so it leaned heavily that way too). Seeing the caliphates seemingly agree to allow another white empire to conquer their black Muslim brothers did not sit well with many Medanese.<p>Standing in stark contrast to both apathetic Islam and hated German Christianity was the unofficial religion of the Surabayan navy, Heavenly Gate. The appeal of a religion that was both "native" and actually seemed to care about them was too strong to resist, and Medan had a religious revival near the end of the war, with it and its neighboring allies mass-converting to Gatism.<p>This was the spark that lit a great fire later termed the Great Revival, as the religious fervor spread through Surabaya's trade network. Most Kemizri trading partners followed along and converted to Gatism, Surabaya's own underground Gatist community exploded, and even Mongolia was infected with the new faith. In less than two decades, Islam had shrunk from a world-spanning behemoth to being just the continental religion of Westeros and the Roman territories.<p>*(Really, I'd just forgotten that I could buy Prophets with faith, and so had been accidentally stockpiling it for centuries. I'd already been saving some prophets (gifted to me by city-state allies), so when I could suddenly buy three more, it was time to bust the fuck out. I was a little scared that Islam would just re-convert a bunch, but it looked like they'd spent their load on conversions back during the Renaissance, and couldn't really afford prophets or missionaries any more.)*<p>With Islam's shackles on trading and commerce thrown off, Surabaya became the epicenter of a financial revolution. This sudden influx of new cash was vital in ending the world war and repositioning Kemizri as a world power.<p>*(FINALLY, Church Property started flexing its muscles. The extra 50 gold or so per turn was really useful at fixing up my navy and converting more city-states into my allies.)*<h2>The End of the First World War</h2><p>Jakartan scientists had been desperately trying to replicate Germany's successes at industry and engines through the entire war, and with the country's coffers suddenly overfull, increased funding led to a breakthrough in ship-building tech. While the Germans were once again sieging Bratislava, the navy around Medan was quickly and quietly upgraded from frigates to the frightening new battleships. The seamen adapted immediately to the new cannonry, learning to push them to operating efficiencies beyond the engineer's dreams, and began finally making headway against the German invaders.<p>*(All that bombardment levelled up my frigates so much that, right around the time I discovered Battleships, they had all picked up the Range upgrade. Going from a 2-range frigate to a 4-range battleship (battleships themselves coming with a 3-range, +1 from the upgrade) with double the attack strength meant I could finally go on the offensive, as I could now attack cities from outside their defense range.)*<p>The new cannons made quick work of the Bratislava siege. Leaving behind a small defensive force, the newly-invigorated navy pushed onward, to the German-Ottoman territories that were producing most of the German navy. Extended shelling, and a desperate focus on reducing Germany's capacity to make war, reduced Ankara and Bursa utterly to rubble; a more moderated offensive merely captured Istanbul and Edirne and revitalized the Ottoman government as an ally.<p>With the entire western seaboard of Archeope now out of German hands, the focus turned to the east. After a quick diversion to reclaim Bratislava <i>again</i>, the fleet circumnavigated the continent and took a few years to easily liberate every Zulu city within reach of the battleship cannons. Peace talks began in 1943, with Germany agreeing to stop all aggression and pay significant reparations.<p>*(They gave me <b>all</b> of their luxury resources, yesssssssss. And all my new Zulu puppet-cities quickly started pumping out a ton of science, gold, and culture. Kemizri is finally rivaling Songhai and Germany!)*<p>With Zululand and the Ottoman empire no longer under Germany's thumb and eagerly trading with Kemizri, Heavenly Gate spreading throughout the world and promoting heavier trade, and the Surabayan navy throwing around their <i>fierce</i> reputation as the undisputed masters of the seas, Kemizri's reputation in the world increased dramatically. It went from being a small trading nation, practically a caliphate of Songhai, to being a vibrant and powerful player on the world stage, able to rival or beat any other country with its dominance of trade and sea-based military power.<h2>The Modern Age, and the Ascension of Kemizri</h2><p>Of course, you can't keep an aggressive empire down for long. The reparations bankrupted Germany, and sent it into a terrible depression. The German people blamed Kemizri, and its leaders fanned that unrest and turned it into political power. Barely a decade after the cessation of hostilities, Germany, with a newly rebuilt panzer army, declared war on the Ottomans. This was clearly a proxy war with Kemizri, and they responded in kind, declaring war against Germany in support for the Ottomans.<p>World War 2 stretched on for quite some time; Germany still held a decisive tech advantage and had finally cracked the airplane code, using bombers liberally. But they were entirely without any coastal cities, and thus had nothing to counter the Kemizri navy. The result was an odd stalemate - every territory that Germany tried to invade was coastal, bringing their armies within range of Kemizri cannons, but the remaining German cities were all too far inland to reach with the navy, and Kemizri had next to no ground forces. Aside from a quickly-reversed blitzkrieg that temporarily took Antananarivo, Germany made absolutely no progress in the war, and eventually their economy and national spirit broke from the never-ending wastage of lives and materiél. After a desperate and horrifying last-ditch nuclear attack against Medan (the Germans having split the atom during the war), they finally gave in. The peace accords ceded the rest of Zululand, shrinking the empire to the historical boundaries of native Germany, and laid even heavier reparations on the country.<p>*(They literally nuked Medan and then offered generous peace terms in the same turn, bastards.)*<p>Meanwhile, Eros was in a second renaissance. Kemizri's newly-opened trading relationships with the non-German half of Archeope continued and grew stronger throughout the war, with the attendant cultural intermingling resulting in massive technological strides that finally brought them into the modern era. *(And, finally, forced them to reluctantly adopt the combustion engine. Not entirely certain how they had battleships without it, but hey, tech trees are weird.)*<p>The League Of Free Trading Nations now had true teeth internationally, and just in time. Songhai's gradual cultural ossification culminated in them forming an officially fascist theocracy, and saber-rattling a bit. Not one to be threatened (and secure in their defense by the rebranded Free Trade Navy), the League (in truth, Surabaya) declared Gatism the world religion, and began pursuing an explicit doctrine of freedom and liberty.<p>*(Germany and Songhai were both dedicated to Autocracy now, while I went for Freedom and <i>rushed</i> Treaty Org (+4 influence with city states every turn you trade with them). Oh god, <i>finally</i> the League was firmly under my control. Repeating World Islam and replacing it with World Heavenly Gate finally shifted the balance of power in Easteros; combined with Religious Texts, Gatism now emits 7.5 pressure per city, drowning out Islam's 4. Gatism's hold on Mongolia tightens, and the Roman territories finally get more Gatist pressure than Islamic. Finishing off the conversion of the minor powers means that Surabaya is no longer inundated with trading-derived Islam pressure, and is no longer under threat of a slight Islamic majority.)*<p>A quick diversion is in order, as Mongolia suddenly held some interesting relevance. As Surabaya was their main trading partner, they signed the Declaration of Liberty as part of the League, officially embracing freedom and democracy. But Songhai was not willing to give up cultural hegemony over Eros; a number of public assassinations of pro-freedom governors, only barely concealing their Songhai connections, led to the Mongolian government imposing martial law "for the protection of the populace" and quickly passing a number of laws restricting religious and political freedom and tightening relationships with the Roman-Songhai territories. The metropolitan north, with more direct ties to Surabaya, erupted in unrest, which quickly moved into an open civil war. It lasted two years, and ended with the creation of the independent Republic of Beshbalik, which became a member state of the League.<p>*(Mongolia immediately declared for Freedom as soon as they went entered the Modern age, to match me, their best friend, but Songhai's cultural influence was too strong, and they switched to Autocracy not too much later. They were now trapped, with the two highest-culture civs both neighbors and pulling them in opposite directions. I didn't even realize was was going on; there was still some unsettled territory in Easteros, so I figured they were just having some barbarian problems, not a literal civil war, as I'd never seen that happen before. Having their biggest city defect to me was another first! Very exciting times.)*<h2>The End of the Game</h2><p>The rest of the modern era was a predictable slide to Kemizri dominance. Germany tried another war against the Ottomans, and again made no progress due to their troops being shelled to death as soon as they came within four hexes of the ocean. Unfortunately, they took Antananarivo while I was distracted, and while I was liberating <i>that</i>, they slid some troops into the Ottomans and took over both cities. I was on my way to retake them when they offered peace terms (again, immediately after nuking one of my cities), and as they were offering more interior cities that I still couldn't hope to take myself, I had to accept.<p>So currently, in the year 2065, Germany is left with Berlin, Hamburg, and two blockaded Ottoman cities which'll I'll retake as soon as the peace treaty ends. The Ottomans are actually still alive - in the middle of this last war, they sent out a settler and founded a small city on the east coast of Easteros, just outside Mongolian territory. I wish them well, as I'm <i>keeping</i> those coastal cities when I retake them this time. It's too annoying to keep a tiny ally alive when a land-hungry militaristic neighbor is around. I could produce some artillery and tanks and roll through the rest of Germany now, but there's not really any point; I've already won, and I might as well let them keep their dignity.<p>And that's the history of Al'Kemizri, the most interesting empire I've ever had the pleasure of playing in Civ.http://www.xanthir.com/b4a30Tips On Keynoting, from Chris Coyier2015-03-09T18:55:38+00:002015-03-09T18:55:01+00:00<p>Last year I was asked to keynote SassConf (it was incredibly great! everyone should <a href="http://sassconf.com/" title="">attend this year</a>!). I'm an experience public speaker at this point, but I'd never keynoted before, and I was pretty nervous about it, especially at a conference slightly outside of my tech comfort zone.<p>So I asked Chris Coyier, who's keynoted from hell to breakfast, what to do. His advice was really helpful (and I should have followed it even more closely). I just ran across it today when searching my email, and thought it could help other people too:<blockquote>
You're right in that often keynotes have a different vibe from the rest of the talks. They are often stories, personal experiences, walks through history, and more often than not, focused on inspiration. The idea being - "isn't it weird and cool that we're all together in this room? Let's consider a reason why that might be - and go get em tiger!"
I can imagine you telling a cool story about how you got into CSS and how that lead to being possibly the most influential person in the future of CSS today. Or perhaps how you feel about CSS as a language. What it means to the web, what it means to the world, it's successes and failures. And perhaps where it's going, but light on the feature-by-feature rundown. Or maybe attempting to answer the question: is CSS going to be around in 10 years? 20 years? Is there any way to answer that question without gut instinct?
</blockquote><p>Obviously some of this, especially the second paragraph, is kinda specific to my own situation, but it's still all good general advice for anyone wanting to give a keynote, or anything similar. Hopefully this helps someone else!http://www.xanthir.com/b4_g0Depixelating Pixel Art2015-02-18T17:42:57+00:002015-02-15T22:06:32+00:00<p>For my future use, I distilled the <a href="http://research.microsoft.com/en-us/um/people/kopf/pixelart/index.html" title="">algorithm for depixelating pixel art</a> into its component steps, minus the explanations and figures.<p>I've also copied this over into <a href="https://github.com/tabatkins/depixel" title="">a GitHub project</a>, which will host the code when I write it.<h2>General Algorithm</h2><ol><li><p>Construct a graph where each pixel is a node, connected to its 8 neighbors.<li><p>Remove all edges between nodes with "dissimilar" colors. (In YUV, colors with dY>48, dU>7, or dV>6.)<li><p>Examine all four-squares of nodes:<ol><li>If all four are fully connected, remove the diagonals. (It's a block of the same color.)<li>If they're only connected via diagonals, use feature detection to tell which diagonal to keep:<li>Compare the length of the curves (valence-2 nodes) that each diagonal is a part of. Cast vote in favor of the longer one, with weight equal to difference.<li>Compare the size of the connected graphs each diagonal is a part of, in an 8x8 window. Cast vote in favor of the smaller component, with weight equal to difference in size.<li>If either diagonal connects directly to a lone pixel (valence-1 node) cast a vote in favor of it, with weight 5 (empirically determined).</ol><li><p>You now have a fully planar set of disconnected graphs.<li><p>Chop each connection in half, associating each half with its closer point. Construct a Voronoi diagram from each of these points+half-connections. Quantize the Voronoi to a quarter-pixel grid.<li><p>Simplify the Voronoi diagram by collapsing valence-2 nodes into lines that connect their higher/lower-connected endpoints. <br><li><p>You now have the basic depixelated shape.<li><p>Walk the graph of cell points (nodes). Ignoring junctions separating similar (connected) cells, find all runs of valence-2 cell points and turn them into quadratic b-splines, with control points set to the nodes.<li><p>Simplify all 3-spline junctions.<ol><li>If one of the splines is a "shading spline" (separating two areas with YUV distance <= 100) and the other two are "contour spline" (YUV distance > 100), connect the two contour splines into one.<li>Otherwise, find the two splines which connect with an angle closest to 180deg, and join them together.<li>Keep in mind that the end-point of the non-connected spline of each triad will need to be adjusted to lie exactly on the curve defined by the connected splines.</ol><li><p>You now have a relatively smooth depixelated shape.<li><p>Detect "corners" that shouldn't be smoothed away. Corners are all runs of 4-5 points that are related by the following 5 relations (plus rotations/mirrors):<ol><li>(0,0) (.25, .75) (.75, .75) (1, 0)<li>(-.25, .25) (.25, .75) (.75, .75) (1, 0)<li>(-.25, .25) (.25, .75) (.75, .75) (1.25, .25)<li>(0,0) (0,1) (1,1) (1,0)<li>(.75, -.25) (.25, .25) (.25, .75) (.75, .75) (1.25, .25)</ol><li><p>Optimize all remaining nodes by minimizing an energy function over them. Each node contributes the sum of:<ol><li>Curvature. Integrate the curvature function over the segment influenced by the node. Can use simple numerical sampling here.<li>Position deviation. Take the fourth power (empirically determined) of the distance between its current location and its original location.</ol></ol><p>The energy function is non-linear but smooth, so you can do local modifications by randomly selecting nodes, randomly jiggling them to find a lower-energy state, and repeating until satisfied. Paper doesn't specify how many iterations they used.<ol><li>Rejigger the "corner" nodes to match up better with the energy-minimized nodes and minimize cell-shape distortion. Paper is unclear here: use harmonic maps; it's solving a simple sparse linear system; [Hormann 2001] has a full explanation.<li>Remember to rejigger the endpoint of the non-connected spline in each triad connection!<li>Render the graph accordingly. [Nehab and Hoppe 2008] Each reshaped cell diffuses its color from its centroid, constrained by the spline boundaries? Simpler if you assume that all color differences are significant; you get more contours, but they're all solid-color and look pretty good. (And can actually be done in SVG, which doesn't have diffusion-based paint servers yet.)</ol><p>DONE.<h2>Future work</h2><ol><li>Detect dithering patterns used in color-constrained graphics, and consider them part of a single solid-color region.<li>Detect "corners" (junctions where long straight lines meet) and increase the multiplicity of the knot vector to get a sharper corner.</ol><h2>Refs</h2><p>NEHAB, D., AND HOPPE, H. 2008. Random-access rendering of general vector graphics. ACM Trans. Graph. 27, 5, 135:1–135:10.<p>HORMANN, K. 2001. Theory and Applications of Parameterizing Triangulations. PhD thesis, University of Erlangen.http://www.xanthir.com/b4Zz0Switching Your GitHub Repo To Use Only The <code>gh-pages</code> Branch2015-01-25T06:22:06+00:002015-01-04T23:05:40+00:00<p>(This is a simplified version of the advice on <a href="http://oli.jp/2011/github-pages-workflow/" title="">Oli Studholme's blog</a>, cut down to just the parts that I've actually needed. I do this often enough, and always forget the steps, so having it put down here is useful for me, and maybe for someone else.)<p>So you want to serve your repo from the <code>http://user.github.io/repo</code> url, and don't have any reason to separate a "code" and "serve" branch. In other words, you want your GitHub repo to only use the <code>gh-pages</code> branch, not <code>master</code>. Here's an easy guide to making that happen.<p>First, if you already have a <code>gh-pages</code> branch, make sure it's synced up to master, showing exactly what you want. If you don't, type:<pre class='code'>git checkout -b gh-pages
git push origin gh-pages</pre><p>Second, go to GitHub, settings for your repo, and switch “Default Branch” to <code>gh-pages</code>.<p>Third, delete the local <code>master</code> branch with <code>git branch -d master</code>.<p>Finally, delete the remote <code>master</code> branch with <code>git push origin :master</code>. <p>Done. You now have only the <code>gh-pages</code> branch, and it's the default one that git will use when talking with GitHub.http://www.xanthir.com/b4Zb0A Quick Primer on P and NP2014-12-12T19:05:51+00:002014-12-12T19:05:51+00:00<p>(This is a quick gloss over the problem, intended to give someone a good idea of what's going on without bogging down too much in details. Pretty sure I've gotten it right, but if I'm slightly off about something, don't worry about it.)<p>So, a lot of problems sit in P or NP complexity classes. This classifies a problem based on how quickly the time-to-solve increases as the size of the problem increases. Adding two numbers is linear - double the size of the numbers, you double the running time. Multiplying two numbers is (roughly) square - double the size of the numbers, you quadruple the running time. Bruteforcing a password is exponential - double the size of the password, you increase the running time by ~60^n (where n is the original size).<p>Linear and square are both "polynomial", or in P, because the relationship between problem size and running time can be written as a polynomial equation where the problem size is the base and the power is a static number. Adding is "size^1 = time", multiplying is "size^2 = time". Password cracking is not polynomial, because its equation is "60^size = time" - the size is a power, not a base.<p>NP doesn't quite stand for "non-polynomial", but it's often described as such, and that's pretty close to what it means. There's an extra wrinkle, though. NP actually stands for "non-deterministic polynomial", which means that if you had a magic 8-ball that you could ask yes/no questions of and it always gave the right answer, you could solve the problem in polynomial time. Bruteforcing passwords is like that - if you can just ask the oracle "is the first letter A? is it B?" etc, you can figure it out in linear time (roughly 60*N, rather than 60^N). A lot of exponential problems are like this - there's not actually that much work that goes into solving it, it's just that you don't know where to do the work, so you have to try every possible combination. The oracle fixes that.<p>An alternate definition of NP is that it requires at least polynomial time to solve, but only needs polynomial time to <i>verify</i> the solution. Again, passwords are like this - if someone claims they know the password, you can tell if they're right by just checking it against the real password, which is linear time (checking each letter).<p>The definition of NP technically covers everything in P as well. There's another category, NP-complete, which means "the hard part of NP". Most of the time, when people say "NP" they actually mean "NP-complete".<p>Quick diversion - it's still an open question whether P and NP are equal to each other. It might be that, with very clever algorithms, password cracking can be done in polynomial time. Most computer scientists don't think so, but we haven't yet been able to prove that it can't be done. (We <i>can</i> prove that some complexity classes are definitely different, but P and NP haven't been achieved yet.)<p>So, we don't yet know whether the NP-complete category is part of P (if P=NP) or is a hard chunk separate from P (if P!=NP). We <i>do</i> know, though, that some problems are definitely in NP-complete - they're the "hardest possible" problems in NP. (though, again, they might still turn out to be in P as well). We started out with <a href="https://en.wikipedia.org/wiki/Karp%27s_21_NP-complete_problems" title="">21 examples of NP-complete problems</a>, and now we mostly add new ones by proving that you can transform the new problem into an NP-complete one and vice-versa (in polynomial time).<p>The NP-complete category is useful because it's big and connected, so that if anyone can ever prove that any single NP-complete problem is in P, they prove that they're <i>all</i> in P automatically.