Lets Save The World!
Tags: atlashackathon
Published: 2022-01-10 18:54:38

Will you join me to - dare I say it - Save the World?

### Overview of My Submission
In this web based game/simulation you play as a country. You are able to enact, revoke and upgrade policies that influence your country in various ways and by consequence, also the Earth as a whole. 

There is no win/lose condition per se, but perhaps trying to keep global warming under 1.5 degrees above pre-industrial temperature is a nice goal?

It's multiplayer, so the more people play, the bigger the impact we can all make!

- You can play the game here: [https://www.letssavetheworld.club/](https://www.letssavetheworld.club/)
- More instructions in the [Readme](https://github.com/maartene/STW/blob/main/README.md) 

#### Play example
{% youtube dNGKFGh7IdM %}

#### History
November 14 I registered a domain name, more or less on a whim: letssavetheworld.club. It was around the time of the Climate Conference in Glasgow and I remember how disappointed I was about the results. Was it really that difficult to actually start doing something? So I decided I'd create a game/simulation to get a sense of the complexity involved. I researched climate change models and the effects of global warming for humanity. 

Then, this hackathon came along, offering the perfect reason to actually create the game and publish it.

### Submission Category: 
Choose Your Own Adventure

### Link to Code
{% github https://github.com/maartene/STW %}

### Additional Resources / Info
#### About the climate change model
Climate change is a pretty complex concept. The model used in this game is very, VERY basic. It only covers average global temperature and warming based on carbon concentration in the atmosphere. It is not aware of regional differences. The model in itself is flexible though and could be expanded to take more metrics into account.
(exact links to the various data sources for the model can be found in the source code)

#### About the tech
Lets Save The World is based on two big technologies:

- backend uses the [Vapor framework](https://vapor.codes): a Server Side Swift framework. I like using Swift and feel that in particular for backend work. Its an opinionated language that somehow seems to help me write better code. That Vapor supports MongoDB out of the box also helps;
- front-end uses the [Vue.js](https://v3.vuejs.org) framework (with Vuex). I'm no Javascript expert, but find it very easy to use Vue to create a usable front-end. 

The runtime version of the game is deployed on the [DigitalOcean App platform](https://www.digitalocean.com/products/app-platform/). The front-end as a Static Website (using a free plan), the backend as a Docker image (using the cheapest paid plan. The app platform takes care of all the complex stuff, such as creating TLS/SSL certificates for the website, deployments and the networking/domain stuff.

#### About the usage of MongoDB
MongoDB tends to be my database backend of choice for Vapor projects. I like the flexibility its schemaless setup offers. And I like that it uses JSON for most interactions, making bridging to data in the Vapor (Swift) world very easy, because Swift has very simple solutions for briding between JSON and actual Swift data structures. 

I also like using MongoDB Atlas as a database provider. Off course, I could run my own MongoDB instance, but having the admin website in Atlas makes it much easier during development to experiment and quickly change stuff. Need to change a value in a document somewhere? The web interface makes this very easy. Need an extra database or drop a table? Just a few clicks. Finally, the larger (paid) Atlas plans provide stuff like backups out of the box. Something that's always a lot of work when you roll your own. 

These two aspects help developer productivity a lot.

#### Feedback/improvements
If you have feedback, please let me know in the comments below. Also, if you have ideas from a game design point of view to make it more engaging, please reach out to me. I'm more of a programmer than a game designer, so can always use help to improve the fun and engagement of a game!