Video Games for Good

Extra Credits is a video series on game design and the game industry.  It has interesting insights I don’t see elsewhere, but it is also… low density.  You could compress most episodes into a single written paragraph and lose nothing.  I tend to watch them when being told the same thing over and over with completely unnecessary accompanying graphics is calming, rather than annoying, which isn’t very often, so I only just caught this video on whether games can induce empathy.

If you are not in the mood to be reassuringly talked down to, they helpfully provide a summary:

Many studies have investigated whether or not there is a link between video games and violence, but few have looked at the bigger picture. What is the correlation between video games and empathy? Since games put us, as players, in the role of characters who are not ourselves, asking us to understand their situation and the problems that they face, they have the potential to teach us about how to empathize with others. While many gamers have anecdotal evidence about games that made them feel a character’s pain, there’s a disappointing lack of formal studies into that side of the question.

Examples: This War of Mine, Cart Life

I didn’t think anything of it until a week later at my Effective Altruism meetup, when we were discussing egalitarianism/maximization.  In a nutshell, EA believes that all lives are equally valuable, so if you can save two lives for $n each or one life for $2n, the most moral thing to do is to save the two lives.  Phrased that way I don’t understand how it’s at all controversial, but in practice it comes up against many people’s instinctive priorities.  For some, passing over a homeless person to give to GiveDirectly doesn’t just give them fewer warm-fuzzies, it feels actively immoral.  Someone at the meeting suggested it was a matter of empathy- people naturally feel more empathy the more often they see someone, or the more they have in common with them.

This is  of course obvious, which is why so many charities try to up the empathy you feel for their beneficiaries, by implying you’re helping a particular person when you’re not, or just sending a letter with a few heartwarming stories of all the injured dogs they’ve saved that year.*  They do it because it get donations, but it’s very hard not to slide into poverty porn. I find those examples really manipulative, but I loved the ability to choose out specific recipients when donating to Modest Needs so clearly I’m just as susceptible.

This is where I thought of that Extra Credits video.  What if instead of telling people how awful extreme poverty is, we gave them a video game demonstrating both the difficulties poor people faced and the resources they used?  Some things I would like to include:

  • Trade offs, trade offs, trade offs.  Do you invest in your child’s schooling or new farming equipment?
  • Bee Sting theory– demonstrating how it is easy to do the right long term thing when you have a few problems, but when too much is wrong sometimes palliatives are all you can manage.
  • The importance of social capital.  The poor (both in the US and the 3rd world) get a lot of criticism for spending so much on alcohol and ceremonies, but the fact is that that builds social relationships that can be crucial later on.  This doesn’t mean spending a lot on booze and parties is optimal, but that the change must come at a societal level.
  • How many well intentioned NGOs fail.  E.g. my continuing hate for the play pump.
  • Ideally you’d like to convey the scope of preventable deaths.  I don’t know how to do that respectfully.  You could do something like Shelter or The Oregon Trail, where you go in knowing some characters will die and the goal is to save as many as possible, but that seems a little horrifically callous.

I have several ideas for how to do this.  You could do the trade offs with a choice mechanism like that of Depression Quest or Long Live the Queen.  Soha Kareem has has apparently done some great work with video games to express her experience of microaggressions and sexual abuse.

EA strikes me as having a real comparative advantage when it comes to producing video games, relative to other charitable movements.  And by “real comparative advantage”, I mean “lots of programmers”.**  None are games programmers specifically, but it might be a skill worth picking up.

*Pro-tip for my local humane society: this may not work as well on cat owners as you were hoping.

**We were up to two non-programmers at the last meeting.  High five.

Testing Android Software

Dear frantic and desperate programmers: if you are looking for an example of a populated android activity test file, go here.

Dear everyone else: you may wonder why that was necessary.  Let me explain.  There are five billion tutorials on how to build android apps and two on how to test them.  Both are full lessons requiring a lot of knowledge of android to make sense of them and are based on Eclipse (deprecated) and not Android Studio, neither provides a decent sample file for steal-and-mutate learning.  For those of us who want to write tests because we are learning to program for android and are worried a new technique might break our lovingly created app in ways we don’t know enough to fix, this is frustrating.

[For the slightly more advanced among you: yes, you could try searching github for the name of the class you know must be involved in your testing.  Unfortunately the push for testing means that 95% of what you find are stubs with no actual tests.]

To be fair, I’m pretty weird in wanting to write tests so early.  I complained to a stranger at a party that work on Hunger Tracker had stopped because I couldn’t find an android testing tutorial and he expressed surprised, because he’d watched people release much more complicated apps without a single automated test.  I know that works for some people, but it would drive me absolutely nuts.

The point of testing isn’t to make the product work.  The product is going to work, or you’ve failed.  The point of testing is to make your work on the project faster and less stressful.  Every time you change anything, and sometimes even when you’re sure you’ve changed nothing, you risk breaking something. The more time or changes that pass between you breaking something and you noticing it is broken, the more effort it takes to fix.  You could manually test every time you change every little thing, but it’s boring, time consuming and prone to error.  Computer science selects for the opposite of people who are good at doing the same thing over and over again.

So you do the programmer thing and write a program to do it for you.  It’s just that the program is tests of the software.  You can run this new program as often as paranoia or check in rules compel you.  This frees up your time from manual testing, your mind from tracking your changes and worrying what might possibly have broken, and decreases the time to notice breaks. The mere act of writing the tests often encourages good code structure by making you think about it rigorously, the same way writing a program makes you define your problem until you practically don’t need a computer to do it.  And in my particular case, when the project is as much about learning as it is producing anything, it’s good practice.

Good testing is especially critical in my case, because I’m working on this project in little bits at a time.  If I break something and don’t notice it until two CLs later, I might as well be debugging someone else’s code.  I know what people about the devs whose code they are forced to debug without tests or documentation, because I’ve said it, loudly, and at length.  I may have expressed a wish for weapons.  I would hate for someone to think that about me, especially myself, and testing is the cheapest way out of it.

Hunger Tracker 0.1

When I started this blog I intended to leave programming for medicine fairly soon.  After a long medical leave that let me recover from burnout, I realized that programming is actually a really valuable skill and before I throw it away and spend several years in school, I should see how far it can take me towards my goals.  My goals are unchanged (mostly around nutrition and mental health, but with some bonus input from Effective Altruism), but maybe there’s a better way I can contribute.

Eventually this means founding or joining a company working on something I care about, but I’m still not capable of consistently working sufficient hours to work with other people.  But I can play on my own projects with no coordination costs, so I started learning to program for android.  Meanwhile on the health end, my nutritionist informs me there are states of hunger between “unpleasantly bloated” and “would shank an infant for juice” that are useful to experience, and that the first step to achieving that is tracking my hunger consciously.  She meant with pen and paper, but I am an engineer, so I wanted something on my magic pocket computer to do it for me.  I’m sure something exists on android that would do this, but I couldn’t find it, so I did the logical thing and started developing my own.

Thus was born the Hunger Tracker app.  Here is my dream feature list for Hunger Tracker:

  • Alarm goes off at pre-set or random times (your choice), to shut it off you enter a number between 0 and 9, representing your fullness level.
  • Timestamp + fullness level data is dumped…somewhere, I don’t know.  A google docs spreadsheet would work for me but there’s probably other services I should integrate with.
  • UI not actively offensive

Here’s what version 0.1 does

  • No alarm, user must manually call up app.
  • User enters number in ugly ass UI.  Actually user can enter any arbitrary string, but don’t, it will break the retrieval.
  • User can retrieve first 10 numbers entered.  Any further entries are skipped, if there are too few entries the last one is repeated.
  • It’s a debug build rather than a release build because Android Studio won’t produce a working release build and fixing that is not at the top of my priority list.

If you are interested, you can download version 0.1 here and install it the usual way for non-market apps.  If you are spectacularly interested, you can check out the source code at github.  Comments are extremely welcome

My next step is not actually features, but testing, which I will explain in the next entry.