Qatapult : A fairy tale for the 99%

In my high tower I was brushing my hairs, singing and waiting for a proud coder to come and port that whole horrible objective-C codebase to a new beautiful Windows c++ project. Quicksilver was it’s name.

That’s a fairy guys ok ? So that’s ok to say that c++ is beautiful there.

It’s sharp moves were a legend and troubadours like Merlin Mann and others sing its accomplishments.

Many nights came and went and that proud coder sadly never came. Quicksilver was still locked in his walled garden were never an apple got eaten by more than bite. I was in love with these three panes and dreamed of deploying them in more dimensions.

[NANY](http://www.donationcoder.com/forum/index.php?board=304.0) the challenge to release new app for the new year was coming, asking for an always larger price of new young and innocent apps. Each year, the price was higher. I saw that the piece would be to the taste of the beast. I threw my forces in the battle, building and crafting bytes and pixels out the keyboard. [Iconfinder](http://www.iconfinder.com/) proved to
be a strong ally, bringing it’s carefully referenced free icons adding flavor
to the project.

Legions were sacrified to the monster, but Qatapult was so large that the beast of
the new year couldn’t eat it all alive.

There I am, NANY is over, and Qatapult, my sweet 3 pane launcher is pursuing it’s quest of being the sweet graphical launcher that Quicksilver is in some other land. There walks Qatapult, grabbing new features as it’s creator feels the need for them.

Qatapult is the Quicksilver of the 99%, it’s rewrite for Windows rather than a port. If you’re a fan of keyboard launchers and you tried all of them on Windows you’d like it probably.


You can get it here

My weirdest bug

Sometimes you stumble upon an exceptional bug ; most bugs are stupidly boring but some are interesting, especially the ones that are perfectly deterministic but whose causes are really mysterious at first.

My weirdest bug ever was a UI involving layered window on Windows. If you’re unfamiliar with win32 programming, it is the name of the technology that allows to do transparent windows under Windows. That UI was a sort of very fluid transparent floating buttons over the desktop.

The mystery machine

This bug manifested itself by the display rate being slow once every 2 times. Once the UI was loaded, it was slow or fast, but we could never know beforehand. I didn’t noticed that distribution before knowing what’s the problem really was, because of course it didn’t occured in a row. It only made sense at the end.

Kernrate profiling

Facing a performance issue you know nothing about, your first tool is kernrate, which is a statistical profiler. It pools the instruction pointer at periodic interval and summarize where the time goes. It’s a very fast and easy, non invasive way of doing profiling. Nyanaeve has a good introduction about it.

With kernrate, we learned that the time was spend in kernel level, not in user level. Kernel level mostly means : drivers. I also got a position :

- EngModifySurface+0x8cc

The only issue is that this meant : nothing.

Windows source code is obviously unavailable to most of us, but Microsoft just know that sometimes you need a little more insight on the platform and provide debug symbol files which can tell you more precisely where you are. If you’re unfamiliar with them, they mainly provide the correspondance between memory adresses and function names.

With the debug symbols installed, we got a much more interesting position :

- mmxAlphaPerPixelOnly
- vSrcAlignCopyMemory

MMX & memory allocations

It took me a while to exactly understand it. What happened was that the video card didn’t had an hardware implementation for layered windows so its driver allocated memory and forwarded it to the default implementation.

Writing gui drivers for Windows is not an easy task, you have to handle pixel writing in many pixels format like 2/2/2, 2/2/4, etc and conversions between all thoses format as well. So MS was nice enough to write default implementation for all those cases. When a driver doesn’t know how to handle something, it allocates memory and gives it to the default Windows implementation. So you write a miniui driver and let windows handle all the special cases.

This default implementation is potentially slower, but not that slow, and
beyond that it wouldn’t be random. So that’s not the reason. But this was
all we got, and we needed to know.

This specific default implementation of the operation was MMX optimised,
because it’s faster of course, and was probably enabled as soon as an
appropriate processor is available. MMX intructions can only operate on 8 bytes aligned memory.

The driver didn’t cared about that and provided a 4 byte aligned memory block. By shear luck the allocation was magically 8 bytes aligned, other times it was 4 bytes aligned.

The Windows implementation couldn’t operate on 4 bytes
aligned memory so it copied it to another memory block, processed it and copied it back again.

As the driver only allocated the memory once at the creation of
the window it was fast once every 2 and never changed after that.

Dead end

That’s a leaky abstraction to its fullest, an hardware requirement caused a very visible user experience problem, sadly unfixable.

A fix would require the source code or the driver, rebuilding it and redeploying it to everyone. A workaround would be to keep creating window until once got created with correct memory alignement, but there is no way to detect it.

Dead end, won’t fix ! But the trip was awesome still.

And you what was your weirdest bug ?

Should I put more bugs into my software ?

Issues are one of the rare occasions were, when everything is automated, you talk with users of your software. Recently I had some contact with users that liked my software but had some bugs :

SwiffOut, my browser extension is exactly the kind of problem I’d prefer to stay away of ; it’s unfixable : I parse webpages to find games and makes them really fullscreen in a browserless way. No website is built the same way, of course, so I use an heuristic to find what’s the most likely to be a game, pick up that and pray for the best.

Please god of mozilla, chrome, IE, add a way to get the position of an
element across iframes…

Social games like Farmville tend to not work as they do some javascript
transaction with the webpage and the servers; some websites don’t really like that you transform their stuff, so they add tokens so that pages and games can only load as a pair. I could have created a subwebpage that could have solved some of the issue, but it would probably still not fix everything. Try to get facebook environment without the UI ?

Some time ago, one of my user suggested that I add a donation button because he’d like to give back. While a very nice proposition, I had tried it and I knew that very few people actually give back. Still, I would have really liked to accept and it cost me to refuse (who doesn’t want some money for their work ?). But, I’m not really in need for 5 or 10 bucks so I asked that he
talk about it to his friends instead.

So he went and wrote that on reddit

“It’s a pretty clever idea; instead of resizing the flash (which typically will
cause lag) it resizes your monitor resolution to the closest / best size for
displaying the swf full-screen. That’s why it’s called Swiffout — it gets the
.SWF out of the browser. After playing a ton of games on Kongregate and Armor it’s pretty clear to me that many of these games were intended to be played full-screen. I gave the developer some love (and a crash report) via email and suggested he put a donate button on his page so i could support his efforts. He requested that instead of donating that I please spread the word about his plug-in. So that’s what I’m doing. If you check this out and give it a
thumbs-up, please thank him by doing the same.”

Probably because it was a good story it did quite well on reddit up to the
subreddit gaming home page.

Two weeks later ghack.net spotted my extension and wrote a nice review, then lifehacker.ru wrote another review, then some italian websites did too.

The fun thing is that all of this happened because SwiffOut didn’t work. A smartbear already spotted that tech support is sales some times ago, but I now realise how much it can be true.

So should I add more bugs into my software ?

The ActiveScripting FAQ

I’ve uploaded pages from the ActiveScripting newsgroup FAQ. ActiveScripting was the technology before .NET that allowed programmers to embed scripting languages in their applications without having to write one. The FAQ

The FAQ was originally maintained by Mark Baker, and were hosted on his site. His website has been down for several years now, I tried to contact him but couldn’t. I hope everything is fine for you Mark.

This FAQ has been invaluable resources when working on FScript (a FARR plugin ). It’s a little bit old technology but it can do great stuff still. I’m putting them online so that google find them back again and that it helps others.

I couldn’t get back some of the pages from google cache or from web archive. If someone has them, I’ll be happy to add them.

Kid’s business

Every 4 years in Douarnenez, France, where I lived, there was a big event of old sailboats. It brought a lot of people in what was otherwise a 20000 people city. I lived in a farm, my parents had a quite big garden and in any place that’s 100 years old there was old garbages laying around. If you wanted to find some piece of old material you could just lurk around to find them. It was easy to find slates.

I was about 10 years old. I had fun carving very stylized old sailboats inside
slates.

My mother was very admirative of things I made, because she is a mother, but this time, carved slates were quite cool. I can’t remember how I figured out that I could sell them, but one morning I installed a little showcase next to where my parents sold vegetables. I had often sold with them, so this was a place where it felt normal to be. It was the first day of festival.

All the stock sold very quickly, so quickly that my little sister had to help
me to sell slates as I was making new ones.

The next day we were back again with all the slates that we had found. Some things are easy to sell. We were at the perfect place, feeling authentic
because we were two little kids selling stuff we had made. It sold so well that my mother said that we outperform her that day.

I regret one thing, one of the people who approached me at that time was a
russian sailor who came in on a military boat. He had no money, and would have like to trade one against a plastic pin of no real value. I didn’t really understand what he wanted, so I refused. I’m really sorry he was disappointed. Today I wish my little slate had come to sail on the sees.

After that I pickup the money and bought a box of lego. It was something I
really wanted, but now when I’m thinking at this story, I had more fun,
creating and selling stuff than playing with my little game box.

Is 600 hours the length of an idea ?

There is a concensus on ideas being somewhat unimportant, motivation seems to be a way more important factor in success.

So are ideas unimportant ?

Some weeks ago, I came to the conclusion that even if ideas are unimportant from a business point, they still are important for yourself. The first point of an idea is to motivate you. Your idea is for you. You have to love it enough to keep working on it for a while. How could you flip on the winner switch otherwise ?. The “startup for the rest us of” podcast seems to consider that beyond 600 hours you are unlikely to release your project. Is 600 hours the length of an idea in an average mind ?

If this is true, that might actually be an interesting metric to decide when to stop working on something. Work 600 hours, including a bit of promotion, get feedbacks, and stop after 600 hours if it doesn’t stick. Beyond that, you need positive feedback.

Don’t forget to enjoy the journey

When I began my career, I worked as a graphic engine programmer on an XBox game : Tork. It didn’t got a big press, because it came way to late and only got a US release, but it was an nice game.

The computer game industry is like a lure to many people, because it feels so nice to play with games all the day. We used to have hundreds of resumes for an job offer. This is also what allows games to be done despite the engineering beeing way more complex that the usual shop : you have this huge pool of talents to pick up to build a team.

In that pool, some volonteers were great but many were completly disconnected from the reality of this work, because, actually, building games has little to do with playing games :

Engine programmers spend their time with maths and algorithms, tester jumps around maps everywhere for literally months, game developers try every variation of what fun could be, and everyone has some dirty tasks that needs to be done like moving bytes from one format to another. Building a game last for 2-3 years, imagine playing the same game everyday for 3 years and it become hell on earth but if you love the process and your buddies.

So, if I get bored of my idea, because I worked on it too long, I remember myself to enjoy the journey too. Sometimes it’s nice to focus on doing the things, do them just well and forget about the big vision. You might even notice some unpolished details you wouldn’t otherwise.

Take care though, because that’s how all mad scientists began, by doing small things without a vision, you might become evil.

My foreign world

French consider language to be part of the culture. We believe that so much that we are encouraged to learn pidgins at school. I did too. I learned
breton. I got top grades, despite that, I can’t make a sentence. Guess
what ? I don’t care, I worry about my english…

I grew up in a small town, at the most west limit of France. It’s a beautiful place for people who love nature.

This was pre-internet era in France, actually that was pre PC era as well and the world was very different. If you had interest in anything not mainstream, your options were : find out on your own (if you were very smart ), read magazines (if they existed ), and talk to people. The best way to get knowledge at something was definitly to talk to people. I was a bit shy, it didn’t helped, but anyway, it was really difficult to find someone interested in computers in that period, at that place.

At that time, speaking english was remotly important IF you travelled.

Then Internet changed the world…

The communication of ideas is so much better now. I don’t know how anyone can critize the Internet. Granted, everything has defects, but today you can learn almost anything you want, you can get in contact with almost anyone you want, provided you speak english because [all the cool peoples speak english — as Jason/Justin said somewhere in Techzing podcast.

Believing that language is the culture is just silly. A language does not equal culture. Culture is about peoples, books, it’s about science, it’s about the world, or just communication.

If english is your first language, you won’t believe how much your culture
can be limited by not speaking english.

Not speaking english today feels as if you had been locked in pre-internet era.

I basically live in english at work. I only read english blogs and articles, I search in english. My coworkers are still french and that’s lucky because despite listening podcasts and reading english everyday, I’m still stuck with my pityful english.

Indeed, I encourage anyone I met to read and search in english if they can, because there is so much more resources, and they are so much better anyway. I can’t tell you how many times I fixed things in seconds for others just by the virtue of searching in english instead of french.

To this day, I’ve read only one book in french that I’ve found of superior quality to english resources on a specific subject. This book was Pratique de C# by Patrick Smackia, and … surprise the new edition of the same book is in english only ! There might be others, but it doesn’t matter anymore because I stopped reading french books now.

I envy you, native speakers. I wish I could reboot myself to speak english first, and french second, because sometimes I feel like I’m a foreigner in this world.

The true face of flash games

Update : SwiffOut the extension for playing flash games full screen is now available at swiffout.com

Games are about immersion. Yes flash games too !

Some days ago, I was listening at the Channel 9 Corrinne Yu interview. She’s Halo technical director, has incredible insights on the game industry in general. Have a look at the video if you haven’t, you’ll see what passionate means. One of the question she answered during the interview was : does the focus on graphism in current games has a negative impact on gameplay in video games ?

While I was internally agreeing with the implicit opinion within the question, she turned me back. I can’t remember the exact wording, but in essence it was : Great graphisms enable greater immersion, avoid breaking the illusion of the game and as such increase the fun.

Here is what flash games look like right now :

![Kongregate](http://grownsoftware.com/blog/wp-content/uploads/2010/08/kongregate2.png)

Kongregate it a great website. I could have choosen way worse.

But, immersive ? Hu ? There is way too much glitches: taskbar, tabs, bookmarks, ads, chat…

Imagine watching a movie with the light on, the fridge buzzing in the background, and your girlfriend doing the dishes (hum, hum ). Nice… but not immersive. This is the current online gaming experience.

We have grown so accustumed that this is what flash games look like that we can’t even believe that flash games can be good. Are we too hard on flash games ? We love to hate flash, we even have dreams about replacing it with HTML5. It is an incredible gaming platform though, with many libraries, nice tools, and a very large number of players. We should love that.

Let’s remove the clutter :

![This is the true face of flash games](http://grownsoftware.com/blog/wp-content/uploads/2010/08/swiffoutgames_sample2.png)

This is what flash games should look like, their true face. And actually,  this is real. I build it.

This is and will be SwiffoutGames – HD Online Games.

This screenshot is your whole screen, not a captured window. To get this, the issue is not flash. The issue is the browser. The browser is simply not suitable for playing games. It is aimed at browsing – we can’t blame it, that’s it’s purpose after all. There is no way to fix flash games that much in the browser.

SwiffoutGames introduces a new thick client that interacts with our website to enable an immersive full screen mode for flash games. Press a button and we make flash games feel and look like desktop games. It’s not a flash game maximizer, it goes beyond that. The thick client switch the screen resolution to preserve speed and game quality and run the game in its own process. You can even save a shortcut to a game and put it on your desktop. But we do this while retaining all the distribution capability of the web and integration with the arcade ecosystem. We get the best of both world.

If you don’t know anything about flash games, or generally think they are crap, here is a selection of flash games that I really like. Flash games are often focused around one gaming mechanic idea. These one are a little more advanced. Here are my recent favorites : Final Ninja, Trap Master, Cursed Treasure, Inferno