Mod Parsing Speed Bump

Hey Folks! Made a small amount of progress restoring mod support when I hit a pretty major speed bump: images.

Early on, I did some minor rewriting of the file structure to make modding work closer to the original Flash engine. OpenFL does some weird things with files when you try to load them through its asset manager. And one of these weird things is the inability to have two of the same filename in a single AssetPaths class.

It's possible to get around this by having different AssetPaths classes for each folder, but that seems kind of kludgy. What's more, AssetPaths only works on files that exist at compile time. Which won't work on mods since the players add those at runtime. And since I'd have to rewrite a bunch of code to do that anyway, I decided to just change it to bypass AssetPaths. The game now loads assets by explicit path plus filename.

Once that was done, I fired-up the old SampleMod and "0" override mod to see if it worked. And it did!

However, that turned out to be a false alarm. Loading up a more complex mod from the forums crashed pretty quickly, right around where it starts loading images. Initially, this seems to be an issue of the images not having correct path info when loaded. But my attempts to fix it so far haven't worked.

I'm also running into some issues here and there with the debugger crashing. It can handle most of the stuff I throw at it, but this mod loading code makes it pretty flaky. Partially, I think that's because of the background worker thread. But it also seems to choke on certain code points with lots of local variables.

Anyway, it's a really complex problem, with tools that are occasionally not up to the task. So debugging is slower than usual. I think it can be fixed, though. And it might just be a matter of making sure the remapping code handles this new mod file structure correctly.


ra1's picture

Ugh. A (randomly) crashing debugger is one of the worst problems. I have broken down and added debug lines to nearly all of my methods in the past due to issues like this - which itself is annoying. (Luckily my world of Java doesn't have debugger problems like that anymore).

dcfedor's picture

To be fair, I'm happy just to have mostly working debugging again. Trace debugging code is something I won't really tolerate anymore :)

Dan Fedor - Founder, Blue Bottle Games