As a child, I spent an impressive amount of time doing my best to screw up our Windows 3.1 machine.  From the time I dragged the Windows directory into the Recycle Bin for some reason (and it worked, for some reason), to the day I realized I didn't *need* my dad to start Heretic from the DOS prompt, I spent just as much effort using the poor Gateway 2000 as I did abusing it. 

That quality is the leading reason for my creation of this post.  One day, my dad came home with a brand new computer game that I'm convinced he purchased purely because of the cover (which is perfectly fine and fortunate, in this case):

Despite my obvious excitement, I had a gut instinct telling me that our Gateway 2000 with a 486 and 4 MB RAM wasn't good enough to run it.  Turns out I was wrong, but only by a small margin.  The game installed and ran properly... with no sound.  Or reliable mouse support.  Or the ability to traverse the game's screens faster than 2 minutes per load.  In the end, exhaustion gave up, and we never made much progress in it.

That is, until we got our blazing fast Windows 95-based Micron a year or so later.  I think we were up to 200 MHz with 32 MB RAM, so I had the highest hopes to finally enjoy playing this freaking game.  And I did!  Until I ran into a bug my 8 year-old self deemed impossible to bypass.  Lo and behold, this magical game fell by the wayside once again.

Years later, I tested Windows XP's compatibility options with Entomorph and actually found it playable after clashing with various configurations.  Eleven years after this thing came out, I finally had suitable conditions to play it.  It's been four years since I passed through those jungles, slowly changing into a mantis-like bug while enjoying the completely inappropriate, but amazing, soundtrack that only a mid-1990s game can really offer.  The itch came back, and I fully intended on scratching it.

I was smart enough to start making backup images of my most obscure and ill-treated CDs, and Entomorph was first on my to-do list after StarCraft.  It was only later I realized I made a good decision in doing this, rather than simply copying the data off of the CD manually.  It turns out, Entomorph is one of them fancy hybrid data/audio CDs!  By making an image, I inadvertantly treated myself to the audio tracks for my enjoyment.

Every time I've played this game, I've encountered problems.  I've accepted that as fact.  Because I retain the knowledge of the previous necessary fixes, it's always a new problem.  In doing so, I've realized that Entomorph is a fantastic game that actually gets more difficult with age! (Sarcasm)

This time, I had a real treat.  How many of you have encountered something like this before?

This, on an Asus EEE PC 1000H with a 1.6 GHz Intel Atom, 2 GB of DDR2, and, gasp!, WORKING AUDIO AND VIDEO CHIPSETS.  Looking around a bit, I found a Slovakian site (google translation) that gave me an idea of what was happening.  Because of perfectly acceptable programming practices at the time of its creation, Entomorph seems to have no trouble with a reasonable amount of available RAM (say, 8 - 128 MB), but shits itself with anything over.  I'd wager it's an overflow problem, or the RAM range is hard-coded into its logic.  But I'd also recommend not taking that wager - I know next to nothing about how the game's assembled (summer project!).

In any case, if the link above is unclear, the provided solution seems to be, in short, hogging up a ton of RAM until the game sees an expected amount of available memory.  The site even recommends a tool to do it for you!

My basic programming intuition has been honed enough to at least raise an eyebrow to a tool recommended to do something as shifty as (voluntarily) gobble your RAM.  So I built my own!

MemoryEater.exe will attempt to allocate the amount of memory you request, then hold it until you exit the program.  Sounds great, but does it work?

So, my terrible memory allocation method works wonderfully, but can I play the game now?

So, there you have it folks.  I proudly archive this progression of events for the ages as proof that CS students can make things work out of sheer stubbornness.  It might not be the best practice; it might even be harmful.  But somehow, it works.  For some reason, I think I prefer this terribly inefficient method over the implications of creating a virtual machine with an OS that can support it properly.  Off to enjoy this game in shameful privacy.

UPDATE! (5/22/2009)

Further investigation has led me to discover that the game's max free physical memory threshold is 256MB.  Using the Windows function call GlobalMemoryStatusEx to fill a MEMORYSTATUSEX struct, one can find some very useful information.  Nothing you wouldn't be able to find in the Task Manager, but it's great for automation.  With this in use, I've made a few changes to MemoryEater.exe.

Or rather, PlagueLauncher.exe.  Because that's all it does now.  I preserved the original, terrible application just in case I need to hog all of my free space, but PlagueLauncher is the main workhorse.  It now:

In retrospect, this is how I should have looked at this small project from the very beginning.  Ah well.  It works and I get to enjoy the experience of Squire 'Dongs' Warrick once again!

UPDATE! (4/25/2012)

A recent email prompted me to rewrite and distribute the PlagueLauncher executable. You can find download links to 32 and 64-bit versions, as well as the source code, below. Usage is:

PlagueLauncher-x86.exe mem time path_to_exe

mem is the amount of memory (in MB) to keep free, and time is the number of seconds to wait before the application exits. After allocating (total memory - mem) memory, the application launches whatever is provided in path_to_exe using ShellExecute, waits for the specified amount of time, and deallocates the memory before shutting down. I take no responsibility in any use or misuse of this program. Enjoy!

PlagueLauncher-x86.exe (51 KB)
PlagueLauncher-x64.exe (57 KB)
PlagueLauncher.cpp (4 KB)

UPDATE! (2/4/2014)

A recent email from this page prompted me to provide an update. I've moved beyond doing dirty things in memory and joined the virtual machine cult. Over my winter break, I played through the game using a Windows XP virtual machine configured to have 256MB of memory. No fuss, no muss ;)