5 things I’ve learned from making a game

For a little bit more than a year now I’ve been working on and off on a simple, multiplayer, browser-based game called Archers!. I’ve deliberately set it out to make a simple multiplayer game as I was afraid anything more complex would be a timesink that I would eventually abandon. I’ve managed to meet the initial requirements and then even added few features but unfortunately the game I’ve made is, quite frankly, dull and boring.

Now that the core-mechanics is done, the game is just about playable and I’ve got some feedback based on running few multiplayer sessions. I’ve made a decision to open-source the project hoping that either game as a whole or at least some components of it will be of use to someone. It has never been a goal to release it as commercial product but I hoped I would be able to put more effort into polishing the game. However the 80/20 rule (see below) got me and I’ve decided to leave the game as is and chase other game-making opportunities. That being said, the time I’ve spent making this game is far from being wasted! In this post I’m going to share lessons learned from making “Archers!”.

(more…)

Automate all the Javascript things! (Part 1)

Automation can save you loads of time whether you apply it to your every day chores or to your development workflow. In this article I’ll focus on the latter, describing some of the common technics focusing on development in JavaScript (both Browser and Node). Let me just stick an obvious, cheesy meme here:

Automate All the Things

(more…)

Hacking League of Legends HUD

Don't care how, just want it done? Link + instruction at the bottom of this post

Whenever I’ve joined my friends for an occasional game of League of Legends I’ve been irritated by the fact that game won’t let me customize my HUD so I can play efficiently on my triple screen Eyefinity setup. LOL will happily render on 5760x1080px resolution, however you’re stuck with map on the far right and character screen on the far left:

Screen02

One night I’ve decided it would be a nice challenge to try and fix this. About 6 hours later the first version of a LOL Hudfixer has been born. I’ve played few games using this hack and have encountered no problems so far. It has been an exciting experience to reverse-engineer some of the logic used in the game, I’ll try to outline my findings/approach in this article.
(more…)

Running Linux on 2012 Macbook Pro Retina

I needed a new laptop so I’ve decided to check whether I could find one that could fully replace my power-hungry desktop and at the same time get decent mobility. My desktop is a high-spec gaming rig with three full-hd screens dual booting Linux and Windows. Can you pack hardware and battery powerful enough to match that into a small pizza box?
(more…)

10 super powers for your shell

Still using Bash? It’s cool, though you might want to switch to zsh and give your shell some super powers! Give it a shot, you’ll love this!

You might have been advised elsewhere to use the zsh-newuser-install but I wouldn’t recommend that. While the intentions of this little program are very good, it scared me off from switching to zsh in the past. There is a much better way thanks to a community-driven zsh framework oh-my-zsh. This wonderful framework will configure your zsh with super powers collectively build based on experience of the community. Not only that, it will allow you to select more esoteric super powers as plugins. Even better, it will allow you to select one of more than hundred themes that delivers super powers to your prompt. Excited? Read on.

(more…)

Ninja SVG sprites

Traditional image sprites for web are done using png or jpg files where multiple small (raster) graphics, often icons, are merged into a single image file to save on file size and reduce amount of http round trips required. This works great unless you want to scale your icons. Wouldn’t it be great if you could have spritesheet full of scalable vector graphics? Just imagine how you could enhance your responsive design? Sadly you can’t do sprites like that. Or can you?

In this article I describe various methods of creating svg sprites, provide examples and outline browser compatibility.

(more…)

The quirks of JavaScript

Developers from my team come up with a rather interesting challenge to produce a small piece of JavaScript code of which output would be impossible to predict for a non-JS developer. Obviously we’re talking about human-readable i.e. no obfuscation. Here is what we’ve came up:

(function() {
    logMe();
    var logMe = function() {
        console.log('Jesus, George, it was a wonder I was even born.');
    };
    logMe();
 
    function logMe() {
        console.log('Great Scott!');
    }
    logMe();
 
    console.log(parseInt('010'));
})();

Can you predict the output? You can find some good hints in my article listing common JavaScript interview questions.

(more…)

Why can’t all software be like Sublime Text?

Most software sux, but there are exceptions, gems that make me believe that not all is lost. Sublime Text 2 is one great example (and I don’t get paid to say so). There are great many places online where you can learn about its features, this post isn’t one. I want to focus on what makes Sublime Text make me love it when I hate most software:

It’s sophisticated yet simple. In its core it’s just a text editor. Yet it has tabs, colored syntax, auto-complete, excellent regexp support, go-to-definition capability, snippets, multi-line selection and million other features that make you love it. It’s all there but it doesn’t manifest itself unless you say so.

It’s centered around you and your work. It doesn’t enforce it’s own workflow (think ‘create project’ from some IDEs). It doesn’t ask stupid questions (try closing an editor with 10 unsaved documents, you will get 10 stupid dialog boxes, 0 in Sublime Text 2). It remembers where you left your work and just gets there when started again.

It’s blistering fast. It pops up immediately – no splash screen, no questions asked. It opens and parses 150K lines of xml in just below 3 seconds (and that’s on my non-SSD PC!) and you can edit and navigate it smoothly without waiting for anything.

It’s extensible. There are hundreds of plugins and you can write your own if you know python.

It’s truly cross-platform. I’m regularly using Sublime Text 2 on Linux and Windows, with exception for some key-bindings it’s exactly the same piece of software. And a single license covers them all!

It’s elegant.

Other software like that: Blender, Firefox, Chrome, XBMC… Gosh why this list is so short?

wtf happened to software?!

Gosh I hate what happened to software. I really do. When did it all happen? Let’s take windows for an example: Why all of sudden to use windows you need at least 2 firewalls, an anti-virus and a rookit detector. Why every time you start something else than Internet Explorer you have to confirm that you indeed intended to run this application and yes it should be allowed to connect to the internet in both home and office network and yes public network too! Why every single app all of a sudden needs to add something to one of 10 places where windows keeps ‘autostart apps'; or sneak in a shitty toolbar plugin to spy on my every action; or at least change my default search engine.

Similar revolution happened to PC games: You need to download Steam, Origin or other spyware, create an account to play a single game these days. Origin takes 5 minutes to start on a well-spec gaming rig and Steam will fuck-up my game every time an update is release. And once you get through all this crap a small fluctuation on your network connection will stop you from playing thanks to our new friend DRM. This is supposed to stop piracy they say, but hey it has been on the Pirate Bay day before the official release day and Razor 1911 made it EASIER to install the damn thing than the distributor itself. Put the disc in, double click razor_install.exe, select path, click OK, grab a drink, play.

Another thing – programmer’s best friend – the IDE (or a very clever editor). My programming environment is like a temple so I can’t stand one that takes 20 seconds to start like Eclipse does, or one that crashes every 30 minutes like Komodo does. Since I’m using different operating systems it can’t be platform limited like Visual Studio and hey I appreciate the fact that your vim/emacs can do all that Eclipse does but I don’t have 10 years spare to learn all the magic nor I really want to use a command-line text editor 40 years after Apple stole GUI from Xerox.

Sometimes I find myself thinking that I should have become a monk; find myself an isolated cave in Himalayas and spend rest of my life searching for inner peace. Yet they don’t have 3G up there so I’ll stick to my software engineer career.

10 Advanced JavaScript Interview Questions

Whether you’re looking to prepare for an interview for JavaScript role, you’re an interviewer looking for inspiration or you just want to evaluate your JavaScript knowledge here are 10 advanced topics that a software engineer working with JavaScript should be able to answer. Bear in mind that answers here are kept minimal, there are lots of caveats not mentioned.

(more…)