Open Source Taxes

Flash game developers may remember Flixel, the open source game dev library created by Adam “Atomic” Saltsman.

HaxeFlixel is the Haxe-based port that eventually became its own full-featured, mature library that allows for deployment across not only Flash but many other platforms.

The five-year-old project is an open source project using the MIT License. That license, unlike the GPL, does not require code changes to be released to the public.

While the MIT License is appealing to developers who want to leverage freely available code for their own projects, there is nothing to encourage contributions to the source code of a project that is under that license.

The terms of the GPL requires any modifications to be released, so it solves the problem of people taking advantage of the code but not contributing back. But if a project’s developers don’t want to make that requirement, would prefer to have the MIT License applied instead, and still have people contribute to the project, whether in monetary terms or source code, what can be done?

How We Paid Our Open Source Taxes documents how the HaxeFlixel project was able to “collect its open source taxes with smiles on all sides.”

In this case, the core contributors realized that the project founder lives in an area where the cost of living is much, much less than it would be in, say, San Francisco. Just $6,000 would be enough.

So rather than having a vague fundraiser and hoping to make a bunch of money to meter out as needed, they were able to make a hyper-focused plea with their IndieGoGo campaign to get enough money to gain a full-time developer rather than require the project to continue to be supported by an all-volunteer base of contributors.

It’s kind of like when you talk to people about how much money they wish they had in life. Some people talk about “a million dollars” as if it is a lot of money that they’ll never see in reality, and other people realize that they can get penthouse apartments complete with maid service in some exotic countries for less than the cost of a New York apartment, such as what Tim Ferriss described in The 4-Hour Workweek.

The trick is learning what’s really possible.

HaxeFlixel’s story gives some insight into not only how an open source project operates but also teaches the lesson that if you know exactly what you need, it’s a lot easier to ask for it.

Nah, I Think I’ll Still Call Games Art

No, Video Games Aren’t Art. We’re BETTER by Spiderweb Software’s Jeff Vogel is an alpha strike against…I guess people who talk about games as an art form?

While I don’t disagree with many of his points, I don’t think it ever really lands home the argument that games are somehow “SuperArt,” beyond mere art and evolved into something that is somehow more.

I love literature and theatre. I love great movies. Yet, I can’t remember any work of art, no matter how good, that consumed and drained me as much as the Cyberdemon in DOOM.

You could make the same argument about sex, which is also not something that someone would argue is art in the first place.

Arguing that games are financially doing well, incredibly culturally relevant, and published in great numbers is somehow arguing that games are doing great and don’t need to be forced to grow up and become art…as if someone is making this argument?

Artistic accomplishment? Creativity? Look up any Best Games list from 2014 or 2015. Video games are breaking new barriers in craftsmanship and artistic expression every year and turning profits while they do it.

I’ll bite. From PC Gamer’s 2014 list:

Game of the Year 2014: Alien Isolation, so basically Metal Gear Solid with horror? EGM’s quote according to the Wikipedia article: “”succeeds as a genuine effort to capture the spirit of the film franchise in playable form.” So a SuperArt form that is oddly derivative of the art it is supposedly beyond.

Best Singleplayer: Dragon Age: Inquisition, a sequel. It may be an awesome sequel, and perhaps they did some innovative work there, but it’s a sequel.

And 2015’s version of these awards went to Metal Gear Solid V and The Witcher 3. More sequels.

Sometimes I go to movies to see sequels, as well, but when gaming’s top offerings for the last decade boil down to space marines (to the point that Ubisoft publishes a game called “Space Marine”), World War II first-person shooters, and sequels to successful franchises, sports or otherwise, it’s hard to argue about how creative the game industry is. Even Minecraft, which don’t get me wrong, is incredible and not only offers a lot of ways to BE creative, but also involved quite a bit of creativity to implement, was originally based off of Infiniminer, and steals (and gives back) from Dwarf Fortress, among other games.

But then, Microsoft always liked to claim innovation with the caveat “for the first time on Windows…”

Listen, I don’t think anyone looks at certain popular films or novels as high art. Some of them are just candy, and candy sells well. So I don’t look to best of lists for innovation. I look to them for popularity. What’s everyone playing? Quite frankly, most everyone is playing sequels to games they already liked, overlooking some of the truly innovative work that is out there. That’s popularity for you.

No, I don’t think poorly of the game industry. I think what we do is amazing, and I have also argued against people like Roger Ebert who thought games can’t be art.

But when film was new, people thought it was a poorer form of theatre. Theatre was ART. Film? It was never going to live up to theatre’s ability to be art.

Then film came into its own. I’m sure people argued that film’s capabilities were so beyond theatre’s that art no longer was an appropriate term to describe it. Speculation on the future of film in its infancy leads to such flights of fancy.

Games are interactive. They pull you into an experience in an active way, which can be considered superior to the passive way a movie or book does it. Games can be elegantly well-designed. Games can do more than film, writing, sculpture, painting, or any number of art forms…in certain kinds of experiences.

But not all. It’s why people still buy books and watch films and go to museums. The fact that more people play games and more money is spent on games changes nothing.

When I write a game, I try to make you feel like you have power. Then I try to make you feel the awesome, terrifying responsibility of having power. When I force you to make a tough decision, for a brief moment, I can reprogram your brain and take your thoughts somewhere they’ve never been before. This is amazing.

It IS amazing.

It’s also not unlike art, which can take you out of your comfort zone and make you rethink your outlook on life. People cry at performance art. People have changed their careers and lives based on books they’ve read. And games have also changed people’s lives in meaningful ways beyond sweating and dopamine hits.

We haven’t begun to come to terms with the power we’ve unleashed with these toys, these addiction machines.

Oh, ok. We’re beyond art, but we’re nothing more than a drug?

It’s one thing to argue that games don’t need to worry about denigrating themselves by calling themselves art and being associated with the lower mediums.

It’s another to make that argument and then kick the legs out from that same argument by making it sound like the people behind games are nothing more than drug pushers looking to exploit those looking for their next high. “Video games are popular to the point of global invasion. Find me a human, and I will find a game that can addict them.” So, games are just an opium for the masses?

I hate it when a good game is described as “addicting.” Call it compelling. Call it irresistible. Call it riveting, spellbinding, or anything else your thesaurus can throw at it.

But don’t compare games to mere drugs. While some games might aim that low, many more don’t.

And as awesome as our medium is, art is art. We’re not “beyond art.” We’re just a different form of art. An awesome form of art, to be sure, but I’m still going to call it art.

The Internal Struggle on Doing Game Development Right

There are a lot of conflicting thoughts in my head about how I want to approach my efforts at creating games. Some of these conflicts are from seemingly contradictory pieces of advice I’ve received over the years, and some are just related to fear, uncertainty, and doubt due to inexperience.

On the one hand, I want to be prolific.

I want to quickly get a minimum viable product out there in the hands of customers, get their feedback, and similarly very quickly make an informed decision to either tweak the existing game or abandon it for a completely different project. If I can do this quickly enough, I have more chances to earn enough money to make these efforts sustainable.

On the other hand, I don’t want to put out junk. I don’t want to release half-finished ideas, non-workable games, or projects that aren’t anywhere near ready. I want the projects to have a chance, and in order to be proud of what I put out, I need to finish my games.

But on the third hand, I don’t want to work on my project forever, constantly tweaking, adding, and removing inconsequential features. You might call it “feature creep,” but I don’t think that name really describes the issue I’m worried about. It’s more like being so afraid of pulling the trigger that you distract yourself into thinking there’s more development work to do to avoid thinking about the hard work of actually releasing the game to the public.

There’s always unimplemented features and more balancing work that could be done in a game, right? As a developer, I KNOW how to do that kind of stuff. It’s easy to stay in the comfort zone of being the technician.

And when you work by yourself, it’s easy to forget to take off your Developer’s hat, put on your Producer’s hat, and think about deadlines and what work is optional versus what work is core to what your game needs. You need to ship.

On the fourth hand, I will become a better game developer if I work on more games more often. There’s that story from Art & Fear by David Bayles and Ted Orland about the ceramics teacher who split his class into two groups. One group was graded on the quality of a single pot on the last day of class, and the other group was graded on the quantity of pots produced by the last day of class.

It turned out that the group that produced the higher quality pots was the group graded on quantity, mainly because the experience of creating each pot also gave them insights into how to make the next pot better. Meanwhile the quality group spent more time merely thinking about how to make a quality piece of pottery, and when it came time to actually put in the work, they were not necessarily up to the task.

So, if I focus on making more games more often, I’ll make better and better games.

Of course, on the fifth hand, I don’t want to make throwaway entertainment that people pay little or no money for and pay little or no attention to. I want my games to have meat on their bones. I want my games to be the kinds of games I’d play.

On the sixth hand, I am not my customers, and I need to make sure I create games with a target audience in mind. I should find out what THEY want to play.

On the seventh hand, I’m creating these games, and the message these games put out reflects what I want to see in the world. I own my art, and they’re not “just games.”

On the eighth hand, I’m not working on games in a vacuum. There are other games being made by other developers, and I should make sure to spend some time playing those games.

I should research other implementations, see what other developers have tried, learn what works and what doesn’t, all without spending the effort myself.

I should listen to podcasts, watch presentations online, and read blogs more regularly.

I can leverage the experience of other people.

On the ninth hand, I’m a part-time indie game developer. There’s only so many hours in a day that I dedicate to being a game developer, and if I spend it playing other people’s games and watching other people talk about how they do their work, I won’t have time to do my own work and put out my own games. I barely participate in online forums anymore, and I finally understand all of those people who complained about the lack of time to participate in forums. Where does anyone in my position find the time?

There’s a difference between doing and learning how to do, and there is always more to learn.

There’s also always more to do, and doing is the hard part.

On the tenth hand, I hate that I’m ill-informed about what’s going on in the world of games and their development. I was blown away to learn that multiple people were making virtual reality games for the most recent Ludum Dare 48-hour game development competition, as it sounds like the kind of thing that still requires a huge upfront investment. Clearly I’m out of the loop.

On the eleventh hand, I’m an indie game developer, which means I define my own rules of engagement.

It’s not a race, despite the realities of opportunity costs and trends, and despite the realities of impending life events that change everything.

Success isn’t defined by money but by accomplishing goals, despite the fact that earning a significant income from this effort would be a great side-effect of those goals being accomplished, one that could help me set and achieve bigger and better goals. Money isn’t a goal, but it can be a measure of progress. But it also doesn’t have to be.

When you’re starting out, you look to people who already know what they are doing to provide some guidance. And they are often more than willing and able to share what they think works.

But in the end, it’s easy to get stressed out about meeting someone else’s expectations if you don’t take care to set your own expectations.

I’ve had people tell me what I should do and what I shouldn’t do. I’ve had people question decisions I made and ask why I didn’t make a better decision on a choice I didn’t know I had.

There is no wrong or right way to go about this process, though.

Some people swear by putting out prototypes daily. Others like to work in secret for months or years at a time.

Some people like to explore one game mechanic fully, and others like to experiment with lots of different concepts.

Some people like to put out fully formed games to be consumed, and others like to release early development builds for people to nibble on.

Some people throw spaghetti at a wall to see what sticks, and other people like to plan out an entire evening with a multiple course gourmet meal.

If I use the same criteria for the spaghetti-thrower’s efforts that EA uses for their heavily-invested and marketed blockbusters, it’s going to look like a lot of failures and flops are being thrown at a wall. That’s not the way to make a blockbuster hit!

But the spaghetti-thrower has different goals entirely. They’re not trying to put out blockbuster hits. They might not even be trying to make something commercially. They’re trying to gauge interest in prototypes, seeing if there is a significant amount of interest in something before putting a lot of time, effort, blood, sweat, and tears into a more substantial work.

Following EA’s playbook is probably not going to help them achieve their goal. They’ll probably stress out way too much to be useful if they somehow get it in their head that EA has the truth about How Games Are Made(tm) and that they are not following it.

While other people might have great advice for their own expectations of how things work, it’s a lot less stressful (although still pretty stressful) if you politely ignore them and create your own expectations. You have enough to worry about without second-guessing if you didn’t make games similar enough to how some celebrity game developer did.

It’s fine to seek out and get advice, and it can all be really great advice, but don’t forget to make your own path.

Gearing Up for Release: Platform-specific Issues, Part 2

Last time, I talked about Linux-specific issues to fix before my game’s release.

This time, I’ll address the issues I’m seeing on Android and Windows platforms.

Android: manual code signing

Quite frankly, between running the game on my phone and on my tablet, I haven’t seen any issues since I first tried to get my game built and installed on this platform. The main issue I had was figuring out which directory to save to, and I solved that issue.

Oh, and code signing was another solved issue. I can build and deploy debug builds by turning on developer mode on my devices, but the release build needed to be signed. As I am not using amazing IDEs that have one-touch buttons that do all sorts of fanciness, I had to figure it out myself from the documentation.

Luckily, the Android developer documentation for signing manually was fairly straightforward in this regard. In my CMakeLists.txt, I added a custom target called sign, which requires the location of my keystore and its alias. I created a few environment variables that I pass into my build, and the following is basically what’s needed as per the documentation:

ADD_CUSTOM_TARGET(sign
"echo" "================ SIGNING WITH KEY ================="
COMMAND "jarsigner" "-verbose" "-sigalg" "SHA1withRSA" "-digestalg" "SHA1" "-keystore" "${GB_KEYSTORE}" "bin/${ANDROID_APP_NAME}-release-unsigned.apk" "${GB_KEYSTORE_ALIAS}"
COMMAND "echo" "================ VERIFYING WITH JARSIGNER ================="
COMMAND "jarsigner" "-verify" "-verbose" "-certs" "bin/${ANDROID_APP_NAME}-release-unsigned.apk"
COMMAND "echo" "================ USING ZIPALIGN ================="
COMMAND "zipalign" "-v" "4" "bin/${ANDROID_APP_NAME}-release-unsigned.apk" "${ANDROID_APP_NAME}-release.apk"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/android-project/")

Otherwise, I found porting to Android be very straightforward thanks to using the NDK and libSDL2-based libraries. If anything, I worry about scaling to different screen resolutions and device-specific compatibility problems due to the lack of devices I have to test on.

I’ve already signed up for the Google Play developer program, so the main piece to worry about is actually submitting my app to their store. How hard could it be?

Windows: persistence and font rendering

While GNU/Linux and Android are more or less the same, Windows is the odd duck.

I can easily cross-compile to create a Win32 build, and with my limited testing I found that the 32-bit version runs smoothly on a 64-bit system, so that’s good.

Since I don’t need to use a lot of memory, there’s no real advantage I can see to building a 64-bit version of my Windows port. The main downside would be an inability to support people on 32-bit systems, requiring that I provide both 32-bit and 64-bit binaries as I might need to do for the Linux-based package.

However, I did have to fix a few issues this past week that I didn’t know were there until someone tested it for me. Thanks, Rick!

I knew of an issue with using MinGW to cross-compile to Windows in which using std::cout would result in a crash. I never looked too hard into it because I only used cout for my own logging in order to find out what is happening, so I just commented them out when I released for Windows, usually for a Ludum Dare game.

Well, it turns out that there was still a crash, and I found that if I commented out the code that saved the current game state to a file, it would run just fine.

Was the known issue applicable to file stream operations, too? Luckily, gdb can be downloaded and run as a standalone applications on Windows, so I ran my game on Windows through gdb and read through the stack trace. It pointed to yaml-cpp.

I use yaml-cpp to save and load my game data, and it works very well. But why does it crash on Windows?

I found this thread on GitHub that mentioned a similar stack trace: Crashy shared object

It was closed without really being addressed, as the original poster gave up after seeing the issue disappear when using a later version of gcc.

Luckily, someone else found a different solution involving a change to a few lines in yaml-cpp’s code, although they said more tests are needed. I tried it, and it seemed to solve the problem for me, although I am a bit wary about not knowing what the change does or how it solves it. B-(

The other issue I found on Windows was that resizing the window results in the text looking completely wrong:

Leaf Raking Game Windows Text Corruption

All the other graphics look fine. Under the hood I am using SDL2_ttf, but using it directly isn’t showing this problem. I am using NFont, which does some caching, and I wonder if it is somehow being corrupted. I need to do some more tests, but this issue does not occur on my Ubuntu system, and Android doesn’t allow you to resize the screen dynamically at runtime, so it’s a Windows-specific issue so far.

I’ll continue looking into it, but updating to the latest version of NFont didn’t help. I tried updating my SDL2-related libaries next since some Windows 10-specific updates were made between the initial Windows runtime binaries and the latest release.

NFont’s creator Jonathan Dearborn has been running test apps I’ve sent him and sending back updates to try, and so far it seems we’re nearing a solution. Thanks for being so responsive, Jonny D!

The main major issue is signing my game’s binary. Windows 10’s SmartScreen puts up a warning about how they have protected your PC because they prevented the app from starting. It shows the binary as coming from Unknown Publisher.

That’s scary. I need to look into how to make it less scary. Does it require buying a code signing certificate, or is it similar to how Android’s code signing works? I don’t know yet, but I’m looking into it.

The other issue with Windows is that saving the game is sloooooow. In my game, I persist changes each time the player makes a major decision. Basically, if you click a button that switches to a different screen or causes something to happen in-game, I save so that if you shut the game down and reload it, it takes you back to where you were.

My Linux-based and Android-based builds are zippy. I can click, click, click, and any changes are instant. As a result, the game has been feeling very responsive despite the lack of a real-time need for it.

My Linux-based system does not have an SSD drive, and my wife’s Surface Pro does, and yet her system takes forever to save a file.

So on Windows, it feels less like click, click, click and more like click, wait, see screen update, then click. Because of the delay, sound effects are playing too early as well. It’s a lesser experience on Windows.

I haven’t ever needed to do multithreaded programming before as a single thread was usually plenty for the work I’ve ever done, but now I am wondering if I should spin of a thread specifically for writing to a file due to this issue that seems to be Windows-specific.

How Much Longer?

Ok, so there’s some technical issues, and some are easily surmountable, and some require some more investigation, and it’s possible there are some I haven’t run into yet.

Since Android seems the simplest to release, perhaps it goes into the Google Play store first, and I worry about the Linux and Windows versions later.

But I do not want this three month project to get to the ninth month before its first release.

The good news is that the next project will have a much clearer release plan, and many of these issues will be already solved. B-)

Gearing Up for Release: Platform-specific Issues

I started a three-month project at the beginning of the year, and I’m now in the eighth month. I reported on the reasons why it was taking so long last month.

But I’m feeling pretty good about it, and while I still have some balance issues to work out, and it’s a bit ugly, I’m preparing for the actual release.

The thing is, I haven’t really done a serious release before, and since I want to do a simultaneous cross-platform release, I’m finding issues unique to each platform.

The platforms I currently support:

  • GNU/Linux
  • Android
  • Windows

What I want to support:

  • Mac OS X
  • iOS

I’ll start with Apple platforms, then talk about the environment I use natively. Other platforms will be discussed in the next post later this week.

Mac/iOS: no development or testing environments

I would love to create a Mac port. I know it is theoretically possible to create a cross-compiler to generate a Mac version, but it seems I need Mac-specific libraries, which requires owning a Mac.

I don’t own a Mac, and while I know of virtual Mac services you can subscribe to online, I haven’t bothered to look too seriously into them. I would also like to be able to test the game, and so I would need to use a Mac in order to see how it really runs, especially after running into the Windows-specific issues above.

As for iPhone or iPad, I’m in a similar position. I don’t own an iOS-based device. As I’m using libSDL2, I know it is possible to port to it, even without a Mac, but I would need to look into how to do so, and I would still need to invest in the devices to test on.

I am saving up for these things, but at the moment I don’t have them and I don’t want to spend time on them until I know what I’m doing.

And in the past it’s been difficult to hear back from people willing to be paid for porting a game for me, and volunteers have had difficulty figuring out how to put my project together on their system. I might look into it again, because that was years ago, and it’s a different world today.

GNU/Linux: distributing dependencies and architecture compatibilities

I develop and test the game on my Ubuntu GNU/Linux system, and the main thing to worry about there is that I can distribute the game and have it work out of the box on other distributions.

My game uses libSDL2 and related libraries. While I installed them on my system using my package manager, I can’t assume that my customers will have them installed as well.

Basically, I need to build custom dependencies, as per Troy Hepfner’s excellent article series on Linux Game Development, and then distribute them with my game.

Quite frankly, rather than worry about an installer to put everything in the correct locations on someone’s system, I think providing a basic tarball might be fine. Rather than provide .deb or .rpm or customer shell installers for each type of system, and then worrying about following the correct Linux Filesystem Hierarchy Standard, you allow the player to put the game in the directory of their choosing, extract it, and play.

But then I need to worry about how the tell the system to load the libraries. Running an application on Windows, the system generally looks in the local directory for libraries to depend upon. Unfortunately, Linux-based systems don’t do so, and while there is a way to point it towards your libraries using the LD_LIBRARY_PATH environment variable, I also know that it is frowned upon to do so due to the security and compatibility issues it can introduce.

On the other hand, many popular commercial games on my system do just that. For instance, looking at the directory for Don’t Starve, I see:

$ cat bin/dontstarve.sh
#!/bin/bash
export LD_LIBRARY_PATH=./lib64
./dontstarve

The fact that it is in this shell script wrapper is better than the original concern of changing the default environment variable in a more or less permanent way, which can cause version conflicts and such. It’s your program. You know what it needs, and any other applications that run will not be affected.

Still, supposedly the better way is to tell your binary at build time where to look, which isn’t very difficult. It requires -rpath=\$ORIGIN/[directory where you put your libs]. $ORIGIN expands into the directory that your binary is located.

So if the extracted tarball would have the following structure:
– foo-bin
– libs
– libfoo.so
– libbar.so

Then I would build foo-bin with -rpath=$ORIGIN/libs.

Of course, now foo-bin MUST be in the same directory as libs, but in practice, it’s fine. When was the last time you moved parts of a game’s files to different relative locations and expected it to continue to work?

I’m sure there’s issues with this approach as well, but with these two approaches, there’s plenty of precedent.

The only unknown I have is dealing with 32-bit vs 64-bit systems. Ubuntu has multiarch support, but I’ve seen comments on forums about people not being able to run an application due to architecture issues.

Don’t Starve distributes separate 64-bit and 32-bit builds. FTL, on the other hand, distributed both the 64-bit and 32-bit binaries and libraries together, and using a shell script, it determined which platform you were on at runtime to point LD_LIBRARY_PATH to the appropriate directory.

And other games distribute all desktop platforms together in one file, so if you bought the game, you bought it for Windows and Linux and Mac, whichever one you wish to play on. I like this option, especially since I hate the idea that I have to pay for a game twice in order to play on two different platforms.

I know some companies make their living by porting games and then selling them directly, but it’s not a business model I prefer.

Next time

In the next post, I will talk about issues specific to Android and Windows.

Follow GBGames on Google Plus and Facebook!

Twitter: GBGames