Confed Project Talks Audio Updates & Texture Atlasing
Here's a new technical update on the Confederation project by AllTinker. He was aiming to deliver a release in time for Wing Commander's birthday on September 26, but that's looking pretty sporty now. Wing Commander fans are nothing if not patient, so we're just happy to get the status update on all the latest progress!Just thought I'd post a quick progress update, mostly probably-dull semi-technical stuff - sadly some contract work is kicking my butt at the moment, so the 26th is looking kind of dubious... But things are still progressing steadily!I'm currently knee-deep in the revised audio system, which (amongst other things) I'm hoping will be able to render the OPL2 (Adlib) sound effects and music purely from the original data. Things seem positive, but I'm not finished with it yet. My previous effort involved using some external data to send to the OPL chip emulation code, but it was a little janky and not ideal. MT-32/CM-32L emulation is already re-integrated and working (bring your own ROMs as usual :p).
Another thing I've been working on improving is the texture atlasing, which I'm using to support quite a broad set of GPUs (e.g. most from around 2006 onwards should work, plus weaker embedded/Intel ones). This is quite basic stuff, where you pack multiple textures into a single larger one, so the renderer doesn't have to swap between them while drawing - since as a rule of thumb the more things you can draw in one go (in one "draw call"), the better the performance. Even the most retro graphics can easily bottleneck on a top-of-the-line GPU without taking this sort of thing into account.
Creating atlases is more often done using dedicated tools and then shipped with the game, but since Confederation loads directly from the original game data I decided to pack the atlases on the fly. For instance this is the atlas in video RAM while running the OriginFX logo scene:
The generated atlas is different every time a scene starts, since it's assembled with some randomisation involved. On the technical side there's actually a fair bit going on to make this happen efficiently; it uses k-d trees and a genetic algorithm to hone in on an optimal solution, using all CPU cores to do so. It also crops out empty border pixels for each sprite, and pads out the colours to make sure there are no artifacts when rendering; here's the same atlas without the alpha channel: Anyway that's it for now - maybe some of that was interesting to someone out there :D; next update should have some gameplay video(s), if not the first test release.
Follow or Contact Us