Today I got introduced to the Loom Game Engine. It looks fantastic; the feature set, supported platforms and philosphy all seem to be just what I’m looking for. I’m going to reserve judgement on “LoomScript” for now. An open mind…
As I was playing around with it this evening, something kept getting under my skin. There didn’t seem to be a way to configure the generated application name, it’s perpetually hard coded every where as “LoomDemo”. So you’re stuck with LoomDemo.app, LoomDemo.exe, the property lists and manifests for mobile apps are also all filled with “co.theengine.LoomDemo” instead of “com.yourcompany.YourApp”.

I decided to poke around in the SDK’s source and see what all would be involved in customizing the host. Things started off well, when I looked the top level CMakeLists.txt file there’s a couple options:
#--------------------------------------
# Configuration Options
#--------------------------------------
# This is the name of the binaries/.apps we generate
set(APPLICATION_NAME LoomDemo)
# The package for the application.
set(APPLICATION_PACKAGE co.theengine.LoomDemo)
I go ahead and change them:
set(APPLICATION_NAME Ochre)
set(APPLICATION_PACKAGE com.ambethia.ochre)
Install the SDK according to the docs:
rake deploy:sdk[ochre]
I also needed to install the Android NDK, that was easy. Some more things blow up because I have a more recent install of XCode without the iOS 6.0 SDK. I only have 6.1 installed. That’s okay, looking through the rake file, I see there’s an environment variable I can set for this:
IOS_SDK=6.1 rake deploy:sdk[ochre]
The project generation and complilation went well, but when the rake task gets to the part where they package up the SDK, they are looking for LoomDemo again. It look’s like “LoomDemo” is hard coded all over the Rakefile too. Blargh. Right around line 60 in the Rakefile, after the settings for the IOS_SDK environment variable, I add this:
if(ENV['APP_NAME'])
applicationName = ENV['APP_NAME']
else
applicationName = "LoomDemo"
end
puts "*** Application Name = #{applicationName}"
Next, I find and replace every other occurrence in the file of LoomDemo with ${applicationName}. I run the deploy task again:
IOS_SDK=6.1 APP_NAME=Ochre rake deploy:sdk[ochre]
Side note: I also needed to install the rubyzip gem (gem install rubyzip).
At this point my “customized” SDK is installed:
$ loom use
Listing installed loom sdks...
1.0.776
* 1.0.782
ochre
Sweet!
∴ loom use ochre
Configuring Project...
Checking for sdk ochre
Preparing sdk files...
Adding permissions to LoomDemo at
/Users/ambethia/.loom/sdks/ochre/bin/LoomDemo.> app/Contents/MacOS/LoomDemo
error: No such file or directory - /Users/ambethia/.> loom/sdks/ochre/bin/LoomDemo.app/Contents/MacOS/LoomDemo. Use > --trace to view backtrace
Blarg! I take a look at the backtrace for the exception, and find that LoomDemo is also hardcoded into the CLI scripts. Are you kidding me? I’m a bit frustrated at this point, but I’m confident that this is something the team at The Engine Co. will be fixing, so for now, just a quick hack will do.
$ subl /usr/local/loom/lib/helper.rb
And I add this line near the top of the file:
APP_NAME = ENV['APP_NAME'] || "LoomDemo"
And I do another find and replace for “LoomDemo” with “${APP_NAME}”
This allowed me to select my custom SDK. Once I tried to build a .app bundle though, I found another script that needed the same hack:
$ subl /usr/local/loom/lib/loom/build.rb

For further customization, I went into PATH/TO/SDK/application/osx/en.lproj/MainMenu.xib and stripped out all the references to “HelloCpp”, and deleted the extra menu items that aren’t really needed for a game.
I didn’t bother messing with the Application.icns in the sdk source, because the surprisingly build script actually swaps this out for you with what’s in your project’s icons folder. Yay, I hope all of this gets handled by that soon.
It could be that I’m completely daft, and I didn’t need to do any of this to change these things. I don’t know. There’s also a bunch of LoomDemo assets left in the app bundle, and the Android manifest is still littered with “LoomDemo” references, but I’ll cross that bridge when I come to it. I wrote this up now, because I figured I can’t be the only person out there who will want to change these defaults.
Maybe now I can actually get to making something in Loom…