Sprite Lamp, take two

One of the biggest failures of Sprite Lamp (as a project) so far has been the OSX version. From the point of view of anyone who backed the Sprite Lamp project as a Mac user, it is now massively overdue, and all they’ve had to go on has been a crappy beta version that isn’t very stable. The good news is, this is about to be resolved. Since this is a blog about development, I’m going to tell you the story that brought me to the current situation, but if you don’t want to read my long-winded rambling, scroll to the TL;DR at the bottom of this post.

The story so far

When I started working on Sprite Lamp, I wasn’t expecting it to be a big deal at all – it was actually just a personal experiment. At the time I was messing around with C#, so I picked up WinForms as quick way of making a UI, and off I went. This was all well and good, and Sprite Lamp came together for Windows reasonably quickly. I put together what I thought was a minimal OSX version that contained all the basic requirements of Sprite Lamp (open images, process them, render an OpenGL window to preview, save images to disk) to make sure the port was doable, because it would be stupid to promise a cross-platform release in the Kickstarter if I hadn’t done at least that, right? And off we went. The Kickstarter succeeded, far quicker than I had expected it to, and development began. Because it exceeded its goal, it even became possible to contract someone to help with the cross-platform stuff. This was a relief, because in spite of me doing my little proof-of-concept port, I didn’t know my way around OSX all that well. At this point I was pretty confident that, though it might not fit perfectly into my schedule because of stretch goals, things were looking pretty good.

And as far as the Windows release, things were basically okay! It did come in a bit late, but I think mostly people got what they were after. At this point I was working with someone who knew OSX better than I did to make a start on that port as well. It turns out that WinForms and C# is quite well-emulated on Linux, so I was working on that version, but while WinForms can run under Mono on OSX, it’s not pretty – we needed to build a new UI. So, on it goes.

However, it soon becomes apparent that things are kind of heavy-going on the port. Despite the unexpected success of Sprite Lamp, I can’t afford to pay all that much to my contractor, and working with C# and building a new UI is going slower than he thought it would (quite understandable, these things happen). Unfortunately, this is getting drawn out to the point that life is getting in the way – he certainly isn’t able to work on it full time, and while he’s an honourable guy and is going to deliver what he said he’d deliver, it’s not easy while he has to make a living somehow at the same time. It gets more and more difficult to organise meetings and make things happen. He and I are kind of hating things at this point – getting things to happen is pretty painful, and I feel sure he’s (understandably) regretting getting involved in the project. All the while, I’m mindful of the fact that people were promised an OSX port, and it keeps failing to progress.

Eventually, my contractor gets a beta together. It’s not perfect, but it’s something, to my relief. Mid last year, I posted about all the troubles we were having, and that we finally had something to show for it. However, that relief didn’t last – development essentially ground to a halt after this. I was starting to feel like Sprite Lamp was a real lodestone on the life of my poor contractor, but it wasn’t going anywhere. Worse, looking at the beta, it wasn’t clear that getting it cleaned up properly was very easy or doable – the UI system we were using was kind of cumbersome, and neither of us knew it well enough to troubleshoot very reliably. When I was really honest with myself, I had to admit what I was expecting to happen – something ‘finished’ gets cobbled together, it’s not very good, I push it out the door with as little fanfare as possible and consider the campaign fulfilled. This option didn’t make me very happy.

A bit over a year ago, it became necessary to get a real job, to pay the bills – and that job was as a programming lecturer. I was teaching C++ (it’s at a game dev school), and though I had used C++ professionally, my skills had atrophied a bit (all of Sprite Lamp was done in C#, after all). So I set about re-educating myself, to get to the point that I could teach C++ with more confidence. Naturally, I’ve been getting more practice through teaching since then.

Now, way back when Sprite Lamp was first funded, some well-intentioned backer suggested I look into rewriting it in C++, because it would make the port easier. At the time, I’d just gotten done writing the thing in C#, my C++ was pretty rusty, and I thought it wouldn’t be so bad on account of my proof-of-concept demo – so I thanked them for the suggestion, didn’t follow it, and forgot about it. It wasn’t until much later, when I was looking at the state of the OSX port and the lack of process that had been made, that I remembered that suggestion. With all the porting woes we were having, and my improved confidence in C++, suddenly this seemed… kind of sane. Back then, the backer had suggested Qt (which I didn’t know anything about at the time), so I had a quick look into it to see if it could get the job done. While rewriting Sprite Lamp in another language just for OSX seemed kind of crazy, anything that provided a glimmer of hope that I could stop disappointing my Mac backers was well worth looking into, and letting my contractor off the hook was pretty appealing, too (he’s a friend of mine, and I don’t like spreading the stress around so much).

Before long, this was starting to sound suspiciously like the best idea ever (usually things have to be pretty grim for “let’s burn the entire codebase to the ground and start again” to sound like the best idea ever, but still), and I started throwing together some first attempts. Before much longer, I had the Sprite Lamp core (ie the engine for converting the images, just no front end) mostly working in C++. I started to wonder if, instead of making the OSX version in C++, I should maybe just get rid of the C# codebase altogether, and relaunch on all platforms.

And now, present day

The idea that the rewrite might be worthwhile first surfaced something like December last year. I apologise for the lack of communication about that decision at the time – I wasn’t sure if it would actually work out, and I really didn’t want to come back here without some good news. Well, I’m pleased to announce that the freshly rewritten version of Sprite Lamp is available on a Steam beta branch right now. I’m not going to just push it to the main branch yet – I’m not that crazy, and obviously it’s less thoroughly tested so I want people to be able to revert to the old (Windows) version if they want. If you want to try it out, the beta password is ‘NoLongerSecretPassword’. There’s a new Windows version there, as well as the OSX version. Please give it a try – the Windows build is much nicer than the old WinForms one, and there are new features too (more on that below), also present in the OSX version.

And if anyone’s wondering, yes, I feel like an idiot for not doing this a long time ago. To that backer who suggested C++ and Qt long ago, it’s very clear now that you were right.

A couple of caveats

Hopefully this fancy new version won’t set anyone’s computer on fire – it has, at least, been pretty stable for my tests. However, there is one persistent and pesky problem with Steam failing to recognise the pro version on OSX (Windows it recognises it fine), and I am still figuring out the best way to bundle the separate command line interface executable into the OSX build. I’ll be getting all the versions up on Humble over the next little while, so if you must have the pro features on OSX, keep an eye on my twitter account. Hopefully that will all be sorted soon, but it didn’t seem worth delaying this announcement for (most people own the hobbyist version, and lots of pro users mostly use the hobbyist features anyway).

How about Linux?

Linux isn’t part of this release, but it will definitely be getting the Qt treatment. A terrible fate befell my Linux box recently, and I haven’t had the time to get it back up and running yet, but before that happened I did confirm that the Qt build worked smoothly. That’s what I’ll be working on next, and I’m expecting (touch wood) that it won’t take all that long.

New Features

Funny thing about rebuilding something from the ground up, is remembering all the design decisions you made the first time around and why, in light of having actually used the thing since then. That hindsight, coupled with Qt being better at certain things, coupled with me being a better programmer now than I was then, have led to a few cool new things. Nothing that’s likely to set the world on fire, but I thought I might as well run through them here:

  • You can adjust the colour and the intensity of the light sources separately – so to make the light brighter, you no longer have to go into a colour chooser and increase the brightness without touching the hue and saturation. You can also make lights more intense than was previously possible with this feature.
  • You can switch between a point light and a directional light in the preview window. Using a directional light means that light renders for tiling textures will, themselves, tile – so you can make use of baked lighting for tile-based games, now.
  • You can adjust the specular intensity in the preview window.
  • Inspecting images scales them up without blurring (filtering) them, so you can view a preview of your pixel art normal map more nicely than before.
  • For rendering lighting, you can export an animated gif or a static image, and choose whether to export at preview window resolution or at the assets’ native resolution, separately. Mostly, this means you can export animated gifs with the input images’ resolution and framing, which a few people requested.
  • You can drag and drop images directly into the Sprite Lamp interface to load them. Dropping onto one of the individual image boxes will load the image into that slot, while dropping them anywhere else in the interface will load the set that image is a part of. This feature has had a pretty big impact on my Sprite Lamp usage – it makes things a lot smoother.
  • You can choose to apply bilinear filtering to the textures (for the preview window).
  • Everything has tooltips now.
  • For the pro version, there is a new CLI parameters helper feature, which automatically puts together the command line arguments you’ll need to process an image with the settings you’ve currently got selected.
  • Everything just looks nicer and a bit more modern and polished, in my perhaps biased opinion. I suspect the UI is a little more responsive, too.

Mopping things up

This blog post amounts to me putting this beta out on Steam (by releasing the password publicly), but there’s more to do.

  • I have to get the new free/demo versions out and available on Steam and on this website.
  • I have to send the non-Steam builds to Humble.
  • I have to see what problems come up with the beta test, and hopefully address them.
  • I have to sort out those last few problems mentioned above – detecting the pro version on OSX, and getting the CLI working properly.
  • I have to get the Linux version done.
  • I have to finalise the launch, and make everything officially for sale on all platforms.

I’m still only working on all this during weekends, but I’m hoping I can get this done over the next month or so. I won’t necessarily post here every time one of these things gets done, but I’ll be uncharacteristically active on Twitter and Facebook to keep people informed.

I’m also hoping to spend a bit more time writing posts here about technical issues such as how normal maps work, what anisotropy means, usage of the depth editor, and so on, in the future.

So, if you’re a Sprite Lamp user, please give this a shot and let me know what you think. Even if your experience is ‘it works fine’ I’d like to hear about it, because otherwise it’s hard to tell the difference between “everything is flawless” and “nobody is using it”.

TL;DR: Sprite Lamp has been completely rewritten in C++, meaning a few new features and a working OSX build. No Pro features on the OSX build just yet, nor Linux support, but they’ll come soon. Get them on the Steam beta branch right now and let me know how it goes – password is “NoLongerSecretPassword”.