Tag Archives: Iridescence

Iridescence mobile development update

When I was at the Boston Festival of Indie Games with Iridescence, I’d tell anyone who asked about the mobile versions that they were about two or three weeks out. At the time I had every reason to believe that to be the case, but it turned out to be a little more complicated than I had anticipated.

This will be a moderately technical post, so the short version: Iridescence is still coming out on mobile devices (iOS, Android, and even Windows 8 phones), but it won’t be as soon as I had hoped.

Now onto the technical side of things.

Iridescence is written in Haxe, which is a language that aims to act as an intermediary between platforms. Instead of writing C++ for desktop platforms, Java for Android, Objective C for iOS, and C# for Windows phone, Haxe allows you to write in one language for all platforms, translating itself into the one that’s best supported by each target. On top of Haxe comes OpenFL, a framework that mimics the Flash API but has support for OpenGL and runs as a native application. A single codebase, a familiar API, and great performance? Almost sounds too good to be true.

It is.

A week before launch, I plugged in my Android tablet to get a build running. It had been my intention to have a tablet on the exhibition table so people could see the game running on a variety of platforms. I’d had it working in the past without any issues and without having to change a single line of code, so I expected it to be uneventful.

It wasn't.

It wasn’t.

I’m at a total loss to explain what’s going on. At first I thought it was just a matter of the renderer acting up, but the music doesn’t start either. Worse, I get this same behavior if the app is entirely empty. Other games work just fine, so it’s not a problem with the device. On my friend’s brand new Moto X nothing displays at all, so it’s not a matter of the tablet being below required specifications.

I’ve spoken to the OpenFL community and development team to no avail. A new beta version of the framework came out and had the same problem. Worst of all, I tried to roll back to an earlier version that had worked before and I couldn’t even compile. The OpenFL ecosystem is in a constant state of flux, with new build toolchains and dependencies popping up seemingly every time it updates, and the older (working) versions weren’t compatible with the new tools.

At this point it was time to start considering my options.

  • I could hunker down, wait for another OpenFL release, and hope that it would solve my problems.
  • Or I could bite the bullet and port the whole game back to C# (the language I wrote the original gamejam version in) and use Unity.

I’m choosing Unity. I’ll be using the Futile framework, partially because the API is Flash-inspired and will be easier to translate code between, but mainly because it’s a fully code-oriented workflow and only has support for 2D. When I first started working on the improved version of Iridescence Unity still didn’t have support for Linux and doing 2D work was a hassle. Not so any more. When I’m finished, this version will replace the current Windows/Mac/Linux Haxe-based one.

It’ll be a tough road but I’m ready to do what it takes. I leave you with the first step.

long road

Iridescence development visualized

Three name changes, three frameworks, and 33,697 lines of code and data — this video represents 11 months of nearly solo development at the rate of two days per second.

Each dot is a file, and each cluster represents a folder. Green lines represent new files being created, yellow for modifications, and red for deletions. Source code settles out at the bottom left, with level files top right. Audio is up on top near the levels, with an equal number of .oggs and .mp3s to support multiple platforms.

Towards the end it’s obvious that a lot of work is being done on level design, with scattered changes to source code as I fixed last-minute bugs, and a lot of new image files being added as I rounded up screenshots and promotional art.

Created with Gource. Music is “Hongdae” by Lukhash.

Get the game:

levelcount

Level count isn’t everything

I’m quickly approaching gold status on Iridescence, and with all foreseeable technical work finished, I’m deep in the throes of level design. Originally I had planned to ship with 100 levels, but today I decided to cut that in half and target 50 instead.

Why am I doing this?

I’ve been stuck in this stage of development for a while, actually. Slide had 16 levels when I released it, and I was intent on having significantly more for Iridescence, being as it’s going to be a commercial release and I want people to feel they’ve gotten their money’s worth. 100 seemed like a nice round number and I assumed that reaching it would be fairly straightforward.

This is the part where I was wrong. Designing puzzles is actually really hard. You want them to be challenging but still fun, subversive but not unfair, and most importantly they have to mesh with one another as a cohesive whole. On top of all that, the puzzle designer has to learn to work backwards from an interesting solution to a starting state that doesn’t make the goal obvious.

The whole process is very creatively-bound, and it’s impossible (at least for me) to sit to down and just crank out new levels up to a set quota. It’s been hard to keep a steady pace, and the constant awareness of how much more work I have in store hasn’t helped.

While considering all this, I realized that I was coming at this whole process from the wrong direction. In all my favorite puzzle games, the number of levels is irrelevant; the game goes on until it runs out of meaningful things to do, and then it stops. My number one goal in Iridescence’s design is that each level provide some way of stretching the player’s mind; whether that’s by introducing a new system, or subverting assumptions to cause misdirection. This is in direct conflict with having to fill a set number of levels. Some puzzle games are based on a small set of mechanics which are then used in levels that are more about going through the motions than finding something new each time.  There’s nothing inherently wrong with that, of course, but it goes against the philosophy I’ve been building Iridescence around.

In the end, I’d rather make a concise game that does what it sets out to do and nothing more, than a long game that’s full of repetition and filler.

Stuck Scripting overhaul

Early on in the development of Slide (before Iridescence had come to be), I added support for small script files to allow levels to contain more complicated puzzles without running into false positives that caused the reset button to show up while the level was still perfectly solvable. I was using C# at the time, and options for proper scripting languages on the .NET platform are shamefully limited, so I rolled my own.

Here’s a sample of what it looked like:

The use-case for stuck scripts is extremely specific, so the language itself didn’t need too many bells and whistles. All I needed to do at any time was compare the number of game objects of a given color, and check if pawns had a valid path to their targets. The snippet above basically translates like so:

The puzzle is unsolvable if any of these are true:

there are more red pawns than blue
there are more green pawns than blue
there are more blue pawns than green, unless all blue pawns can reach a target
there are more blue pawns than red, unless all blue pawns can reach a target

Needless to say, it’s as ugly as it is functional, and adding new features proved difficult. The inflexibility of the original design meant for some truly impressive hijinks as I tried to implement more complex behaviors with only the original syntax.

Today I stripped the whole system out and replaced it with a new one. Since I’m using Haxe for this remake, I was able to take advantage of hscript, a subset of Haxe that allows for runtime interpretation. Now, the script above looks like this:

Much better.

The original scripting system was designed as a black box, with a minimal number of inputs and outputs. By keeping the interface consistent between implementations, I was able to completely change the underlying code without changing any other aspect of the program. It’s nice to be able to change something so integral to the gameplay without worrying about side effects.

Menu work

This week in development on Iridescence I’ve been focusing on menus, settings, and save data. Here’s what I’ve implemented as feedback when the player tries to open a level that hasn’t been unlocked yet. The animation is inspired by WordPress’ login window, and I think it’s pretty clear what’s going on.

Haxe macros are amazing

Here’s a neat trick I discovered today while working on Iridescence.

Haxe has native macros that are very different from those found in C; rather than using a separate pre-processing language, Haxe macros are simply snippets of Haxe code that are run at compile time instead of run time.

In native builds, Iridescence populates its soundtrack dynamically by searching for all song files in the /assets/music folder. On more restrictive platforms like Flash, all assets have to be known at compile time so they can be embedded in the SWF, which meant I needed to create a list of files manually and update it whenever I added a new song. I wrote this little macro to iterate through the music folder at compile time and build a list of song files automatically.