Why Does Your Game App Need My Browser History and Photos?

Years ago, I started paying attention to the usage of so-called digital rights management (DRM) in games and made my purchasing decisions accordingly. I might have missed out on some major cultural impacts, but I wasn’t going to passively accept what I thought was a draconian form of copy protection. A form of protection that, by the way, doesn’t even work most of the time, so only legitimate customers get punished.

In practice, it meant not buying many major games. Spore is one very famous example, and I wrote a bit about it in this post about it’s reception in the market. Reading it today, I can see I was a bit angry about the DRM:

Do I like the game? I haven’t played it. Apparently Spore has some crappy so-called DRM solution attached to it, and it’s definitely not available for Gnu/Linux, so my choice is to boot up Windows AND suffer this DRM crap, or play a different game on my preferred system. It’s too bad. If things were different, I’m sure I would have liked Spore, too, but I refuse to pay for a steak dinner delivered on a garbage can lid.

Ooh, burn!

It was my attitude, and it still is today, partly because DRM is fundamentally flawed and partly because it’s a system that makes it easier to be a criminal.

But this post isn’t really supposed to be about DRM. Today, I find myself concerned about downloading free-to-play games on my smartphone that require bizarre permissions.

Recently, I was looking for a good strategy or simulation game to play on my Android smartphone. I found some that seemed promising and popular, and I found myself stopped when I clicked the install button because the requested permissions were ridiculous.

Why does this game need access to my browser bookmarks and history? Or why does that game need access to my photos?

Actually, it seems that Google’s API just doesn’t allow very fine-grained control of what is and isn’t allowed to be accessed by an app. According to this What’s on Dave’s Droid? post, if an app needs access to the state of the phone to know when to minimize if a call is coming in, it has to get that information from the same permission that gives it access to the identity of who is calling.

And this isn’t a new story. I’ve just only become aware of the problem myself.

I get that the permissions section can’t be too complex for the user experience. People don’t read EULAs as it is, and I’m sure many apps are perfectly safe, but is it weird that we’re being so trusting of apps by hoping that they don’t cross a line we’ve given them permission to cross? Especially in a world where we know we’re being spied on?

For now, I feel that I need to treat some apps just as I treated games packaged with so-called DRM. I’ll ignore the ones that ask too much or that are made by someone I have no reason to trust. Maybe I miss out on a gem, but I’ve survived without Sony’s rootkits and the pain of not being able to install a game I’ve legally purchased in the past. I think I’ll survive not playing a game that may or may not be compiling a list of my contacts and recording my location.

Merry Christmas, Indies!

I’ve been enjoying time with family, including my nieces who have introduced me to what’s going on in children’s television these days. The oldest one wanted to play with apps on my phone that let her “build, build, build!” I found a very basic Lego app, but if anyone has any better suggestions for a 4 year old, I’d appreciate hearing them.

I hope you’re enjoying a great holiday. Merry Christmas from GBGames!

What Is Wrong With Internet Society? #BeBetterStewards

I know the Internet magnifies the amount and scale of abuse, especially in terms of misogyny, homophobia, and racism.

It’s disgusting, and it has resulted in the silence of some great people, such as Kathy Sierra, and makes it more difficult to bring intelligent and grown-up conversation to sometimes (often?) immature game industry the way people such as Anita Sarkeesian do.

But I had no idea the mindset of the stereotypical 11-year-old, entitled Halo player who loves to curse into his headset had made it into the realm of indie games and the customers who pay for them.

Cliff Harris wrote Who Would Be a Game Developer?, a post about how indies not only have to do the hard work of making a living making games but also seemingly must endure abuse at the hands of fans and customers. Apparently customers are threatening the creators of the games they paid for with extreme bodily harm and a destroyed life.

It’s bizarre posturing from the safety of a keyboard.

But it feels like another offshoot of problem fandom that seems to be everywhere. From comic and game conventions where women, homosexuals, and rape victims feel unwelcome to “you’re not a real geek/gamer/Doctor Who fan/etc” arguments that tend to be aimed at women to a culture of privileged misogyny that creates online communities in which only white, male heterosexuals ever feel welcome, it’s an ugly thing that is highly visible to everyone else.

Even if a large number of the people think it is just good-natured, “oh, you guys!” kind of Internet joking, it has real repercussions. If it happened rarely and in isolation, it would probably be enough to tell the people who are the victims of this kind of abuse that they can ignore it and get a thicker skin and don’t worry about it.

But it doesn’t happen rarely. It’s a fact of life for a lot of people, and we shouldn’t tolerate it.

There’s an entire vocabulary around these kinds of issues:

  • Privilege. If you have it, you’re probably unaware of it. And if you’re unaware of it, it’s hard for you to understand that other people who don’t have it also don’t have the same advantages and paths through life that you do. We’d like to think that the world operates to reward merit, but for many, it’s not enough due to systemic issues. If the system benefits you, you don’t necessarily know it is there and how it has impacted your life. It’s kind of the equivalent of being born on third base and thinking you’ve hit a triple. If it hinders you, on the other hand, it’s really obvious. You’ve probably seen John Scalzi’s Straight White Male: The Lowest Difficulty Setting There Is, and here’s an article about privilege in geek culture. There’s also this article about someone who acknowledges the role privilege played in developing his talents as a programmer versus other classmates who didn’t have access to computers or had the lack of responsibility that allowed him to spend the time to work hard on learning it.
  • Rape culture, which also brings up terms such as victim-blaming and slut-shaming. If you got raped, you were probably asking for it. Why were you wearing those clothes or walking somewhere by yourself? Don’t you know that it’s not possible for people to control themselves and act as humane individuals? Crap like this is the obvious set of examples.
  • Panicked male, an example of which Scalzi recently tongue-in-cheek critiqued.
  • Moral relativism. If you’re about to argue, “But there are worse things in the world, so why are you complaining about XYZ?”, your thinking is bad. Yes, there are worse things in the world. If you want to discuss those worse things, I’m sure you’ll find people willing to do so, as the Internet is big enough for those kinds of discussions. But if someone is talking about an issue they find important, you can opt-out of the discussion, or you can participate, but you can’t say, “Hey, you can’t talk about it because it isn’t as important as world hunger or terrorism.” A systemic problem has been identified, awareness is being made, and you think that we as human beings can only focus on one problem at a time? Stop selling yourself short.
  • Deflection and silencing. A lot of the so-called arguments against concerns about inappropriate jokes and the culture it perpetuates aren’t addressing the issue seriously. They tend to be statements that attempt to quiet the person making the concerns known. If someone says, “I think this game is sexist”, any response that has the intent of coercing that someone into never bringing it up again is not healthy. Saying that someone is being over-sensitive or to lighten up are examples.

If you want humor with your education, see Film Crit Hulk’s GODDAMMIT VIDEO GAMES: THE FIRST FEW HOURS OF ARKHAM CITY IS LOTS OF FUN, BUT SUPER-DUPER SEXIST and part 2 (because it is almost required to do a follow-up when you call out stuff like like this), HULK VS. ARKHAM CITY – ROUND 2: BITCHES BE TRIPPIN’!.

What’s really scary is the undercurrent of violence and dehumanization. There is a lack of empathy, and it seems to be almost nurtured into the culture. When a woman is raped, we have television personalities saying she was asking for it, and almost no talk about how the rapist shouldn’t have been raping. And if the guy on TV thinks it, it’s likely the viewers are going to think along those same lines.

Similarly, when prominent figures in the video game industry laugh off, tolerate, or perpetuate misogyny, homophobia, and racism, their fans are likely to fall in line right with them. And when it is part of the marketing and game development, it’s worse.

The Internet brings a previously-unheard-of-number of strangers within communication distance, and while many people take advantage of it to make the world a more understanding and intelligent place, there is unfortunately a loud and obnoxious segment of the population who think extreme violence is super effective at getting their way.

And the more they see and hear each other, the more accepting of that behavior they become. And while most think they are having good-natured fun, occasionally a few think that actual violence is called for and accepted behavior.

So it is gratifying to see people within the industry call out the B.S.

The nature of the Internet and human nature is that we tend to be attracted to those who are like-minded. Talking with someone who has new and different views is a lot harder, especially if those views are opposed to your own.

But we all live here. I think the least we can do is try to have some empathy and consideration instead of dismissing someone else out of hand.

If someone does do something inappropriate, speak up. Show this person that you won’t tolerate it.

We need to be Be Better Stewards, as Corvus Elrod has so eloquently and succinctly put it. We need to call out the bad in a constructive way, and we need to praise the good.

Because what we say matters and has power.

Taking Responsibility For Your Code

When you start a new project from scratch, you have a lot of freedom. Adding lines is almost as simple as typing it out and compiling.

As you add more code, however, it starts to constrain itself. You can’t easily add a few lines here because the code over there interacts with it poorly. Eventually, your code starts to rot and smells awful, but you have to work in it. It’s just not as fun nor easy anymore.

The state of your code base is the result of decisions made in the past. Sometimes developers have taken shortcuts to “get things done”, and then they have to suffer by working in stinky, smelly code that makes it difficult to do The Right Thing(tm). Unfortunately, these developers don’t take responsibility for their situation, and they keep doing what got them there in the first place. A colleague of mine says that they get into a state of learned helplessness.

As a result, it becomes easier to accept the state of the code base, to go with the flow, and to forget to be proud of your craft.

Soon, you are taking shortcuts as the normal course of events in large part because the shortcut looks like the main path. The path to creating legacy code (definition: code that doesn’t have tests) looks a lot less tangled than the path of TDD and SOLID principles. The real deception is that doing so creates the barriers, the gnarled weeds and growth, and you need more discipline and more patience to cut through it in order to get back to the right path, if you even bother at all.

Today’s shortcut results in problems with delivering results in a timely manner tomorrow.

The good news is that code is malleable. Even if the current state is bad, it’s possible to improve it, even if just a little.

Each day, you have an opportunity to improve the code for the people following behind you as well as for yourself as you traverse the path through the code again. And each day, despite the cause of the stench, you have the opportunity to use your skills as a software engineer, skills such as refactoring and TDD, to change the code from the stinky state it is in to a better, lemony-fresh state.

The alternative is to wallow in poor quality code, slowing your ability to deliver, and oftentimes adding to the problems that got you here in the first place.

Take responsibility for the quality of your code. It’s possible to have a better code base. Make it happen.

I Received My #LD48 Gift Exchange Gift!

This is the first year I’ve participated in the Ludum Dare Gift Exchange. Yesterday I received an invoice in the mail in French, but no package. I was confused, thinking, “An invoice? This isn’t how this works.”

Today, there was a knock on my door. The jolly postal worker had me sign my name on a small piece of paper and handed me a rectangular box:

A mangled up box marked FRAGILE

It says “FRAGILE” and yet you can tell it was still shipped in the same cargo ship that transported exotic circus animals. Still, I opened it, and it seemed that even if the box looked worse for wear, the contents were packaged in some heavy-duty materials to make transportation safe. So the laugh is on you, circus animals!

Mead!

Chouchen Lancelot is mead, according to La Boutique Du Comptoir. Sweet nectar of the gods, I have a bottle of French mead! And the cork is covered in real wax, and it smells like fantastic French cork and wax!

Merry Christmas, Ludum Dare! And thanks, Adrien Giboire! I look forward to enjoying my gift!

Merry Christmas, Indies!

Merry Christmas 2012

It’s another Christmas, this time with snow here in Des Moines.

I’ll be enjoying a few days with my wife’s family, feeling welcome in each other’s company, playing cards, eating our fill, and watching classic holiday films. As a tradition I don’t want to skip, I hope to convince them to watch “Santa Claus Conquers the Martians” with me. It wouldn’t feel like Christmas without it.

May you and yours have a fantastic holiday season!

Living on Purpose: Prolific Creation

In Habitually Living on Purpose, I mentioned how I am focusing on habits this year in an attempt to live according to my Life on Purpose statement: My Life on Purpose is a joyful life of freedom, continuous learning, encouraged and supported creativity, insatiable curiosity, and prolific creation, driven by passion and a desire for excellence, powered by a healthy body and soul.

Previous articles in this series include: “powered by a healthy body”, “continuous learning”, “insatiable curiosity”, “a joyful life of freedom”, and “encouraged and supported creativity”. Today’s post is about “prolific creation”.

Being Prolific

In one of my favorite audiobooks, 100 Ways to Motivate Yourself by Steve Chandler, there’s a section about Anthony Burgess. At one point, he discovered he had a deadly brain tumor, and at the time, he had nothing to leave behind to his wife.

Burgess had never been a professional novelist in the past, but he always knew the potential was inside him to be a writer. So, for the purpose of leaving royalties behind for his wife, he put a piece of paper into a typewriter and began writing. He had no certainty that he would even be published, but he couldn’t think of anything else to do.

In that final year, he wrote a handful of novels. But then his cancer went into remission and never came back.

“In his long and full life as a novelist, he wrote more than 70 books, but without the death sentence from cancer, he may not have written at all.”

The Power of Creative Habits

Now, part of the point of that section is the idea of giving yourself a sense of urgency to get important things done, but I liked the idea that Burgess was so prolific once he got started.

In an interview with John Cullinan of The Paris Review, he explained how he could be: “I’ve always written with great care and even some slowness. I’ve just put in rather more hours a day at the task than some writers seem able to.”

It makes sense that to be a prolific creator, you need to put in a lot of time creating. Burgess mentions that he does a lot of his work in the afternoon. Other writers have different habits, such as writing for an hour each morning, or writing until at least 500 words have been placed onto the page, or writing from 9AM to 1PM. Stephen King writes 10 pages a day without fail, for instance. Every prolific writer has his/her own set of habits, but the commonality is that they have habits.

When I first started my blog, I had a goal of publishing at least three posts a week: Monday, Wednesday, and Friday. I wasn’t always successful, but there were good periods of time when my blog had regular new updates. Oddly enough, this was during a time when I was working a full-time job and trying to do game development on the side.

When I went full-time, I was able to dedicate a lot more of my time to game development, and so I didn’t publish blog posts nearly as often. I was less focused on updating three times a week, especially because I was so focused on my work. I didn’t spend a lot of time finding interesting, relevant links to write about.

In my various attempts at creating a schedule for myself, I have tried to set aside time to writing. Currently, I have a writing hour on Wednesday, Thursday, and Friday. I used to have it daily, but I decided to use those Monday and Tuesday hours for organizing.

Getting Out of a Routine

The trick has been to follow the schedule. By default, the schedule is followed, but when other priorities come up, I allow them to take over my day. The problem I’ve had recently is that I haven’t gotten back to the regularly scheduled program. For instance, when I was about to get married and go on a honeymoon, I had a large number of tasks I wanted to complete. I had articles to write for ASPects. I wanted to send out a newsletter to my Stop That Hero! customers and to GBGames Insider Info subscribers. I wanted to write a few blog posts, especially those in this Life on Purpose series that I started in May. I wanted to have the next version of my game out the door.

And in the end, I got a lot less done than I intended. There was just too much to do. I was spending quite a bit of my time working on the marketing for ISVCon, and while I wrote for ASPects, it felt a lot more rushed than I would have liked, which probably impacted the quality of my output. But I had a wedding to prepare for.

During that time, I didn’t work on Stop That Hero! except at the very beginning of the month. Getting back from my honeymoon, I had more conference preparations, and so I didn’t do any game development during June. If this game project was a novel, I’d be the exact opposite of someone like Stephen King.

And I should also add that when I started working full-time, my expectation would be that I’d have a few games published at the end of a year. My first project was for the MiniLD I hosted in 2010, which I completed late and never published. Then Ludum Dare #18 started, and I submitted “Stop That Hero!” for the LD Jam by the end of the third day.

And then I started working on a full, commercial version of the game in October 2010, and I’ve been working on it ever since, even though I never intended to work on a multi-year project when I started. The only other game I’ve worked on is for Ludum Dare #20, Hot Potato, and the only real positive I can say about that one was that it was finished by the deadline.

This isn’t being prolific.

Getting Back Into a Routine

So what habits can I adopt to become more prolific?

I could start by following my schedule more strictly. Sometimes that means saying no to new commitments or requests for my time, something I’ve been very bad about protecting recently.

That means writing at a set time each day, according to my schedule. It means not allowing other tasks to take up that time scheduled. I can set everything else aside and write for that hour.

When it comes to game development, one thing I’ve found really helpful is using a timer to block out chunks of time for me to work within. I set the timer for 45 minutes, work on game development until the timer goes off, then take a break for a few minutes before repeating. I’ve tried with 25 minutes, ala the Pomodoro Technique, but I found that the first 20 minutes is sometimes needed for me to figure out what I want to do in the first place, so using 45 minutes means I have more time to implement the solution I’ve figured out.

Calendar entries with marks indicating game dev sessions

I keep track of each 45 minute session and mark it on my calendar for the day. I’ve found that doing more than four sessions is starting to push it, even though it only adds up to a total of three hours. Andy Schatz claims he works about 60 hours a week, although I don’t recall if he said it was all game development or if it included marketing efforts as well.

Whether I’m working all day or only for a few hours, the point is that I have a daily game development habit.

Finishing versus Doing

Does prolific creation imply finishing? There’s a lot out there about the writing habits of novelists, but not a lot about how they translate that writing into finished, published works.

Writing a blog post is relatively easy, since they are usually quite short, and publishing is even easier.

But I would count writing in my journal as part of my writing time, and it isn’t a public medium at all. Still, I could say that my journal entries are complete and whole.

Finishing “Stop That Hero!” is a lot of work, but I’ve clearly demonstrated to myself that dedicating a lot of game development sessions doesn’t necessarily translate into a finished product. I can make progress, but towards what? It’s easy to lose sight of the core of the game, what’s really important to the game play, especially from the customer’s perspective. It’s especially easy to get busy without actually doing work that adds real value.

I’m willing to bet that Stephen King doesn’t write 10 random pages of words that eventually fall into a bunch of different novels. He’s probably writing 10 pages of his current novel, and every 10 pages of work translates into understanding what he’s writing about and how to best put it all together.

Creating prolifically implies completion. Finishing is an important skill that needs to be developed as much as any skill involved in the act of creation.

So while the doing is important, it definitely helps to have a goal for that doing. A good quote: “What does done look like?”

Life Achievement: Co-op Mode Unlocked

Today, in front of our friends and family, my fiancée and I will exchange vows and become husband and wife. In doing so, we will agree to share our lives together, unlocking a new game play mode in our world.

A lot of people think of love as something that fills a hole in your heart. Luciano de Crescenzo said, “We are each of us angels with only one wing, and we can only fly embracing each other.” Jerry Maguire said, “You complete me.” Countless songs, TV shows, and movies make it seem as if finding The One will make you happy.

In reality, love is not a togetherness based out of need. Couples aren’t two halves that belong together. They’re each complete individuals. They choose to be together because they want to, because they enrich each others lives, because together, they make each other more wonderful and amazing human beings.

My fiancée is my best friend. She’s been a source of encouragement, support, and inspiration. She’s a great teacher and my favorite dance partner. I love her, and I always will.

I look forward to us traveling through life, side by side, hand in hand, from now on.

Did You Know The IGDA Has a Healthcare Plan?

Health Insurance

Back in 2009, the International Game Developers Assocation (IGDA) announced the launch of the IGDA Healthcare Program.

When I became a full-time indie game developer, I was going to lose my employer-provided insurance, so I turned to the IGDA’s program to get coverage instead of trying to find my own insurance on my own. Basically, they teamed up with Association Health Programs, and AHP is able to negotiate a block/group rate for you in your state with a quality insurance provider.

Aside from the fact that insurance companies have opaque policies (“Let me get this straight. A medical professional says there is nothing wrong with my ankle, and you still insist there is a preexisting condition? And you won’t cover the visit I had with the doctor who said that there is no condition in the first place because of this supposed preexisting condition?”) and are hard to deal with in general, I’ve been quite pleased with the IGDA’s program. I’ve had decent coverage at a decent price for more than a year now.

Granted, I’m single (for now), have no children (for now), and am generally healthy. I don’t know what the rates might look like for your specific situation. Or mine in the near future. The coverage is not nearly as comprehensive as my previous employer’s, but it’s a bit better than catastrophic insurance.

But I bring this up because whenever I mention the program in conversation, so many people say “Oh, the IGDA has a healthcare program? I had no idea.”

So now you know.

Integrating LodePNG with an SDL Project

In efforts to port Stop That Hero! to the Mac, I ran into a strange issue involving PNG image data.

See, the level layout in “Stop That Hero!” is defined by a 50×33 PNG. The colors of pixels in the PNG correspond to tiles and structures in the game. Grass tiles are represented in the PNG as green pixels, water is blue-green, mountains are gray, and so on.

This PNG (blown up since 50×33 is so tiny):

Level 4 PNG

results in this level layout:

Stop That Hero! Bringing evil back...

I use libSDL_image in order to load image formats other than BMP, and on Windows and GNU/Linux, everything works as expected.

On the Mac, however, I was seeing a problem. It was as if most of the tile data was not getting loaded correctly. Instead of seeing grass, fields, forests, and mountains, I was only seeing mountains. And structure data was also not loading correctly. The player’s castle wasn’t appearing either, so the game always ends in defeat.

After ruling out endian issues (Intel-based Macs aren’t going to require any data-parsing changes from Intel-based Windows or GNU/Linux), I found that the pixel colors being returned from a loaded PNG weren’t what I expected.

I expect red-green-blue(RGB) data to be (0, 255, 0) for grass tiles, but the color that I was seeing was slightly different.

And it turned out that I wasn’t alone. A thread on the libSDL mailing list discussed a similar pixel bug on Mac OS X, and it turned out to be related to libSDL_image’s use of Apple’s ImageIO for the backend. I’m still not quite 100% clear on what the actual problem is, but the best I can figure out is that ImageIO tries to helpfully convert the image you’re loading so that it is more optimized for rendering on the specific Mac running the code. It’s not a problem if all you want to do is render images to the screen, but is a problem if you’re depending on the pixel data to be accurately decoded.

Last week a fix was introduced to solve this issue, but as it isn’t in the release version yet, and I didn’t want to convert my data or change how I was doing things, I decided a better way would be to replace libSDL_image in my own code. Thanks to a conversation on Google+, I was introduced to stb_image and LodePNG, both of which are liberally licensed, comprehensive, PNG-handling modules of code. By comprehensive, I mean that unlike libSDL_image, I don’t also have to require zlib. You just drop in a couple of files into your project, and you’re done.

I opted for LodePNG because unlike stb_image, it not only loads PNGs but also saves them, and I want to make sure I don’t have to switch libraries again when I get around to creating a level editor. Also, quite frankly, it was less intimidating than stb_image being a .c file that leaves the production of the associated .h as an exercise for the programmer.

LodePNG had some examples associated with it, and while one example uses libSDL, it wasn’t clear how to load a PNG into an SDL_Surface. The example simply rendered the PNG to the screen. It was not what I wanted, and I could not find any code out on the Internet that used LodePNG and libSDL together.

So, in the interest of filling this gap, here’s how to load a PNG with LodePNG and store it into an SDL_Surface:

SDL_Surface * loadImage(const char * filename)
{
    //Using LodePNG instead of SDL_image because of bug with Mac OS X
    //that prevents PNGs from being loaded without corruption.

    std::vector<unsigned char> image;
    unsigned width, height;
    unsigned error = LodePNG::decode(image, width, height, filename); //load the image file with given filename

    SDL_Surface * surface = 0;
    if (error == 0)
    {
        Uint32 rmask, gmask, bmask, amask;

#if SDL_BYTEORDER == SDL_BIG_ENDIAN
        rmask = 0xff000000;
        gmask = 0x00ff0000;
        bmask = 0x0000ff00;
        amask = 0x000000ff;
#else
        rmask = 0x000000ff;
        gmask = 0x0000ff00;
        bmask = 0x00ff0000;
        amask = 0xff000000;
#endif
        int depth = 32;
        surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, depth, rmask, gmask, bmask, amask);

        // Lock the surface, then store the pixel data.
        SDL_LockSurface(surface);

        unsigned char * pixelPointer = static_cast<unsigned char *>(surface->pixels);
        for (std::vector<unsigned char>::iterator iter = image.begin();
                    iter != image.end();
                    ++iter)
        {
            *pixelPointer = *iter;
            ++pixelPointer;
        }

        SDL_UnlockSurface(surface);

        SDL_Surface * convertedSurface = SDL_DisplayFormatAlpha(surface);
        if (convertedSurface != NULL)
        {
            SDL_FreeSurface(surface);
            surface = convertedSurface;
        }
    }

    return surface;
}

Technically, the piece of code related to convertedSurface isn’t necessary, but SDL_DisplayFormat and SDL_DisplayFormatAlpha convert the surface to one that is optimized for rendering. And it doesn’t modify the pixel data, which means that if you depend on it for map layout or for doing interesting effects at run-time, it just works, like you expected.