Last Login:
October 11, 2016

Secret Agent

User Profile

Hits: 105,089
Joined April 14, 2006
Games (8)
Examples (2)

orbiting example
April 30, 2006
Unity Pong example
December 04, 2009
Favorite Users
Dev - Sort these by name
Favorite Games

Dirty Hacks
Posted on June 24, 2013 at 18:31

Sometimes you just have to get code working, regardless of how pretty it is. This is especially true for game developers, since you generally want a playable prototype as fast as possible.

I find this quite difficult sometimes. My progress gets bogged down by planning for the future, by writing clean and modular code, or by finding the optimal solution for everything.

Perhaps my engineering degree created this desire for perfection? I don't think so. Code written by my lecturers was almost always very messy, with sloppy indentation and inconsistent braces. (At least it wasn't as bad those ancient hieroglyphics they call handwriting.)

So do I write perfect code? Definitely not! Looking back at code I wrote months ago, weeks ago, or sometimes even just seconds ago, I spot things I would do differently. Why is this? That answer could take up a whole other blog post.

What I want to show you is this level editor I've been working on:

Above is a cubic bezier curve.

The black shapes can be moved to manipulate the curve. The squares indicate end points (where the terrain begins and ends), while the circles represent control nodes (used to manipulate the shape of the curve.)

It was surprisingly easy to implement, taking only a few hours. Feeling confident, I decided to add circular arcs as well. After all, surely arcs would be super easy in comparison?

Above is a circular arc. It turned out to be terrifically hard to implement, and took, on and off, about three days to get working.

I found it very irritating because, at the outset, it seemed like such a simple thing to do! The user places three points; two squares and one circle; then the arc then just has to pass from one square, through the circle, to the other square. For any three given points there exists a circle that passes through, so it is just a matter of determining this circle, and taking only a section of it - the arc.

The first bit I could do - determining the circle - that was a simple wikipedia job. It was the second part that stumped me.

I managed to isolate the problem down to a couple of things. Part of the it was this: my algorithm incorrectly calculated the angle that passes from one square, through the circle, to the other square.

In the above image, the correct solution is the yellow angle. However, my calculation would always return the shortest angle, so it never worked for a reflex arc. I spent a while trying to find a mathematical solution to this, but hours passed and no progress was made.

Through experimentation, I found that by manually adjusting a couple of boolean parameters of the arc generation code I could always create the correct arc! The parameters controlled a couple of things: whether to flip the arc direction, and whether to subtract its angle from 360 degrees.

And so I arrived at my solution: brute force!

Given that one combination of the aforementioned two boolean parameters always led to the solution, this meant that only 4 possible combinations exist. So I stuck the arc generation code inside a loop which tries all 4 combinations and returns only the correct one. It works flawlessly!

Is this solution sub-optimal and terribly ugly? Yes; but that's not important! What really matters is now I can move on to making it playable, and find out whether the game is fun.

For similar tales, read the Gamasutra article on Dirty Game Development Tricks. My favourite one of those is where the programmer exploits a buffer overflow to patch his own game. Oh, and also the one where they store audio data within a 3D model.

What dirty hacks and programming sins have you committed in order to get things done?

Giant Creme Egg
Posted on February 10, 2013 at 13:55

I love Cadbury creme eggs. My favourite tea mug is a creme egg mug. I've been known to stock up on creme eggs during Easter to try and make it through the rest of the year when they are unavailable.

When I am not on the computer doing programming I often like to do cooking or baking. As a result over the past three days I did something I've always wanted to: made a giant creme egg! (There - that's my tenuous link from game development to giant creme eggs. Now onto the fun stuff!)

-2.2kg icing sugar
-1.85kg Cadbury dairy milk chocolate
-1kg golden syrup
-350g butter
-5 tablespoons of vanilla essence
-Yellow food colouring (though you should use orange)

-Two 25cm x 17cm egg moulds
-Mixing bowl large enough to place over your head
-Pastry brush

1) Mix together the golden syrup and butter. Gradually add the icing sugar in, a little bit at a time. Once mixed thoroughly, you should have a bowl weighing over 3kg and tasting delicious. (Takes about 2 hours)

2) Place mixture in the fridge, then perform steps 3 to 7.
3) Melt the chocolate over boiling water, starting with just about 200g.

4) Put a little bit of oil in each egg mould, and use the pastry brush to spread it around.
5) Using the pastry brush, paint a layer of melted chocolate onto the egg moulds. Paint slightly beyond the edge of the mould. Don't make the layers too thick.

6) Put the moulds in the fridge for 10 to 15 minutes (such that the chocolate is no longer runny). Then repeat step 5: keep repeating this process until all chocolate has been used up. This amounted to 14 layers of chocolate, over the course of nearly 4 hours.
7) Leave in the fridge overnight.

8) With a sharp knife, cut the excess chocolate off that protrudes above the top of the mould. This should leave you with a flat chocolate plateau about half an inch wide all the way around.

9) Take the mixture out the fridge, and separate about 1/3rd of it into a separate bowl, and add lots of colouring to it. We used yellow food colouring, but that was a bit of an oversight - creme eggs are actually orange in the middle.
10) With the egg halves still in their moulds, gradually add in the uncoloured mixture. Spread it around with a knife, making sure to spread the mixture up above the height of the mould - this is because the mixture is slightly elastic, and always returns to a smaller size than initially spread into. Leave a large dent in the middle of each egg.
11) Fill the middle dents with the coloured mixture. Pray that you have enough to fill up to the top. Then leave in the fridge overnight (again).

12) Melt some more chocolate, and spread a thick layer all around the rim of one egg half. With both halves still in their moulds, place them adjacent such that they are symmetrical.
13) Each egg half weighs approximately 2.5kg. Enlist the help of a fellow human being, and have them slowly lift up one egg half while you lift up the other, rotating both halves upwards until they stick together forming an egg shape, oddly enough.
14) Carefully place the whole egg in a bowl for stability, and press around the mould to ensure the chocolate forms a tight seal all the way around. Place in the fridge for 1 hour.

15) Remove the egg from the fridge, and placing it horizontally in a bowl again, lift the top mould off. Cut all the excess chocolate off. Flip the egg over and remove the other mould. Use paper towels when touching the egg to avoid it melting.
16) Pose the egg for some saucy shots.

17) Wonder what on earth you will now do with this monstrosity. Take into account the following facts:
-It weighs 5kg;
-It contains approximately 4000% of your GDA of sugar;
-It is equivalent to about 125 Cadbury creme eggs.

Slower Speed of Light in Games
Posted on October 29, 2012 at 20:25

Wouldn't it be cool to see the effects of special relativity very visibly by lowering the speed of light? Well now you can by playing this game!

Developed by MIT Game Lab, you can download A Slower Speed of Light here.

The aim of the game is simple: collect 100 orbs. With each orb you collect, the speed of light is lowered. Things start getting a bit psychedelic when you have upwards of 80 orbs, due to the Doppler effect shifting colour hues, and warped models from length contraction.

Another game employing this same idea is Velocity Raptor. I found velocity raptor a lot more informative, plus it takes you through the effects of special relativity one step at a time. The puzzles are a lot harder though. I got up to level 31.

To finish, it seems that Frog Fractions didn't get much love in my last blog, perhaps because I didn't sell it too well. Let me try again!

In Frog Fractions, you play as a frog who eats bugs and collects fruit. Use fruit to buy upgrades. Upgrade your lily pad to a turtle, and swim underwater to find a stash of fruit. Use all that fruit to upgrade you turtle to a dragon, and then attach a warp drive. Now you can fly your frog on your dragon through space to combat the bugs in asteroids on the way to Mars! But oh no, you get taken to court on Mars, and sentenced to prison. You manage to escape from prison, swimming through the underwater caves while listening to the history of boxing. Finally, you find an old space ship, and play a text adventure to set up the targeting computer and put goo in the sleeping pod. You can at last fly back home, where you find yourself president of the world, and in charge of the economy. To become rich, you can print as much money as you like in order to aid in your bug porn business.

That is Frog Fractions. I apologise that I had to ruin the whole story.

Sexy Hiking
Posted on October 21, 2012 at 07:54

Do any of you remember this game?

Or perhaps this one?

I was doing some digital archaeology, digging through some files from my previous hard drives. I came across a lot of old game maker games I had completely forgotten about, including the two shown above.

They were made by a guy called Jazzuo, perhaps 5 or more years ago, I can't find the exact date. Unfortunately his website 403 errors, so I took it upon myself to reupload those two games for you here:

Sexy Hiking
Sadist Meets Pacifists

They are really difficult games, with an odd mix of programmer art and 3D rendered graphics, but yet the gameplay I find extremely fun. I just played through the whole of Sadist Meets Pacifists, and a bit of Sexy Hiking.

As I played these games, it gave me a thought. Perhaps I spend too much time trying to get little sections of my games perfect, such as making a smooth menu interface, or making sure the story makes sense; and as a result I neglect making the game actually fun.

I put together a compilation of many of my games, and a trend seems to be that I have become more pedantic as time has passed. My really old games are pretty terrible in terms of graphics and definitely have massive room for improvement in many other areas, but at their core I still find some of them really fun!

I suppose I am getting at two main things in this blog:
-Can you remember other great games/game developers that have been forgotten?
-Does being too pedantic/perfectionist cripple making good games?

Graphical Error
Posted on October 04, 2012 at 08:16


Up until recently, I had been working on a game for S4D, which looked like this:

My aim was to invoke that feeling of thinking-you-know-what-will-happen-next. For example; when you suddenly get the thought that the phone will ring, and a few seconds later it does. Or simply that feeling of something-bad-is-gonna-happen.

I achieve this effect by showing the user a series of events at the beginning of the game. Then, as the user progresses through the game, they find these events occur to them but in reverse order. The further they progress, the harder it will be to remember the events they were shown. This should then create the feeling of subconsciously knowing the outcome of situations presented to them.

That's the plan anyway.

The black and white art style gave me other ideas though. I went off on a tangent and created a completely different game: Graphical Error!

It's hard to do this game justice with just screenshots. Apart from level 1, you can only tell what is happening when everything is in motion.

All the graphics are white noise (in varying ratios/offsets/phases). As a consequence, I find it leaves me feeling quite nauseous, and gives me a headache if I play for too long.

If that sounds fun, you can try it for yourself! Download "Graphical Error"

I'm also working on another black and white game (which fortunately does not cause nausea etc).

Prev Page | Next Page

Recent Activity
Active Users (0)