Visualising Binary Strings

April 30th, 2010

Yesterday I met an interesting lady called Lisa doing her final year art degree project at Staffs Uni. Her project looks at the interaction between man and machine, I’m sure she could give you a nice, long explanation, but I’m not an art student ;) The reason I got involved was because I can knit! Lisa had taken a poem (Ode to the Framers of the Frame Bill) and converted it into binary. From there, she had converted it into knits & purls. We were all asked to sit in front of computers and follow the onscreen and spoken instructions, knitting and purling together, man following machine, introducing mistakes and the human element.

It was an interesting experience. I was one of very few who could keep up with the instructions, right up until I got a tangle in my yarn :( But I managed to play catchup and there was only half a row of random ;) The collection of final knitted pieces were a very interesting selection. I don’t think many of the knitters would have been employed by a knitting factoy ;) Or perhaps we just all needed slightly slower instructions and less tangly yarn? :D

We ended up chatting for quite a while afterwards, as Lisa was interested in other ways her string of binary could be used. We discussed ways of turning it into a picture of some sort… and so I lost my evening to playing with some C# code creating bitmaps in various ways from binary strings. So as not to spoil Lisa’s project, I will be demonstrating my crazy image creation with a different poem, If… by Rudyard Kipling. First, we need to turn that into a binary string, for which I used this translator as recommended by Google ;) So from words we get a binary string which starts like this: 01001001011001100010111000101110001011100000110100001010000011… :)

The first two images are fairly obvious… translate each digit into a pixel, with 0 = black and 1 = white or vice versa. Lisa wanted an image 64 pixels wide to match other pieces in her project. Obviously a multiple of 8 works better (there being 8 binary digits to each letter) but here I’ve chosen 128 to get a more square image. I’ve also zoomed in for you, so you can see the detail better :) (click on the images for even bigger versions!)


Next up, Cayden suggested using each 8 bit section as a colour, using that number as the RGB values to create a grey scale image. Here’s the result…

This naturally led onto using 3 characters per pixel to create a colour image from the text…

Next came one of my ideas… I had envisioned a tree, branching out from each side, a string of 0s creating a branch on the left, a string of 1s a branch on the right. Of course, there aren’t any particularly long strings of matching digits, so it wasn’t quite what I expected. I turned it sideways and it looks more like a bar graph now :) This is just a short section as the full text is over 6000 pixels wide, and that’s before I zoomed in to make it clearer ;)

Then I had an idea about it making a path, 0s going right, 1s going down. This created a nice, almost diagonal line, but that wasn’t very exciting. So instead, I limited it to a 64 pixel height, and reversed the direction of the 1s each time it hit the edge. This created fairly neat hills :) Again, this is shortened as the full text is very very long!

Then Bryan suggested that for a 0 you could turn left and take a step forward, and a 1 would turn you right and a step forward. I thought this would just end up with basically a circle… oh how wrong I was! Instead it created these beautiful maze/fractal/organic pictures…

Well, I couldn’t resist adding a little colour, first getting the colour to cycle black to white through all shades of grey, increasing the RGB value with each step…

Then using 0s to increase the red value, and 1s to increase the blue value, each resetting to zero once 255 was reached. I’ve also marked the start and end with a bright green dot! :)

So there you go… a number of ways to visualise a binary string taken from a poem. Of course, the text can be anything you like! A lot of time was spent last night parsing various things through the program and sharing crazy images :) Here’s the Declaration of Independence:

Should any of you be interested in playing with my program, here’s a nice little zip file of the latest version. It’s not very intuitive, it only displays a few of the images in the window, but does generate all of them (just look in the folder). It shouldn’t crash, but if it does, send me an email with the binary you used to crash it and I’ll look into fixing it :)


Oh, and in case you’re interested… here’s the source code ;)

Smile Inducing :o)

April 26th, 2010

Inspired by Attic24‘s “Three Things” posts, here are three things which made me smile over the past few days…

A big pile of DVDs purchased with an Amazon gift voucher my parents gave me for Easter.

There’s something of a Tim Burton theme, and for anyone interested the DVDs are: Edward Scissorhands, Beetlejuice, What’s Eating Gilbert Grape, Sleepy Hollow, Ed Wood and 9. Coraline also arrived a couple of days later :)

Baking cookies! :)

I love the spritz cookie maker I was given for Christmas, it’s so easy to make cookies with! :) This batch were just the classic recipe, decorated with some very sparkly “barbie glitter icing gels” I was also given as a present. Rupert, Bryan and I had great fun getting icing, silver balls, chocolate sprinkles, hundreds & thousands, glace cherries and the like everywhere :) They tasted pretty good too ;)

Watching my garden grow :)

Can you see all those little specs of green? In that photo there are radish, lettuce, leeks, purple and white sprouting broccoli, spring onion and carrot growing. No sign of the courgette or runner beans, but I’m not giving up on them yet :) The strawberry back left was a bit of cheating, since it was transplanted out of the middle of the gravel patch (no idea how it got there!) in the hopes of keeping it away from the ants so we can eat some this year.
Inside I have some flowers growing, and this morning I caught a first glimpse of green in the pepper tray! :) It’s all very exciting… if they would just grow a little bit faster, I want to eat them already! ;)

What has made you smile over the last few days? :)

Websites I Frequent

April 21st, 2010

For those of you reading this blog who haven’t signed up to be part of the beta testing, you might be thinking that I never post. I do… it’s just all hidden! ;) So I thought I should write some posts which everyone could see.

Today’s post is going to be about the websites I frequent and why I find myself spending time on them. Places you should maybe consider having a little look at to see if they might interest you too :)
In no particular order…

If you are in any way knitting, crochet, weaving or other yarn related craft inclined, this is the site for you! This site eats up rather more of my day than I’d care to admit to, thanks to its HUGE pattern database which I browse for ideas, and the very chatty forums. There are people around to help when you can’t figure out a new technique, groups where you can chat about the latest episode of your favourite TV show (including ideas on how to create any knitted/crocheted items seen) and so much more. It helps me keep track of projects, tries to organise my stash (though I have more than I’d ever admit to!) and has a lovely community.

Another craft related item, this time a blog. Lucy documents her life in beautiful, colourful photos. Her posts are almost always upbeat and cheery, full of random moments from her day, and never fail to make me smile. I love Lucy, and I bet you will too! :)

Camp Chemist
Following on the blogging theme, I have a friend from Stafford Concert Band who studies chemistry up at Keele Uni. He’s started writing a blog and I’m sure he’d love some more readers. His posts could do with a spell check ;) But he’s generally quite interesting, talking about chemistry, astronomy, and his days.

Stafford Concert BandStafford Concert Band
Since I mentioned them, I thought I would add a linky to their Facebook page. I would link to their site, but it’s updated even less often. I’ve been playing with them for a few years now and have just been “promoted” to first clarinet (i.e. none of our current first clarinettists can make it to some of the concerts this year!) We play at quite a lot of fetes during the summer, and are always looking for new members! :)

Paper or Plastic?
Some of you may remember Astragali from the Astraware beta forums, but I don’t know how many of you will know he writes a web comic. The art might not be stunning (but then xkcd is just stick men) but the comic always makes me laugh :)

Walker Tracker
With the current trend for everyone to feel a need to get fitter, I’ve found one good way to keep myself moving is by wearing a pedometer. Walker Tracker gives you somewhere to write down your daily steps, provides nice little graphs, and has a competition area to keep you motivated.

Conceptis PuzzlesConceptis Puzzles
A site full of lovely Japanese logic puzzles to steal away your free time. I love the ones which make pictures in particular. They have a free one in each section every week, and more if you’re willing to pay.

Hopefully one or more of those links got clicked, and I showed you something new :) Just don’t blame me if you spend the rest of today reading the Ravelry forums, playing logic puzzles, or reading comic/blog archives! ;)

Apologies for Silence

March 23rd, 2010

Well, I feel like I’ve been gone a while… sorry about that! The release of OddBloB marked the end of my employment with Astraware and life has been a little busy since then. On the personal side, my best friends are getting married this weekend and so I’ve been busy being prodded with pins and baking cakes. On the work side, I’ve been working on my first contract developing an iPhone app. Yes, you heard that right, app, not game! :(

On the bright side, app development is very different and so has been keeping me interested because there’s been a steep learning curve and lots of new tech to get to grips with. It’s been interesting learning how to write contracts, trying to stick to the original agreed specification when the people I’m working for aren’t actually the end client, and keeping myself disciplined to do 7.5hrs work a day without ending up working 10. When I get engrossed I tend to forget everything else, like food or sleep. Luckily I have Bryan dragging me out of my office every evening so I’ve been doing okay!

The most exciting part of the new work was that I didn’t actually have a Mac… in fact, I still don’t! Thanks to a few friends and some cunning, I have Snow Leopard running in VMWare. So my shiny new Windows 7 laptop has a Mac running in a window! Look….

My Office Setup

Mac on the right, Windows 7 on the left, with my Windows XP box under the desk which I’m remote desktopping into for email checking purposes! There’s also a Windows 98 machine under the desk on the right, for game playing purposes! Plus some pretty daffodils :) Although, they’re looking a little droopy now as that photo is a few days old!

I haven’t forgotten my games, and I certainly haven’t forgotten Worcle! I am desperate to get back to it… but I haven’t even had time to get the required software installed on this new laptop yet. It literally only arrived the day before I had to start work, and I was rather focused on getting everything set up for iPhone development. I will get back to it soon, promise :) I have ideas I want to implement, and mostly I just want you all to get to play the game that’s in my head, rather than the rough prototype you’re stuck with!

OddBloB Released for iPhone

March 2nd, 2010

OddBloB Title Screen

Exciting news today! The game I had been working on for months at Astraware has finally been released today! :) iPhone only to start with, though I know they’re intending to convert it over to other platforms (and I had it running on Windows Mobile, just lacked graphics in the correct resolutions).

OddBloB is a cute little game made from modeling clay, which involves helping a little purple dude bounce from the bottom of the screen to the top, collecting as much fruit and points along the way as possible. There are obstacles to avoid, a “Cake or Doom” mini game to play, and you need to move quickly to avoid the tiles crumbling away from under your feet! :)

I really enjoyed creating this game, and I’m very glad to see it finally released. It took a long time to go from “basically finished” to having the final sounds and music in there, so it seemed to drag on for rather a long time! But it’s finally out there and you can go grab yourself a copy over on iTunes: OddBloB

I realise I’m a little biased here, but I think you should all go and get a copy, because it’s a lovely little game which I worked very hard on! :)

Here’s a nice little video of the gameplay which you can watch which should help convince you to part with your monies:

Worcle Prototype – Sneak Peek!

February 7th, 2010

Here’s a little screenshot of the prototype to encourage you to join the beta group! :)

Use the register link on the right to sign up and then leave a comment on this, or the previous post, to let me know what devices you have :)

Call for Beta Testers

February 4th, 2010

This is your chance to get involved! :)

I have one game already with a prototype running, and a number of other ideas in the pipeline.  Now I need you! :)

If you have a Windows Mobile, Blackberry, Android or Symbian device and would like to try out my new games, hunt bugs, make suggestions, and generally just help me out (since I don’t have many test devices myself!) then please register with this blog and leave a comment on this post.  If you could tell me what devices you have and your username if you’ve come from another place I know you, that would be great :)  I’m hoping iPhones and iPod Touches can be added to the list of devices I can work with, but this requires a Mac and an AppStore account for signing (or jail broken devices) so I can’t do that just yet.  Feel free to register if you have an iPhone/iTouch as you’ll still get to see all the screenshots and possibly Windows builds even if I can’t get you a device build for a little while :)

I want to get people involved from the outset so that you can try out the prototypes and let me know what game mechanics work and what just isn’t fun to you.  I want a friendly community of people enjoying my games and helping me make them the best that I can! :)

Update: Apparently Airplay doesn’t support Blackberry at present… I have no idea why my brain decided it did, sorry about that!  If you’ve signed up and only have a Blackberry don’t worry, there will be windows (and maybe linux) builds to play with.  I am hoping to get a prototype build up today in every format I can coerce into building :)

The Importance of Prototyping

February 3rd, 2010

You’ve got this great idea for a game, and you just know everyone will love it… so where do you go from here?

Well, the first thing you need to do is test out your concept.  Just because a game sounds fun in your head, or even on paper, doesn’t mean it will actually be fun to play.  How many times have you tried out a game which sounded like great fun from the description or marketing blurb only to be bored with it 5 minutes later?  It could be that the graphics style, story line, or audio is detracting from the game play and frustrating you… but chances are the actual game mechanic just isn’t any fun.  This is why you need to make a prototype.

If you dive straight in and start making beautiful graphics, gorgeous sounds and music, working out complex algorithms for the underlying code… and then 6 months later realise that no one’s actually going to enjoy playing the game you’re going to be kicking yourself.  Of course, some of the resources you’ve created might be reusable, but wouldn’t it be better to save yourself all that effort?

This is where a prototype comes in handy! :)

The basic idea is to get something up and running as quickly as possible which will enable you to test out the basic gameplay.  Sometimes you can actually do this without any code:

  • If you’re considering a new card game, go and grab a pack of cards (or three)
  • If it’s more of a board game style, then draw out a basic layout and pieces on paper and try playing it
  • A white board can be great for trying out ideas, particularly word games in my experience

Your next job is to do some very, very quick coding.  Throw together some really bad art, just the bare minimum, using squares or letters for objects is fine, it doesn’t have to look pretty.  Work in whatever language you think you can create it fastest in regardless of what you think the final project will be created with.  Don’t worry about getting it perfect!  Grab bits of code from old projects and smoosh it all together.  Don’t worry about edge cases, or loading times, or file size, just get the basic game mechanic running! :)

Prototyping is one of my favourite processes.  Taking that twinkle of an idea and turning it into something which people can actually play.  It might be quick and dirty, and oh yes, it crashes if you do X, Y or Z, but it plays.  At this point you can see whether your game idea is going to be worth pursuing.

Next, get people to try it out!  Get your prototype onto a device you can carry around with you and ask your friends to test (or invite a bunch of people over to your house if you’re not making mobile games!)  Warn them that it’s just an idea, the graphics are obviously bad, and tell them the basic premise (because you didn’t bother to give it a title screen, or instructions, or a tutorial now did you?)

If they give your device back to you after 2-5 minutes you probably haven’t found the next big craze.  If, however, you have to fight your phone/iPod out of their hands, and promise to show them the next version, then you just might have a hit!  Of course, not every game is everyone’s cup of tea, so you need to ask a number of people before getting disheartened.  Some people hate word games and just won’t be interested, some people hate RPGs or racing games or puzzles.  Try to find a mix of friends and see what reactions you get.  Make note of any suggestions they make for the final game… a lot of them will likely be things you knew would be included, but some of them might be great ideas you’d never have considered.

If your prototype didn’t go down well think about what people said to you.  Did everyone complain that the controls didn’t work right?  Is this something you could change and try again?  In my latest prototype you shoot balls into a circle and people were complaining that the balls weren’t going where they expected.  I added in a simple line to indicate where the next ball would go and it showed me that my maths was just plain wrong for calculating the angles.  I hadn’t noticed as I’d adjusted my playing to how it was working without realising.  I fixed this bug, left the indicator there to help people, and suddenly every one liked it a lot more! :)  Try making a few changes based on the responses you received and try again.

A prototype can help highlight ideas which just aren’t as much fun as they sounded, and also help you realise how complex a game is going to be to create.  Even if the idea goes down well, you might decide that the amount of work it will require is just too much for the likely return.  Alternatively, you might realise how simple a game is going to be to create, and realise you can add extra features without dramatically increasing development time.

Basically, prototyping is awesome and it’s fun! :)  You don’t have to worry about the tidiness of your code because no one else is ever going to see it (seriously, when you start work on the real game you will start afresh!)  You don’t have to worry about catching every bug or making all the various boring forms that every game needs.  You get to just turn that spark of an idea into something you can actually play and show others how awesome you are when you can do that in less than a day! :)

Thoughts on Airplay SDK

February 2nd, 2010

A couple of weeks ago Alex from Tuna Snax recommended I take a look at Airplay.  The basic idea of the SDK is that it enables you to write once in C++ on a Windows machine and build across all the mobile platforms you can think of – iPhone, Windows Mobile, Android, Blackberry and Symbian.  This really appealed to me as I’m confident in C++ and am used to working within an SDK.  Plus, the only Mac in my house recently decided it had had enough, so I’m a little stuck with no way to develop for iPhone at present.

The download (of the 30 day trial) and installation was fairly painless and didn’t mind working with Visual C++ Express.  There was a slight issue with Windows 7, but a quick search of the forums found someone else with the same problem and a solution from one of the developers which did the trick.

The SDK comes with 3 full game examples, which I had running in a simulator very quickly and even on my Windows Mobile phone without much difficulty.  The documentation is well written and there’s lots of little demo apps to illustrate how to use the various functionality.  Their simulator is well equipped to mimic the functionality of many devices, and even has means by which to test accelerometer controls with just mouse and keyboard!

Conveniently, Bryan had just come up with an idea for a game, so I decided to try out Airplay to create a new prototype.  I was impressed by how quickly I got something up and running.  Within an afternoon I managed to go from “Oooo, I wonder how to use this new SDK” to having something with basic functionality running on their simulator.  Then after spending the following evening having a few arguments (mostly due to not realising that one of their forms doesn’t auto-refresh) I managed to get it running on my device too.

It feels a little strange trying to work with 2D graphics in a system which is clearly intended for 3D work, though it is perfectly possible.  I’m hoping to try out the 3D side soon, although I think Bryan would like me to turn this prototype into a full working game first! :)

Overall I am very impressed with Airplay and I suspect I will be purchasing a license when my evaluation runs out, since Bryan and I both have Windows Mobile phones, so we’d rather be able to build for that (if you only want to do iPhone development there’s an entirely free version!)  If you’re considering mobile game development and are comfortable with C++ I would highly recommend you take a look, it certainly beats having to convert your code for each of the platforms you want to support!