From my squishy brain to yours.


Welcome to my little corner of the web where I open up my brain and see what falls out. My name is Michael Duffy, and I spend way too much time thinking about computer graphics and how to push around little points of light. This blog is meant as an outlet for my ramblings.

August 2016
« Sep    

Would you like to play a game…?

Posted By on September 2, 2012

Game Circus Logo

I started a new job a couple of weeks ago at Game Circus, a company that develops game apps for iPhone, iPad, and Android.  This will give me an opportunity to work with and learn the Unity toolkit, as well as learn the ins and outs of mobile app development.  I have been studying Android development with Java and C++ using the Android SDK and NDK, but Unity is nice in that it allows you to work in JavaScript or C# and write one code base that can run on Windows, Mac, Linux, Android, iOS, and even Flash.

I’m continuing to work on my own projects when I can, though for the next few weeks I’ll be concentrating on learning new languages (JavaScript, C#) and code bases (Coin Dozer, Prize Claw, Paplinko, etc.).  I’m even having to get used to working on a Mac, which is a platform I’ve not had to use professionally before.  I had to re-install Windows NT on my home machine so I could run Unity (and Multimedia Fusion 2, but that’s another story).  So now I find myself alternatively using Mac, Windows, Linux, Maya, Blender, Unity, C++, C#, JavaScript, Kate, MonoDevelop, and Boxer all during the same week.  My muscle memory is so screwed…..

30 Days To Zen

Posted By on June 24, 2012

A few of the screens from the "30 Days To Zen" app.

Over the past couple of months I’ve been getting up to speed on Android app development. In addition to pouring over the Android SDK docs on the android developer site, I’ve been Googling the heck out of the various questions I run into. More times than not, I wind up over at where it seems most API questions under the sun have been talked about at one point or another. So a huge “thank you” goes out to the coders over there.

For my first app, I’ve teamed up with my friend Mark Rosenberg to write an app that supports his eBook on meditation techniques. Mark is supplying the expertise on meditation and the content for the guided lessons, and I’m providing the code and art to create a meditation timer that ties in with the text. In addition to a customize-able mediation timer, the app has support for logging your progress, lessons on meditation, and guided audio meditation so you can close your eyes and let the voice in the headphones lead you to Zen enlightenment. Or at least to relax and de-stress for a while.

If you are interested in following this project, we have a Facebook Page up with the website to follow. I’ll also be posting my progress here from time to time, and will of course announce when the app and eBook go on sale.

I started working on the app in my spare time and had several weeks where I didn’t get a chance to touch the code at all. But now that I’m done packing up our house and we’ve officially relocated to a new state, I’ve been able to buckle down over the past few days and get the app much closer to a releasable state. It still needs testing and polish, but almost all of the main functionality is now in. Most of the work now lies in finishing up the text and getting it into the app, recording the guided meditation, adding the ability to post your progress to your Facebook account, and some additional visual polish. Then of course comes the testing, tweaking, polishing, re-testing, etc. I’m not going to try and guess when this will all hit the app store, but I’m glad to at least have it far enough along where our beta testers can start to play with it.

Next up I’m looking forward to digging into the NDK more so I can use my existing code base on a portable device. My next personal app is going to be along the lines of a digital toy where the user can interact with a 3d character. I’m going to start roughing in the framework over the next couple of weeks, and hopefully it will go much easier once my desktop machine arrives in the shipment of our stuff and I can stop using a netbook whose screen resolution and processor isn’t much better than the smartphone itself!


A tiny window into the world

Posted By on June 24, 2012

My family and I have relocated to Texas from California, but all of our possessions are boxed up somewhere still in Cali, looking for an empty truck to be loaded into so they can make it over here. Apparently a lot of people are moving out of California and not as many people moving into it, so empty trucks are a bit scarce.

Alas, my main desktop computers are tucked away inside those shipments, and the only computer I’ve had with me for the past month or so is my Toshiba Netbook. I love how light the Netbook is and have written a ton of code on it using the Kate text editor, but this little single-core Atom-based machine isn’t going to be winning any speed records.

I’ve recently moved into developing apps for Android devices, and it amazes me that I can take this little Netbook computer, hook up my smartphone to it via USB, and write applications for the device. Sweet! Need to test the app on the tablet? Just hook up the tablet and run the app on there. Once everything is set up, it’s pretty much easy peasy.

But the Eclipse environment used for Android app development definitely wasn’t designed to be used on a 1024×600 resolution screen. In the standard configuration I have about 12 lines of text to work with in the code editor. I think my old Atari 800 displayed more lines than that! As a result I have to keep a lot more of the flow of the program in my head and concentrate on coding a few lines at a time. It ain’t pretty, but it can work.

I’m really looking forward to our stuff being shipped an being able to work on my desktop machine again. Maybe later this week. Maybe next. The shipping company isn’t quite sure yet…..



Demo Reel 2012

Posted By on March 20, 2012

I’m in full job hunt mode now, and this weekend I finally had time to put together a demo reel of some of the rigging work I’ve done at past studios.  Enjoy!


Blowing off the Dust

Posted By on January 17, 2012

As the end of my contract draws closer, I’m faced with some life-changing decisions on which direction my career should go from here.  Do I look for a position at another film company?  Do I return to game development at a large game company?  Do I go the indie route?  I’ve truly enjoyed all of the projects I’ve had the opportunity to work on up until now, and I’ve had the chance to work with a lot of really talented people.  At the same time, I’m really wanting to be a larger part of my next project, and be part of the driving force that brings it into existence.

So while my resume flies far and wide to see what opportunities are available, I’ve also been digging through some of my past projects to see what can be re-factored into any new projects.  That search unearthed the following gem from a deep, dark, dusty directory.

Looks like our hero just missed lunch

Barrels always open best when struck by heavy melee weapons

These screenshots are from a game I wrote back in 1999 when I was trying to get my own company Studio Blue off the ground.  It was a 2D RPG engine where you could walk around the world on an isometric Diablo-esque map and interact with various objects and NPCs.  The lighting was all dynamic, and this was back before 3D cards were as common as they are now, so everything had to be done with sprites and various illumination lookup tables.  It ran at a good clip back on the 200 Mhz machines of the time.  Alas, I had to abandon development after our initial round of funding ran out and we couldn’t find a publisher to pick it up in time.

Maybe I’ll try to port the engine to my more modern framework of code.  The libraries I use now evolved out of the original code for that game engine, so it isn’t entirely out of the question.  Plus, my experience with 3D programs has improved dramatically since those days of trying to rig characters in 3D Studio Max with the Bones Pro plugin.  Might be worth a look after I’ve finished some of the more immediate projects on my plate.

Off to poke at my code some more.



2012 : Endings Bring New Beginnings

Posted By on December 31, 2011

Happy New Year and Welcome to 2012.

This year is going to be bringing lots of new changes to my life and to this site. My contract with DreamWorks Animation ends this year, so come March I’m off in a new direction. Time will tell what that direction will wind up being, but I plan to dust off some old projects, start some new ones, and actually be able to talk on this site about what I’m doing.

For certain, I’m going to be developing some games for the Android platform, with plans to port them to iOS before the end of the year. I also want to start working on the story and script for my own film, with pre-production beginning before the year is out if I’m lucky. I’ll also be dusting off the code to the 3D and compositing application I was working on before starting at DreamWorks, and I hope to release it as Open Source once I get it a bit further along.

Today my wife and I were talking about what our New Year’s Resolutions should be this year. We decided that mine should be “Embrace Your Passions.” And that is exactly what I aim to do.

So here’s to New Endings… and to New Beginnings.


Dear Spammers

Posted By on December 27, 2011

Dear Spammers,
I’m not dead, and I moderate all of the comments to this blog. So your trying to post things into the comments is really just a waste of both your time and mine. Please stop.


Drawing Again

Posted By on February 9, 2011

Last month I had some time to sit down with my Wacom Bamboo tablet and I loaded up myPaint to try sketching out some sprites. It has been forever since I’ve had a chance to draw anything, so I’m a bit rusty. I was looking over some Michael Turner artwork prior to sketching so the sketch is roughly influenced by his style and proportions. I’m leaning towards more of a western comic book approach to the art, rather than something more anime or manga influenced.

I still need to work out a good art production pipeline… myPaint is great for sketching, but pretty bad for editing (as in you can’t edit, you can only redraw.) Swapping between myPaint and Gimp on a regular basis may be a bit clunky. I’ll have to think on this some more.

On the coding end of things, I’m almost ready to play with some animated sprites. I had to set development aside for a while since work and life got busy, but I’m feeling the urge to start work on the game again.

Well, that took longer than anticipated

Posted By on April 26, 2010

How is it that whenever you think things are finally coming together, something has to pop up and gum up the works so badly that you are thrown completely off schedule?  I blame Murphy.

My code had finally reached the point where I could implement the main menu and the main conversation window.  Immediate mode GUI widgets were in place.  The scripting language had been upgraded to use the node and attribute system.  The dialog script parser was largely implemented.  Everything was finally integrated together, and all I needed to do was write some scripts to tie it all together and set the ball in motion.

And then.. crash!  Memory leaked onto the floor.  Bugs in the code, lying dormant for over a decade planning their revenge, reared up and dashed my hopes against the digital rocks!  I had fallen into the code’s well-laid trap!  I shook my fist angrily at the compiler and cursed it under my breath.  It just stared back at me, unmoving, like only an inanimate object could.

For the entire next month, I laid siege to its digital defenses.  Wielding Valgrind with steeled determination, the memory leaks were the first to fall.  Uninitialized values were tracked down with a vengence.  Forgotten allocations were slain as soon as their usefulness had passed.  Soon the only villains that remained were cowardly hiding in the SDL libraries themselves.  I decided to let them live… for now.  But if they start causing trouble someday in the future, then mercy shall not be theirs.

With the crashing vanquished, I turned my eye to the disobedient code base.  I issued commands, but the system either failed to follow them, or completely screwed up the execution.  Such insolent behavior cannot be tolerated, lest other lines of code decide that they need not do their sworn duties either.  Through a grueling process of elimination, I tracked down the lines of code that failed me… that failed their brethren.  Code that could be… re-educated… was reprogrammed and put back into service.  Code that was deemed beyond repair was tactfully eliminated and more cooperative replacements were brought in.

Finally, after weeks of hunting down and eliminating the code that had betrayed me, I was finally able to behold a well-won victory.  Code compiled, read its instructions from the game scripts, correctly directed the GUI windows where to display, and the bitmap, text, and sprite routines each performed their task to display onto the screen correctly.  The end result, as you can see below, is glorious to behold.

the main menu

Our Glorious Main Menu

conversation window

The Conversation Window Of Doom!

Ok, so maybe it is difficult to make a code update seem exciting, especially when screenshots of the results look like a 5 minute comp job in Photoshop.  But I am actually excited that I’m able to drive the GUI from my own scripting language now, and the essential widgets that I need are performing as expected.  Everything is displayed with bitmaps and sprites, so a graphic overhaul is simply a matter of generating and dropping in the needed bitmaps.  Art will come later, once gameplay has been established.

Now I just have to make sure the conversation/scene scripts are updating the interface, and that the text moves forward when the screen is clicked on or the spacebar is hit.  Then I will essentially have everything that is needed to implement a kinetic novel.  After that, I can use the same script driven GUI system to implement choices and I will have the tech to do a basic visual novel.  A lot of work still remains to be done, but it is exciting to go from a collection of back-end infrastructure code and turn it into something that can be interacted with; an actual game.

Here’s hoping the next update will come faster and won’t require so much bug hunting.  And here’s hoping I didn’t just jinx it.



Building the bricks so I can make a house

Posted By on March 3, 2010

I’m falling into the bad habit of not wanting to make a blog post until I have something significant to show.  However, since progress is slow when you are working on the basic engine that sits beneath the game, and I don’t get a lot of time to program anyways, I wind up not posting at all.  And that is bad.

So here’s my attempt at posting more, even if the updates aren’t earth-shattering.

Test sprites, lines, and fonts

Test sprites, lines, and fonts

The above image is one of the test pages for my engine/library.  Here I’m testing simple drawing primitives (lines, rectangles, xor’ed rectangles, setting draw color, sub-canvases, checkerboards, TGA file reading, sprite encoding, sprite display, reversed sprite display, clipped sprite display, solid sprite display, clipped solid sprite display, etc. etc.)

I’m also testing out my bit-mapped font display routines, displayed as both simple rectangle copies per glyph and sprite encoded glyphs.  The advantage of encoding one’s own fonts is that you have a lot of control over how the glyphs look, and don’t have to worry about certain fonts being installed on the target platform.  The downside is that it makes supporting porting to languages like Japanese, Chinese, and Korean much more difficult.  Ah well, I’ll cross that bridge when I come to it.  Once upon a time I worked with Shift-JIS, bitmap-encoded Japanese fonts in the days before Unicode, and I’m sure I can pull off something if need be.

In the lower right hand corner are a couple of buttons driven by the new Immediate Mode GUI library.  Many years ago I wrote a GUI library which saw light of day in games like Business Tycoon and the original version of Galactic Civilizations 2, and I’ve been salvaging what I can of either code or ideas from it to build the new IMGUI library.  It is actually simpler to develop my own Widget library than to try and use an existing one, and it will again give me complete control over how the interface looks and responds.  It also makes the code very portable across platforms (Win/Lin PC, Mac, Pandora, Nokia Internet Tablet, netbooks, etc.) since I just need a surface to draw on and I’m good to go.  Also it will be possible to display the widgets through 3D surfaces in the future if need be, though the game engine is currently only 2D.

I’ve also been busy with the scripting engine.  I overhauled the old C-syntax scripting language I wrote for an RPG engine a decade or so ago, and brought it up to integrate with my modern code base.  I’m combining ideas from C, C++, and Python all into one language, and with the tight integration with my world representation / scene graph, it should suit my purposes nicely.  I also wanted to write my own scripting language rather than using Python or Lua or somesuch, so that I could make sure the syntax and flow works exactly how I want it to.  (Do we see a theme developing here?)  Also I wanted to insure maximum portability and minimum external dependencies in my code.

I’ve also been working on a dialog script parser, that is similar to the script parser in RenPy.  RenPy’s dialog scripting approach made a lot of sense to me, so my own dialog scripts are… errr… heavily inspired by it.  This is the code that currently has my focus, and I hope to be driving a dialog interface with the code before too much longer.

So there you have it.  Lots of individual bricks have been built, but there’s no house yet.  I haven’t started on any art or story yet, so my Visual Novel is lacking both visuals and a novel.  All that will come in good time… I just need to get around to building the house!