All posts by Finn

Stretch goals and PayPal added to Sprite Lamp campaign

So I sent out a survey to the early Sprite Lamp backers, asking about what kinds of features they’d find useful, and got a pretty extensive and pretty quick response. So without further ado, I present to you Sprite Lamp’s stretch goals.

StretchGoal_6kThere are more details available on the Kickstarter page itself – scroll all the way to the bottom (almost). These stretch goals are bigger than the original goal by such a margin because they represent new features that I have to build from the ground up, now – the original goal represented remaining costs of a significantly pre-developed project.

Other things I learnt are that Sprite Lamp backers are pretty tech-savvy, with 24% saying they’re completely confident they can make their own shaders, and only 5% saying they have no chance of doing so. 24% are rolling their own game engine, and an impressive 70% knew what I was talking about in the question about anisotropy maps. I also learnt that almost half of the backers were planning on using Unity in conjunction with Sprite Lamp, which isn’t all that surprising, that TextureMapper is an overwhelmingly popular atlas tool, and that Spine appears to be the 2D skelmesh software of choice. Finally, I learnt that pretty much everyone is at least intrigued in trying out the palettisation tech that I have in mind.

Thanks to everyone who helped me out by responding to the survey!

Sprite Lamp hits its goal!

Well, I was planning on posting an update when Colour Bind’s Kickstarter went live, but I ended up getting distracted by a bunch of social media stuff, and now that I am actually getting around to posting this, it has a different title.

Sprite Lamp on Kickstarter

That wasn’t quite what I was expecting. Sprite Lamp hit its goal of 6k around the seven hour mark, which I strongly suspect (but can’t prove) makes it the first official Australian kickstarter to be funded. Sweet! The obvious thing to say is THANK YOU to everyone who pledged, and everyone who helped boost Sprite Lamp by sharing the kickstarter on social media (and in general). Because of you, Sprite Lamp will not only happen, but it will happen in a timely fashion, and most likely it will get a bunch more features and be a higher quality product than it would have otherwise been. Also because of you, I get to buy a new pair of shoes (seriously, my old shoes have holes in them).

With that out of the way, it seems I have some work to do. I had put some vague stretch goals in the Kickstarter, but now I’ve got to make them specific much more quickly than I was expecting. I’ve already had some good suggestions. In accordance with one such suggestion, I’m going to set up some rudimentary forum here for talking about suggested features and the like.

I’m also going to make a series of blog posts here about a variety of graphics techniques that will be applicable to Sprite Lamp. I’m going to cover things like how the shaders work, issues with using normal maps that you might not see coming (like the fact that rotating a normal map in Photoshop results in incorrect normals), and a variety of shadow techniques that exist somewhere along the correct/fake spectrum that might work well in conjunction with Sprite Lamp.

Oh, and don’t forget that I need your precious votes on Steam Greenlight – any help there is much appreciated.

Thanks for all the support, everyone!

Returning from hiatus with Sprite Lamp

Okay so, I’ve been pretty absent around these parts. To some extent that’s because I’m a socially backwards hermit who hates the internet, but it’s also because I’ve been working on something that I haven’t gone public with yet.  Well, now I have, and that something is called Sprite Lamp.

Unlike everything else I’ve ever worked on or thought about working on, Sprite Lamp is not a game but a tool (for games). It’s all about combining dynamic lighting with 2D art. I think it’s kind of cool. You can read some details about Sprite Lamp or just enjoy this picture of the logo for it, at your leisure. I will be talking a bit more about this kind of stuff on social media, or at least trying to, in the near future, so that’s something to look forward to, too.

I’m going to be going all Kickstarter with this thing as soon as Kickstarter lets Australian projects go live, which is November the 13th. Wish me luck.

Sprite-Banner-big

Colour Bind – real trophies

I did a fun thing recently. It’s only sort of related to game development. There is, however, information below on how to win fabulous prizes, so read on because you wouldn’t want to miss that.

Back in the day, I made a game called Colour Bind. I thought it was pretty cool – it’s a physics platformer where you drive a car through various levels, but also there are puzzles and a rather nifty gravity-is-based-on-colour mechanic too. Alas, not that many people played it, but so it goes. The game was/is very challenging, and has lots of achievements (proper ones, for achieving things, not for pressing the jump button a hundred times or whatever) and lots of scope for mastery. Accordingly, I made the bold claim that a couple of the things you could achieve were so challenging that the first people to do it would be given a trophy. A real trophy that you can put on a mantelpiece, not a virtual trophy. Furthermore, I would actually make these trophies myself, and they would be awesome.

That coloured triangle is the goal - you play as the car thing. Also you can change colours.
This is what the game looks like…

So the game came out, and a couple of people really got into it. Before long – although with some pride I will say that it did take a couple of weeks after launch – the trophies were won. I was/am impressed with these guys – I’m pretty good at Colour Bind, but I’ve been playing it for years, and these guys are already as good as me or better on lots of the leaderboards. One fellow, an American by the name of Nathan, won the first three trophies (getting all the gold medals, getting fifteen platinum medals, and finishing all the cooperative levels with his brother), and a Spaniard by the name of Asier won the last one, for finishing all the secret levels (also no small feat, believe me).

I’m generally not very good at being active on the internet, but I thought it was worth documenting this adventure into the world of making actual physical things. It took ages, and lots of mistakes were made, but the end result is something I’m pretty proud of.

The fifth one remains. Go on, try out the Colour Bind level editor. I dare you.
And this is what the trophies look like!

Booya! I made a thing.

Don’t you just want to read a long description of how they were made? Well, you would be in luck, because I have written just such a blog entry, in four parts:

Part 1 – 3D printing

Part 2 – Dying the prints and making the supports

Part 3 – Painting and assembling

Part 4 – Tricky painting and bring it all together

The Fifth Trophy

Okay, this is the bit about fabulous prizes. The trophies were originally claimed to be for:

  • Getting all the gold medals
  • Finishing all the cooperative levels
  • Finishing all the secret levels  (real hard)
  • Getting 15 platinum medals (I didn’t even know if this was possible at release)
  • Making the coolest level in the game’s level editor

Now the purists will notice that the photo of trophies above features four trophies, and the list of trophies just there includes five. The disparity is the last one. The first four are very easily defined – when people achieved them, I crossed them off the list – but the last one, about making something in the game’s level editor, had no predefined cut off date. I kind of wanted to leave it open, because the game was only out on Windows. Then the MacOS version took ages due to various bureaucratic annoyances (don’t ask – suffice to say, it wasn’t the fault of the awesome person who did the actual port work), and the whole thing kind of dragged out. However, I haven’t forgotten. I will be posting back here with precise details (want to see if it’s reasonable to include the Linux release in this before I say any dates), but if you want the fifth trophy, you should get the game and start making some cool stuff. There’ll be a Mac version real soon, the Windows version can be had right now either via Steam or DRM-free via Desura. I’ll look through the Steam Workshop for levels, and they will be automatically in the running. If you make stuff in the DRM-free version, you’ll have to email the level to me or something like that for me to notice – I’ll put some details up for that when I do an official post on the subject.

So I hope you’ll give it a shot! There’s some documentation for Colour Bind’s level editor that can help you get started. Feel free to get in touch with me if you want to know how to do something in the editor or want to know if something’s possible. Or of course, if you happen to be attending PAX Australia, come ask me in person at my booth at the indie pavilion!

Colour Bind trophy building – part 4

Okay, let’s tackle the hard bit first. The colour bind goal model is sitting on my desk with a big white triangle where the colours should be. Mocking me. Telling me that I’m not good enough to paint it. Well, we’ll see who’s not good enough.

This is potentially going to be a bit of a challenge. The things against me are that I have never really painted anything before (apart from some Warhammer figures when I was a kid), and the extent of my paint mixing experience begins and ends with mixing up some grey paint for the other bits of the trophies earlier. Furthermore, the Colour Bind goal triangle is basically just the OpenGL triangle, that is, a triangle with its points being pure red, green, and blue, and those three colours smoothly interpolated between the points.

It may sound strange to some, but red, green, and blue are chosen because they are primary colours – specifically, primary light colours, also known as primary additive colours. The primary colours many people are more familiar with are primary subtractive colours, or primary pigment colours, red, yellow, and blue. With paint, you mix yellow and blue to get green. With light, you mix green and red to get yellow. Screens, and thus computer games, use additive mixing, which is why the OpenGL triangle and the Colour Bind goal use the additive primaries.

So, naturally, I have to paint what’s in the game. But since I’m painting, I’m going to be using subtractive mixing – a subject I know considerably less about. Halley assures me that, unlike the wonderful abstract world of computer graphics, paint is made of chemicals that may or may not have identical mixing properties, consistency, intensity, and whatever else. Fortunately, she’s going to provide me with some advice. She also did a pretty awesome job of masking the model for me. I am seen here taking my first feeble steps into mixing colours.

Also, that picture of the guy with the glasses on my desk is freaking me out. I don't know where that came from.
I probably should have shaved my beard a bit before taking this photo.

After a fair bit of remixing, faffing about, and general obsessing over needless details, things have come out reasonably well!

Damn you, creepy glasses man, why can't you leave me alone?
Seems to have come out pretty well! I’m as surprised as you are.

All that’s left for this trophy is to take the masking tape off and retouch some bits (the white dotted line around the edge needs it), and then attach everything to everything. Specifically, the trophy and the nameplate both need sticking to the base. I also varnished the whole thing in some matte polymer varnish because I was concerned that the paint job would get chipped.

Meanwhile, the other trophy’s repainting job was drying in a somewhat unorthodox drying scenario:

I got paint on my glasses and everything.
If you think I didn’t walk into this face first a couple of times during the process, you give me too much credit.

Now we’re practically home and hosed. Just sticking a bunch of stuff together remained at this point, and happily, it went off without a hitch! There isn’t really even an intermediate phase – just the finished trophies in all their dubious glory. Check it.

This trophy is actually pretty robust, too - if any of them break it'll be the dratted coop one
Done and dusted! I am very pleased with this one.

And last but not least:

The front wheel is riding a little lower than the back, because it's driving up a jump ramp. Just like in real life.
This one too. I like the suspension.

That’s it! Four trophies completed.

As a side note, as someone who generally creates things digitally, my heart goes out to people who spend most of their time making physical objects, because you don’t get to keep what you make! I made Colour Bind, and I sell it to people, but I also get to keep the game. Not so with these – I’ve taken my last look, now it’s time to make some overengineered packaging.

As mentioned, these trophies are going to two people, so I need two boxes. My plan is to cut out some of that weird cardboard/chipboard stuff that the trophy bases are made of, get some wooden dowel, and drill holes the size of the dowel – then, I’ll have squares of wood making up the floor and ceiling of the box, and the dowel holding them apart. Hopefully the result will be rigid enough to survive the adventure of international shipping. I didn’t document this process all that much, because it’s not so interesting, but I did get a photo of my standing near a drill press, so that’s something.

I'm wearing gloves and goggles because I was traumatised by a drill press injury earlier in the project.
This might make more sense when you see the finished product

Basically what you see above is two squares of wood taped together, and I’m drilling holes in the corners. The plan is to then thread some wooden dowel through those holes, and put a nail in each connection to hold the whole thing together. The dowel and the drill I’m using are pretty precisely the same size, so it should be reasonably solid. The next challenge will be to hold the trophies in place without damaging them, or having to attach sticky stuff to them that will leave a mark. I decided to drill some smaller holes in the base of the box and tie the trophies to the base with twine. Here’s Asier’s trophy suitably bound and ready to post:

I'm still a bit fearful of posting the thing.
Not a scratch on it.

And here are the ones for Nathan and Scott:

This twining process actually took ages.
I’m still a bit scared about the coop trophy. Fingers crossed.

Now for the packaging process. We got some vaguely appropriate boxes from the post office, loaded them with bubble wrap and other random packaging that we’d saved from all the stuff we’ve been sent throughout our lives, and got ready to go.

Complete with notes on to the recipients, and a sort of hinging door thingy to protect the set of three.
Almost there…
I almost spelled 'fragile' wrong but I saved it at the last moment.
Mission accomplished!

Well, that’s it! The rest of the story involves me going to the post office, and paying absurd prices for shipping (it is going some distance, I suppose). Next post I make will hopefully be about the recipients of the trophies telling me that they’ve arrived safe and sound, and that all is well.

Anyways, I hope you’ve found this interesting and/or entertaining! Remember, there’s still one trophy somewhat like this one, but different (and yet to be created) up for grabs! These four trophies were for gaming skills, but the last one goes to the person who makes the coolest level in Colour Bind’s level editor. If you want to try that out, you can get the game on Steam or you can get it on Desura as well. The MacOS version is coming out really soon (at long last!) too – its fate is currently in Apple’s hands, but will be on Steam and the App Store when the time comes.

Colour Bind trophy building – part 3

Rightio, so I believe last time I was just about to get up to painting. Well, there’s not much to say here I suppose – here’s a photo of me painting stuff:

Wallpaper by the beautiful and talented Darren Geers
Awesome desktop wallpaper included to provide contrast with my meager painting skills.

That wallpaper is pretty cool, by the way. Anyway, at the moment I’m painting the black bits black and everything else can wait until later. Here’s the front:

And it says 'Halley' because that's my girlfriend's name and the bit of cardboard belongs to her. Not really.
That bucket is because we had a leaky roof

What may be less apparent in this photo is that I’m dipping the three prongs from the back of the goal triangle in some green paint. You can also kind of see that I’m holding the wooden curvy bit in my other hand. The reasons for all of this are ingenious, and explained in the next photo:

Brilliant. Yes.
Brilliant, no?

So, now my cunning plan comes together. By marking the base with green paint from the pegs, I can now drill holes there of the appropriate size and fit them into the wooden base. I actually took kind of decent photos of this, so I’ll let them do the talking.

The lack of green around the holes is promising
Holes drilled, moment of truth approaching…
I was so proud that this worked first go - you have no idea
Success!

Okay this is awesome. The pegs fit into the holes so well that I could actually hold the whole thing by the base, or the triangle bit, without them falling apart. I’m pretty surprised that worked so well, actually. I’ll still glue them in, but it’s nice to be able to see roughly how this is going to look.

Anyway, that’s enough painting there for the moment. The other things that need painting are the curvy wooden bases. My plan here is to undercoat with black paint, then mix up some grey (I bought red, green, blue, yellow, white, and black paint) to put over it. There’s not really much to say here, but I’ve provided some action shots anyway.

In fact there are kind of slinkies everywhere in this photo. My secret shame!
Yes, that is a big tower of small metal slinky springs in the background.

You might think, based on this photo, that I have cleverly masked out the base of the trophy so I don’t accidentally get paint all over the pretty wooden base. But you’d be wrong, because it was in fact my girlfriend, Halley, who did that, using her amazing artist skills. This is nothing though – the masking necessary for the goal triangle is even cooler. But before we get to that, one last thing. I realised, after painting this thing with about five layers of grey paint, that one of the edges was unacceptably uneven. I figured I should be as much of a perfectionist as was necessary for the recipient of the trophy to finish all the secret levels, so I once again grabbed the whittling knife and went back to the chopping section of the project:

Background featuring chainsaw, brushcutter, and spare harpsichord
I like the way you can see the layers of paint in this photo

Anyway, long story short: It took a surprising amount of re-paintings to make the colour of the freshly whittled bit smooth with the rest of it, but the upside of so many coats of paint is that the bits where I screwed up slightly have been thoroughly concealed by paint now. But, I got there in the end.

Somewhere during all of this, I had been asking around regarding some competent people who might like to laser etch some name plates for these things. A friend of mine recommended the good people at 5 Star Trophies, and I got in touch. Before long, they had sent me the following bundle of goodness:

They have cool sticky stuff on the back too
Secret fact: These aren’t actually metal, they just look that way

Now, I made a mistake here. I was expecting to be screwing these things to the front, so I asked them to put holes in, but that turned out to be both problematic and unnecessary, since the screws wouldn’t sit flush and it looked crummy, plus I can get the plates with sticky stuff on the back and that will do a good job of holding things in place. After ruining a few of the above pictured plates, I gave up and re-ordered them without the holes. 5 Star Trophies gave me the second set half price, too, so that was nice of them.

The exciting thing here is that now, I’m able to finish two of the trophies! The two simpler ones, for all the gold medals (just a car on a base) and for the coop levels (two cars ‘high fiving’ on a base, have all their parts assembled. The bases are good to go, the nameplates are ready, now I just have to drill holes and glue stuff in. Here’s a hideous monstrosity that I created while practicing various methods of screwing things together:

Also: See how much better the car looks painted?
I needed to figure out how to drill holes and drive screws somehow, right?

The tricky bit was drilling the holes for the car prongs just the right distance apart, so the car would sit in there reasonably tightly and not fall out, but I got there in the end. All I have to do is the same thing on the real trophy base, apply a sticker, and…

Still quite pleased with that base, given it was made out of firewood and all.
Bam! First trophy finished!

This was a pretty exciting milestone because this whole process has taken ages. And what’s more, the coop trophy is also finishable with a similar amount of work – in fact, it’s easier, because I have slightly more wiggle room for the hole placement.

I lucked out and found a slice of wood with two sets of concentric circles in the grain. Symbolism.
Part two complete! Sorry this photo is a little blurry.

Okay! So, two down, two to go! And one of the remaining two is all but finished at this point. Unfortunately, the remaining paint job is by far the most daunting. Plus, I’ve got to figure out a way to package these things so that they don’t get destroyed in transit. For the exciting conclusion, you’ll have to read the next entry, coming up right now.

Colour Bind trophy building – part 2

Okay, back into it! Last thing that happened was I shamefully confessed my incompetence about using green wood for the trophy bases and having them split. But, no real harm done – I got some other wood and repeated the same procedure, and it went better.

More importantly, I was about to experiment with colouring these white plastic prints. I’ve heard a few people recommend using textas (like a sharpie, I believe, for those who don’t know what textas are), which seems like a dubious option. However, I made a mistake on one of the models – the suspension line on the car which is supposed to be at right angles to the car body was actually rotated a bit. Various people have told me that I am being obsessive throwing this one out, and they might be right, but if anyone is going to notice besides me it’ll be the people who played the game enough to win the trophies, right? Right. So I’m going to practice colouring this thing green.

Textas work well on fingers too
Half way done green car

By the way, see how the suspension lines in this model aren’t parallel to each other like they should be? Poor form on my part, but at least it meant I have a print to experiment with.

In retrospect, I could have seen this coming
Pretty good even colour, but I couldn’t get into the crevices

As you can see, textas are pretty good for this purpose – I would wholeheartedly recommend them sometimes. But for this, ultimately, I couldn’t colour the whole thing – there’s no good way to get the texta down behind the wheels, and in practice, it’s pretty noticeable. Dang. Well, that brings me to attempt number two – I’ve got to dye these things. I found a helpful youtube video that told me how to dye shapeways plastic – so, let’s go with that. I’m going to make the gold medal car red, the co-op cars blue and green, and the secret trophy car blue (I asked Asier which he preferred). The goal triangle model won’t be dyed – it has to be different colours so that will take a different approach. I got some blue and red Rit dye, but they didn’t have any in a good green colour so I got a different brand called Dylon (the lady at the shop told me it was the same kind of thing). Naturally, step one is to clean the models with a toothbrush.

Weights in background included to give false impression that I work out
This part of the process was as exciting as it looked

Then came the mixing part. You see here half water, half vinegar, with a probably excessive amount of blue dye mixed in.

Does the phrase "so blue that it's pretty much black" even make sense?
Primed and ready

Look at the car in the background there. It looks so clean! But, not for long. In we go.

This next part of the process took a while, featuring me initially freaking out that it’s not blue enough. In fact, I think I did that with all the dye jobs (although in some cases I was freaking out that it wasn’t red/green enough instead). But, so far, so good! I particularly enjoyed the car shapes on the paper where I dried it off while re-microwaving the mixture.

Only three to go
So far, so good!

After that, I had a minor hiccup with the creation of the green dye. I may have done some bad chemistry here, but in the end it worked fine.

It's not even a real table so much as a big piece of chipboard
Now I have a green table, so, that’s cool too

With the red car, I had a bigger problem. Let’s just say, any of you out there planning to dye shapeways white plastic red, don’t use Rit scarlet dye. I’m sure it works great on fabric, but…

Credit where it's due though - the paper towel turned a pretty good red
This is really not the bright vibrant red I was hoping for

Okay, so, that colour is kinda terrible. I can’t go around calling that a red Colour Bind car – it would make a mockery of everything I stand for. I fixed it by painting over it with some red paint. This actually worked much better than I was expecting – I was worried it would ruin the texture of the model, but figured if it didn’t work I’d just have to re-print the model but at this point that would be necessary anyway. But instead, it worked perfectly! Unfortunately, I didn’t take a photo of this at this stage – but this car will reappear later so you can check out its proper colour then.

Okay so there’s one other thing I’m going to talk about. If you go back to the first blog post and look at the initial 3D models, you can see that the car in the Secret Levels trophy is sitting on a sort of curvy platform, not dissimilar to the shapes in the game. Likewise, the goal triangle in the 15 Platinums trophy is supported by a similar curvy shape. Since I’m no longer planning to 3D print these bits, I needed an alternative plan.

I tried a few things. Initially I thought the best would be to get a bit of thick grey plastic and cut it into shape, but obtaining plastic of that nature turned out to be harder than I was expecting. I tried out a similar plan with one of those plastic chopping boards from the supermarket, but it didn’t receive dye or cut very well, so I gave up on that and got some extremely fine chip board. It’s strange stuff – kind of more like very thick/dense cardboard than wood. But, hopefully, this would do the trick.

My initial plans to cut the shape out roughly with a bandsaw failed due to inferior cornering ability, but a quick wikipedia search revealed that what I really wanted was a coping saw. Predictably, a quick search of dad’s workshop revealed that we had one already. I cut the very rough shape with a bandsaw and then drew a guide line with a biro and got to it.

Done. Ship it.
That’s the easy bit done

I have a few more cuts to make, obviously. Incidentally, in the above photo it’s actually screwed to the base (that is, screws going up through the base and into the underneath of the shaped bit) – I figured I was less likely to split the wood/cardboard/whatever if I drilled holes in it now rather than after it was cut into shape. Spoiler warning: It kind of split anyway, but it wasn’t too bad. Anyway, I also drilled the little hole for the car’s peg thingy to fit in, to make sure the whole thing was going to work, and it seemed pretty good. So, I disassembled everything and got back into it with the coping saw.

Way too many offcuts of failure in the background here
Getting this shape was a bit tricky – had to be done in two parts

And after part two:

Can't really get sand paper in there, either
Here it is after part two, but it’s a little rough

So clearly that ‘curve’ I’ve created is less curvy than is ideal, and I can’t easily sand it down like I can the other curves because there’s no room. A while ago, I tried my hand at whittling, and I have a nice sharp knife around, so I decided to try whittling the corner away to a slightly nicer curve. Here was the result:

Shame about that over-cut - will have to fix it in post
Not bad – hopefully will look nicer when painted.

Now, clearly this is not finished yet. However, once again, this is one of those times I foolishly failed to take more photographs, so you’ll have to wait and see how the other cuts went. Long story short, though, I cut the other bits out and then sanded the whole thing a whole bunch. I also made the shape for the other curvy bit, using basically the same method – more on that later.

Next up, I’m going to be painting some stuff. The wooden curvy stand things need to be a nice shade of grey, and I’ve got to figure out some kind of plan for the coloured goal triangle too. That’s it for now though – I’ll be covering that stuff in the next post.

Colour Bind trophy building – part 1

This is going to be a long one.

You can find some of the backstory explaining this elsewhere on the blog, but to cut a long story short, I made a game. It is called Colour Bind. It’s a physics/puzzle/platform game, and it’s quite challenging. I promised physical trophies would be mailed to people who were the first to achieve various epic feats of brilliance in the game.

This is the story of these trophies.

Now, it’s important to note that I don’t know what I’m doing when it comes to making physical stuff, and I don’t have much of a budget either. What I do have is access to my late father’s workshop (I say without hyperbole that he was a million times better at this kind of thing than I could ever hope to be), and an internet full of advice on how to do things. I was determined to make the trophies like the game – not necessarily perfect, but unique, and made by me according to my own twisted sense of aesthetics. So, off we go.

My first thought? 3D print these suckers. Shapeways lets you print stuff in all manner of crazy materials – I can just make the things in some 3D modelling software and then send them off and we’re all good. Here’s what I came up with:

It seems like so long ago that I made these things.
Straight from my modelling program. Not to scale.

Pretty ace, right? I thought so too, even if I didn’t get around to attaching Asier’s name to the trophy before I took these screenshots. Anyway, you see what I’m going for. The All Gold and the Coop trophies are the simper ones, but the 15 Platinums (platina?) and the Secret Levels trophies are a bit fancier, because those are the two very difficult ones. I was all set to go. After some wrangling to get them into the right file type (the polygon soup outputted by programs like 3dsmax isn’t what you want – volumetric data is what 3D printers crave), I uploaded them to Shapeways. To my considerable suprise, I had managed to create them all devoid of geometry problems, first time, and they were ready to print!

Unfortunately, there was a bit of a snag. If I wanted them to be of a reasonable size, this was going to set me back quite a bit, even if I just printed them in the cheapest white plastic – certainly getting them in stainless steel or anything fancy like that was going to cost hundreds of dollars at this size. So, I need a better plan.

I got to thinking – printing the cars and stuff makes sense, because I don’t know how I’d go about building one of those cars by hand. But the trophy bases, as well as the curvy bits in the Secret and Platinum trophies, are simple enough shapes – maybe I can make them in some other way.

My new plan is to make the bases out of a slice of wood. I live on a farm, so wood should be reasonably accessible, right? I get a small log, cut a slice of it, and from that slice I shall shave off a face, and that face will give me a place to attach a plaque. Then I can put the model on that. That’ll save quite a bit of 3D printing volume already, and might also make the trophies more interesting.

So, let’s get started. As luck would have it, I had to cut down a couple of almond trees a few months ago (don’t feel bad for them – they were rubbish at actually growing almonds), so I’ll cut myself a slice of that and see how it goes.

Chainsawing almond tree
Gratuitous chainsawing photo

There was also some cutting with a regular hand saw in there, but it didn’t make for very interesting photos, so I’m just going to cut to the ‘finished’ product. Don’t act like you’re not jealous of my double glasses set up here, either.

This was the least bad photo I had of this, I swear.
The flat bit is where the plaque would go.

I’ll go into more detail later about whether or not my plan to use totally green almond wood for the base works out well (it doesn’t), but around this time I was distracted because my 3D prints had arrived! Check it out:

3D printing is so cool
A handful of Colour Bind cars, and one goal triangle thingy.

These things are so cool! The ability to go from 3D model to 3D object like this is kind of magical. I’m definitely planning on doing some more of this in the future.

From left to right in my left hand, we have – little blue car that I printed for fun and to see what the colour prints were like, gold medal car, secret levels car (note that it’s riding low on its suspension, just like in the game!), the two coop trophy cars, and then another car for a separate thing that I screwed up and didn’t end up using. And of course in my right hand is the medal thing that goes on the platinum trophy. Note the little pegs that most of the models have, to attach them to the various things they need to get attached to. In my next post on the subject, I’ll be talking about taking these prints from white plastic to the colours I need them to be, including the rather onerous problem of getting the goal triangle to be a blend of red, green, and blue.

Before I do that, though, a brief note about the trophy bases. Of all the dumb mistakes I made on this project, the one where I really should have (and on some level, did) know better was cutting a base from undried wood. Woodworkers reading this will know where this is going – when wood dries it will warp and crack, and that’s exactly what happened with this. In the end, the almond wood bases that I made were thrown away, and I did basically the same process to cut some more out of some redgum we have (firewood – nice and dry), as well as some other nice-looking stuff I found downstairs that I think Dad cut from a cherry tree years ago and kept it for some project that never happened. For some reason, I neglected to take any photos of that, so you’ll just have to trust me – the bases show up in later photos, of course, so you’ll see what I’m talking about in the next couple of posts.

Messing up FRAPS – a warning

Well here’s an interesting thing that I haven’t gotten to the bottom of yet.

I was just recently putting together an entry for a game competition. Since I like to mess with shaders and other odd graphics card things, examples of that activity needed to be collected for the submission. Among them was a thing called the Cave Demo – basically the idea is that it was to be a game where you are exploring a procedurally generated cave, but unlike most such caves, this one has its generation parameters tweaked on the fly, causing it to shift around all crazy-like. Unfortunately, I’m not convinced that this was going to become a good game, so for the moment I’ve stopped working on it – it did result in some really cool -looking things though, at least to my tastes.

As it turns out, rendering a cave each frame is pretty easy – you render a bunch of stuff into a greyscale image, with the map representing some kind of density function, then by rendering with that image as your punchthrough texture you do a sort of automated Marching Squares thing, and bam, you’ve got a cave. You can render greyscale images into the cave buffer additively to get various effects like platforms appearing and disappearing, that kind of thing. It’s neat. From there it’s just a matter of interpreting the density map in a more complicated shader to generate a more impressive looking cave. Obviously this is a really ineffective explanation because how this was all done is maybe a blog post for another day.

Anyway, the key to this is that that’s actually not all that’s required if you want to have actual gameplay that interacts with the cave. This ever-changing cave will be needing functional collision detection, and for that, we need to get some or all of the cave buffer from video memory back into main memory so the CPU can deal with it. This can be annoying to set up, and it’s not the speediest operation in the world, but it’s doable and I did it and I was quite pleased with myself.

Fast forward to the other night, where I’m assembling a bunch of videos of stuff I’ve worked on to prove to people that I can make stuff. I fire up my trusty FRAPS and record what I presume to be some rad footage. I open it up in Media Player Classic and am confronted with something way way less rad than I was expecting. Rather than capturing what was actually on the screen, FRAPS has captured the contents of the cave buffer – a weird-looking blurry image about a quarter the size of the video frame, and wholly unsuitable for entering into a competition of any kind.

This was pretty soon before the competition was going to close, so I didn’t really have time to do much about it other than use a camera to film the footage and hope the resulting low quality doesn’t offend people too much. I did manage to figure out that the act of getting stuff back from the video memory to the main memory was what was doing me in. I discovered this using the time-honoured debugging technique of commenting that bit out and seeing if it fixed the problem. So that gives me something to go on, although it didn’t actually help at the time because of course getting rid of all the game’s collision detection kind of broke things. When I do figure out what’s really going on here and if there’s a way to get around it, I’ll update this post with more helpful advice.

In the meantime, don’t make the same mistake I did! There are things that can trip FRAPS up.

Faking depth values

This is going to be a short but technical post, about some information that I found surprisingly hard to find online. If your a programmer in the gaming world you’re probably pretty familiar with a depth buffer. If you’re not, you might find this post a bit confusing or tedious.

One thing you might know about depth buffers is that they don’t exactly store a simple depth value. They store a weird non-linear version of it, in a clever way to get you better depth precision closer to the camera. A good write up of the gritty details of how this works can be found at this article here called Depth Buffer – The gritty details.

Another thing you might know is that although the depth values written out are usually pretty standard (and derived from the depth of the pixel in the way described above), it’s possible to write non-standard depth values from the pixel shader. This can be useful for techniques such as imposters.

I had need recently to fake some depth values, and I was surprised that I couldn’t find the formula for converting to standard depth to depth-buffer-friendly depth. Perhaps this is because my google-fu is weak – I’m not entirely sure – but I did eventually figure out the maths required and I present it here on the off chance that someone finds it helpful.

You will need three numbers. The near and far clip distances set on your camera, and the depth of the fragment. Note that this isn’t quite the same as the distance from the camera to the fragment – it’s the distance in the direction of the camera’s forward vector (that’s what you get by multiplying the fragment’s world position by the view matrix and taking just the z component).

So to get from there to the value you write to the depth buffer, here’s what you need:

zBufferValue = (farClip / fragDistance) * ((fragDistance – nearClip) / (farClip – nearClip))

That’s it! In glsl you write that value to a built-in called gl_FragDepth – how it’s done in other shader languages is an exercise for the reader, because I have no idea.

Anyway, I realise this article falls quite a bit shy of a proper tutorial on depth buffers or imposters or whatever – maybe I’ll come back and write one of those later – but for the moment I just wanted to write down that formula. I hope somehow it is useful for someone’s particular purpose.