Posts tagged with “Random Thoughts”
Now that I've calmed down a bit after my The State of HTML5 Audio article, let's see if can actually write something productive.
Here's the deal: for a typical game you may have a sound effect that you want to play very often. In Biolab Disaster the sound of your plasma gun is such an effect. This particular sound has a length of 0.6 seconds, but you sure can mash the shoot button quicker than 1.66 times per second – so to not interrupt the plasma sound each time you press the button, but instead play a new sound we need to have multiple sound “channels”.
Read complete post »
When I started to work on my JavaScript Game Engine back in October 2009, the biggest problems I encountered were with the new HTML5 Audio Element. The Canvas Element already worked nicely in all browsers that supported it at the time, albeit some were a little slow.
Now, in 2011, the rendering performance for Canvas has been improved dramatically, audio however is still broken in large parts. I think it is time for a change in tone. Be warned, there's some profanity ahead because HTML5 Audio is still that fucked up.
Before we start, you may want to play a quick round of Biolab Disaster or Z-Type and have a look at a simple test case to experience the sound issues first hand.
Read complete post »
It has been a month now that I launched my JavaScript Game Engine. My decision to charge for licenses to use the Engine has been met with a lot of discussions to say the least. People told me I would sell thousands of licenses more, if I had "dual licensed" Impact under the GPL. Some told me I was doing the right thing and putting it under GPL would be a bad idea. Others called me a scammer for charging for something that I had previously advertised as free (which I did not).
So, with all this controversy how has it been going? Quite good actually! In the last 31 days I sold about 150 licenses for Impact. After the initial hype died down, I'm now selling 2 or 3 licenses a day.
In these 31 days I also made about 700€ from AdSense banners that I put on the Biolab Disaster page and later on the Z-Type page (the first few days after Z-Type hit Reddit's front page it was ad-free).
So here's an immensely ugly chart that I put together from Google Analytics, AdSense and my License database:

All the payments for Impact went through PayPal. I've read a lot about how PayPal likes to keep your money, closes your account for no reason and a number of other shenanigans. I also had my share of bad experiences with PayPal a few years earlier, when someone purchased a software of mine through a hacked PayPal account. This time however, I haven't had any problems at all.
Sure, the PayPal website is still as bad as it ever was. I need about 60 seconds to login in to my account each time. Every single page needs at least 10 seconds to load and I'm forwarded from paypal.com to paypal-deutschland.de and back to paypal.com again. PayPals Instant Payment Notification API is equally horrible, but what can I say – it works and there's no other viable solution here in Germany anyway.
On a lighter note: I've sent more emails in the last 31 days than in the 12 month before that combined (236 vs. 124). I got a lot of job offers and even decided to go through a phone interview with Facebook after they approached me (I failed). I also got a lot of "business offers" that I still don't know how to deal with – emails talking about "partnerships" but never with a concrete idea. Maybe I just don't understand marketing.
So all in all I'm very happy with the success of Impact and I will definitely continue development for it.
(Silly title, I know, but how could I ever resist such an opportunity?)
My HTML5 Game Engine Impact is now ready. It took some time, but I think it was worth it. I'm proud of what I have achieved and I hope you'll like it too.
Part of why it took so long to put it all together is that it now runs on the iPhone, iPod Touch and iPad. Try it yourself at playbiolab.com and impactjs.com/drop or watch a short video:
All those platforms still have their problems with sound and the iPhone 4 has a hard time filling all its pixels, but the games remain to be playable even on the 1st gen iPod Touch. You can read a bit more about Impact on mobile platforms in the documentation.
Even with iOS support, it might come as a shock to some of you that I am selling Impact, rather than releasing it for free. I love free and open source software and I've been contributing stuff for quite some time now. I had a hard time thinking about whether to release my Game Engine for free. The reason I decided to charge for Impact is a) it is easily the biggest thing I've ever made and I'd love to continue working on it full time, and b) I believe it is worth the money.
Ironically, my decision to sell Impact set back the release date quite a bit. If I'm selling something, I want it to be worth every penny. And even though the engine hasn't been far from completion for some time, I hadn't written a single line of documentation.
I feel that a good documentation is crucial for the success and adoption of any software project. So I set myself the goal to write the best documentation I possibly could.
I'm not a big fan of inline documentation (with documentation generators like JSDoc) because it tends to clutter the source code with trivial statements and – more importantly – makes it easy to write bad documentation. If you are writing the documentation separately from the code, you think about it differently. You think about the documentation as something that works without the source code, something that makes sense without the source code.
You rarely see code examples in automatically generated documentations, but for me as a developer, code examples are oftentimes exactly what I need. Take a look at the documentation for the ig.Entity Class - one of the more complex classes of Impact. This is something documentation generators just can't do.
Of course it took me longer to write the documentation separately than it would have if I wrote it inline, but this is only because it is more in-depth, more thorough.
But don't take my word for it. Please see for yourself!
On a lighter note, I'm currently sending out a few thousand emails to those who signed up on the old Impact landing page. I'm using a 10-line PHP script for that. Let's see how this turns out...
I finally found some time to work on the Impact website in the last few days. I just wanted some pages with documentation and tutorials along with a nice and simple forum. Nothing special. I looked around to find a forum software that would fit my needs. I couldn't find any.
So I sat down for a few days and put together my own forum. It's called Discuss and you can see the beta here. Account creation only takes a second and you don't need to provide an email address, so please try it.
This is my problem. I love to create my own stuff. My problem even has a name: Not Invented Here.
“Not Invented Here” syndrome is manifested as an unwillingness to adopt an idea or product because it originates from another culture
Ouch, that sounds pretty harsh. Of course there's a bit more to it, as Joel Spolsky wrote some time ago.
The thing is, “Not Invented Here” has worked great for me. This Blog is running on my own CMS, that I created some time in 2004 and it has been virtually unchanged since. It survived being linked by Daring Fireball twice, has seen the Reddit frontpage twice and the Digg frontpage once (when Digg was still popular, mind you). All without downtime or any security issues. I can only imagine what a struggle it would have been if this site was running on WordPress.
Of course, my CMS is not the answer to all problems. In fact, it only does very few things, but those are the things I need and it does them very well. (That also means that I won't release it any time soon. The fact that it works for me doesn't mean that it's “complete” in any way. Sorry.)
Back to my original problem. All the different forums that I tested suffered from feature creep. The big players (i.e. phpBB, woltlab and vBulletin) are trying to let you create your own personal Facebook, with Blogs, profiles, private messages and whatnot. Even those forum applications that advertise themselves as “light” (FluxBB, PunBB) will greet you with more than 200 files and make little distinction between code and layout.
And they all look the same, like they time traveled from 2001 to the present day. It's extremely difficult to make one of these systems feel like a part of your site. I'm still impressed by how Shaun Inman was able integrate his Mint Forum (PunBB) so tightly.
I like simple. I like software that does one thing and does it well. I'm extremely allergic to feature creep and code smell. When I create my own stuff I know what I get. Sure, the “Not Invented Here” syndrome initially demands a lot of time, but I like to think that it pays off in the end.
With all that said, creating my own forum probably is borderline stupid. I will be surprised if this works out and I don't end up installing PunBB or FluxBB anyway.
How do you display a list with a huge number of items? Easy: just paginate – split your list into several pages and let the user click through them one by one. Google does it with their search results, every forum software in existence splits a thread after N posts, my Blog only shows 8 entries at most. It's a solved problem.
Some years ago Microsoft had a different idea with MSN Search (now Bing): Infinite Scroll. If you do an image search on Bing and scroll down far enough, more results will be loaded on the fly and appended to the current page. There's no need to click a Next Page link. I don't know if they were the first to do it, but they certainly were the first I remember.
Today, many sites are using Infinite Scroll or the slightly less ambitious Load More button. And it constantly annoys me. It's not so much that most implementations are done very carelessly, but that the idea is inherently broken and really can't be done right.
Take Twitter for example. Say I'm writing a Blog post about how John Gruber was all the rage about X a few days ago. Naturally, I want to have a link to his tweets from said day in my post, so I visit twitter.com/gruber, click the more button two or three times, till I see those tweets and… now what? How do I link to this page? Do I have to link directly to twitter.com/gruber and tell my readers to click more a couple of times? How often? Well, it of course depends on how chatty he's been since I posted my story.
You might say that this issue could be easily fixed by utilizing the Fragment Part of the URL. So after I click more the URL would change to twitter.com/gruber#20, twitter.com/gruber#40, twitter.com/gruber#60 and so on (or better yet, counting from the first tweet). Now, what if I'd want to link to Grubers first 20 tweets? The URL would be twitter.com/gruber#8900 and the page would load nearly 9000 tweets? I don't think that's a good idea.
The non-link-ability is not the only problem of this technique: How do I jump to the end of the list? Or generally, how do I jump to a specific item (e.g. the first unread post in a forum thread)? What if the page becomes so long that my browser struggles to keep up?
It ultimately boils down to what we gain by using a Load More button instead of Next Page. And the only answer I can think of, is a few milliseconds of time I'd otherwise would've spent waiting for a whole new page to load. I also believe that appending items to a page is even more confusing for the user than going to a new page. After you've clicked more a few times, the list becomes so long that you easily get lost in it.
Pagination might not be as cool as all the AJAX stuff, but for navigating a list of “infinite” size I really can't think of a better approach. It doesn't have to be the old school pagination with a Next Page link though – you could build something that utilizes AJAX, caches the next page in advance, makes use of your mouse' scroll wheel etc. Ultimately it just has to be something that says “you are viewing items 340–380 of 920”: Providing a fixed sized, moving window into a set of items, instead of the fixed position, growing window that is Load More.
For the last ten years or so, I used to turn on my PC when I came home from school or work and shut it down again right before I went to bed. So most of the time when my PC is running, I'm awake. I've also been idling in IRC for as long as I had Internet – when my PC is running, so is my IRC client.
I still have all my IRC logs since 2001 lying on my HDD. The log format of mIRC changed slightly over the years, but it's all easily parsable with some basic Regexp. I quickly wrote a PHP script that extracts the Session Start and Sessions Close markers and timestamps from these logs and transfers them into an image.
Open image in a new window
As you can see, I tend to stay up late. I also tend to go into a free-running sleep mode when I don't have to get up early every morning. At May 2004, after my A-Level exams and before my apprenticeship started, I “rotated” my sleep cycle three times. This has been even more extreme for the last two years, where we only had few lectures in university but instead worked on a lot of projects. I should really get one of these daylight lamps.
There's so much more interesting information hidden in these IRC logs. Maybe I can bring myself to parse and import all of them into a database, so I can run some simple queries on them. Maybe I can even find my pre-2001 IRC logs on some backup CDs.
Google introduced Chrome Frame today, which is essentially a plugin for Internet Explorer to use Chrome/Webkit as it's rendering engine. This at first may seem like one of Google's Aprils Fool's jokes or an attempt to make Microsoft even more embarrassed of IE. However, when looked at closely, the Idea to bring Chrome to IE is very clever and might actually work!
The problem is clear: While Microsoft certainly fixed many issues of the now infamous IE 6 in their newer versions, IE 8 still has many many problems and is far behind in terms of standard compatibility, features and speed. This has hindered many sites from using new technologies and ideas and oftentimes forces developers to backpedal in order to still support IE. So how do we get people to switch to a different browser?
Imagine you're visiting a website and are greeted with a message like “Your browser is not supported by this website. Please download one of the following browsers...”. Would you do it?
For the average user, the answer is of course no. There are way to many hurdles to overcome. Many people don't even know what a browser is. For them, IE is the Internet. They won't understand why they need to install a new software and they won't know what to do if they wanted to switch. Even if a user exactly knows what a browser is and how to install software, he'd still have to trust the browser vendor that this new software won't do any harm to his PC and he'd also have to invest some time to get familiar with it. It's just not worth the effort.
Now imagine you're visiting this website and you get the message “You need the plugin XYZ to view this site”. Imagine this plugin was created by Google – a company you know and can be sure of that they won't harm your PC. Installation of this plugin is just one click away. You don't have to download or install anything manually and your browser will look and behave exactly the way it used to.
Google Chrome Frame is just that. It's only a plugin, but for web developers it has the same benefits as if the user switched to another browser. If you're working on a high-end website that you can't possibly get working in IE (like Google itself does with Wave), or that just would work better with a standard compliant rendering engine, then Chrome Frame seems like a very good answer.