Articles

HaxeFlixel on Arch Linux

I've been meaning to play around with HaxeFlixel for a while now. I've heard that it's great for rapid game development and can easily compile to several platforms. Today I decided to start digging in and give it a shot. Getting everything working on Arch hasn't been completely straight-forward so I figured I'd write a blog post about my experience in the hopes that it will help someone else in the future!

To start off, you'll need to install Haxe. Arch makes this part pretty easy but there are a couple of gotchas:

$ sudo pacman -S haxe
$ sudo mkdir /usr/share/haxe/lib
$ sudo chown USERNAME /usr/share/haxe/lib
$ sudo mkdir /usr/lib/haxe

/usr/share/haxe/lib is where we'll be installing our Haxe libraries. I opted to make my user the owner of that directory so I could avoid using sudo to install & switch versions of libraries. /usr/lib/haxe is where haxelib tries to place scripts etc... I'll come back to why that's important later.

Next you'll need OpenFL. This is where the complication begins. The current version of HaxeFlixel (4.1.1) does not support OpenFL > 3.6.1. To install 3.6.1, we can do:

$ haxelib install openfl 3.6.1
$ haxelib run openfl setup

This step will probably ask you for your Haxe library path. For me, the default was /usr/share/haxe/lib and that was fine with me. This will also install some other stuff.

Lastly we need to install HaxeFlixel:

$ haxelib install flixel
$ haxelib install flixel-tools
$ haxelib run flixel-tools setup

The last step will ask you if you'd like for it to place a flixel script in /usr/bin. If you did not create /usr/lib/haxe in the previous steps, this will fail. At the end, it will ask you which IDE you're using. I don't use an IDE so I selected the "None" option.

Everything should be installed now. It's a good idea to check & see which versions are installed/active:

$ haxelib list
actuate: [1.8.7]
box2d: [1.2.3]
flixel-addons: [2.1.0]
flixel-demos: [2.2.0]
flixel-templates: [2.0.2]
flixel-tools: [1.1.3]
flixel-ui: [2.1.0]
flixel: [4.1.1]
hxcpp: [3.3.49]
layout: [1.2.1]
lime-samples: [2.6.0]
lime: [2.9.1] 3.0.3
openfl-samples: [4.0.0]
openfl: [3.6.1] 4.0.3
swf: [2.2.3]

As you can see, I'm running lime version 2.9.1 and openfl version 3.6.1. That's perfect. If for some reason your current version is incorrect, you can fix that with:

$ haxelib set openfl 3.6.1
$ haxelib set lime 2.9.1

At this point, the HaxeFlixel Getting Started page has you create a 'Hello World' application. If you have flash installed, testing your application with lime test flash should work just fine. Unfortunately lime test neko yields unpleasant results:

$ lime test neko

export/linux64/neko/haxe/ApplicationMain.hx:205: characters 57-75 : Warning : Use programPath instead
export/linux64/neko/haxe/ApplicationMain.hx:89: characters 42-60 : Warning : Use programPath instead
Called from /usr/share/haxe/std/neko/_std/EReg.hx line 200
Uncaught exception - load.c(237) : Failed to load library : ./regexp.ndll (libpcre.so.3: cannot open shared object file: No such file or directory)

My "gross" fix for this was:

$ sudo pacman -S pcre
$ sudo ln -s /usr/lib/libpcre.so /usr/lib/libpcre.so.3

That's definitely not an awesome solution to the problem and could cause other issues down the line but for now, it has resolved the issue for me. At this point, I was able to run the 'Hello World' application just fine!

I'm sure there will be other gotchas down the road. As I come across them, I'll attempt to document them here!


Game bucket list and Metroid Fusion

I recently added a new page to my website - video game bucket list (which I have since removed again). There are a lot of games that I've "been meaning" to play or "been meaning to finish" for years. The list is so long that it has gotten hard for me to keep track of. I've decided to keep a "video game bucket list" and actively try to whittle it down.

With August being Metroid's 30th anniversary, I figured I should play a Metroid game. I had initially wanted to start with Metroid: Zero Mission - a remake of the original NES Metroid game - however I did not have a copy of it and couldn't easily track one down locally. That lead me to the fourth game in the Metroid Series - Metroid Fusion.

The plot is quite intriguing. Samus, while exploring SR388 with a survey crew, unknowingly becomes infected with something called the "X parasite". It turns out that the Metroid of SR388 were the X's natural predators. Without Metroid, the X has run rampant. Using a vaccine made from the cells of the infant Metroid from Super Metroid, the Galactic Federation is able to conteract the damage caused by the "X parasite". Parts of Samus' infected suit were surgically removed & sent to the Biologic Space Laboratories station for research which lead to the X rampantly taking over the station. Samus is then sent to investigate.

I always have a hard time getting drawn into games at the beginning. They're usually too wordy with their narrative or overly boring. Metroid Fusion did a great job of giving me just enough story mixed in with lots of awesome action! Most Metroid games are known for their "alone" ambiance. Without going into spoilers, I'll say that Metroid Fusion does a good job of accomplishing that same feeling while also incorporating an almost horror/panic feeling. There were a few parts that absolutely got my heart racing!

Metroid series games - specifically the boss fights - can be difficult for some casual gamers. I feel like Metroid Fusion was just right. There were a few bosses that took me several tries but generally I felt like it was always a fair fight. The bosses that I found the most difficult/frustrating were:

Security Robot B.O.X.

This fight took me a while because hitting the middle part while it was frantically running around was difficult. Naturally you have to fight this boss twice =\

Gedo X

Gedo X is a giant spider that diagonally moves up and down the screen. If it catches you, it will slowly drag you up the screen while sucking the life out of you. Once it gets to the top, it slams you down to the ground doing significant damage. It took me a while to figure out how to keep it from picking me up. Pro-tip: use morph ball in the corners when it's close to the ground.

Nightmare X

This boss took me several tries to beat. During parts of the fight, he will chase you around the room trying to slam into you doing large amounts of damage. I never quite got the hang of his movement in that part.

Neo Ridley

Ridley was difficult for a different reason. He takes a MASSIVE number of super missiles to defeat. My maximum missle capacity before this fight was 115 and I had a little over half of that available to me (mid 60s). It wasn't enough! After getting his AI movement down & beating the crap out of him, I ran out of missiles! NOT GOOD! I ended up needing to spend about an hour farming missiles in a nearby room to defeat him. 115 was JUST enough. When the fight was over, I literally had 0 missiles left.

Playing at the optemetrist is hard!

I managed to beat Neo Ridley while waiting at the optometrist (before they dilated my eyes haha). AS SOON as I beat him, they called me back into the exam room and I didn't have time to get to a save point! I turned the volume down & just jammed it in my pocket. The picture above was taken when I finally got the chance to save!

Only 35%?!

As you can see, I only managed to gather 35% of the hidden items. At the beginning, I didn't really do a lot of extra exploring & that probably cost me a lot of extra missile upgrades. Metroid Fusion was a lot of fun and I'd definitely play it again! Maybe I'll play again some day & explore more!

Last night I started playing The Legend of Zelda: A Link to the Past - the GBA version. That'll be the next game knocked off of my bucket list!


Cutover time!

I've mostly finished converting my old HTML posts to markdown. There might be a few errors here & there. I plan on proofreading them gradually & correcting any errors that I missed. There's one post (getting telegram working in bitlbee) that I haven't converted yet because it's going to be more of a manual process. I'll hopefully get to that tomorrow.

I've move DNS for nathan.chowning.me & nathanchowning.com to point here now. If you're seeing this, Hello!


New site, less problems

It's no surprise that I've been neglecting my site & blog for a while now. Life has been a bit crazy. I'd like to start writing blog posts again. I have a few ideas for some technical blog posts. Hopefully those will materialize soon.

You might notice that the site is changing quite a bit. My previous design was a 'from scratch' blogging platform using the Django Python web framework. It was generally functional but lacked some features & had a few bugs that were annoying to deal with. It seemed like I was working on my blog's code more than I was writing blog posts.

I've decided to stop reinventing the wheel & use something a bit more robust - The Pelican Static Site Generator. Eventually I plan on designing my own theme but for now I'm using a very nice theme called Flex which was made by Alexandre Vicenzi. I like this theme quite a bit so I'm not really in a huge rush to replace it.

My first goal is to get all of my previous blog posts moved over to this new platform. Pelican supports HTML and Markdown so I should be able to forklift most of them. I'll just need to add metadata.

That's all for now!


Disabling ~/.mysql_history logging

If you haven't heard, there was a nasty Firefox vulnerability discovered last week. The "tldr" is, malicious ads were able to read the contents of local files on your computer. According to Mozilla, there exploit leaves no traces behind so you can't really know if you were a victim. The jury is still out on whether or not ad-blocker software would have saved you either.

This situation has made me reevaluate some of the bad computing habits that I've formed over the years. This post is about disabling the mysql client's logging to ~/.mysql_history. It's easy enough to empty the contents of ~/.mysql_history after adding a user or some such "sensitive" query... but that's also easy to forget. It's easier/safer for me to just disable the client logging entirely. There are two ways to accomplish this. The first (and probably easiest):

ln -sf /dev/null ~/.mysql_history

The other way is by setting the MYSQL_HISTFILE environment variable to /dev/null:

export MYSQL_HISTFILE=/dev/null

I prefer the symlink approach since it didn't require me to update any of my dot files etc...