Category Archives: free software

Liberating a Thinkpad X220

I had been looking for a suitable replacement to my old, slow Compaq
laptop that I purchased during my freshman year of college when I had
very little money. What I liked about my old laptop was that it played
well with free software. I had no trouble getting all of my hardware
to work out-of-the-box with fully free GNU/Linux distributions such as
Trisquel, and I wanted any future laptops of mine to play nicely, too.

I have heard much praise for Thinkpads over the years. Solid build
quality, utilitarian design, and cheap to buy used. However, upon
further reading, I realized that most newer Thinkpads require nonfree
software in order to the drive the Intel wireless chip. Furthermore,
there was DRM present in the BIOS that would prevent the installation
of PCIe wireless chips that weren’t in the whitelist.

This really bummed me out, but I bought a Thinkpad anyway. I found a
great deal on a used X220 on ebay for $400. In order to liberate it, I
had to make a small deal with the devil: Use the pre-installed Windows
7 to flash a hacked BIOS that removes the whitelist. I could only find
the needed BIOS as a Windows executable, so I didn’t have much
choice. This process left me hoping that coreboot gains wider
adoption.

Once I had verified that I didn’t brick my Thinkpad, I installed the
new wireless card. I purchased a Wireless N, half-height, mini PCIe
card from Thinkpenguin. It uses an Atheros chipset and is free
software compatible. I met Chris, the owner of Thinkpenguin, at this
year’s Northeast GNU/Linux Fest at Harvard. He is doing some great
work and I wanted to support his business. It was nice to buy from
someone who could assure me that the hardware I purchased is fully
supported on a libre GNU/Linux distribution.

Now that my Thinkpad was free (sans BIOS, of course), it was time for
the final touch. I replaced the hard drive with a 128GB SSD and
installed Debian testing. It takes roughly 9 seconds to get from GRUB
to the GDM login screen. It feels very nice to have a device that
boots so quickly.

Now that everything had been installed and configured, I was able to
start hacking and get a feel for things. The keyboard is the nicest
I’ve ever used on a laptop. The TrackPoint is quite a nice way to
move around once you get used to it. The ThinkLight is pretty neat
when you’re in a dark area. The battery life is extremely
impressive. I don’t know exactly how long it lasts yet but I never
have to charge it while I am using it. I was lucky if I got 2 hours of
battery life out of my old laptop, which caused me to be constantly
tethered to an AC adapter. The screen is matte, which is awesome
because it’s very difficult to use a laptop outdoors when the screen
is glossy. 1366×768 is not an ideal resolution (16:9 be damned), but I
can live with it on a 12.5" screen. Last but not least, I honestly
like the aesthetics. A lot of people are enamored with the brushed
aluminum designs by that fruit company, but I love the flat black,
functional design of the Thinkpad.

I hope to really break this thing in over the weekend at the GNU 30th
Anniversary
hackathon. πŸ™‚

From the blog dthompson by David Thompson and used with permission of the author. All other rights reserved by the author.

The Liberated Pixel Cup! – Dev Blog 2

It’s been a slow start, but hopefully things will start to move a bit faster. I am on vacation for the week and I have managed to get some work done.

I spent several days trying to figure out the best way to represent Actors on the world maps where the player can walk around. The Actors walk one tile at a time, fitting to the grid, rather than having “free” movement where Actors can move by any increment. It is much easier to implement free movement (which is what I’ve done in the past) than tile movement. I re-wrote the code that handles all of this several times before I found an implementation that was clean and functional enough.

In this screenshot there are several randomly spawned Actors that have walked to random places on the map. They do this by using the A* pathfinding algorithm I talked about in the previous post. There is an Action class that actually performs the walking animation. This Action is smart enough to re-route upon collision with another Actor.

The player can touch/click on a map tile to walk a path to it. For desktop users or certain Android devices, the D-pad can also be used to move the player around on a tile-by-tile basis.

I have also started work on an interaction and dialog system. In the screenshot, the text box shown is a result of the player interacting with the sign on the building. Right now the text box only displays one string of text, multiple strings and maybe even branching dialog paths still need to be done. Item chests are on the to-do list as well. Hopefully I can get them done soon.

From the blog David Thompson Β» WSU CS by davexunit and used with permission of the author. All other rights reserved by the author.

The Liberated Pixel Cup! – Dev Blog 1

Image

The time is finally upon us. The art portion of the Liberated Pixel Cup has reached its deadline, which means that the programming portion of the contest has begun! The competition is a month long in which us code monkeys need to use the art assets that were generated to make the best possible game that we can. Since this pixel cup is “liberated”, all of the source code will be available under the GPLv3.

I am working with someone that I only through IRC (#liberatedpixelcup on Freenode) with the nickname of fr33mind. We will be making a Pokemon inspired game where you control monsters to use in combat. The actual gameplay details will get fleshed out more as the competition goes forward.

We are using libGDX to make the game. LibGDX is a fantastic Java library that allows us to write a game that runs on the desktop (GNU/Linux, Mac, Windows) and on Android devices with very little platform specific code.

Above is a screenshot of my experiments with libGDX. Here you see a path of ghosts that was generated by my implementation of the A* pathfinding algorithm. It took a long time to wrap my head around it but it is a crucial element to the game considering that users will move across the map not only with arrow keys, but by touching/clicking areas on the map (my Android phone has no D-pad). This makes decent pathfinding a must have so I wanted to try to get it out of the way early. The code performs well on the desktop but for some reason takes about 3 seconds to run on my Android phone, which is a serious problem. My choice of data structures or too much memory allocation could be the problem and I need to investigate who the culprit is. I’m using a PriorityQueue and a HashMap to maintain lists, and a Pool (in libGDX) to minimize memory allocation, yet the problem persists.

I’m going to try to keep this development blog going over the course of the month with screenshot updates. Let’s see if I can manage to actually do that.

UPDATE:
Turns out the performance problem was because of how I was drawing the path on screen and NOT the algorithm itself. I have since abstracted away the things that are dependent upon a specific tile map implementation and have a rather generic set of classes to use for pathfinding.

From the blog David Thompson Β» WSU CS by davexunit and used with permission of the author. All other rights reserved by the author.