Lemmings "live-development" blog
successfully ported source code from Palm OS to iPhone and Palm Pre in less than 24 hours!

subscribe to our mailing list to hear about new releases and competitions!


HOT NEWS Mobile1UP has released Caveman!

afer almost a year of being dead-in-the-water; we recently put a bunch of effort in place to turn this into a real title after the talks with SCEE ended up going no-where. we teamed up with an excellent artist guy and audio/sound effects dude to refresh the Lemmings concept with a 2011 update - in a pre-historic setting!

in-game screenies - completely new but totally familiar?

It already is starting to get a lot of rave-reviews from users - but we are not yet finished! Loads more levels to be added to the game and of course a bunch of improvements to make Caveman the game year for 2011 (a modest goal - we know)!

03-Jul 16:00 >> Thank you for all the support!

we have received a lot of attention and support from many users and websites over the world around bringing Lemmings into the radar for iPhone and Palm Pre - even with the cease & desist, it has not put a damper on our enthusiasm for this title.

in the event we have no success talking with SCEE (Sony Entertainment) we will rework all the artwork, audio, music and levels to create a brand new title based on the engine - which we wrote from scratch without on our own based on observation in 2001.

we did start an independent version a while ago got side tracked with other tasks.

level 1 - new artwork redesign (late 2009)

using the same engine - but it would require a lot more effort to convert 120 levels.

29-Jun 22:00 >> SCEE - Sony Entertainment Cease & Desist

as much as we would love to have this title reach everyone, we have unfortunately been contacted and instructed by Sony's intellectual property and legal department to remove our Lemmings conversion from our websites and distribution channels.

while are did this as a tribute to the game - we can only hope that Sony actually does a conversion for platforms like iPhone and Palm Pre in the near future. we will open communication with Sony to explore the rights for these platforms!

stay tuned!

27-Jun 21:30 >> YOU TUBE VIDEO POSTED!

while many of you anxiously wait for this - here is a video of it in action on an iphone.

thanks for Joel Evans over at the mobile gadgeteer blog on zdnet for making this video!


after a mere 36 hours (beat that!) - the news you have been waiting for! we are complete!

submission for iOS (iphone/ipod touch/ipad) is complete

submission for web os (palm pre) is complete

it is now up to the various "superior" approval boards to handle the rest!

we have successfully ported over 10 year old Palm OS source code that we had lying around to these new platforms - however, more importantly it was done solely with the efforts of Aaron Ardiri, the chief guy behind Mobile 1UP. if you have enjoyed this live-blog and want to support us - you can paypal us a donation to:


the application will be made available for free - so grab it as soon as it becomes available!


we have reached our milestone for this effort and downloads are available!

downloads removed due to request of Sony Entertainment

we did a lot of play testing and cosmetic improvements this morning and we are very happy with the result - it has been an amazing journey over the last few days to make this happen, we even surprised ourselves! it has been a long time since we coded this way!

it is key to point this is a "homebrew" version - not the official, so we added this:

just to be 100% clear that this isn't an official version

we will be submitting a binary to the iphone and palm pre distribution channels later today!

26-Jun 08:00 >> RISE AND SHINE!

no sleep for the wicked as they used to say - and we are back!


yes - exactly 32 hours into the process we have a beta for play review.

the end is so close?

we will give it some internal play testing to see if everything is fine and there are some minor changes/tweaks to make but otherwise we'll be ready for submit for review on all the various usual distribution places for both iPhone/iPod Touch and the Palm Pre.

it is time for some ZZZZ's - we'll be back in the morning with desktop binaries!

25-Jun 23:05 >> GAME SUMMARY DONE

after taking a small break for dinner (have to eat guys!) - new update

a summary screen showing your progress or failure on a level

the user interface is pretty much now complete, this is a fully playable game now with only a few small changes to make before it can be considered for submission/publishing. this will definitely kill a lot of time for people - we are already play testing internally.

should have no problem submitting this before going on vacation.


it is always the user interface that takes so long - but here is an update!

you can preview levels before playing them

we of course cannot post all 120 level previews but this is going so well - the preview is exactly 50% of the underlying level bitmap and the configuration matches what was in the original game. select the level to start or go back to the difficultly selection for more!

time for dinner (supper) and then the game summary screen when we am done!


after a little distraction with fixing the audio - we are now working on new screen designs.

mention @ toucharcade.com

25-Jun 16:15 >> AUDIO LATENCY - 8khz vs 22khz

we mentioned earlier that the music and audio samples were 8khz - this means 8000 cycles per second. cd quality is commonly refereed to as 44khz (44100 cycles per second) - what does this mean to lemmings? well, the big term used in the development world is latency.

latency defines how long it takes to respond - in the demo it takes a while to play a sound when an action is performed. going from 8khz to 22khz means the response is 2.75x faster.

     ** source piece to convert 8khz to 22khz on the fly (2.75x scaler)
    // 8khz
    //   _MemMove(sound -> pcm, data, size);
    // 22khz (converted from 8khz)
         src = data;
         dst = sound -> pcm;
         idx = 0;
         for (i=0; i<cnt; i++)
           idx += 93; if (idx > 256) { idx -= 256; src++; }
           *dst++ = *src;

this is some magic code we wrote a few years ago - basically we need to stretch the 8khz audio buffer over to a 22khz one. this is done by writing the same value until 2.75 cycles passes. a perfect way to do this fast? 93/256 is 2.75 - we use an internal counter to check when this period passes, the result is perfect.

... or would you prefer to have a binary 2.75 times larger :)


we have successfully ported all the code we need from the Palm OS version over to our new development environment, so any new features now are focusing on the new user interface and playability on the new devices.

"just dig" ala lemmings font

we searched high and low and eventually found a bitmap with all the lemmings font sprites in it and we can now start working on the new user interface - a sample of how the font looks is shown above using the "Just dig!" title for level one in the FUN set.

25-Jun 13:35 >> ... AND WE ARE BACK!

we had to pop out for a few hours to prepare for the big vacation.


in less than 24 HOURS of effort we have a fully playable version!

screen grabs of the first level in each difficulty!

you can now play the first levels of fun, tricky, taxing and mayhem on your desktop!

downloads removed due to request of Sony Entertainment

we are looking at how to best handle the user controls and of course the selection of levels to play - but all the core parts are there (gameplay) including that retro music and cool sound effects. check out the different difficulties for the various music!

we need to run some errands; so development will stop for a few hours - we will be back!


well - even if we are doing this live, this just proves we are human!

grr - notice how the id's for the resources change between lines?

we were scratching our heads for a while on this one - kept getting a EXC_BAD_ACCESS (not good), as it turns out it all came down to a cut and paste bug - the worst! now we found it, we can continue with development. that killed over an hour of our time.


it is one thing to see the little green dude walking over the screen but what about partying to those awesome tunes the original game had!? surely you remember those classics (some listed below) and the cute "lets-go" and "oh-no" sounds when the lemmings pop when nuked.

  • can can
  • she'll be coming 'round the mountain
  • ten green bottles

to gloat in the retro goodness; we'll even keep the original 8khz audio format - it also allows us to keep a smaller binary. our development environment has support for playing music and mixing samples on the fly, using the classic PCM (pulse code modulation) format - where we actually mix the audio wave on the fly.

the PCM representation of the "pop" sound at 8khz

we use a tool called audacity to convert audio files into raw PCM audio format for mixing - while we could go with existing music (mp3, ogg) and audio (wav) formats; to avoid any computational overhead and to have full control we mix everything ourselves.

want to know about the history of the game - check out Mike Dailly's (creator) writeup:

Complete History of Lemmings

25-Jun 05:30 >> RISE AND SHINE!

no sleep for the wicked as they used to say - and we are back!

24-Jun 21:45 >> CATCHING Z's

working on this effort "solo" surely takes it out of you - almost 16 hours today.

it has been an extremely long day and lots of progress has been made with the port, the majority of work now is around interaction design and looking at a new user interface for the game selection. music and sound effects are also the final piece of the puzzle.

if there is time tomorrow - we will build a version for the other majority that uses windows.


we have been receiving a lot of cool emails and messages from people!

mention @ precentral.net


we are definitely past the half way point in this port - not bad for a day!

the majority of the core lemmings game logic has been migrated; all that needs to be done now is to integrate a control mechanism for the lemmings (to assign tasks) and work on the user interface for the game itself. all of the mechanics are in place right now.

downloads removed due to request of Sony Entertainment

if you are using mac osx - grab this version and give it a whirl. the nuke button no longer returns to the level pack selection - it will start the nuking process for the lemmings. try this on a level where the lemmings get stuck in a small area that can be blown up.

24-Jun 17:00 >> 24 HOURS IN - WHERE ARE WE?

we started on this 24 hours ago - where are we exactly?

we just got the automatic release of lemmings working so now we can see lots and lots of lemmings on the levels - we can also nuke them (gonna have to make returning to menu another key). all in all - the progress has been great.

we should have a playable "demo" in a few hours without any problem.

mention @ webosroundup

24-Jun 15:45 >> SOME PALM PRE "LOVE"

we figured we would give it a spin on the palm pre - amazing!

yes, it looks lovely in real life as well!

just to demonstrate the versatility of our development environment we just built a version for our palm pre to try out - bottom line is that it looks amazing. it may even be very playable even if you have fat fingers, fast forward works like a charm as well!


not even 24 hours in (including some sleep) and we have our first walking lemming!

the first walking lemming - following the terrain as expected

this definitely calls for a new mac osx binary to download and play around - you cannot control the lemmings yet, but you can switch the levels and see the little bugger fall to their death or walk back and forth forever waiting for you to control them.

downloads removed due to request of Sony Entertainment

you can even use the fast forward button to speed it all up!


got a slight distrction - will go to lunch after this entry :)

how the mask relates to the foreground bitmap

the lemmings engine uses a pixel perfect collision detection system and this is done via the use of a mask - an example is shown above, to highlight the different types of "ground" that can exist within the game. if the mask has white - the player can freely move around, different colors of gray/black however mean something completely different.

diggable areas are marked as black rgb(0,0,0) and non-diggable areas as dark grey rgb(128,128,128) - these do not get removed by explosions or digging. there is however, a special type marked in light grey rgb(204,204,204) allows for directional digging only, where the lemming must be facing a specific direction to dig.

it is amazing how we pulled this off back on Palm OS back in the day


wow - it is amazing how coding styles change in 10 years!

some of the core logic behind some of the lemming movements

a very productive morning - the core "movement" engine of the lemmings is around 1,000 lines of code. after putting a few stubs in place and cleaning it up a little - it compiles (yay). the code isn't as pretty as we would have hoped but it does not stop the porting process.

we have been at this for a few hours already - time to clean up and eat!

24-Jun 11:15 >> MAC OSX - DOWNLOAD AVAILABLE (2)

been doing a lot of things the last two hours, getting all the sprites into the right formats and cut and pasting some code from the Palm OS version and making it all work. progress takes time; but we are moving along!

downloads removed due to request of Sony Entertainment

a new version (mac osx only sorry) is now available showing the basic loading of level configurations and some elementary animtions (clock, fires) in addition to be able to pause it.

still not playable yet - but it will be soon.


you want to see something real right?

a walking lemming sprite and the resulting animation

there are a lot of individual sprites within the lemmings game - in fact, each individual sprite is 16x16 pixels in size. the final sprite bitmap with all the individual frames is 128x848 - that is approximately 424 individual frames! they must have gone cross-eyed.

we also have all the configurations loading correctly now!


earlier on we showed how the original Palm OS lemmings game had the level configuration defined - works well for PRC files but a little more of a hassle for the modern platforms. it is much nicer to define a single configuration file for each level.

a new version of the level configuration information

to make this process automated to some degree we put together a small "extract" utility that parses the original RCP files from the Palm OS version and defines individual files for each level. all 120 level configurations were extracted in a matter of seconds.

24-Jun 06:00 >> RISE AND SHINE!

no sleep for the wicked as they used to say - and we are back!

23-Jun 23:50 >> ZZZZZ

maybe we should have started earlier today - but it was lovely weather here in stockholm.

(... at least i'll try to get some sleep ...)

we made some excellent progress today and expect to make more tomorrow. we will continue the live-blogging and keep you up to date. we have seen in the past 72 hour challenges for iphone to build and submit a game to the application store.

we figured we'll do one better. doing a timeless classic that everyone wants and most importantly, since this live blog is the effort of an individual and not a team - with much less resources! blogging and coding at the same time makes the process a little longer - but, it will be worth all the effort in the end!

nite - see you tomorrow!


ok - we know it is not a full game yet, but it has only been a few hours. for those who are lucky enough to have a Mac OSX machine - here is a binary for you to download! we would also give you iphone and palm pre binaries - but do not blame us :)

we apologize for not building a windows binary yet - that requires windows to be started (eek)

downloads removed due to request of Sony Entertainment

it should start up easy enough and show a sexy boot screen that fades out to black and then gives you the option of choosing a game pack (FUN, TRICKY, TAXING, MAYHEM). it will by default load the first level - you can then use:

    [-]  - go to previous level
    [+]  - go to next level
    nuke - return to pack selection
while you are there - click and drag the mouse and the level should scroll left and right to match the dragging of the mouse. this is all it does right now - soon i'll add the clock, some animations and more importantly, the little guys.

there you go, you saw it happen here first!


we just got word that the mobile gadgeteer at zdnet has picked up the live-blogging - perfect timing for us to send a proof of concept to them which we are in the process of making available to everyone else to download.

mobile gadgeteer @ zdnet


now we have all the foundations in place - it is all about getting down to the nitty gritty and actually showing something on screen. the level bitmaps are 640x128 - so to make them of any use on the iphone and palm pre, we'll need to do some special pixel handling.

low level programming - creating the screen bitmap on the fly

looks complicated? nah - its simple pointers and C :)

what gets displayed to the user - perfect!

since the dimensions of the display are 480x320 - we only really want to draw a small region 240x128 blown up here, our next step is to introduce a variable to allow the display to move left/right to show the complete area of the level.

it is nice to see stuff come together so quickly!


so far both games are goal less - i wonder why we are even watching this *g*


boy are we glad we've done this before :)

we develop in our own cross-platform development environment that builds native binaries for each platform - our code is written purely in C so we do not violate any of the distribution developer agreements (ie: Apple - section 3.3.1) - we build everything using platform tools.

we have our first binaries! the show the boot and home screen right now (but, do have all the resources) - this is typically where the fun stuff begins because we have finished with the project setup. the good thing is that everything we work on from now on is for all platforms.

currently we are building binaries for iPhone, Mac OSX and Palm Pre.

23-Jun 19:25 >> LEVEL RESOURCES (2)

the original artwork as a 256 color gif image - however for it to be of any use for us moving forward, we need to convert it into something more useful that we can rely on.

    $ convert.sh
    for i in `ls *.gif | sort`
      j=`echo $i | sed 's/gif/bmp/g'`
      convert $i -type truecolor $j
      echo "convert $i to $j"

the above shell script uses the excellent open-source and free imagemagick toolset to convert the bitmaps into raw 24 bit BMP files which consist of RGB values that we can optimize and convert to what we need within resources. each bitmap now is 245,814 bytes in size - 640x128 @ 24bit + 54 bytes header.

since we are designing this with cross-platform in mind - we are not going to store them in some "platform specific" format, we actually will deal with all the compression and handling on our own. as resources, the following setup will be used:

    FUN:    base id = 0x2000
    TRICKY: base id = 0x3000
    TAXING: base id = 0x4000
    MAYHEM: base id = 0x5000
    the mask: 0x0ff0 will determine the level number itself
    the mask: 0x000f will determine the bitmap, mask and level configuration

it is always good to allow yourself the ability to define a pattern that you can identify for extracting information out of resources. you will find this is a common technique used by developers everywhere - maybe we have been doing this too long *g*

with all the compression in place - the level bitmaps + masks on their own come to 1,472,475 bytes in size. not bad, effectively 12,270 bytes per level. we are using a mixture of compression algorithms, custom built over the years - good for us, bad for hackers.

that update took around an hour - so many files to play around with!

23-Jun 18:30 >> LEVEL RESOURCES

by now; you've checked out the original levels on ardiri.com and the first part before we really start anything is to know howe we'll deal with the level definition/resources.

the basic artwork - minus any animations and overlays

the mask bitmap - used for determining where lemmings can do stuff

each level has a background bitmap and a mask - defined as 640x128 pixels in size. the background bitmap is used to give the look and feel and the mask is used for logical purposes; effectively defining where lemmings can walk, dig and perform their actions.

in addition; each level has a configuration:

in these we get an idea of where the entry/exit positions are and also the configuration for how many of each type of lemming exist - since we have done all the hard work back in 2001, we really dont want to mess with this again.

now the task is to convert it into resources we can use. the original format was 4bpp (4 bits per pixel), with a palette which seems a bit of a hassle to deal with since we wont be using that screen format for the game itself.

now it is time to write a script to convert these bitmaps and configuration files.

23-Jun 18:10 >> GOING BACK IN TIME (2)

while we dig up all the original artwork for the game - why not take a minute to check out what we are basing this whole effort on - check out the original game!

Lemmings for Palm OS

we will be including 120 levels in the game - just like the original, they have been modified slightly due to restrictions on the platform back then, we will work with this version!

  • 30 levels - FUN
  • 30 levels - TRICKY
  • 30 levels - TAXING
  • 30 levels - MAYHEM
  • the original game didn't store things this way; but since we have done all the work, and we do not want to use any copyrighted material we'll explain how this all worked.

    23-Jun 18:00 >> GOING BACK IN TIME

    wow - it has been a long time since we have looked at this source code, in fact, we originally did our port for Palm OS back in 2001 - but it went through a few iterations.

    the original code was designed to run with a very small dynamic heap; so we had a lot of cheats for dealing with colors and memory allocation, in fact, the original version was actualy 16 grayscale with hacks to make it colorful.

    we wont need all of the original code, as there wont be the same hurdles now we have newer mobile platforms - however, to give you a point of reference, the original source code comes in at 25,000 lines of code!

    at least it is documented :)

    23-Jun 17:40 >> VIRAL MARKETING - IT HAS BEGUN

    we have posted news items in the biggest forums for iPhone and Palm Pre related development - lets get some traction on some visitors viewing this stuff happen..

  • forums @ toucharcade.com
  • forums @ precentral.net
  • my facebook feed
  • now it is time to get down to the business side of things, as one would say in the game

    lets go!

    23-Jun 17:30 >> TITLE AND IN-GAME MOCKUP

    KISS (keep it simple stupid) - game selection

    conceptual view of how the game play will look

    23-Jun 17:00 >> PROJECT START

    we have wanted to do this for a while - but have always put it off due to other commitments and lack of time. we hope to post regular updates here - keep checking back for updates!

    "Lemmings" is a trademark of SCEE (Sony Computer Entertainment Europe) and has been used on this website without permission but to recognise the original source of the game idea this software imitates. SCEE has not been involved in any way with the development of this software. "Palm" and "Palm Pre" are registered trademarks of Palm Computing, Inc. "iPhone" and "iPod Touch" are registered trademarks of Apple, Inc.

    Copyright © 2008+, Aaron Ardiri. All rights reserved. Designed for 1024x768 resolution.