I’ve been wanting to write about Political Arena’s technical architecture for a while now, and considering all the debugging I’ve been doing ahead of our Early Access release, now seems like as good of a time as any to broach the subject.
I’m going to anchor this with a story about one of our most frustrating bugs. It not only gives a nice look at everything from the game’s systems, modern computing, politics, and even quantum physics, but the solution to the bug is a prime example of how all these things sometimes intertwine to make Political Arena a better game.
So here’s the deal: very few of the votes scheduled in Political Arena were actually occurring at their allotted time. The problem wasn’t that our simulated senators were being held up at simulated industry fundraisers, the problem was that the computer was literally running behind the game clock.
The game clock: It giveth and it taketh away
Even in its comparatively lightweight Early Access 0.1 state, Political Arena is a meaty sim: How much game currency should the Senate Majority Leader receive today? How much news value should be assigned to a congressman’s gaffe? Has lawmaker X done anything offensive enough to lawmaker Y to keep lawmaker Y from co-sponsoring lawmaker X’s bill? And on and on.
As time progresses, the game’s computational load only grows heavier. Congress produces ever more data to sift through: hundreds of new bills each month, new favors given, new cosponsorships to consider, new instances of committee leaders being upset over their chamber leader’s bigfooting them over a vote. Much – if not most – of the game’s logic is tied to the game’s clock. Each tick unleashes a cascade of increasingly cumbersome calculations from scripts with names like “BillDraftingManager” “CosponsorManager” and my personal favorite, “FavorGrudgeManager.”

The pettiest of data
To keep your laptop from getting too toasty, we instituted all manner of changes to the game architecture and logic, some obvious others less so. Certain things were sacrosanct, including that each lawmaker had to actually vote when a bill came up for consideration. After all, it would be disingenuous to apply a “top-down” simulation approach by batch applying a bunch of Republican “no” votes to a Democratic bill and then roll the dice for the occasional GOP defection. More significantly, it’d undermine the game’s appeal as a sandbox simulation.
Still, we trimmed a lot of algorithmic fat. We made sure the AI stopped considering votes for bills that congressional leaders had no taste for, we streamlined the way we individualize lawmakers’ policy views by tethering them to their ideologies, and we throttled just how many senators could pester the White House at once.
Most significantly, however, our optimization journey took us into…
This is where our humble game about the Senate Committee on Agriculture, Nutrition, and Forestry runs up against the realities of computer hardware and the frustrating ambiguities of physics. This is where a new heavy hitter enters Political Arena’s system of influencers: quantum physics pioneer Werner Heisenberg.
Historically, most personal computers had a single-core CPU — a central processor that, to use the technical term, does the stuff. Even though your Gateway 2000 let you multitask like a boss — simultaneously loading HamsterDance.com, stealing music on Napster, and contributing to Perot/Kemp ‘96 — the CPU was effectively doing one thing at a time. This illusion of multitasking was (and still is) handled through multithreading, in which tasks are divided into threads and rapidly interleaved. But ask too much of a CPU in too short a time, and things lag.
For much of the 20th century, chipmakers improved performance by cramming more transistors — the building blocks of computer logic — into CPUs. The more transistors, the more threads a computer had to accomplish more per second. But around the turn of the century, these manufacturers hit a wall — or, rather, their walls stopped working.
At small enough scales, particles like electrons don’t always do what they’re told. At these quantum levels, electrons can literally appear in places they normally couldn’t — slipping through barriers and bypassing a transistor’s wiring altogether. One possible consequence of this uncertainty, first described by Heisenberg, is that 0s can potentially be misinterpreted as 1s, and 1s as 0s. Suddenly, your ability to send a pragmatic, independent voice to the White House gets bogged down in technical errors. This phenomenon is known as quantum tunneling — the wacky electron bit, not the name of Ross Perot’s 1996 tax platform.
So manufacturers shifted from shrinking transistors to slapping more processors – or “cores” – onto their chips. These extra cores make computers even faster – each one able to concurrently manage hundreds of the above-mentioned “threads.” On the production side, however, they’re a total pain. If two “threads” simultaneously access the same data, your Napster download might stop, if the threads aren’t properly synchronized, your dancing hamsters lose the beat. It’s like managing a rail yard with hundreds, sometimes thousands, of inbound trains.
Like most modern simulation/strategy titles (Paradox strategy games, Civilization VII, Cities Skylines and more) Political Arena has no choice but to leverage these additional threads.
Votes are one of the many systems whose logic must run on threads separate from the game’s graphics. While a vote in a small Senate committee might take less than 10 microseconds, computing a all the logic behind a House vote can take upwards of five seconds (technically it could happen near-instantaneously, but your computer has a lot of other concerns aside from Political Arena). That may not sound like much, but if the computer waited for all of these computations to complete before updating the graphics — to say nothing of the rest of the simulation — Political Arena would become unplayable.
Which brings us back to the original problem: late votes. Each lawmaker’s vote — even when optimized to the Nth degree — represents a series of chonky calculations. When stress testing the game at higher speeds, our threads started to backlog just enough that votes would occur hours, days, or even weeks after their scheduled time.
So what to do? We didn’t want to delay the game clock to wait for every thread to finish, and we didn’t want to precompute votes — after all, it’s not like bills undergo some kind of advance analysis…
…except of course they do.
Maybe it was my hyperfixation on the game appearing to be synchronized, or maybe it was the myriad other systems I had to worry about, but I had forgotten about one of the most overlooked facts of the politics we’re trying to depict: there’s essentially a shadow Congress.
Most votes in Congress are foregone conclusions. If a bill is coming to a vote, leadership is usually confident it has the support to pass — or confident that it will fail so as to demonstrate its political infeasibility. But leaders aren’t psychic. In the days, weeks, and sometimes months before a vote, they begin taking the temperature of their members — and of lobbyists, activists, constituents and other stakeholders. Views are gathered. Coalitions are shaped. And often, opinions shift. The chamber’s whip might be the most visible figure in this process, but they’re just one node in a much more complex network.
And that’s when it clicked.
We could precompute the heaviest part of a voter’s analysis — the policy analysis — before the vote is officially announced. After all, a person’s view on an issue is their view, regardless of the context. Then, in the time between the vote’s announcement and the vote itself, these analyses could be updated ad hoc. When the vote actually happens, we’d no longer need to calculate every facet of a bill — its policy changes, its supporters, the amount each member was lobbied — because those calculations were made as as those events arose, not at the moment of the vote itself.
Not only does this make vote execution technically efficient — adding up a few numbers for each lawmaker (“policy score,” “cosponsor score,” “lobbying score,” etc) rather than engaging in dozens of heavy computations — it also makes it more true to life. Most importantly, it lays the groundwork for adding depth and excitement to our legislative and influence systems. How do you make voting interesting when most votes are foregone conclusions? You immerse the player in the part that isn’t.
[Votes are sometimes quite interesting]
Political Arena is all about giving people the chance to experience politics on the ground and understand the difference between how politics is designed (civics) and how it behaves (…applied civics?). The machinations around a vote is one such example: it doesn’t fit into the Schoolhouse Rock version of civics and this kind of behind-the-scenes maneuvering is only intermittently reported on. It’s vital that we get it right.
As an aside, the very thing that caused our technical bottleneck — time — will help players grasp these dynamics. Since a single day in Political Arena might take a few seconds (assuming no interruptions and a high game speed setting), a weeks-long legislative cycle can unfold in minutes. The lengthy sausage-making process gets compressed into fun little nibbles – toothpick-impaled bits of civic charcuterie our players can digest.
Anyway, the real takeaway from all of this is that your humble dev blog updater — once a political reporter/cheeky newsletter writer and humorous political encyclopedia author — is effectively a mediocre systems engineer now. After each of you buy 60 copies of Political Arena (as I’m sure you will), we’ll hire some developers to handle this stuff and free me up to focus more on the content. But in the meantime, I’ll be doing my own politicking with your computer’s threads.
Onward!
– Eliot & The entire Political Arena Team