2010 and 2011 in Review

December 31, 2011

If you’ll forgive me for “metablogging,” I’ve been ruminating lately on the purpose of this website.  Up until now, I’ve been trying to focus exclusively on technology, programming and game design, and to minimize the subjective aspects of my connection to those fields.  Put more simply, I’ve been avoiding writing about who I am and what I do in favour of producing a series of mostly impersonal tutorials and critiques of technology.  There are a number of reasons for this—the word “professionalism” comes to mind as chief among them.  I’d like this website to be my public face on the Internet, and as every saavy Internet denizen should know by now, there are certain risks associated with maintaining a public persona.  I greatly admire Zed Shaw, for his personality as well as his technical accomplishments, but I have no desire to make myself unemployable as he claims to have done (albeit temporarily).

That said, trying to take a dry, detached and objective approach to creating a personal website presents a number of problems itself.  First and foremost, it’s an inherent contradiction; if I don’t write about myself in any meaningful capacity, then there is nothing aside from the superficial about this website which makes it mine.  I can’t imagine it makes for a very interesting read, either.  Realistically, how many people will come here looking for advice on how to link GLUT?  Readership numbers are of little to no concern to me, mind you, but I can at least endeavour to give this website a purposeful existence.  To that end, I want to start writing more about personal topics, although for the sake of cohesiveness I’m going to continue to focus primarily on those aspects of my life that will be of interest to a technically-minded audience.

As a start, I think that this is a good time to reflect on what I’ve done since I started this blog in May of 2010.  Early in May, I moved to Calgary, Alberta, to start a sixteen-month internship with Pason Systems Corporation.  Pason is the market-leading provider of oil rig instrumentation and service, with a wide variety of tools and technology available to facilitate safety and improve efficiency on oil rigs.  All of Pason’s rig-site hardware and software is designed in house, but my work was on an internal web application designed to support Pason’s most valuable employees: the field technicians who directly provide services and equipment to customers.

For obvious reasons, I can’t go into great detail about the work I did at Pason.  I will say, though, that it was extremely rewarding.  I had the opportunity to work alongside some of the smartest developers I’ve ever met, and I was able to do work that I felt had a tangible, significant and lasting impact on my team’s product. That’s a rare honor for an intern!  From a technical perspective, I got to work with some interesting and unfamiliar technologies; I did extensive development in Python, created rich user experiences with HTML5 and JavaScript, and dabbled with C# when the need arose.  The whole experience was hugely instructive, and I will always fondly remember my time at Pason.  Of my entire education, my internship is without a doubt the part that I value most.

In September of this year, I moved back to Edmonton to finish my Computing Science degree at the University of Alberta.  It being my final year and with most of my specific course requirements out of the way, I loaded up on computing science courses, which led to a fairly engaging but difficult semester.  Among the courses I took were Advanced Games Programming in C++, Compiler Design, and Introduction to Computer Graphics.

As a term project for the Advanced Games Programming course, I undertook a modification of the ORTS game engine to allow user interface scripting with Lua, à la World of Warcraft.  I feel that the outcome of this project was a little underwhelming, as limited time and the complexity of ORTS forced me to settle for less comprehensive scripting capabilities than I would have liked.  Nevertheless, I learned a great deal about Lua and the process of interfacing with Lua from C++. I think I now have an inkling of what’s involved in creating a robust client-side scripting system as in World of Warcraft, or even a custom development platform like Corona.  Given the popularity of Lua as a scripting language in game development and my interest in developing games, I’m sure it will be valuable experience.

Although I believe I would be within my academic rights to do so, for the time being I don’t foresee myself releasing the source code for my Advanced Games Programming project.  ORTS has not seen active development in a number of years, so it is outdated and difficult to compile and run, let alone modify.  Additionally, my own work—being a school project as it is—would probably not prove to be a good demonstration of Lua/C++ integration best practices, and I’m always wary of releasing code from which others might learn the wrong way of doing things.  I do have a report on the project which I’d like to reproduce here at some point, though.  One final word of advice to any University of Alberta students who might be reading: if you already know C++, as I did, I would not recommend taking the Advanced Games Programming course.  Much to my chagrin, a significant number of the lectures were exclusively about how to write C++.

Compilers was perhaps my favorite course of the semester, although it was also by far the most difficult.  I would describe it as a strangely paradoxical course.  The theory behind formal languages, parsing and code generation is not extremely hard to grasp, but it does seem somewhat hard to hold on to, with a large number amount of often deceptive terminology, as well as numerous rules and axioms to memorize.  The process of building a simple compiler for a simple language is, in retrospect, fairly mechanical and manageable, but it seems anything but when approached without the benefit of hindsight.  Overall, the course is just a staggering amount of work, but it is also among the most rewarding courses I’ve taken.

Finally, Introduction to Computer Graphics, I got to expand upon the OpenGL knowledge I had built during the development of my iOS game, while also learning the fundamental aspects of computer graphics.  Like Compilers, Graphics is a challenging but rewarding course, one of the most difficult aspects of it being the time commitment required.  (Of course, it is also fairly math-heavy.)  As someone who appreciates the beauty of a well-designed, simple algorithm, I found that learning about such achievements as the midpoint circle algorithm was one of the most enjoyable aspects of the course.  I feel that there’s an almost Zen-like quality to a clever but simple algorithm which strips away preconceptions of complexity to accomplish a task in the most efficient manner possible.  If you’re of a similar mind, graphics is full of examples of such algorithms.  Of course, working in graphics is also rewarding for its ability to produce visually interesting results, which is a rare treat in academic computing science:

A demonstration of shadow volumes from an Introduction to Computer Graphics assignmentA demonstration of shadow volumes from an Introduction to Computer Graphics assignment.

2010 and 2011 were exciting years for me, and although I’m not ready to discuss it yet, I have something huge lined up for after I graduate in April of 2012. In the meantime, I’ll continue to post here as often as I can manage. Thanks for reading, and happy new year!

Ethical Game Design from Gamasutra

December 30, 2011

I came across a couple excellent articles on Gamasutra which I want to share here. The first, “Contrivance and Extortion: In-App Purchases & Microtransactions” is by Adam Saltsman, creator of Canabalt, among other games. He argues that in-app purchases and so-called microtransactions are being abused by some game developers, “deliberately contriving their designs in the worst way in order to extort money from players, which is unethical and unacceptable design practice.” I’ll lay my cards on the table and say that I am in complete agreement with Adam.  As he does in his explanatory follow-up, I acknowledge that there are benefits to the “freemium” model, but the techniques commonly associated with that model are often used in a cynical, manipulative and profit-driven manner which I feel is harmful to consumers and the industry. Whether or not you agree, Adam’s thoughts on the subject are certainly worth reading.

Radical Plagiarism: The Ethical Lessons of the Gamenauts Controversy,” by Evan Jones, is equally thought-provoking. Evan recounts the cloning of the indie game Radical Fishing by the more established indie studio Gamenauts, and adds his perspective on the cultural impact of the rampant cloning that takes place on mobile app stores. Returning readers may recall that I’ve previously defended the practice of cloning games. My defense excluded the cloning of smaller titles by established studios, which I’ve always viewed as morally questionable at best, but Evan’s article nevertheless gave me pause. He provides a strong counterpoint to my own thinking on the matter, and while I’m not yet ready to reverse my position, his argument has undeniable weight. If you’re at all interested in game development, both articles are well worth your time.

How to link GLUT in Qt Creator on OS X

September 21, 2011

This tutorial is for an extremely specific and possibly unusual set of circumstances, but I’m hoping that it will prove useful to someone. For one of my courses this term, we’re building OpenGL apps using Nokia’s open source Qt framework. Qt provides some very nice scaffolding, and the Qt Creator IDE is among the best I’ve used, although I imagine it lacks flexibility for general-purpose applications—that is, you probably wouldn’t use it to build non-Qt applications. Qt also allows one to easily write cross-platform C++ GUI applications. That said, linking procedures can be a bit different on different platforms, and as a beginner it’s not always immediately obvious how instructions for Windows development translate into other environments.

In particular, I found myself having difficulty linking the OpenGL Utility Toolkit (GLUT) with my project on Mac OS X. After much Googling and some frustration, I came up with the correct way to go about it, which is as follows:

  1. In Qt Creator, open your project file (.pro) in the text editor.  Right click on the text editor pane and select “Add Library…”
  2. Chose “System Library.”
  3. Locate the GLUT framework.  On my Mac, running Lion, I used /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/GLUT.framework. However, it seems there are multiple different copies on the disk that you could use.  If that path doesn’t work for you, just search for glut.h in Finder and you’ll find a copy of the framework.  The path you enter into Qt Creator should point to a .framework directory.
  4. Qt Creator will generate code in your project file which will link to the correct framework or library depending on which platform the code is being compiled on.
  5. Finally, because Apple loves to be different, the glut.h header path is different on OS X.  You’ll need to #include <GLUT/glut.h>, instead of <gl/glut.h> is usually the case.  You can use preprocessor conditional statements to make this inclusion cross-platform:
    #if defined(__APPLE__) || defined(MACOSX)
      #include <GLUT/glut.h>
    #else
      #include <gl/glut.h>
    #endif

That’s it! If you have any trouble, leave a comment.

How to reinstall OS X from a disc image using only one computer

September 21, 2011

My internship recently ended, and as such, I had to move from Calgary back to Edmonton, where I’ll be completing the fourth year of my Computing Science degree at the University of Alberta. I hope to be able to write more about my internship later, but at the moment I want to share a handy trick I discovered for reinstalling OS X. The reason I bring up the move is that after I arrived in Edmonton, I found myself wanting to reformat my Mac Mini and re-install Snow Leopard, but my Snow Leopard disc was nowhere to be found. Luckily, as a semi-paranoid computer scientist with an abundance of disk space, I keep images of important discs on my network-attached storage device for just such occasions.

Unfortunately, however, the Snow Leopard disc image is large enough that it can only be burned to a dual-layer DVD. I don’t tend to keep writeable dual-layer DVDs lying around, so I needed a solution which required only the disc image itself. There are a number of methods available for installing OS X over the network, but none of them seemed to work for me—perhaps owing to the fact that I had only one Mac. Luckily, I discovered that you can install OS X from a separate partition on the same disk. Here’s how:

  1. First, you’ll need to re-partition your disk. Open Disk Utility and select the disk you want to use. Be sure to select the disk itself, rather than one of its partitions, which are indented beneath the disk.
  2. Click the + button to add a new partition, and drag the new partition’s section in the disk layout graph upwards until it’s large enough to store your operating system disc image. Apply the changes. It may take some time for the disk to be re-partitioned.
  3. Now, select the new partition from the list on the left. Go to the Restore tab, and restore your operating system disc image to the new partition.
  4. Once the restore is complete, restart your computer, holding Option (Alt) at start-up. This should bring up a list of available start-up disks. Choose your new partition.
  5. You should now be at the installer, and you can re-install to your primary partition. Once the installation is complete, delete your installation disc partition to and resize the primary partition to reclaim the extra space.

That’s it! In retrospect, it’s completely obvious, but I haven’t seen these instructions anywhere else on the web. This technique might be particularly useful for owners of Macs without disc drives.

Rest in Peace, Jack Layton

August 22, 2011

I don’t discuss politics on this site, but today warrants an exception. Canada has suffered a terrible loss with the death of Jack Layton, the leader of the federal New Democratic Party. He was an inspiring figure, hopeful and optimistic right to the end, and he devoted his life to the betterment of Canada and its citizens. He was taken from us far too soon, and will be sorely missed.

Rest in peace.