OpenGL Resources

OpenGL has changed a lot through the years but it seems that many of the tutorials you’ll find on the internet are dated and only cover the fixed function pipeline. I wanted to find more information about programable shaders (glsl), framebuffers, vertex buffers, and many of the other newer features found in later versions of OpenGL. So I’ve compiled a list of good tutorials and sites I’ve found that cover these topics.


Start here first. These tutorials are well written and clearly explain some of the details of OpenGL that seemed mystic to me before. I actually understand the difference between a framebuffer and renderbuffer now!

OpenGL Tutorial

These tutorials include the full source code which is very useful for tinkering.

Anton’s OpenGL 4 Tutorials

He has a large number of tutorials from getting started to some very advanced techniques.

Heroku’s GLSL

This site is full of mind blowing fullscreen glsl effects. Everything runs in the browser and the source code live reloads. It even lets you save your own changes too.

OpenGL 4 Reference Pages

When you’ve exhausted the above sites this is the official reference for OpenGL. It has complete descriptions on all of the gl functions. There are probably many others but these gems have helped me immensely. Let me know in the comments if there are other useful sites I missed.

Posted in Programming

Tags: OpenGL, tutorials, and glsl

Haxe Networking and Bonjour

I’ve been working on a party game for the last few months that requires local networking between iOS and Android. The only problem is that I didn’t want users to have to type in ip addresses. Enter the world of zero configuration networking…

Bonjour has been around for quite a while and primarily works on iOS and OSX, although Apple has provided a Windows library as well. Essentially a program publishes a services over the network that is available to find from any computer on that network. Another running program can then broadcast out a request to find certain types of services and resolve them. If none are found, the program can choose to stop looking or send out another request.

This is all well and good but Android doesn’t have support for Bonjour. Instead someone created jmDNS which is a Java implementation that can talk with Bonjour services, with some minor differences. So now I knew which libraries to use but neither one of them works with Haxe which is the programming language I prefer.

With some help from hxcpp I was able to glue the two libraries together into a single class that can be used on multiple platforms. This solved my problem of finding devices over the network but what about connecting them together?

Haxe has basic socket connection classes, UDP will be in 3.1.0, but no major networking library (that I’m aware of). Using Python’s twisted framework as inspiration I decided to create hxnet. It has simple Client/Server code for both TCP and UDP as well as basic protocol classes for RPCs and Telnet.

The Bonjour class is included in hxnet and it should be flexible enough to add protocols like HTTP, FTP, etc… I’m not sure I’d consider it production level code yet but it’s solid enough for me to build my game with it. If you want to give it a shot the code is on GitHub and feel free to create pull requests if you find bugs or code up a crazy new feature.

Posted in General

Tags: Haxe, networking, twisted, udp, tcp, and hxnet

When setting up a deployment script from git I needed to know what files were recently changed. Here is a useful script that does exactly that. Just change HEAD~4 to whatever commit you want to go back to.

git log --pretty=oneline --name-only HEAD~4..HEAD | sed -E -e '/[0-9a-zA-Z]{40} /d' | sort | uniq

Posted in General

Tags: git, deployment, and script

Do you…

  • develop indie games?
  • get tired of playing (insert title) (insert version) games?
  • enjoy tinkering with consoles?
  • wish you could actually punch your friend while playing a multiplayer game?
  • like playing flash games but wish they were more complex?
  • have a need to be a hipster?
  • feel jaded about the upcoming next-get consoles?
  • hate everything that is bad and love everything that is good?
  • want to play your Android games with a controller?
  • currently have a pulse?

If any of these are true you need to stop reading now and purchase an Ouya.

Seriously… now.

What are you waiting for? It’s $99 well spent.

Posted in General

Tags: Ouya

Ouya Review from a Developer's Perspective

My Ouya arrived a few weeks ago and I thought I’d post a review of it. My experience so far has been generally positive and the system gets better with every update. For $99 it’s worth the price of admission.

Little Crane That Could

There are already a good variety of games for it, around 200, and so far one of my favorite games is The Little Crane That Could. The graphics aren’t amazing and while the controls can be frustratingly hard the sense of accomplishment from completing each of the puzzles is exhilarating. I hesitated to download it at first due to the less than stellar promo art but it is a game you absolutely should try out. My other favorites (in no order) are Polarity, Towerfall, Knightmare Tower, A Bit Of A Fist Of Awesome, Beast Boxing Turbo, and Stalagflight.

Which brings me to what I think is a game changer for the industry, the marketplace. On the Ouya you can try every game for free. It’s a little like shareware back in the 80s-90s when you would get a sampler disk of games and later mail in an order for the ones you liked. This was amazing for a kid growing up in a lower income family since I could try lots of different games at a low cost.

The thing about the store that is completely different from any other marketplace, that I’m aware of, is that prices are not listed anywhere. The game might be charging $1 or $20 and I won’t know until I download and play it. This removes the price barrier from trying something out and seeing what I enjoy. It also diminishes the value of discounts that are so prevalent on mobile stores and the, often loathed by developers, $1 price point.

Ouya Controller

As for the hardware, I am really impressed with the controller design. The triggers feel a bit spongy but overall the controller feels comfortable and evenly weighted. I have larger hands so PlayStation controllers have always irritated me and while I still think the Xbox has a better controller overall I’d say the Ouya comes in a close second (especially given that the D-pad is better). However, if you like the other controllers there are ways to use them on an Ouya. Talk about a win/win.

The actual hardware I’ve heard compared to a turbo-charged PS2. It has more RAM than the current gen consoles which is wonderful for resource loading. The Tegra 3 graphics might not hold up to today’s standards but I’m hoping to see less “realistic” games and more creativity on the Ouya. It really feels like the NES all over again with so many unique games. Except that it’s easier to develop a game now than it was in the past.

Possibly the best “feature” of Ouya is the openness for developers. This is exactly what iOS and Android have provided for mobile and now indie developers have a chance at console development (without selling our souls). The ODK is a bit rough around the edges at the moment but it is no more difficult building a game for the Ouya than it is for Android. I was able to port several of my HaxePunk prototypes over a single weekend. Most of the work was just getting the input to function like I wanted.

Overall my outlook on the Ouya is good. I was one of the last groups to receive my Ouya but I understand how difficult it would be to manufacture that many units as well as plan for a commercial release. That being said, I feel like the Ouya team is fully committed to making this a quality product. The console is well thought out and while there are still rough spots I think that will all get sorted after they are out of the growing pains stage.

Posted in Reviews

Tags: Ouya

TestFlight for Haxe

TestFlight is a great testing tool for iOS apps. I’ve used it a lot at work to distribute builds to multiple devices around the company. It prompts the tester when there is a new update and tracks analytics with checkpoints and crash logs. The only issue is you need to have the SDK installed to get all those goodies.

Since I use Haxe a lot and have been working diligently on the HaxePunk library I knew having TestFlight integration would be a huge benefit. So I finally got the code to a point where it is ready for release and am hoping it proves useful to other people.

The code is located on GitHub at You can also get it through haxelib by typing the following in your command prompt.

haxelib install testflight

Posted in General

Tags: Haxe and TestFlight

I participated in Ludum Dare #23 this past weekend with over 1000 others. It was a fun experience and I was able to chat with some great guys on the HaxePunk forums/IRC. Unfortunately my time was divided between LD and several other events over the weekend but I’m happy with what I ended up with. Check it out!

What went right

  • Built on a simple concept
  • Used tools I was familiar with (HaxePunk, MilkyTracker, Sublime Text 2)
  • Had a working game with objective in the first few hours
  • Used a real mouse for drawing instead of a touchpad

What could have been better

  • My power was out for 2 hours
  • I had several other events to attend over the weekend (besides church)
  • The sound effects were last minute

Next time

  • Have a laptop with a good battery (mine lasts 20 minutes…)
  • Participate more in topic selection and blog posts

Posted in Post Mortems

Tags: HaxePunk and ludum dare

What Happened to Text Adventures?

I came into possession of an Apple IIc that was in great condition this past year. It has several programs and a bunch of games with it. Having grown up with a DOS computer as a kid I wasn’t entirely familiar with the Apple II but it was simple enough to boot up. The screen flickered and gave off a green tint, no color, but I realized quickly there wasn’t an operating system… So I started sifting through the stack of 5 1/2” floppy disks to find the game I wanted to play, Zork.

In terms of quality, Zork is not the best text adventure, but it is probably the most well known. This was the first time I had played the game and what better way to experience it than on an old piece of hardware. You start out in front of a house and have the options of going several directions. I type in the direction I want to go, and within a few turns find myself lost. I’m in a forest somewhere and start to think the house has vanished. I guess it’s time to practice my cartography skills.

Grabbing a fresh sheet of paper I start drawing boxes with the names of each location in them. There are lines shooting out of each rectangle in all directions and it looks more like a plate of spaghetti than a map. So I pull out another sheet of paper and clean up the lines. Now it’s starting to make more sense… and I found the house!!

I open the side window and climb through to the kitchen. Hopefully no one cares that I’m breaking in. I go up to the attic to look around but there isn’t much to see because it is dark and I don’t have a light. A couple more turns and I end up dead, eaten by a grue if you want to get specific. Death is a bit strange in Zork because you can still explore but there is no way to interact with the world. So I restart the game and find myself in front of the house again. At least I know where it is now.

Zork I box art Back in the house I reveal a trap door under a rug. Of course it takes several minutes to move the rug by typing every verb I can think of. After opening the trap door I descend into a cavern and turn my light on to begin exploring. There are a ton of rooms and a thief frequently pops his head in a room from time to time. He doesn’t seem to bother me much but he did nick a painting from under my nose. I wander around for a bit before confronting a troll. He takes a couple swings at me and BAM! I’m dead again.

This time I was smart enough to save so I manage somehow to defeat the troll, by typing attack repeatedly, and make my way into a maze. After a bit of walking around I realize I am really lost and start dropping my stuff in each room to try and figure out where I’m at. The only problem with that plan is the thief has the bright idea to pick up my stuff. Isn’t he lost too? I think I’d better reload and go down a different path.

Several hours later I end up draining a body of water, stop myself from exploding, and find myself in front of the house again. This game is like a really big loop. I sweep through a couple of time to grab stuff I missed and end up finishing the game. I’m not sure I actually won but there isn’t much else to do at the end.

I feel quite satisfied with my experience and I am fascinated by how rich the world seemed when in reality it was just a bunch of text on a screen. Most modern games fail to provide this deep of an experience although I would say Bioware and a few other companies have come a long way in telling rich stories. Why don’t text adventures exist today?

You could argue that gamers today are lazy and don’t want to read anything. This may be true to some extent but I think it is an outcome of how games have evolved. You might come from a different angle and tell me that interactive fiction is still being written today and that it’s not dead at all. But let’s be serious, how many people are really playing these games? They have the exact same flaws that existed 30 years ago.

I’m not claiming to have a silver bullet but I do believe that interactive fiction, or IF for short, would have a larger audience if we threw out some of the antiquated elements. Think of all the people who enjoy reading literature, whether on paper or in digital form, and how many of that group are aware that IF even exists. But we’re getting ahead of ourselves, just what killed text adventures?

The Parser

Anyone who has ever played an IF game, used voice recognition software, or any other form of natural language parsing will know how infuriating it is to get a computer to understand you. Even if NLP improved ten-fold there will still be subtext it won’t understand. Think of how many ways you can say the work “pick up”. (Take, retrieve, lift, grab, swipe, etc…) Not to mention the multitude of ways you can form a sentence.

What I don’t understand is why the parser is such a sacred cow in IF. When text adventures were first written the only input device was a keyboard. Graphics were primitive and slow. Mice existed but were the ball kind that used to get sticky and stop working. It is no wonder Infocom and others decided to use the keyboard to input commands in the form of simple sentences. But why are we still doing that today?

You could argue it has to do with immersion. Although when I read a book, which requires no typing that I’m aware of, I feel more immersed in the story than if I’m writing a sentence for the eighteenth time because the computer didn’t fully understand what I was saying. Unless it’s a story about how I throw the computer out the window.

Amazingly enough we have a medium that is perfect for text adventures, the web. Imagine highlighted text you can click to get a list of applicable verbs. The advantage to this approach is that I instantly know what I can interact with and what I can do with the object. This may not be a new idea but the best part is we can get rid of the generic feedback systems that are commonly found in IF games.

Directional Movement / Filler rooms

The standard movement in interactive fiction games is to specify which cardinal direction you want to go. The player will then exit the room in that direction, if possible, and be given the description of the next room. While this form of movement certainly works, it has its flaws.

This is actually more of a design flaw than actually technical. Early IF games had a tendency to create mazes by connecting exits going north to exits going southwest, instead of direct opposites. Normal people assume that going north would mean that you could then get back to that room by going south. This could further be circumvented by simply listing the name of the next area and traveling to it. How many times in books does it say that someone went north from the kitchen to the living room? Can’t we just go directly there instead of having to specify the direction?

The other issue with cardinal directions is when designers try their best to keep everything to a grid. This ends up creating a bunch of filler rooms that have identical descriptions to the last four areas you’ve been in. Note to IF designers: if there isn’t any purpose to the room, leave it out. Heck, this rule is followed by most decent modern games.

Unsolvable puzzles

Actually I was surprised that most of the puzzles in Zork were fairly simple and only a few times did I have to look up how to do something. But I feel it is worth mentioning because this is the same reason I feel point-and-click adventure games died. Puzzles can still be hard but at least be realistic, there are some really ridiculous puzzles put into adventure games.

I honestly think that this genre can be revitalized and there is already a niche group of people who play IF games. The problem is, the genre has been stagnant for at least 20 years. It doesn’t mean we have to reinvent the wheel but look what indie developers have done with platformers, there are tons of various FPS games, role playing used to be strictly turn based but now even Final Fantasy is more of a hybrid.

Graphics have come a really long way through the years but it doesn’t leave much to the imagination. Written words still have the power to evoke strong emotions and maybe the addition of voice overs would lower the barrier. One of the most interesting game experiences I’ve seen in a while was Dear Esther which was purely a discovery game.

I will step off my soap box now and let you decide what you think. What other improvements could be made to the genre to make it appeal to a new audience. I would especially love to see an opportunity for mobile games, or even Nook/Kindle. Am I just blowing hot air or do you think text adventures have a chance in the modern world of gaming? Feel free to leave your own comments.

Posted in General

Tags: games, text adventure, and Zork

Updates to HaxePunk

A few weeks ago I decided to continue development on HaxePunk. It was spurred by some updates made to GitHub as well as interest in the forums. For those unaware of what HaxePunk is, it’s a game engine written in Haxe that can run on multiple platforms. The largest benefit is that it will compile natively for mobile devices as well as the three major PC platforms (Windows, Mac OSX, Linux).

The first thing I changed was how the project was structured. It used to be where you had to clone the repository from GitHub, install SamHaxe and Haxe, and use the FlashDevelop project. This worked for Windows developers but since I like working on my Mac I wanted a different process. Now you get the engine through haxelib and can use any editor you want.

Secondly there was an issue with the way assets were handled. Last year the best asset embedding tool was SamHaxe but since then NME has gained traction and become a decent platform. I switched everything over to NME (still supporting SamHaxe and SwfMill) and haven’t looked back.

Screen resizing is now supported which is useful for fullscreen flash games and games that run on different device resolutions. It’s not perfect but in the coming weeks there should be some improvements made to it.

Instead of boring you with more details, go check out Haxepunk now.

Posted in General

Tags: Flash, iPhone, Android, and HaxePunk

Need an idea for a Christmas present?

Last year I made a video game for my family to play on Christmas. I didn’t have much money at the time so it was part of my gift to everyone. It ended up being a simple board game where tokens moved forward on a timeline, the past year, and the goal was to reach the end. Once everyone made it to the end of the game it would tally up memory points and determine the winner.

The memory points were gained by landing on event spaces. There were 10 major event spaces and 15 minor event spaces. The major events had something to do with our family in the past year like when someone got a new job. The events were placed in the timeline in the month it occurred in (each month having 10 spaces). Minor events were just generic things like buying a cup of coffee or having to shovel snow. They could add or subtract to your score while the major events only added.

Other spaces included move ahead/backward squares and lose a turn. It’s generic to most board games but added enough variety to make the game fun. It was all done on the computer so I stored the board layout in a file and loaded it at the beginning of the game. That made it easier to test different layouts.

To move our tokens I decided to use physical dice instead of randomly generating numbers on a computer. This allowed me something to give my family before showing the game to pique their interest. I also did it this way so that my parents felt they had control. After each turn, I simply input the die roll into the computer to advance the game.

Overall it might have taken me a week or so to get the game done in my free time. The result was something that my entire family enjoyed and let us reminisce the past year. If enough people are interested in the project I might consider putting it up on GitHub.

Posted in Game Design

Tags: Board Game, Java, and Christmas