Guild Wars 2 + F.lux

There’s an awesome utility called F.lux which automatically tweaks your monitor colors throughout the day, to make your display easier on the eyes. The problem is, it doesn’t work with fullscreen games, by default.

Luckily, there is a cool utility called Color Clutch which was created as a way to get around the fact that Windows desktop color calibration doesn’t apply to DirectX fullscreen mode. It accomplishes this using function hooking, so it won’t work for all games (games with strict anti-cheat detection will get a false positive on it).

To get this working, just download Color Clutch from the website above. Create a batch file with contents like this (you will need to use the correct paths):

inject.exe "D:cclutchcclutch_ix.dll" patch "C:Program Files (x86)Guild Wars 2gw2.exe"

Now, just run that batch file when you want to launch Guild Wars 2.

If the game you want to use F.lux with is using a different version of DirectX, you’ll need to modify the batch file to point to a different version of ccluch_*.dll – easy enough.

Pixel Scaling (Nearest Neighbor, Scale2X, HQX)

I decided to get HQX to compile on Win64, so it can be used by sprites. The author didn’t reply to my email, so I just decided to hack it up. It’s open source, after all.

It wasn’t too bad, just a bunch of random tweaks to get it to compile using visual studio instead of MinGW. So, since there was already some code sitting around for the Scale2X algorithm, I took a few screenshots to see how they compare with Nearest Neighbor scaling.

Nearest Neighbor

Nearest Neighbor





I can’t really decide which I prefer. Nearest Neighbor always looks a bit too jagged for my tastes, but some sprites don’t look right with HQX. Scale2x does a good job retaining the classic look, but it’s not without artifacts.

There were a few researchers at Microsoft who wrote a paper on a really cool scaling algorithm, called Depixelizing Pixel Art. The sad part is, they didn’t release any source code or a library. So it’s pretty much just something to look at and say “Oh. That’s nice. Too bad none of us can actually use it” ..

I’d love to give their algorithm a shot to see how it stacks up against the others. I honestly don’t know what the point is to create an elaborate algorithm and presentation, then do nothing with it. Maybe it has some use case at Microsoft, I suppose.

So, which do you prefer? Do you have a favorite scaling method outside of these 3?

Sprites application, with source code

I’ve put together a new site, with a forum and source code, for my goofy sprites program:

The project has ended up being a good demonstration for using node.js to host a server for C++ clients. The sprites program uses a node.js server to automatically pair up anyone running the program, so sprites you throw off either side, top or bottom, of your desktop are thrown onto another person’s desktop. The network topology is generated by the server using a novel match-making algorithm. It’s pretty fucking cool, actually.

There have also been a great deal of Windows programming nuances to get the layered window animations working smooth as butter. The whole thing is optimized to perform well with over a hundred sprites at a time. This is done via caching all the animation data, deferring window repositioning, synchronization with DWM refresh, and other techniques.

Anyway, download it, install it, register for the forum and give some feedback IF you don’t mind. It’s a very young project and really benefits a lot from feedback and people trying it out.

If you happen to be the first person to see this blog post and install it, you have the unique opportunity to flood my desktop with a metric ton of Mario sprites. Otherwise, you still have the opportunity to flood some random other person’s desktop, but just be prepared to expect the same in return 😛


Fix for multiple monitors with fullscreen games

There’s a pretty annoying issue that happens in windows when you are playing a game in fullscreen on one monitor, and have a second (or third, fourth) monitor with other stuff open on it. If your game is playing at a resolution that is different than your normal desktop resolution on that monitor, everything gets all moved around on the other monitors.

To fix this, I wrote a tiny utility program which you can run before you start the game, and it fixes this behavior by calculating what the correct location should be for all your windows and moving them there. It’s useful if you like having IM windows open, notes or a web browser, etc. You can’t interact with those programs while you’re in the game, but at least you can *see* them (for example, if you have a strategy guide or map, etc open)

Of course, I’m not responsible for any damage this program does to your computer. I’ve tested it a fair amount, but it’s entirely possible somebody with an unusual setup could find a situation where you may lose a program’s window due to it being positioned in the wrong place.

Let me know if this is useful, I’ll try to improve it and turn it into a proper project.



autoblitz + source code

Since some folks have expressed interest in trying this bot for themselves, I decided to share the source code and binary 🙂

It’s not perfect, but you can tweak the source code (for example, changing how long rp_thread::sleep() is called, and where), and probably get some better performance. If you’re up for a challenge, you can also try to improve the code that decides on the next move! (if you do, it’d be great if you shared the changes!).

Anyway, here is the zip file. [ ]

The binaries are in the export directory. You will be asked for a “hWnd” (window handle), which can be found using the program “Spyxx” which comes with visual studio.

Game playing AI bot

Every once in a while a silly idea grips you and you decide “Screw it, I’m going to do it”.

That happened with me with a game called Bejeweled Blitz on Facebook. My friends online have been competing for high score for the past few weeks. I got to thinking…”How hard would it be to write a program to automate playing this game..?”.

This is the result of that question. It took a few days at a few hours per day. Probably about 6 hours combined time. Right now the bot is able to play pretty well. It can do better than I can most the time (although my high score currently beats the bot’s high score). With some improvements, I expect that will dramatically change.

Anyway, here’s a video of the program in action.


The autoblitz bot just scored 258,400.