While I intended to post the second part of my article about VGA programming I regret to inform you that I haven’t finished writing it as its not the easiest thing to explain. Don’t fret however as it’s on the way. Instead I have decided to give an update on the stuff that I’ve been working on instead of writing that article.
In addition to working on art, designing puzzles and composing music, which occupies the bulk of my development time as I do all of those tasks myself, I have:
Overhauled the music system
Original Adlib card
Before this, the game played MIDI music and only supported the original Adlib music card and it’s Yamaha OPL2 sound chip, and the game engine mapped a single midi channel to each of the Adlib’s six melodic voices (the other 3 of 9 were taken up by the drums). The problem with this is that it limits all the music to six instruments and none of those could play chords.
This has been replaced with a more MIDI centric system where each of the 16 MIDI channels are mapped on the fly to a free voice on the Adlib card, replacing the oldest note if a free channel is not available. This allows the system to play chords and juggle 16 channels pretty well among a smaller number hardware voices. An interesting result of this is that now if I give the playback engine more voices, say 18, I could make more complex music sound even richer. This is exactly what happens with the OPL3 chip, used on the SoundBlaster Pro 2, SoundBlaster 16, Adlib Gold etc. The OPL3 chip supports stereo music, 18 hardware voices and more complex timbres.
Additionally I have added support for the much loved Roland MT-32 synthesizer/MPU-401, This works by just pumping all the MIDI events through the MPU401 card and is slightly more efficient than the voice juggling that happens with the OPL cards, this is offloaded to the external MIDI module.
Of course if you’re using a modern system don’t worry if you don’t have this hardware as it will be emulated by DOSBox which will be bundled with the Windows, Mac and Linux versions of the game. If you are using a vintage system don’t have any of this hardware I am working on adding PC speaker support 😉
Felix McKnight: lead singer/guitar player of the funk band Felix McKnight and the SoundBlasters
Made save game actually work
Anyone who has had to implement this feature probably understands that It’s actually a miracle that you can save your game and pick up exactly where you left off. There’s just so much in a game that you need to find and stick into a file and then make sure you can actually load that data back in at any point without crashing the game. As you might imagine many games cheat at this and don’t offer a perfect load/save. As I don’t use save states as a game mechanic (like a Sierra game were you need to save your game every 5 seconds because Roberta Williams is trying to kill you) it’s probably not that important but I really wanted to get it right because it makes testing easier.
Added an inventory view
Up till now Chuck (and every other character) had an inventory and the game would keep track of it but you the player could not look at it or use items in it. If Chuck had an item that he needed for a puzzle he would automatically use it. Now you can press the “i” key at any time to see the items you are carrying and interact with them, each inventory item having a unique icon. This allows for some more interesting puzzles as well as encouraging players to pick things up.
Optimized sprites and lower Memory usage
Explaining how I did this is probably too long for this post but the memory usage was basically improved using better data structures and paging things in and out from disk but in such a way that it actually helps to allow the game to run off floppies by optimizing for locality to minimize disk swapping (disk swaps are most likely to occur when travelling between planets and between acts of the game).
Generally the engine has become far less buggy, more optimized and the scripting language has become more powerful as needed for implementing certain puzzles. I always make sure that as I add new content that I also keep disk usage down. When I ship this game in a box I don’t want it to be on a ridiculous number of floppies.
If anyone has any questions about anything regarding this game (except spoilers) I’d love to answer them.