OSX and Linux Builds Now "Work"

Hey Folks! Another slog of a day, as I worked on getting the Linux build running.

Most of the morning was spent in a mode similar to my OSX day: chasing phantom errors in the build process which were not really the issue. I couldn't build the game because the lime compile was missing a header file. Chasing down that header file got me further, but then I was missing some Linux libs. After those were installed, I ran into a missing ndll for Linux (we never needed one before on mobile, so it wasn't in the repo).

So then I spent an hour or so trying to build the Linux and Linux64 ndlls for Lime. Except g++ was missing from my Ubuntu. Then some libs for that. Then I found out my lime source code was missing some dependencies from git because they were in their own repos. And syncing to those was giving me missing includes. Then I remembered that using haxelib to install a specific version of lime would give me the binaries for the ndlls and why didn't I do that before?

No matter, still didn't work. Segmentation fault. I'm about ready to cry.

It was at this point that I stepped away to have some lunch. And a bit of research and a full stomach later, I read a thread about how this often happens when haxe was installed improperly. Specifically, when it was installed one way, and then another on top of it, confusing the setup.

So I unrolled everything, uninstalled, blasted the dirs and removed the apt-gets. From a blank slate, I installed the most modern stack of haxe, openfl, lime, flixel, and built a test project. So far, so good.

Then, I set my libs to the repo versions we need for the game, compiled again, reinstalled any libs that were missing, compiled again, and it worked!

Except it crashed immediately upon clicking anything. A lot like OSX did before I un-embedded the audio.

Still, this was good. At least we had parity on OSX and Linux. And switching off embedding similarly got Linux running normally.

That leaves us with one remaining issue. The sound effects used in the game need to be packed or embedded so they don't sit raw in the game dir. Contractual obligation. So I was back to figuring out this old problem.

By some serendipity, I stumbled upon this: PakLibrary. Wouldn't you know it, Lars actually rolled his own asset packer which did 90% of what I needed! Thanks, Lars!

I spent the rest of my afternoon integrating that into the project, packing up the necessary audio assets, and shimmying the PakLibrary loader into the code where sounds get loaded.

The game compiles, runs, and I even get a list of the audio assets out of the pak! But none of the audio is working yet. It seems my conversion from deflated ByteArray into AudioBuffer isn't quite right. I might need to send it raw Bytes instead, or maybe I uncompressed it wrong? Or not enough? Unfortunately, the error is happening inside a non-debug dll, so I can't step through to see. But I have a few more things I can try.

It's almost there, though!


ra1's picture

You mind me asking your motivation for this entire endeavor (updating to the new engine)? Are you planing on NS chapter 2?

dcfedor's picture

For all the trouble it's been, sometimes I have to remind myself, too :)

I am planning on NS2 at some point, and it'll be using this Haxe engine. So this isn't wasted work in the long run.

The reason for this now however, is because I'd like to officially announce the space prototype and start marketing it. I.e. release the official name, screenshots, a Steam product page, an official BBG website section, etc.

While I could've just done that, I was thinking that marketing might be more successful if I tied up this loose end, and desktop customers didn't feel like I had abandoned them. It's been a long time (1.5 years?) since a desktop patch, and the engine overhaul might garner some extra goodwill. I.e. solve many of the most significant complaints in the game like cookie saves, performance, "Flash," etc.

Rather than feeling like the space prototype is taking something (my time) away from the NS desktop crowd, this makes it feel a bit more like I'm giving them some love and announcing a new thing.

Plus, it's a way to regain marketing momentum. It gives me something legitimate to announce on PR channels like Steam, which might remind some people I'm still here. And if there are even a smattering of conversations about BBG caused by this, that amplifies the publicity when the space prototype announcement goes live.

Or so the theory goes :)

Dan Fedor - Founder, Blue Bottle Games