Categories
Geek / Technical Politics/Government

Books I Have Read: Tools and Weapons

A colleague at my day job lent me a copy of the book Tools and Weapons by Brad Smith and Carol Ann Browne.

Tools and Weapons book cover

The main premise of the book is that technology is a double-edged sword.

On the one hand, it has the potential to do so much good for individuals, organizations, and societies. It can ease our lives by automating drudgery, help us make and keep connections with friends and family, and assist us in solving some huge problems in healthcare, conservation, and business.

On the other hand, technology has the potential to do a lot of harm, especially in the area of human rights. It makes it easier for totalitarian governments to identify and spy on political enemies. Our privacy is at risk as organizations find ways to take disparate pieces of data and find correlations that give insights into who we are. Inequality can get exacerbated.

I found myself impressed with Smith and Browne’s ability to tie modern day conundrums back to analogous situations in the past. The late 1800s gave birth to the modern U.S. government when it started to regulate railroads, an interstate technology with a scale and scope that was unheard of in an era when states were almost exclusively the ones doing the regulating. What does our modern Internet require?

In the early 1900s, combustion engine technology put horses out of work in firehouses all over the country. The need for food to feed these horses also dropped, which had knock-on effects for other areas of the economy, from farming to packaging to shipping. What will AI do to today’s workforce, and how much can we reliably predict?

When it comes to making broadband Internet available for rural residents, what can we learn about the initiatives to spread the benefits of electricity throughout small towns and farms?

And as Smith is an executive at Microsoft, I also enjoyed getting quite a bit of insight into the company’s approach to dealing with the world and governments over the last few decades, especially when juxtaposed with newer tech companies such as Facebook.

While I don’t doubt Microsoft led some initiatives to work with governments, I did find myself rolling my eyes at reading how moral the company supposedly was and is. There was a lot of name-dropping, including U.S. presidents and major figures in technology and political science, and I appreciate that there were discussions about how a large and influential tech company such as Microsoft needed to create policies to ensure that they did as little harm as possible to society, but then again, this is the same company that for years liked to spin their monopoly as natural.

But now I also know that this is the same company that provided their technology to organizations such as ICE. I mentioned the name-dropping earlier because I wanted to emphasize how weird this one passage was:

A glimpse of what lies ahead emerged suddenly in the summer of 2018, in relation to one of the hottest political topics of the season. In June, a gentleman in Virginia, a self-described “free software tinkerer”, also clearly had a strong interest in broader political issues. He posted a series of tweets about a contract Microsoft had with the US Immigration and Customs Enforcement, or ICE, based on a story posted on the company’s marketing blog in January. It was a post that frankly everyone at the company had forgotten. But it says that Microsoft’s technoloygy for ICE passed a high security threshold and will be deployed by the agency. It says the company is proud to support the agency’s work, and it includes a sentence about the resulting potential for ICE to use facial recognition.

The next paragraph goes on to talk about how that supposedly forgotten marketing post took on different meaning in the context of the Trump administration’s decision to separate children from parents at the US border, and it goes on to talk about employee activism, but wait…

A gentleman from Virginia? Why didn’t we name this individual like we did everyone else? Well, there was an endnote:

Taotetek (@taotetek), “It looks like Microsoft is making quite a bit of money from their cozy relationship with ICE and DHS,” Twitter, June 17, 2018, 9:20 a.m. https://twitter.com/taotetek/status/1008383982533259269.

While Smith makes it sound like the relationship between Microsoft and ICE/DHS was this forgotten quirk, here’s a thread in which this “gentleman from Virginia” gives more context to this section of the book, including pointing out that a Microsoft executive got a job at DHS and shortly after a number of contracts between Microsoft and DHS were established.

https://twitter.com/taotetek/status/1173338647673933825

All this is to say that while I found a lot of insight into how major tech companies are starting to recognize that great power requires great responsibility and how they are doing more to work together with governments and society to make it happen, I’m also taking the “we’re trying to do right by everyone because it’s the right thing to do” line with a huge grain of salt. When big companies seek out regulations, it is often to make it easier for them to compete and not out of some moral character.

Still, the book tackled privacy, the ethics of AI, inequality, cybersecurity, and modern society’s dependence on technology to live and work while discussing the repercussions of data moving across borders into data centers and the laws that regulate them.

In the end, even while Smith talks about the needs of a “Digital Geneva Convention” to protect civilians against cyberattacks by nation-states, and privacy regulations to protect people against rogue companies (it sounds like Europe is way ahead of the world in terms of pushing technology companies to respect individuals and their privacy rights), I worry about a world in which most of our technology is seemingly dependent upon Microsoft, Google, Apple, and Facebook doing the right thing by everyone. In each case, they’ve shown that there is a priority for them, and it isn’t my or your interests.

Categories
Game Development Geek / Technical Linux Game Development

Screenshots Made Easy with Window Resizing Tool wmctrl

I needed to create screenshots for the iOS port of Toytles: Leaf Raking, my leaf-raking business simulation. My game doesn’t have a built-in screenshot shortcut key, and I needed screenshots that were 2688×1242, 2208×1242, and 2732×2048.

Immediately I knew I didn’t want to resize windows by hand, as it would be annoying and error-prone. Was there a tool that let me do it in a much more controlled manner?

I did a search, and I came across this Ask Ubuntu question about resizing windows to a particular width and height.

That’s when I learned about wmctrl. It is a tool that allows you to interact with the X window manager, which is the main windowing system used by GNU/Linux desktops.

I ran the following command to find the window of the running game:

wmctrl -l

It output a bunch of windows and showed me that I had:

0x0320000f 2 [machine name] Toytles: Leaf Raking

And then I used the ID corresponding to the game to resize that window:

wmctrl -i -r 0x0320000f -e 0,10,10,2688,1242
wmctrl -i -r 0x0320000f -e 0,10,10,2732,2048
wmctrl -i -r 0x0320000f -e 0,10,10,2208,1242

And then I just navigated around my game, found a good spot to take a screenshot, pressed Ctrl+PrtScn to take the screenshot, then resized and repeated for the various iOS sizes.

I then used Gimp to remove the top 30 pixels which was just the title bar of the window. I think I should be able to take screenshots without the window decorations, but I haven’t researched it yet.

I think I’d like to create a script to handle resizing, taking the screenshot, cropping the top 30 pixels, and placing into the appropriate screenshot folder, but I’ll probably create it next time I need to make screenshots, which might be sooner than I think.

Categories
Game Design Geek / Technical

10 Years Later: Look Inside the Source of Terry Cavanagh’s VVVVVV

Last week, Terry Cavanagh made an announcement with the post VVVVVV’s source code is now public, 10 year anniversary jam happening now!

Collectors of commercial indie game source code have another project to add alongside games such as Aquaria and Gish.

And people are swarming all over it.

A lot has been made of the apparently low quality of the code, with people remarking on the very large case switch statement. To be fair, this is code that was converted from Flash to C++, but it’s apparently quite horrifying and fascinating to read through.

Others are more pragmatic about it:

https://twitter.com/mikeBithell/status/1215939170079821824

In contrast, and as a personal story, I just found some old notebooks of mine from around 2005, and I was very concerned about writing code “the right way.” Now, I wasn’t demanding perfection, but I did have in mind that I didn’t want to just hack together something and hope it worked. I wanted to know it would work. And I apparently wanted to learn UML.

I never shipped that project. But I was also pretty early in my career as a programmer, and I didn’t know much of anything.

Today, I know that I would put something together that works, and then I would iterate and build upon it. I mean, I believe in creating high quality code and using test-driven development to help get me there, but I also don’t spend a lot of time focused on up-front design so much as ensuring my code base is easy to refactor and modify without a lot of pain.

And I know that years of not learning UML hasn’t hurt me.

Cavanagh went on to say:

A decade on, I still feel the same way. I’m incredibly proud of VVVVVV, and grateful for everything. I want to thank everyone who helped me along the way – Magnus for his incredible soundtrack, Ethan and Simon for all their work to bring the game to more people, Bennett for naming the rooms, Stephen for helping me get that mac build out late in launch day. This game is special to me – thank you to everyone who played it and supported me over the past ten years. It’s meant so much. <3

Congratulations, Terry!

Categories
Marketing/Business Personal Development

My 2019 In-Review and My 2020 Vision

Every year end and start, I spend time reassessing how my life is going. I look at my goals, think about what I envisioned at the beginning of the year and how I would change things with an entire year of experience, and set new goals. It helps me collect a summary of my thoughts and plans, and it makes them public.

I just checked and found that my last published year in review was for 2016. My next post reviewing 2017 was still in a draft state and never published, which is too bad, because 2017 was a year to report on!

A lot happened in the last couple of years to throw me off of my pattern, but let’s do a quick recap of 2017 and 2018, then I’ll focus on 2019.

A QUICK LOOK AT 2017

From my 2016 New Year’s post Looking Back on 2016; Looking Forward to 2017:

2015 was about keeping my goals in front of me and establishing habits.

2016 was about being outcome focused. I logged more game development hours in 2016 than in 2015, but the more important thing was that those hours were aimed at targets.

In 2017, I want to focus on promotion and sales.

I didn’t need an overnight hit to be successful. I needed a foothold.

My goal was to go from $0/month to at least $10/month in sales by December 31st.

I know $10/month doesn’t sound like much, but that was the point. It should be relatively easily achievable, but it still required me to put in the work to setup my business to make sales. The idea was that once I had $10/month in income from sales, I could build on it to $20, then $50, then $100, and so on. I was in it for the long haul, and I was fine with being patient while I learned what I needed to learn and put in the hard work to make it happen.

In 2017, I had my first profitable year in probably forever. Awesome!

But I had $0 in sales. Not so awesome.

My income came from part-time contract work. In 2017 a colleague from a former job introduced me to a family in Chicago who wanted an app created. I explained what I knew about game development and mobile in particular, and then offered my services, being completely upfront about my inexperience with contract work and my day job obligations which would prevent me from working on the contract full-time.

It has taken a long time, much longer than I thought at first, and there have been requirements changes, art direction changes, and porting challenges.

But I remember that first payment coming in and feeling pretty good. Here I was, getting paid to create games. It wasn’t full-time work, but within just a few months, I had earned more in 2017 than I had in 10 years from advertising and game sales combined, which was simultaneously a good and awkward feeling.

On the learning front, I got ambitious.

At the end of 2016, I saw a tweet by IGN’s @_chloi about her plans to read 100 books in 2017.

In the past, I would try to read or listen to one book per week, but I was so enamored with the idea of all of the learning and exposure to new ideas that doubling my efforts would bring. So my 2017 reading goal was to read two books per week.

In 2017, I read:

  • 29 books on success
  • 25 non-fiction books (histories, technologies, true crime stories, biographies)
  • 12 books on game development
  • 7 works of fiction
  • 6 books on software development
  • 5 books on marketing
  • 4 books on business
  • 4 books on leadership
  • 4 books on productivity
  • 1 book on child-rearing
  • 1 book on creativity
  • 1 book on sales
  • 1 book on speaking
  • 1 book on writing

That’s a total of 101 books in a single year, just short of 104 to meet my goal. Even though I failed, it was a year that really expanded my mind. I learned so much about so much, and getting it all in a compressed time period helped it all reinforce each other, especially when it came to the success and game development books.

Also that year I set a goal to attend at least one professional development event a month. According to my records, I attended 8 local IGDA meetings, giving a presentation at one of them. I went to two software development conferences as well.

But in 2017, I also succeeded in stressing myself out. I put too much on my plate. I wanted to do it all: marketing, writing blog posts and newsletters, game development, contract game development, exercising, giving presentations, joining the chorus at my church, and getting more involved in social justice efforts at my church as well. Oh, yeah, and my wife and I were licensed for foster care as well.

2017 was going to be a year of market research, customer development, and sales. It turned out to be full of stress and pain, a lot of it self-inflicted.

I realized at one point that I never gave myself time to just be. If I wasn’t reading, writing, programming, designing, planning, or exercising, I was worried I was squandering my precious resource of time. I had to make every second count, and I didn’t realize that my priorities had gone out of wack, that I was letting down my family for not recognizing that I was taking them for granted.

Once I stopped putting so many expectations on myself and demanding that I put in 29 hour days, my life immediately became less stressful. It only took a few months of talking with a friend for me to be convinced to give myself a break, that I’m only one person and can only do so much.

Thanks, Shane! I miss our regularly scheduled talks.

WHAT I WANTED 2018 TO LOOK LIKE

I wanted to finish the contract, which would free up time to focus on my own business again.

I realized that my blog, while enjoyable to write, attracts other game developers primarily, and other game developers are not the primary audience of my games. I mean, yeah, sure they might buy some of my games, but my target customer is not “indie game developer.”

So I planned to change my blog’s target audience.

I wanted to read more books by women and people of color. I wanted to play more games. I wanted to spend more time enjoying life.

While I enjoyed the experience of trying to finish two books a week in 2017, it didn’t give me a lot of time to reflect on what I had read or heard before I was off on to the next book. So I scaled back to one book per week.

WHAT 2018 ENDED UP LIKE

2018 was a bit of a mixed bag.

I did not finish the contract, which meant I did not spend any time on my own business. My profit was still mainly due to income from the contract.

I did have almost a handful of sales of my game Toytles: Leaf Raking, although I am sure it was all people I knew personally.

I showed off my game at a local art and games expo, so it was great and gratifying to get feedback from strangers.

My writing output dropped significantly. I had a total of four blog posts for the year, and they weren’t exactly focused on building an audience for my games.

I surpassed my reading goal with 56 books for the year although I did not read much in the way of game development books. I cut myself some slack here, though.

And I gave a presentation at dsmAgile, earning myself a nice Amazon gift card for it, which I’ll count as getting paid for presenting for the second time in my life. It helped me buy myself a 4K monitor.

In the spirit of realizing that I can’t do everything all the time, I cut back on extra-curricular activities, such as choir or attending IGDA meetings, especially when I became a parent of two kids.

I was trying to have a day job and be a parent while continuing to work on the contract at the same rate as before. The more I put into it, the sooner I could be done, right?

But it left a lot of the burden on my wife to act as a single-parent, which was not fair to her. So I cut back the hours I let myself work on the contract in order to contribute to the labor of our home. She still does the lion’s share of the work, especially when it comes to scheduling appointments and coordinating with school, but I do dishes and laundry a lot more often. Our home is still stressful (we went from 0 to 7-year-old and 9-year-old within months), but it’s a bit less so.

Becoming a parent was a huge change, and I’m still coming to terms with how much of a challenge it is. I was always told I’d be a great father, and now that I’m here, I feel like I suck at it. To be fair, parenting is a skill that I had no practice with. Still, I used to think I was a disciplined, calm, patient, and easy-going person, but it turns out that I’ve just never been tested before.

FINALLY, LET’S LOOK AT 2019

My two main goals for 2019 were to finish the contract and earn $10/month in sales by December 31st.

I accomplished neither of these goals.

My expectation was that I would focus on finishing the contract, which had been “almost done” for over a year, then port Toytles: Leaf Raking to iOS, then work on a very quick project to get it published before the end of the year.

But my primary focus was the contract, which was in a weird state. I was pretty much finished with my part of it by September. There were no more deliverables for the client to test, and so I was helping the client get the app into the Google Play and Apple App stores. It’s been waiting to be published for months. I would periodically get a request for a small change or a question about the project, but otherwise, the rest of the work of publishing the game is on the client’s plate.

I’m not actively working on it, and since there are no more deliverables I am no longer getting paid, but it feels like sitting in front of the finish line instead of crossing it.

Before the contract and kids, I had regular morning habits and routines related to my business. I needed to relearn or reconstruct them all. Despite having the time, I finished the rest of the year doing very little non-contract game development. I opted instead to focus on resting and being more present for my wife and kids.

I only wrote a total of three blog posts. Heck, I barely wrote in my own personal journal.

I only read 32 books for the year. It sounds like I fell very short of my one book a week goal, and if I compare it to previous years in which I tracked the books I have read, it is the fewest I’ve read since 2013.

However, the 100+ books in a year experience from 2017 drove me to choose relatively shorter books and audiobooks. I would often go to the library and pick a 5-CD books over a 20-CD book, even if the latter was something I found very interesting, mainly so I could get more books finished sooner.

This past year, I decided to consciously pick larger books, which took longer to get through. Also, I decided to stop listening to audiobooks in my car in favor of listening to podcasts for a change. Currently, I am catching up on the strategy game podcast Three Moves Ahead, which led me to research some older yet fascinating games.

So between the longer books and lack of audiobooks I can listen to on my day job commute, my “# of books read” metric was lower, but I’m not sweating it. I’m still learning and exposing myself to new ideas, and with podcasts I’m getting a wider variety of ideas than before.

Last year, I showed off Toytles: Leaf Raking as well as the contract game at the local art and games expo again. I felt a bit more prepared, and I enjoyed the experience of getting feedback as well as connecting with others showing off their games and art. I wish I had a newer game of my own to show off, but there’s always next year.

GOING INTO 2020

I’ve been assessing the last few years and comparing them to what I wanted them to be.

My main efforts and income came from the contract. I just received my final payment for helping to get the game through the app store publishing process. The contract is over after 2 years and 10 months. It is no longer a source of income, but it also means that I can put my focus back on my own business.

And I’m going to pick up where I left off in 2017:

In 2017, I want to focus on promotion and sales.

Ostensibly my goal for the last few years was to get from $0/month to $10/month in sales. Again, the goal was meant to be achievable and to be a stepping stone to increasing sales over time.

But I think what might help is if I gave myself a much more inspiring goal, something that is doable but also would require me to stretch to make it happen.

So my 2020 goal is to get $10,000 in sales by December 31st.

It’s not quit-your-job money, but it’s not so small as to let me think I can procrastinate and make it happen in the last weeks of the year, either. It’s also not about the money, but money is an easy metric to track.

Ok, so that’s a goal. How do I go about accomplishing it?

I’m still working on my plan to do so, but I can already think of a few things that will feature as key to that plan.

I need to start creating again. Between the lack of game releases and blog posts, I feel quite irrelevant in the game industry. It’s been years since my last new game. I haven’t been participating in game jams either.

I need to find my audience. Blogging for the benefit of other game developers is great for building relationships, and I want to continue to do so. But I also need to work on finding and reaching people who are interested in entertainment that encourages curiosity and supports creativity.

2017 is when I challenge myself to be incredibly proactive about putting myself and my work out there.

Uh, ditto for 2020. I will be working on getting back into the swing of things and doing my part to contribute to the indiepocalypse (are we still calling it that?).

It will be challenging, and a big part of that challenge will be in trying to be present for my family. With a day job, wanting to sleep a full night, and spending real quality time with my family, I only have so many hours available to make things happen for my business. Luckily, I can dictate what the pace and cadence for my business will be instead of trying to hold myself to other people’s expectations for how I should run it.

Perhaps it is unrealistic, and something will have to give. A giant chunk of my waking hours are taken up with “Not Game Dev,” with the day job taking up the lion’s share. Maybe I will find I am moving so slowly in my business that I’m actually falling behind, that it takes me months to do what others do in a few days of concentrated effort.

I worry there is a minimum amount of time and effort required that I’m not going to be able to give with my chosen priorities. It would be one thing if I was Sisyphus pushing a boulder up a mountain and having to do it again and again. It’s another if I am barely budging the boulder while it grows moss.

I’m saying no to a lot of things in my life to try to make sure I do have time for the things that are most important to me. I have been greedy in the past and have wanted to do and learn and be everything, but I know now that I have limits.

But in the spirit of my past goals, I’ll make slow and steady progress, and then I’ll build on those successes.

And perhaps those successes will give me the capacity to start saying yes more often.

Let’s start.

Categories
General Personal Development

Dealing with No Longer Being Player 1 in My Own Home

My wife and I gave our son a Nintendo Switch for Christmas.

In the week leading up to the day, it dawned on me: this will be the first video game console in my home that wasn’t mine.

I mean, I think the Atari 2600 was the family’s console. But otherwise, my parents gave me an NES. I saved up and bought myself a Game Boy, opting to get the system without a game so I didn’t have to save so much allowance to get it. Santa got me an SNES. I bought myself an N64, then a Gamecube. A friend gave me a Famicom with a few games when he came back from Japan. A girlfriend gave me a Nintendo DS. I got a great deal on a used Wii as it came with a bunch of games, then my wife got me a Wii U. I believe I had a Tiger electronic handheld of Pitfighter of all games, as well.

In case you’re wondering, I never had a non-Nintendo console other than Sega Genesis someone gave me when they couldn’t get rid of it at a garage sale. I never played it. I used to be a partisan of the console wars, but I haven’t cared about it since high school. But I also didn’t care enough to get an Xbox or Playstation in the years since. I much prefer PC games these days anyway, and specifically look for games that run on my Linux-based system.

Anyway, the point is that every console in my life has been mine to play whenever I wanted to.

And now the Switch…isn’t? How does this new world order function?

When I was younger, no one in my family cared about video games. My mother would play Tetris on her Game Boy, sure, and I would play games with my sister, but I was always Player 1. She gets to claim credit for finishing Super C before I did, but I claim that I carried her to the end and she stole one of my lives and happened to land the finishing blow that I had worked hard to get to. Otherwise, if a game was being played in my home, odds were very good that it was me doing the playing.

The games were mine. I subscribed to magazines about games. I bought RPGs, platformers, strategy games, and more. I was given games as gifts for years of birthdays and holidays.

And I’m not sure how things have changed exactly, but I know it would be presumptuous of me to assume I could just use my son’s Switch without asking. I mean, we gave it to him, so I should not act like it belongs to me or the family.

The day after Christmas, he asked me to play Mario + Rabbids Kingdom Battle with him, a game I was delighted to discover was a Mario-themed turn-based tactics game. I said I would love to play a game with him.

And then he handed me the second controller. Huh.

When my friends and I would play games at each others’ houses, the unwritten rule was that Player 1 was the person who’s house you were at. A college friend said he had a different upbringing, that wrestling matches would start to fight for control of Player 1, but where I came from, it was peaceful and understood. Player 1 was the home team, and Player 2 was the visiting team.

Realizing that I am now Player 2 in my own home is weird.

But I think this weirdness is something I’m still getting used to as the father of adopted children. We went from 0 to 8yo and 10yo very quickly here over a year ago, and part of what I am getting used to is the idea that my children are going to be given a lot of my time, effort, attention, and resources, that my time isn’t just mine anymore, and that one of my goals is to help my children become more capable of reaching their goals.

In another example, my son came home from the library with a collection of Archie comics, so I pulled out a tote I’ve been carrying around with me since the 90s with all of the Archie digests and comics I used to get. I told him to be careful with it all, but frankly it is more about him learning to take care of his and other people’s things than it is about me caring about my old comics. I don’t care about the comics anymore. I haven’t read them in forever. They might as well be read by him, and to be a lesson in how to take care of things that can be ruined if you’re careless is a bonus.

I’m finding myself sharing stories about toys I played with when I was a child. I have given him some of my collectible cards I have held onto for decades. Some of my old books are now on his shelf in his bedroom. We’ve played games on older consoles before, often with me watching him play through a game I have fond memories of.

But these were always things that were mine to pass down to him, sometimes like relics of my past, and sometimes as junk I have no use for. I was in charge and making the decision to let him have access to things I thought were important to me, and so I hope he likewise finds value in them. I once let him play a Mega Man game to see how he would handle something that was Nintendo Hard(tm) and not as forgiving as Minecraft. I have also withheld things I didn’t think he was ready for, such as some movies I enjoyed as a child (it turns out that PG meant different things in the 80s than it does now) or anything I was worried he’d get jelly or something else on (kids are gross).

But the Switch was never mine. It was his first. It is at his discretion whether or not I play games on it.

He has become Player 1. And I realize now more than ever that, as a parent, I am a non-player character in someone else’s adventure.

Categories
Game Development Geek / Technical General Personal Development

Derek Yu’s Updated Pixel Art Tutorial

In ancient times, around 2005, Derek Yu of Spelunky fame created a 10-step pixel art tutorial. It took you through the process of creating a cartoonish lucha lawyer, including brief discussions on lines, shading, dithering, and more.

Derek Yu's pixel art luchador
As seen in archive.org’s history of Derek’s old site.
Also, Derek, please don’t sue me.

Yu recently tweeted that he’s rebooted the tutorial, which can now be found at https://derekyu.com/makegames/pixelart.html and takes you through drawing an orc.

Derek Yu's orc from start to finish
Who would win, this orc or the law?

It’s a more detailed tutorial, and it shows what Yu has learned about teaching pixel art with almost 15 years more experience since the original was created.

There’s also a tutorial about common pixel art mistakes to go with it, so you can see what you’re doing wrong as you try to follow along.

Thanks for contributing to the world of game making, Derek Yu!

Categories
Games General

Come See Toytles: Leaf Raking and Continent Race at 60 FPS Fest

GBGames will have a table at 60 FPS, “a festival for videogames, boardgames, and illustration” taking place tonight from 5:00pm – 9:00pm at Mainframe Studios, located at 900 Keosauqua Way, Des Moines, IA.

There are three floors to explore with over 70 studios full of talented artists and arts non-profits, a nacho bar, a photo giveaway, arcade games, board games, virtual reality, and more.

I will be showing off two games.

Toytles: Leaf Raking

One is my own leaf-raking business simulation game Toytles: Leaf Raking, which puts you in the role of a budding entrepreneur looking to earn enough money to buy yourself the Ultimate Item(tm)! It’s a game designed to teach responsibility and strategic thinking, currently available for Android and soon for iPhones and iPads.

The other is a game I’ve been working on for two and a half years for Byron’s Games called Continent Race: World Puzzle. It’s a geography game in which you locate and place countries on a world map, earning stars along the way. It will be available for Android, iPhones, and iPads soon.

The story of Byron’s Games is incredible and inspirational, and I’m fortunate and honored to be part of their efforts to help other kids. An extended hospital stay and a passion for geography gave Byron the inspiration to help other kids learn and have fun — at the same time! Bryon’s Games also has a Continent Race board game which I’ll also have at the table. You can get the Continent Race board game and know that a portion of Byron’s Games profits benefit select children’s charities.

So if you’re in Des Moines, come see me at the Fest! I’d love to talk with you!

Categories
Geek / Technical

Fixed SDL2 Android App Issue When Suspending and Resuming

Months ago, I needed to update the SDL2 libraries I was using in order to gain access to a new piece of functionality in SDL2 that lets me load SVG vector graphic file and create textures out of them. But then I found a problem was introduced. The app would hang whenever I would leave it to look at a different app. I posted about it on the libSDL Discourse site, but I did not receive a response. I finally had a chance to investigate this issue and I think I have solved it.

When an SDL2-based Android app needs to suspend and resume, there are events that need to be handled immediately, before your main event loop: SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERFOREGROUND.

So you create an event filter, register it with SDL_SetEventFilter(), and it is here that you need to handle things like music. If your app enters the background, but music is still playing, the app will crash. So, in your event filter, you would have code that looks something like the following:

int EventHandler::eventFilter(void * userData, SDL_Event * event)
{
    int whatToDoWithThisEvent(ADD_TO_QUEUE);

    IHardwareLayer * hardwareLayer = static_cast<IHardwareLayer *>(userData);
    if (hardwareLayer != 0) 
    { 
        switch(event->type)
        {
            case SDL_APP_WILLENTERBACKGROUND:
                {
                    hardwareLayer->pauseMusic();
                    whatToDoWithThisEvent = DO_NOT_ADD_TO_QUEUE;
                }
                break;

            case SDL_APP_DIDENTERFOREGROUND:
                { 
                    hardwareLayer->resumeMusic();
                    whatToDoWithThisEvent = DO_NOT_ADD_TO_QUEUE;
                }
                break;
        }
    }

    return whatToDoWithThisEvent;
}

In my case, I have a wrapper around SDL that I call IHardwareLayer, and it will delegate the calls to SDL as well as do some other useful things.

The above code worked fine. Before I added this event filtering, my music-playing Android app would become unresponsive whenever the app would get suspended. With SDL2 and SDL2_mixer, the music plays on a separate thread, but most of the time you don’t need to know about it. In this case, however, you need to stop the music before your app gets suspended in order to prevent it from trying to play music in a bad state.

Ok, great! But then I updated my libraries in order to handle the ability to load SVGs, and the above code started failing. Except suspending worked just fine. It was the resume functionality that was broken now. How bizarre!

So the symptom is that when the app is suspended, everything is fine, but bringing the app back to the foreground would cause it to become unresponsive.

By adding logs and using adb logcat, I could trace the code all the way until it called Mix_ResumeMusic(), and it never returned from the call. What gives?

After trying a number of different approaches, including updating SDL2_mixer to the latest release, I finally tried to resume the music in the main event loop.
I presume the issue has to do with threading, as I learned I couldn’t call functions that would let me query the pause state of the music in the event filter without the app becoming unresponsive.

The way the event filter works, it gets called before your main event loop, giving you a chance to handle an event beforehand. You can, of course, ignore an event, and in my code above, the default return value ADD_TO_QUEUE is an int that has a value of 1, which has the effect of allowing the event to get handled later in my main event loop when I call SDL_PollEvent().

So I changed the above code so that it no longer tries to resume music and it no longer returns DO_NOT_ADD_TO_QUEUE (otherwise known as the return value of 0) when the filter receives the event SDL_APP_DIDENTERFOREGROUND. Then I added the following code to my main event loop, which is in my HardwareLayer wrapper class:

SDL_Event event;
while (1 == SDL_PollEvent(&event))
{
    switch (event.type)
    {
        case SDL_APP_DIDENTERFOREGROUND:
            {
                resumeMusic(); 
            }
            break;

...

So now I pause the music when handling the SDL_APP_WILLENTERBACKGROUND event in the event filter, and I resume music once my app is up and running the main event loop again. No more crashes or unresponsive app!

I am a bit bothered by the lack of symmetry in terms of how to handle suspending and resuming an app, but software development is often about compromise. B-)

Categories
Marketing/Business Personal Development

Slides from My Presentation at #dsmAgile: “You Are Not a Code Monkey So Stop Acting Like One!”

The relationship between organizations and IT can be quite dysfunctional, and unfortunately they grew up together thinking poor results and demoralizing interactions are perfectly normal.

Developers tend to learn they have no control over their situation, which is unfortunate because they have so much more to offer an organization than merely following orders and writing code to a specification. Some internalize their status of “code monkey” and even take pride in it.

Organizations want efficiency, but then behave in ways that discourage developers from helping them actually become more efficient, and developers behave in ways that give organizations no reason to even think to ask developers for their input.

At dsmAgile 2018, my presentation “You Are Not a Code Monkey So Stop Acting Like One!” seemed well-received, and I had a number of people come up to me afterward to ask if I had been in their organization recently.

You can download the slides here:

Based on conversation I had at the conference, I think I should have focused a bit more on hope for the future and less on itemizing the symptoms and illustrating the problem. My goal was to ask developers and organizations to step up and treat each other as partners, and not to provide ammo for a gripe session. Next time…

What are your thoughts? Do you feel your organization treats you as a partner or as a code monkey?

Categories
Geek / Technical Personal Development

Come See Me Speak at dsmAgile on September 28th

dsmAgile is a one day Agile conference in Des Moines, Iowa, and I’ll be presenting at it this year.

On Friday, September 28, 2018 from 8:30 AM to 4:30 PM, you can discuss, discover, and learn more about Agile software development from people who have been practicing and living it. And it only costs $100, a great deal.

My presentation is called “You’re Not a Code Monkey, So Stop Acting Like One!” You can read more about in the dsmAgile session descriptions, but the main idea is that software developers can and should do more than write code.

You are responsible for not only creating value through technology but also for maintaining that capability, and you don’t get to pretend that “they won’t let me” is a valid excuse.

Merely slinging code is not enough. You are not a code monkey following orders. You are a first-class citizen in the organization, more than capable of driving value as well as delivering it. Let’s discuss how you (and your organization) can start acting like it.

I have enjoyed attending dsmAgile in the last few years, and I look forward to being part it. Will I see you there?