Electioneering is a game set in a fairly detailed simulation of Canadian electoral politics where you play the leader of the NDP, Liberals or Conservatives and you must adapt and market your positions on important issues to garner support. The catch is that you are only given imperfect information in the form of polls and tweets, all of which have their own demographic and reporting biases and omissions.
Electioneering uses the set of issues and party positions from iSideWith. The map includes many thousands of generated Canadian citizens with positions on these views of varying strengths, in proportions corresponding to real polling data. The twitter feed is based on the satisfaction/dissatisfaction of these individual citizens and is pulled from real tweets about the Canadian election run through Indico's sentiment analysis API to determine when they should be shown.
How we built it
A series of map generation scripts written in Ruby take in real polling data, issues of importance, geographic maps, locations of major cities and populations of the different provinces to produce a detailed map of Canada with regional demographics and political leanings.
The tweets are also scraped in with a Go microservice using the Twitter and Indico APIs.
All of this data is fed in as JSON files, plus a generated SVG file for the map.
The gameplay is all done in client side javascript using ES6. The design is all done with flexbox, SVG styling and CSS3 animations. Most of the processing of the dataset of generated citizens is done in the client's browser. This includes algorithms for taking a set of political views and updating a citizen's affinities for each party based on how well their views match up with the party's.
Challenges I ran into
Unfortunately, the polling data on the set of Canadian issues we used was done through internet polls and was heavily left-wing biased, and especially towards the NDP. I had to manually add a bias towards the Conservatives in the generator (correlated linearly with the age of the citizen). I also added a bias towards the Liberals in large cities so that the race would be nice and even, just like it is in real life right now. You can win no matter which party you choose, at the cost of some true-to-life accuracy.
Accomplishments that I'm proud of
The UI ended up really nice and quite slick. I'm also proud of the map generation code, which is a centerpiece of the game.
What's next for Electioneering - The Game
Mostly game balance, there's lots of power factors that were chosen somewhat arbitrarily that need to be tuned to have a gameplay experience that is challenging, but not impossible. Also we might time limit the election period and not allow you to call the election day at any time.
Log in or sign up for Devpost to join the conversation.