Page 11 of 12

Of Hiatuses, Jobs, and Other Shit

At a minimum, I try to write something at least once a month. However that hasn’t been possibly lately since I’ve had so much going on. In fact, it hasn’t really been possible to do a lot of things that I was planning on doing due to recent changes in my personal life. So allow me to banter on a bit while I sip on some coffee and listen to the Tron Legacy soundtrack.

So let’s start with the interesting stuff: I’m currently trying to use Ubuntu as my day-to-day distribution instead of Fedora. Blasphemy I know but I’m really wanting to put Linux everywhere in my house. The only hold-out is still my media center and the most critical component of that is the gaming portion. Yes I still enjoy freedom-hating triple-A titles and while Steam is now available on Linux, those titles aren’t. But I’m really doing an honest attempt at getting that Windows machine out of there and putting a full-time Linux box there. My gripe from the outset was that I couldn’t get Steam to run under Fedora. I know people have accomplished this and there are tutorials available but I’m convinced that Gallium hates my graphics card (Radeon HD 4670). Not to mention that Valve have cozied up enough against Canonical that Ubuntu is the gateway drug for this particular piece of software. So I have to spend some time with it to get familiar with its eccentricities so I know what my potential media center is going to be doing. Even though it’s Linux, Canonical have a habit of doing things their own way.

Not the juicy tidbit you were looking for? Fine. I get it.

I started my first enterprise job around the late-middle of March. I’m not writing code for a company (mostly because I don’t want to ever hate writing code) rather I’m driving around to multiple locations and effectively working as a break-fix for servers, PBX/phones, registers, PCs, RF devices, MFDs, etc… It’s definitely a challenge and a bit different than what I’ve been accustomed to for the past three years but it’s certainly welcome. I just can’t come to terms with the overwhelmingly deep penetration Windows has in that environment. I suppose that’s true in a majority of enterprises but I really do cringe when I turn my company laptop on and Windows 7 comes up. I asked if I could get a Linux image deployed but they reserve that for the almighty developer. Putting that aside, the other change came as a shift in schedule. While most people are accustomed to a 8AM-5PM job, I’m not one of them. Prior to this, my time was usually 2AM-5PM (waking at 2AM, bed by 5PM). Of course I’d be writing code for nearly this whole time but I enjoy waking up that early in the morning in general. Now I’ve been contending with a five-hour shift and it’s still not taking to me very well. I’m still coming home and crashing hard because I just feel completely beat since I’m getting off the clock at the time I used to go to bed. And typically I’ll be more than an hour away from home at any given day.

While definitely a much needed job/change, this unfortunately has meant that I’ve had to put nearly everything I was working on prior to on a bit of a hiatus for the time being. At least until I get my bearings and stop stumbling around like an idiot (which hopefully isn’t too long since I tend to pick up on things pretty quickly). Despite having a very steep learning curve from this position, I’ve already found myself starting to wean back into writing code on the weekends (which is actually how I started programming as a weekend/bedroom coder). I’m starting with small stuff for now with the thinking that I’ll be able to get back up to writing decently complex programs by next month barring any complications that come up.

I haven’t been able to publish any screencasts to YouTube either. I’m actually sitting on a few that just need to be rendered but I haven’t had the time or inclination, simply by virtue of being tired, to click the render button on Pinnacle. Eventually I’ll get more of them up there.

So it’s time for me to order new Google swag. My original Google coffee mug, still kicking after three years, is starting to show its age thus it must be replaced. And I bid you adieu.

Fedora 18 Post-Install Tips/Tricks

I wanted to share some things that I do after I install a Fedora system and some tips for getting by with your sanity intact. More specifically, these are steps that I follow after a fresh install and not an upgrade (I haven’t had a chance to use fedup yet).

Keep in mind that this list is entirely subjective to your particular needs. Being a developer/media junkie, the packages and steps that I’ll go over here may not be to your liking or even something that you’d want to do at all. However I’m hoping that the steps would somehow come in handy for certain people. These steps cover a GNOME Spin of Fedora. Some of the steps are specific to GNOME while some are more particular to Fedora.

The first thing I do, as anyone should really, is run updates. There’s a pretty good chance that you’re going to have updates in your software channels right after a fresh install. This is actually quite common especially when you’re installing a version of a distribution that’s dated even by a few weeks. This is doubly true with Fedora which tends to be the “bleeding-edge” distribution because it contains both pretty radical changes (in some cases) and usually runs the latest kernel whereas other distributions are typically a few versions behind. Fedora uses the YUM package manager and the RPM package format. You can check to see if your system has updates available by running yum check-update, as a non-privileged user, which will print a list of all packages that have pending updates in the channel. When you want to actually update, simply run yum update as root and you’re all set.

Here’s a quick tip while speaking of updates. Have you ever run updates and then have your system start acting flaky? I’m sure the issue here though is that you’ve installed a lot of updates and you’re not sure where to start to fix the problem. You could always drop out to a single-user recovery console and check the logs. But if you want to take the Draconian approach and just roll back the updates, there’s a really easy way to do this. YUM stores anything you do with it in a transaction history. These transactions are numbered starting from one and counting forward. To show a list of the twenty most recent transactions, use yum history list as root. From here, you can get some basic information about recent actions taken with YUM. You can view details about specific transactions by using yum history info followed by the number of the transaction you wish to examine. This can help you pinpoint exactly which transaction it was that you ran the updates on. Finally, to roll back to the point before the updates, use yum history undo followed by the transaction number as root. This will undo all of the changes listed in that transaction. Keep in mind that it does this in what’s known as “leaf style” so any packages that were installed as dependencies will also be removed.

The people over at the GNOME project have a pretty interesting mess on their hands (despite them probably not thinking so). Admittedly, I’m a GNOME guy myself (always have been frankly) but even I can admit that things are getting a little out of control with this desktop environment. Don’t get me wrong, I still think it’s the best looking Linux DE available but they’re really stretching the idea “less is more” to a point where it’s going to end up being “less is actually just less”. GNOME 3.6.x takes this to a new extreme with Nautilus, their default file manager. While it’s definitely trimmed down quite a bit to look nicer, astute users will notice that missing from the button lineup is any way to access the preferences for Nautilus itself. Instead, they’ve elected to tuck it away under the application’s global menu located in the top-left of the screen next to the hot corner. So if you were looking for a way to customize Nautilus, or to get your single-click functionality back, this is where it’s been this whole time.

nautilus-preferences-location
The magical location for the Nautilus Preferences

Sure stock GNOME looks nice but it isn’t immediately welcoming to customization. Some things you’ll want to customize for sure. Maybe the clock at the top-center isn’t showing as much information as you’d like. Maybe Cantarell isn’t your favorite font and you want your windows to use Liberation Sans. Maybe the sub-pixel smoothing isn’t high enough or isn’t using the proper smoothing method. I know that everyone wants to change those bloody gaudy-looking default icons right out of the gate (they don’t event go well with Adwaita!). Anyway, the point here is that if you want to make even the most subtle of tweaks to the GNOME experience, you’ll need to get the GNOME Tweak Tool (named, oddly, gnome-tweak-tool in Fedora’s channels). This package is a must-have for making your GNOME truly unique since it permits you to change a number of things. It even integrates with GNOME Shell Extensions so you can skin GNOME Shell as well as GTK. There are some really amazing skins for both of these utilities and they can be found at gnome-look.org.

Screenshot from 2013-02-13 06:57:45
GNOME Tweak Tool

Media playback on Linux is still a touchy subject since many media formats require proprietary software to playback properly (try playing a MP4 file on a fresh install because it’s not happening). Your open formats will typically work without a hitch (OGG, WebM, FLAC) but there’s a pretty good chance that your existing media isn’t encoded in one of these formats. Most software that’s required for this case isn’t located in the default channels that are registered with Fedora. What that means is that you’ll have to find a third-party channel that contains these packages. Thankfully, there’s a really great one from the folks over at RPMFusion.org. Setting up their channel is quite easy since they provide both a graphical way and the command to issue on the terminal to do it. Once added, you’ll want to update the system using yum update to make sure it integrates okay. From that point on, you can search your channels using YUM and it will pull down results from the RPMFusion channels you added. These channels contain additional Gstreamer packages that help for playing back files in formats like MP4 or videos encoded in H.264 as well as the media essentials like ffmpeg, lame, mencoder, transcode, and libavc. Trust me on this one because you’ll start to like Totem a lot more after you’ve done this.

So I Unlocked the Bootloader And…

One of the cornerstones of my Android development is that I want to write to what the majority of users are running on. Under most circumstances, this is vanilla Android in one of its many legacy incarnations that are still floating around on the market.

Honestly this is a pretty fair approach. Especially if you’re invested into the Google ecosystem, want to distribute and market on Play, and want to hopefully attract the largest possible user base you can.

There’s this other side to Android that’s always poked, prodded, scratched, kicked and nagged at me to just do what I please with it. Unlock the bootloader, root the device, install custom ROMs and have a field day. These days, it’s extremely tempting to do so with superior hardware and a slew of ROMs like Ubuntu and Cyanogenmod. Not to mention all of the fun programs you can run on a rooted device!

I tried for so long to resist doing all of that. After all, custom ROMs don’t compose a majority of the market share of Android and I’m not really keen on supporting several ROM variants for my programs. However, despite my best efforts to the contrary, my inner geek took over and I went to town on my Nexus 7. Unlocked bootloader? Check. Custom recovery image? Check. Rooted? Check. Cyanogenmod 10.1? Check.

But then something strange happened. I was stuck. I’m not going to argue that CM didn’t grant me the power to do whatever I wanted to do to the device and I was able to make it look quite aesthetically appealing (more than it does with vanilla). I was left wondering how the hell I was going to get programs and use it as a work device like I did before (which was flawless).

The first obvious problem here was the Google ecosystem integration; you’re immediately divorced from it. I’m already tied down pretty well to it having invested a bit of money into programs and media and a developer’s license to distribute my programs on Play. So I needed to get those apps back on the device somehow. Turns out there’s an archive that you can download and install via the recovery image that puts the Google programs back on the device. Cool. So I did all of that and rebooted the device. Turns out that CM 10.1 has some serious issues with the AOSP keyboard. Literally, in the five minutes I had that running, I’d seen more ANRs than I ever have in all the time I’ve owned the N7 (five months now). Even worse was that no keyboard seemed to want to function. I even went through the effort of installing a second arbitrary keyboard program and it wouldn’t work. If I removed the Google programs, the device functioned properly. Unacceptable.

Setting aside the withdrawal syndrome you experience having been removed off of Google’s life support system, there’s the other obvious problem of installing software. Out of the gate, there’s no aggregate store/repository to get programs from. You have two choices here: either find such a program and install it manually or hope, and I mean seriously hope, that you can find an APK for the program you want to use and manually install it.

The proliferation of “app stores” or, in a more non-copyrighted way, central program repositories for mobile devices, like Play, has made the concept of secondary installation methods a bit uncommon even to the point of obscurity for most people (most people meaning your average user). Thus, while independent distribution of your programs for Android is entirely possible, I don’t suppose it’s the most feasible and user-friendly method of doing so. Have you ever tried to explain to a non-technical user how to manually install an APK on their device? I’ll give you three guesses how that conversation ends up and I can hint to you that it never ends the way you’d hope it would.

The underlying problem here is that because repositories like Play or the Amazon Store are so prevalent in the mobile space, the proper APK isn’t front-facing to the user unless they’re technically savvy and can expose it. Otherwise, users would be, and in fact are, non-the-wiser about the entire process. On top of that, most developers who choose to distribute their programs in these channels either refuse to or simply forget/don’t release the APK independently for other users who wish to have it in that way.

And this is where most custom ROMs leave you. You’re stuck in the weird limbo place where you now can do whatever you want with that Android device in your hands but it almost removes any type of practical usage from it.

I think my overall takeaway here is that a custom ROM isn’t really a great solution for average users who just want the device to work as they’d expect it to. I’m not really sold on them either just for the simple fact that they take away the vanilla experience which is something I need.

“Studio” Update

I couldn’t really think of anything better to call my desk than a studio. That and I’m sure “Desk Update” sounds more like a press room churning out whatever they can come up with.

The holidays have a way of stealing time away from projects. As does family drama and everything else that constitutes a curve ball in life. But you have to do what you have to do. If that means putting things on the back burner for the time being then that’s what has to happen.

As the holidays are just literally right around the corner, I’m starting to find time to get back to working on The Shopper v. 2.0, which is long overdue, and trying to finish up the two Android game projects I’m cooking up.

Two? Oh yeah. My second “filler” project. A Greg-ified Pong variant. If you don’t know what that means, don’t worry about it. I don’t either but I’m sure that whatever comes out of it will be pretty decent. At least I’m hoping it will. I really just needed to do something else besides for work on The Shopper and my other game. I haven’t churned out any Android apps since my pilot release and I want to get something else out there. I’ll be distributing on Play as well as other channels to friends and family. No need for any restrictions on this as it’s intended to be open source. Now clearly, I don’t own Pong or anything like that but I’m sure that as an educational vehicle, it’ll be just fine. As an entertainment vehicle, you may or may not puke over how awesome it’ll be.

For my game projects, I’ve finally decided to put my own personal touches so that it is clearly my work. Most of those are code formatting subtleties (nothing that makes the code unreadable). Others are visible to the user.  One such way of doing this is by creating a splash image for the name that I distribute apps under, Quorra Apps. The image is shown below. Nothing fancy but it’s pretty clean and simple. Plus the green kicks ass.

The splash image used in my games.
The splash image used in my games.

Maybe I should have added some inset to the characters? I rather appreciate the appeal and simplicity that “flat” brings.

In my last post, I’d mentioned something about doing a write-up on migrating from simple pixel-oriented mechanics in 2D games to using classical mechanics, or actual physics, to regulate the behavior of your in-game entities. I’ll release this in parallel with my Pong variant release. This way, I can get code samples lined up inline with explanations. Keep in mind with this though that I’m not the “go-to” game developer or physicist or mathematician. My profession is writing software for practical everyday solutions or business application. So what I’m saying there will not be the best way to do things and some of what I’ll say might be wrong. If it is, just send me a “Hey asshole!” email and I’ll fix it.

I’m going to finish up with salutations. I hope everyone has a damn good holiday, whichever one it is you subscribe to, and you don’t do anything too crazy.

After all, we survived the impending apocalypse yet again. Might as well pat yourselves on the back for that one.

Game Development – Migrating to Classical Mechanics

Let’s clear up some possible confusion regarding the title of this post. I’m not necessarily directly talking about game play mechanics as I am talking about the branch of physics called Classical Mechanics. You know, the fun stuff that helps us describe motion of mass under certain types of forces and the effects, both direct and indirect, resulting.

Well it’s fun for me anyway. Even though I hadn’t necessarily realized how much I’d forgotten about really simple stuff.

And let’s clear one more thing up here. I’m not a professional mathematician or physicist. I’m a software engineer. So if you’re looking for a primer on those areas, you’d be better served by Wikipedia/Wolfram, sites dedicated to those areas, or proper coursework. More importantly, my understanding of certain concepts might not be as robust as a skilled professional in either of those areas but I’m confident enough that I can describe what I see in everyday life enough with classical mechanics to be proficient in what’s called applied mechanics (that was actually my strongest point).

What I wanted to talk about here is something that I’m sure every game developer has dealt with at some point in time when designing a 2D game (strictly 2D). But to best describe what I’m getting at, I should probably start with an example.

Moving a block from one point to another is a relatively simple task to accomplish. Assuming that you’re not using an origin offset of some type, moving from point A to point B would look like this:

A simple affine transformation
A simple affine transformation

Geometrically speaking, this can be accomplished by a simple affine transformation. However, even though you could get away with expressing this event with an affine transformation, it’s not taking into account how this would happen in the real world. Even autonomous movement doesn’t occur without some type of external force being applied to the object to make it move in a certain direction. That being said, an affine transformation like this wouldn’t actually happen without some force being applied to the rectangle to make it move from vector A to vector B. Visually, the player may or may not be able to tell the difference between which method you chose to use. But we all know which one is more fun. 🙂

With that example, I wanted to point out that even in the most seemingly simple situations, it’s really easy to avoid the use of classical mechanics. But should you even if you could?

The really nice thing about classical mechanics is that the rules for movement, collision, and forces are all already laid bare before you. Even better is that these rules and observations are and have been made about real-world objects and these rules can be expressed mathematically (thus you’re translation point into software). At that point, it’s nothing more than to write a utility class or a series of methods that parameterize those expressions and make arbitrary calls to them in code as needed.

Ignoring classical mechanics means that you’re basically left to invent your own set of rules for these behaviors. Not only would that mean that things would probably not do what a player would expect them to do, but it makes a significant amount of work for a developer.

One particular point of difficulty for developers looking to migrate to using classical mechanics would be the change in understanding of objects in the game world. You can no longer look at your objects and entities as mere rectangles and circles with dimensions based in pixels. Now you have to start thinking about how these objects relate to real-world counterparts. Gravity now comes into play thus properties like mass, density, volume, etc.. are all now factors. It’s not enough to simply say “the user pressed this key so now I call this method to do a transformation to make the player move from here to here”. Now it’s more or less along the lines of “the user pressed this key so based on the current factors like gravity, applied friction of the area they’re standing on, if the wind is blowing or not and how fast, how fast can they move in the direction requested and move them accordingly”.

It all comes with the territory transition though.

A really simple but fun exercise for this transition would be to try and write a Pong clone implementing as much of classical mechanics as possible. It’d be fun to discuss this so I think I might try to do so soon.

The Shopper – Questions, Questions

This morning I was able to complete another critical portion of the feature set: item deletion. It now works for either single or batched deletion. In other words, you can delete either single or multiple items in one fell swoop. Of course, there’s no way to undo this but I’m not too concerned about that right now.

Something struck me though. The original version of The Shopper had a visible dynamic calculator. As the user added, deleted, and edited items, the calculator would display the cost with and without sales tax applied. It also showed the total number of items in the list. More accurately, it showed the total of items that should be in your buggy (it counted item quantities rather than strictly the number of items in the list). I thought this was a really useful feature but for some reason or another, when I was drawing the initial UI design drafts for the current version, it never made it in. It still isn’t in there.

In fact, the degree to which it’s missing is evident in code as well. There are no accommodations for calculating a running total for the items currently existing in the list. None.

This might be a little bit of a problem. Adapting the code that calculates these values from the old code base isn’t a problem. I just need to figure out where the hell to put the calculator at. Originally, it was below the list of items (as shown below). I’m thinking that maybe it should go there again? Or maybe above the list? I’m not sure.

The Shopper v1.0 showing the dynamic calculator below the list contents

So here’s another screenshot showing the current iteration in landscape mode. Any thoughts?

Coding in the Winter

Winter is always a bit of a nostalgic time for me. Despite the negative connotations surrounding it (snow, cold, its inept ability to make people drive really poorly), winter is my favorite season for many reasons.

I have a lot of fond memories of winter growing up. There are also some things that I do as a sort of “winter-ritual”. For example, starting the first day that snow falls, I start playing the first Parasite Eve game until completion always starting from a new game with a new file (don’t get me started on my Parasite Eve obsession). Coincidentally, that day is today so I’ll be setting aside about five hours tonight for that very task.

However there’s also something really close to me about winter; more specifically the month of November. This month, eight years ago, I wrote my first computer program ever. It was quite snowy at the time so there’s obviously that association as well but I won’t ever forget how stupid excited I was that I actually had something compile and run without bugs (although not optimized in any way).

To provide a little background, I am your stereotypical kid who grew up indoctrinated by video games. My mom and dad bought me a NES when I was two and ever since then I’ve been involved in gaming in some way. At some point during that time, up to 2004, I had the notion that I wanted to create a video game. I’m pretty sure that every gamer at some point has this idea. The only catch here was that I never actually owned a computer up until about 2001 so I knew absolutely nothing about how games worked, how software was written, or even what software was. All I knew was that I had all of these ideas in my mind that I wanted to see translated into something interactive like what I’d been seeing and using my entire life.

When the opportunity presented itself, during my twilight years in high school, I took up a computer science and networking program at the vocational school near my home school. This was when I learned about writing software and everything that’s entailed with it. What happened here, more importantly, is that I learned independence. I only spent two years at that course as that was the length of it and I’m a college dropout. But everything that I do know has been self-taught. I’m not going to get into an argument about me being comparatively superior to someone with that level of education but what I did do was throw myself into the fray and developed an ability to learn new things extremely quickly. Without that learned independence, I wouldn’t be where I’m at today.

My first programming language was Visual Basic (VB6). Not the greatest language on the planet but despite its shortcomings, putting out Windows-based programs quickly was very possible and satisfying. The first program I wrote with it was a mock inventory management program. This wasn’t a database-backed program like it should have been. Instead it was based around fixed lists where you could enter, delete, edit, and clear items. Nothing fancy but at the time, it was pretty awesome to me.

This was exciting to me. Ever since I learned about software engineering, I’ve always looked at the world a bit differently. I see the things around me and wonder how something like it, say for example a portable heating unit, could be expressed via software. How could I observe what it does, how it behaves, how it responds to interactions from different things, how it looks, how it feels and describe all of those things in the context of code. This seemingly biological analysis of animate and inanimate objects is what compels me to write code and drives me forward.

Winter brings all of this back to me. All of the drive, all of the over analysis, all of the feeling of creating the world I want in terms of software. I’ve never really written software to be used by masses of people; that was never the goal. I’ve always written it so I could use it. Every piece of software I’ve written has always been part of this grander expression of the world around me. But if other people like what I do then that’s very cool.