-->

More Dink stuff.  I’ve been focusing on the more technical parts, especially dmod support.

Please ignore the ugly temporary GUI I’ve got going now.

Day/night mode added! Just kidding, just some palette glitch.

The .dmod format

When Dink was developed, I didn’t give too much thought to how add-ons would work.  Here is what it had:

  • Each dmod gets its own directory name
  • A readme.txt with a lot of info that I don’t think anybody uses, unsure
  • A text dmod.diz file would include the name, a line for copyright, a url, and a description. (starting with Mystery Island?)
  • preview.bmp that nobody uses (Actually, I think this was added by redink/Merlin for the 1.08 release, not me)

So yeah, very basic.

Also missing was a way to package and install them.  The first DMOD’s (Search For Milli Vanilli and Mystery Island) were packaged with .exe based installers that would locate the dink directory (in the ugliest way possible) and create a directory there.

By the way, Search For Milli Vanilli has a 4.6 rating?? Come on!! First DMOD ever, giant heads, awesome music, and eerily predicting the future mean nothing?! (The map.dat is dated 10/15/1997 .. yeah, not even I would be in poor enough taste to do the dmod AFTER what happened)

So I thought everybody would create a windows-centric .exe for each add-on?  Dumb idea, especially back before the era of nice free install makers.  So we ended up with a bunch of zips/rars/lha’s or whatever without a real standard.

Then, an enterprising lad from the Dink community by the name of Merlin created DFArc, a utility to help install and manage dmods.

He invented the “.dmod” file extension.  (I think?)  This is basically the above but compressed as tar.bz2.  (Grr, I only support .zip in my game framework!)

Then, the dink community went through the laborious task of converting existing dmods to .dmod format making everybody’s life easier.

Tar.bz2?!

If I want to make the DMOD experience smooth and take advantage of the currently 301  add-ons (some as big as Dink itself), I need to allow you to download and install the original .dmod files.  No porting, no special iPhone versions.  No repackaging.

First I improved my net code to handle redirects and allow in-game downloading by URL: (there will be an easier way too, but this “manual” download way will remain, useful for testing or just installing any dmod you feel like)

Enter any URL your heart desires. It just better be a .dmod.

I searched in vain for a small and portable tar.bz2 unarchiving class so ended up writing one using the bzip2 library.

Tar is a dead simple format, especially when you can ignore stored file permissions and the like.

I force all files to be lower-case when writing, helps with the case-sensitivity issue.

Single pass un-bzip2'ing and un-tar'ing. Quite zippy.

After it’s finished, it will kick back to the scrollable DMOD management screen:

Basic, but functional. I will add more text and probably icons for the readme and url if applicable.

And finally:

Ta-da! You're now playing a user made add-on from the comfort of the train and/or bathroom!

Incorrect aspect ratio and no midi music yet, but hey, it's playable.

What next?

Well, most of the technical issues are out of the way so it’s time to move on to interface and better audio.  At first I was thinking I wouldn’t need to support midi because I was going to remaster the whole dink audio track, but now I see midi support is a must for dmods.

So do I want to spend $500 to license fmod for iPhone? (I used this for Prey Invasion, so I’m already familiar with it… that would also give .mod/.xm support.  iiiiinteresting.)

Is there anything with similar functionality that is cheaper?  Hurrumph.

Thanks to magicman, Ex-D, and scratcher from the Dink Network‘s chat for helping me out.

Related posts:

  1. Development Diary – Porting Dink Smallwood to iPhone
  2. Development Diary – Irrlicht and Flite TTS on the iPhone
  3. Dink Smallwood Mobile – coming to iPad too!
  4. Dink for iDevices beta 1 goes out the door
  5. Development Diary – More Irrlicht on the iPhone (pvrtc, mipmaps, lightmaps)

11 Responses to “Development Diary: Dink on iPhone – DMOD support”

  1. David says:

    Love the development diarys. Thanks for the updates.

  2. Chrizum says:

    Interesting stuff, I love that Dink is still “relevant” today.

  3. Linus says:

    Well keep on working, I want this so bad! ;(

  4. Fireball5 says:

    I don’t have an iPhone, but as a Dink fan this sounds pretty cool! Good work Seth *pats on back*.

  5. DaVince says:

    I have no idea what your options are or if it’s portable enough, but fluidsynth can handle MIDI playback pretty well… It’s GPL, though, if that’s a problem.

  6. tonic says:

    Have you tried to look for ports of module playing libraries?
    quick google for mikmod and iphone reveals e.g. this page:

    http://damienciabrini.blogspot.com/2008/06/mikmod-library-ported-to-iphone.html

  7. Seth says:

    DaVince – GPL is a problem…

    tonic – Hmm, I really need MIDI so mikmod alone wouldn’t cut it. :/

  8. Linus says:

    How’s it going, any progress?

  9. Seth says:

    It’s going very well, hope to post an update soon

  10. cdoty says:

    Hekkus Sound System looks pretty good, it supports a bunch of devices, and it cost 50-80 Euro at most:

    http://www.shlzero.com/

  11. Jay says:

    holy crap! I can’t wait.

Leave a Reply