I've written the conversion app. So far, only one-level-at-a-time, but once I confirm that's working, mass conversion is the next step, and it won't be a huge task.
I haven't tested it yet (about to do so, compiling as I write this); it's rare for something I write to work perfectly the first time, so let's see how long it takes to get it right...
Test run 1 results- Worked fine up until processing objects. At this point, crashed because the XML file was no longer open; I forgot to re-open it after closing it at an earlier point. I since realised there's no need to close it in the first place, and have adjusted the code accordingly.
Test run 2 results- Processed objects fine. Hung upon attempting to process steel/oneway areas, due to the level I'm testing first not
having any, yet the code specifically looking for the </Boxes> tag in order to process to the next part.
Test run 3 results- Program exited before any conversion attempt due to me accidentally pushing "Exit" instead of "Convert single level" at the main menu.
Test run 4 results- Program executed successfully. Will now attempt to play level in NeoLemmix and add results of such.
- Result: NeoLemmix gives an error upon attempting to load the level.
- Attempted using an Orig VGASPEC in place of the generated one. Error no longer occurs, so it can definitely be traced to VGASPEC code.
- This aside; some stats were not converted correctly. Time limit and skillset are wrong; lemming count, save requirement and possibly release rate are fine. Level title is missing, level author is present and correct. Level is in the correct graphic set. Objects are in incorrect places or missing entirely. Level dimensions are incorrect, as is screen start position. (Can't say for sure about release rate, as the level's RR is 1, which is what shows up; but NeoLemmix also defaults to 1 if an invalid release rate is provided. EDIT: By checking with a hex editor, I can confirm that the RR is indeed correctly converted.)
Test run 5- TARGETS: Attempted to fix all level stats, apart from time limit and quantities of skills (but did attempt to fix types of skills).
- RESULTS: All attempted goals were successful.
Test run 6- TARGETS: Attempted to fix time limit and skill quantities.
- RESULTS: Appears to be successful! Have noticed another issue - music number is not being converted properly; I missed this detail before. On closer (ie: hex editor) inspection of objects, it appears the only thing it's actually getting is that the object
exists; all other values are being converted to zero (or "off" in the case of flags).
Test run 7- TARGETS: Music number and objects fixed.
- RESULTS: Appears to be succesful!
- On closer examination: One detail with objects isn't fixed; the flags (such as flip, no overwrite, and fake). Made one minor change and re-tested; they are now working.
Time to take a break for 5-10 mins or so. I'll continue with the updates when I'm back.
Test run 8, 9, 10, who knows how many- TARGET: Fix the damn VGASPECs!
- RESULTS: Fail. Fail fail fail. Fail.
Test run Infinity+1- TARGET: Still fix the damn VGASPECs!
- RESULTS: Success! I thought the fault was in my RLE compression algorithm, but it turned out it was as simple as the wrong sizes being written to the file! Who knows how many of my attempted rewrites of the RLE were actually spot-on; the one I had at the moment didn't compress correctly, but the faux-compression version of it worked fine. Need to improve this of course and use proper compression. (Of course, it still has DAT compression, just not RLE.) However, while that tweak is needed to minimize filesizes (which, make no mistakes, are going to be HUGE for converted Cheapo levels, even after this is fixed, due to the way they work combined with the DAT and RLE algorithms not being intended for 18-bit color images), I can now say
I have successfully imported a Cheapo level into NeoLemmix! I'd say I'm well on track to my goal of having a (beta) NeoLemmix version of "Copycat Lemmings" released later tonight.
Test run Infinity+2- TARGET: VGASPECs working with proper RLE compression.
- RESULTS: Mission accomplished.
I need to run the convertor on some more-complex levels next (namely, those with steel and/or one-ways); that's pretty much the only thing remaining untested that'll matter for this first release. If that works out, I'll write the code to mass-convert and pack into LEVELxxx.DAT files (which should take about 5 minutes; the underlying code is already there, I just need to specifically tell it
what files to convert and then pack into LEVELxxx.DAT files), and we should have the NeoLemmix player I promised very soon.