(cross-posted at Medium)

Earthers is a simulation game whose core dynamics are provided by real climate, earth system, and economic models — the kind of models used in IPCC reports and academic research. It is turn-based, and inherently social. The mission of the game is to become an engine of our collective imagination: to help players and their societies to understand the set of possible futures that humans face on Earth, and the courses of action that will select each of those various paths.

The game will only be a success if many people choose to play it. It is not a “game for good”, and playing it can’t feel like eating spinach. This means that Earthers’ design has two, equally-important goals: it must provide a high-fidelity simulation of the earth system whose decision-making lessons transfer to the real world, and it needs to be fun and addictive enough to face down Minecraft and the other scary beasts in the attention jungle.

Earthers must tackle plenty of familiar game design challenges: it must deliver periodic rewards that keep players engaged, it should provide markers of status and mastery to represent players’ investment, and it must proffer beautiful and pleasing environments that invite players to dwell for extended periods.

But the game also faces a handful of unusual issues that spring from its concept and mission.

Agency and character identity are tricky notions. Earthers cannot be a so-called God game, in which the player acts as a disembodied and omnipotent force with complete autonomy (within explicit resource limits). At the same time, the global scale of the game would make it awkward and unrealistic to identify players with any one individual or institution, fictional or not. So, just who are the players?

I don’t have a great answer to this question, but I do think that the solution must be guided by the fact that some of the most important challenges in anthropogenic climate change involve difficult tradeoffs and collective action problems. These difficult value judgments, and the social dimensions of navigating them, must be directly represented if the game is to address the true challenges we face.

Standard approaches to gameplay balance do not apply. Most games strive for balance: single-player games shouldn’t be too easy or hard, player rewards shouldn’t be too frequent or rare, and the challenge should increase at the right pace. Multi-player games should strive for fairness between participants, so that no player class or character is able to dominate. But Earthers must strive for fidelity to the real world through the lens of the scientifically-derived models at its core, and satisfying game play must be delivered within these basic constraints. Therefore, what is easy or hard in the game will ultimately reflect the nature of the challenges that humanity faces. As game designers, we cannot tweak the parameters at will in service of the gameplay. The result: some shares will simply be more difficult to play than others, and the degree of difficulty may not increase smoothly as the simulated years roll by.

Play cultivates humility, for it requires us to treat things as they are rather than as we wish them to be. -@ibogost in Play Anything

The rules are — and are not — the rules. The ecological and economic constraints encoded in the models are grounded in reality, and part of the mission of the game is to teach us what it means to take those constraints seriously as a society — this is a version of the humility that Ian Bogost refers to. At the same time, the models are subject to intense and legitimate scientific debate, and they evolve continuously as researchers gather more data and our collective understanding of these systems increases. This is a feature, not a bug, of the scientific process. How should this tension— a tension, it should be noted, that is ruthlessly and deceitfully exploited by some interest groups and political factions — be incorporated into the design of the game, and communicated to players?

Good outcomes are not easy to define. One way to see this is to notice that global climate change is quite simple to solve if we are willing to slam the brakes on economic growth — though this would probably mean a decline of the standard of living in developed countries, and prevent billions of humans in the developing world from ever being able to improve their own situation. The challenge, then, is how to continue the last decades’ rapid progress in economic well-being, quality of life, security, and overall opportunity while avoiding the destructive outcomes of that economic activity.

That is, Earthers needs scores so that players can understand how well or poorly their actions turn out relative to other choices. And those scores will necessarily encode moral judgments — scores are all about valuing certain outcomes over others. But it’s also crucial that the game not be too narrowly prescriptive or normative in these evaluations, since it’s important for players to have real choice in which outcomes they prefer. One likely possibility is for the score to have (at least) two dimensions, reflecting the ecological and economic factors that are so often at odds with one another in our present day.


I’ve never designed a game before, and I’m hoping that there are some relevant precedents for some or all of the design challenges. I’d love to hear from those who might be able to help think it through, or from anyone who is interested in any aspect of the Earthers project.

GCAM is the model that we will use to track energy generation and usage, as well as agricultural land use and yield. Like the CESM, it has been under development in an academic setting for many years. While it's core functionality is impressive and immensely valuable - incorporating a vast amount of scientific wisdom - the tools and data formats that provide job control and input/output certainly didn't have our use in mind.

So, again like the CESM, it is important to package GCAM in such a way that it can be used as a docile and reliable software component of the larger Earthers system. At this stage of the project, our strategy will be to keep the GCAM code intact, and wrap it in an interface that is more suited to our needs. Should Earthers succeed, it's likely that we'd want to dig into some of the core I/O routines in the GCAM make some different optimizations.

GCAM run execution and behavior

(see here for GCAM tutorial slides)

The core GCAM code is implemented in C++, and can be built without too much trouble on Posix systems. A future post will describe this process in more detail.

Each GCAM run by default spans all of the years from 2015 to 2100 in five year time steps. We would like to change the time step to be a single year, and also to make it possible to stop and start runs at any year. A complete run takes about 10 minutes, and requires about 4GB of RAM (i.e., it will not fit within the limits of a Lambda call - this is a real bummer).

Both the input and output data formats are in XML, and GCAM uses the Xerces parser to read and write them. The de facto XML schema (no actual xsd seems to exist) has clearly evolved over time, and is not exhaustively documented. It does not conform to XML best practices: element names are mixture of hyphenated and camel-cased, attributes and text elements are used inconsistently, element types are mixed together within parents, etc.

For interactive scientific use, GCAM comes with a graphical query interface implemented in Java. We will not use this interface, but rather postprocess the results from XML into another form that better suits our needs (see below).

Requirements

With the above in mind, we would like our GCAM execution system to have the following properties:

  • It must be horizontally scalable without tears; in the absence of a serverless option (which would be ideal), provisioning additional capacity should be as simple as adding properly configured instances to a pool.
  • It must be controllable through an HTTP service interface, with model options provided as POST data
  • Results must be queryable through an HTTP service interface
  • Overhead should be as low as possible

It's also important to enumerate the model options that the control interface supports, as well as the query types that the results interface is able to serve. Both of these still need to be fleshed out.

Proposed Architecture

With these requirements in mind, we propose the following architecture:

  • Chalice microservice for job control
  • SQS queue for job tracking (or Dynamo table?)
  • Docker container for each worker, containing a process that 
    • polls the job queue
    • executes a run
    • writes job metadata to Dynamo and raw output to S3
  • Lambda function triggered by S3 object creation (or Dynamo stream?) to postprocess results and write them to...
  • Postgres database for model results
  • Chalice microservice for querying model results

While the taming of climate and economic models probably constitutes the largest technical challenge in the development of Earthers, the biggest risk to the project's ultimate success is whether a simulation game based on scientifically realistic models of the entire planet can actually be fun and addictive. In order to have real impact, players need to choose to play Earthers over all of the other fun and engaging things at their fingertips - Minecraft, Snapchat, Pinterest, Clash of Clans. In other words, Earthers needs to play in the big leagues of the attention economy.

One part of this is that the game must be beautiful - players must want to spend time inside it. We'll talk more about the art design later, but in this post I want to focus on the core game mechanic - what players are doing, why it is interesting and challenging, and what keeps them coming back day after day.

  • Earthers is turn-based, with each turn representing a year. A sequence is a play-through from present day to 2100, when the simulation ends.
  • Each sequence is played collectively by a group of players, numbering approximately 20 but varying from one sequence to another. Each player has one or more of 50 shares, where each share represents a geographically-derived fraction of the Earth's population (about 150 million in 2016).
  • Each share commands a set of resources, with different shares having different resources depending on their geopolitical station. The exact makeup and allocation of these resources is TBD, and will be discussed in a later post.
  • On each turn, any player may put forward a proposal outlining the actions that will be taken on that turn. Other players can then commit the resources of their own shares to an open proposal. All proposals with sufficient resources committed (above a minimum threshold) will be executed on that turn.
  • Actions are drawn from several realms, including technology R&D, subsidies and direct funding, tax and policy, other forms of regulation, public awareness and media campaigns, and so on. Each action requires a certain minimum level of resources, and some actions may have greater effect with more resources committed to them.
  • At the end of each turn, accepted proposals are executed, the game models are run for the year, and the resulting outcomes - climatic, economic, agricultural, technological, etc. - are determined and made available for the players to observe.
  • The game state at each turn is scored along multiple dimensions, reflecting at least the ecological and economic state of affairs. These scores can be compared to all previous sequences.

Many details remain to be worked out:

  • What exactly are the resources, and how are they allocated among shares?
  • How do each share's resources change as the sequence progresses, as a function of population, economic growth, peace and security, etc.?
  • What are the actions, and how are they "priced" in terms of resources?
  • How are action availabilities and prices affected by the game state?
  • What is the minimum resourcing needed for a proposal to be executed?
  • How important is it for players to come together and agree on one or a few proposals, rather than fragmenting?
  • How are the outcome scores computed?


If you want to get in contact about the project, the best first place to find me is on Twitter. I also have the same handle on gmail.

I'm interested in help, feedback, and collaboration of all kinds, so please ping me if this project resonates with you.

Here are some of the topics I hope to eventually cover here. I'll add links to the posts as I do.

Backend & Models

  • Grid types, resolution, and computational requirements
  • Model execution times and costs
  • Job execution architecture
  • GCAM: basics, execution, parameters
  • Other model components
    • Economic growth and activity
    • Hurricanes & typhoons
    • Conflict, migration, refugees
    • Greenland / Antarctica ice melt
    • Sea level
    • Deforestation / reforestation

Intermediate Artifacts

  • Data viewer / editor
  • GCAM visualizer

Game Design

Frontend 

  • Why WebVR
  • Sharing and sequence state links


The key technical hypothesis behind Earthers is that real climate and earth system models can be used to power a simulation game. So some of the first questions that had to be answered were:

  • Are these model codes available?
  • Can they be packaged to run on commodity cloud hardware? 
  • How much do these model runs cost?

Because these seemed like the scariest questions for the whole project - i.e., the biggest risks - these are the issues I tackled first.

Being new to the climate modeling world, I began looking around at the various models that were used to make predictions for the IPCC reports. It turns out that there are a few different classes of climate model, from simple models that contain just a few differential equations and can be run instantaneously, all the way up to so-called "coupled earth system models" that include the spatiotemporal dynamics of the atmosphere, ocean, land, and biosphere. It is these more complex models that can track and predict how the climate will play out at each location (and altitude) on the globe. And because the game I had in my mind used the Earth as its basic "game board", these coupled models are the ones I was drawn to - in spite of their general hairiness and computational requirements.

There are a handful of such models, each developed and maintained by different laboratories and research consortia around the world (such as the ESM2M from GFDL). But I eventually settled on the Community Earth System Model because

  1. It is one of the leading earth system models, and is actively used for cutting edge climate science
  2. It is a so-called "community model", meaning that users outside of the research group that develops the model are invited to use it for their own research, and are supported in doing so
  3. It is under active development and improvement, and has been for decades
  4. It seems to follow the best software engineering practices: the code is available under a reasonably permissive license, uses source control, follows a regular if infrequent public release cycle, etc.

Containerization

That said, the CESM is a beast, intended to be run on specialized HPC hardware. The core numerical routines are written Fortran, config files are mostly XML, and the glue scripts are mainly perl. The input data is mostly stored as NetCDF files, and the data repository is many TB in size. Could something this big - traditionally run on specialized, professionally-administered supercomputers - it be made to run easily and reliably on standard cloud instances?

Given these uncertainties, the first big Earthers project was therefore to package the CESM into a single docker image that would accept parameter settings, and output results to S3. That effort is contained in this github repo, which contains scripts and configuration files to 

  1. Build a docker image that contains the CESM
  2. Start a container of this image
  3. Launch a suitable EC2 instance that installs the necessary dependencies and starts a CESM run using one of these containers. 

This effort was a success, which was the first sign that Earthers had a fighting chance. CESM runs can be initiated with the launch script, with results being written to S3 as they are checkpointed. Metadata about each run is written to Dynamo tables, so that run status and parameters can be tracked.

This is really just a proof of concept, and there's still much to be done before this packaging will be truly useful as part of a larger software system: more robust job control and management, a complete system for setting and tracking model run parameters, and especially the ability to restart runs from previous stopping points (which is essential for the turn-based play of Earthers).

But it's an important start!

Most of this dev diary will describe what is happening with Earthers development, but I wanted to start with a basic pitch for what Earthers is and why I believe it needs to exist.

Earthers is a multiplayer simulation game whose underlying dynamics are provided by state-of-the-art climate and economic systems models - literally, some of the same codes used to generate IPCC forecasts. In each game iteration, a group of players (about 20) come together to navigate the years from present day to 2100.

Earthers is motivated by the observation that climate change is primarily a collective action problem, not a tech problem. Yes, the ultimate solutions will (I believe) be largely tech-driven, but the real challenges are understanding what will work (and what won't), deciding to do it, and implementing those actions in the context of our planet's diverse societies and political regimes. Yet existing "climate communication" efforts have failed in substance; if this were a legacy business, entrepreneurs would be licking their chops. As a result, climate change's cultural mindshare today is a bit like the Olympics - dramatically but infrequently relevant, remote from everyday life, filled with obscure and inaccessible content - when it needs to be like Twitch: a daily habit, under my complete control, populated by my friends and those I admire. There is so much else that should be tried here, and Earthers leverages many of the deep tech that Google is already using to transform so many other areas of our lives.

With all this in mind, Earthers has two equal requirements:

  • It must be fun to play and addictive, able to compete directly with the likes of Minecraft, Clash of Clans, and Overwatch on both engagement and scale. It is not spinach, or a "game for good"; people play it because it's the best option available to them.
  • To the greatest extent possible, what works in the game must transfer to the real world. This is what sets Earthers apart from Sim City or Civilization - the dynamics are as real as our current state of scientific knowledge will allow. So maybe not quite Ender's Game, but players will be directly training themselves to tackle the challenges we face.

Earthers is all about scale: it will be a success if and only if it achieves both broad and deep impact on the place of climate change in global culture - not just awareness of the dangers and likely outcomes, but visceral, embodied understanding of possible solutions and how to make them real.

Some key aspects of the game, as currently envisioned:

  • Earthers is beautiful and engaging, available through both touch and immersive interfaces.
  • The basic game mechanic is turn-based (probably one model year per turn), where the action space consists of technological, social, and policy interventions that the players must debate and commit resources to.
  • The outcomes of previous game iterations are explicitly surfaced in various ways, so that game play evolves over time as the state of collective knowledge improves. A strong result soon after launch will be laughable two years into the game's life.
  • Earthers is natively and deeply social, with game states and player accomplishments being directly shareable on the relevant platforms - everything is linkable and defaults to public. Earthers gameplay, achievements, results, and lessons learned will be deeply woven into everyday internet life - well beyond the core playing audience.
  • Preventing climate change is, from one perspective, simple: just shut down the global economy. For this reason, Earthers game states are scored according to both environmental and quality of life measures - one of the major challenges is to find solutions that satisfy both requirements.

This is a project I feel driven to pursue, literally, for my daughters' sake. We are running out of time for effective action, and collective understanding and consensus are the roadblocks.