# Creating a Code Profiler in Haxe Using Macros

Haxe macros are said by many to be "black magic", and in some ways they are—macros in Haxe are actual Haxe code (rather than macros in C/C++ for example, which are just fancy pre-processor directives). Macros are undoubtedly the most advanced feature of Haxe and probably the hardest to grasp, however I think a major reason for that is a lack of really solid documentation on the subject. To me, the Haxe docs regarding macros are somewhat obfuscated and leave something to be desired, and unfortunately there's not a lot of other resources online. This is what led me to embark on my own journey of learning Haxe macros, and hopefully starting to shed a little more light on their mystery.

I had some trouble getting this example off the ground, so I would like to thank ousado for helping me out on the Haxe IRC. Haxe is truly a great and supportive community, and if you're ever stuck with something I strongly encourage you to pop on the IRC—you're bound to have someone help you out!

# A Unity 4.6 UI Shader to Ignore Depth Testing

I've started using Unity again for some 3D development with Google Cardboard and have been using the new Unity 4.6 UI (which I think is great by the way). Specifically, in order to get UIs rendered for the user in the 3D environment, I needed to place text on a canvas set to World Space (parenting the canvas to the camera, so that it tracks with the user's head motion). This places the UI in a physical space, which works well for the 3D view but doesn't work well for a HUD where you need it to always be displayed over everything.

After some searching around and not finding a fix, I ended up modifying the default Unity UI shader to ignore z-testing; I've shared it here in case someone else runs into the same issue!

# A Platform Agnostic Thread Pool for Haxe / OpenFL

With modern hardware utilizing multiple cores, it can be highly advantageous to do as much parallel processing as possible. I think the most elegant way of doing this is to use thread pools which allocate tasks to a limited number of threads. Unfortunately, multi-threading support isn't fully implemented in Haxe—but it is on the neko and cpp targets, so I wrote a simple thread pool to take advantage of multi-threading on those platforms!

# AutoTileGen Rearranger

I somewhat recently came across AutoTileGen by Pixelatto—a tool for rapidly creating "blob pattern" tilesets from just three input images. It seems like a pretty good tool, at least for a quick rough-in of tiles. It just has one major flaw—the tilesheet that it outputs is all mangled:

# Swept AABB Collision Detection Using the Minkowski Difference

Continuing on from yesterday's post where I explored detecting discrete collisions using Minkowski differences, today I'm going to talk about detecting continuous collisions using Minkowski differences (again, focusing solely on axis-aligned bounding boxes). Continuous collision detection is essential in any game where you have fast-moving objects and/or low frame rates. It adds slightly more complexity to the discrete collision detection algorithm, but the advantages far outweigh the costs in this case!

# Simple AABB Collision Detection Using the Minkowski Difference

Since I've started on an adventure to start creating my games with Haxe and OpenFL, I found myself in need of some collision detection. I don't really need anything as fancy or extensive as Nape, and although the HxCollision library is a pretty solid Separating Axis Theorem implementation, it doesn't deal with swept-collisions, which is a bit of an issue for games (without swept collisions, any lag spikes can easily cause objects to pass right through objects!).

With some simple requirements in mind, I started Googling, and came across a method of using Minkowski addition to detect collisions. It turns out this method is super fast and very easy to compute for axis-aligned bounding-boxes (AABBs), which is all I'm going to focus on for now. This point is also only going to focus on discrete detection (whether or not an AABB is penetrating another object, regardless of velocity). I'll do another post on using this method with swept collisions when I have that sorted out.

# Setting Up OpenFL and MUnit To Use Test Driven Design in Games

I recently discovered the Haxe language, which when combined with with OpenFL, can produce some pretty great things (for example, Papers, Please was developed with Haxe + OpenFL). I've also been reading about Unit Testing and Test Drive Development and how it can greatly improve not only the quality but also the efficiency of the code you write. This seemed like a perfect opportunity to learn some new things, so I've decided to start developing some games using TDD in Haxe!

Before I could do that, however, I had to figure out how to get MassiveUnit (munit) set up, which was a bit trickier than I was expecting. Hopefully this guide will help others who stumbled with the process!

# Better Beamer Themes

I love LaTeX for typesetting all my documents. A lot of people don't understand why, but that's a discussion for another time. One thing I've always been hesitant to use LaTeX for is presentations - the main LaTeX package for making presentations is Beamer, and although it is extremely functional, I am firmly of the opinion that all the default themes are butt ugly and there are barely any other themes out there. Thankfully, Beamer themes are very easy to create from scratch!

# Futuristic Office Pixel Art

I created these tiles for a MiniLD that I ended up simply not having time for and never got much more done on it than making these tiles. So here they are, in all their 8x8 pixel glory! You can also download it on OpenGameArt.org from my profile.

# Changing The Audio Track of a Video with Avidemux

Avidemux is a handy program for dealing with video files. It can even do batch operations easily enough — that is, if you can figure out how. The documentation for doing any sort of batch job is absolutely terrible. I have a few videos that have a few different audio tracks. Three, to be precise: Russian, English, and a third "unknown" one. Whenever I would play these, it would play them by default in Russian (I would have to manually change the audio track for each file), which is not helpful to me at all. I needed a way to batch change the default audio track (or even just strip the Russian out) for all the video files. Enter Avidemux.