Tag Archives: Deus Ex

Mods, Mods, Mods: A few updates

I’ve been publishing some small projects lately, so I thought it was a good time for an update on them and how things are going.

My health is still not good. I think the progression of my illness has slowed slightly as I’ve become more aware of how it functions and how to manage it.  However, I’m still not aware of what it is.  I’m still researching and analyzing and fighting to figure it out, though.  But it is probably some kind of rare genetic metabolic disorder.  Regardless, I have to take things slow and put any energies into smaller, less-intense projects.

Mod Music Conversion

One such project was converting all my old mod music into MP3s so I could listen to them more conveniently.  I’ve been manually converting small batches of mods for years and found through that process that many automated ways of transcoding mods had issues.  Either metadata would be left out or certain bits wouldn’t sound right or the volume was too low or the frequency balance would be muddy sounding.  This is why I would always just playback the mod in ModPlug Player (my player of choice) and directly record the output into Audition, tweak the volume, save to MP3, and done.  You can’t reasonably do this for a library of over 400 songs, though.

The first problem I wanted to tackle was getting as much metadata out of a module file as possible and putting it into an MP3 file’s ID3 tags. I started looking into libOpenMPT as a way to open the four major mod formats and grab their metadata in a standardized way.  It’s a decent library, but the documentation could use some work. I had to read through its source code for hours until realizing that it returns strings at UTF8. This was only a problem because .Net can only marshal strings from unmanaged memory that are ANSI or UTF16 by default, which seems pretty weird given UTF8 is so common.  But one custom UTF8 marshaling function later and I was in business.

The next problem was that the mod metadata ended up being not the greatest. Almost all mods have a title and a field for what tracker software was used, but modification date only became a feature by the Impulse Tracker format, and none of the main formats have artist fields.  I had to use a lot of regex magic to even get a fraction of the date and artist metadata from the song comments.  The comments, by the way, are another quirk of the mod formats.  Artists typically put notes about their work in the comments; however, only Impulse Tracker had a specific field for this. The earlier formats used either sample names or instruments for these notes.  Being that I wanted to preserve all of this in the extracted metadata, I just concatenated all three fields together with some delimiters between them.

Luckily, getting the extracted metadata into an MP3 file is a bit more simple as there are a number of ID3 libraries for .Net.  TaglibSharp is the most popular one, but it is not without its quirks as well.  Particularly, trying to delete specific user text frames (TXXX) is not the least bit straightforward.  But in the end, I came up with an imperfect little tool to copy module metadata to an MP3 file (or output to text if necessary for your purposes) that I put up on Github.  Thankfully, ID3 is a much better tagging format than what module files used. 😄

As I was trying to figure out how to work with libOpenMPT, though, I discovered that ffmpeg also uses this library to load module audio. Given that libOpenMPT was basically the evolution of ModPlug, I thought that the playback might be comparable between the two. I did some test runs converting a few songs to MP3 and found the results to be promising.  Obviously, the aforementioned muddiness of the sound persists, but I then found that ffmpeg has quite a vast library of audio filters to utilize. One EQ later and that issue is fixed right up.

What was more of a struggle was how to balance the volume of the songs.  Naturally, you don’t want to risk clipping the audio data by doing a straight up amplify.  ffmpeg does include a hard limit filter to avoid clipping, but how do you know how much to amplify?  You can’t normalize a song’s audio without having the whole song to analyze and ffmpeg only works in streams of audio data.  It’s a problem I have yet to find a straightforward way to tackle. In the end, I used the loudnorm filter to extract the loudness of the song, calculated the amplitude needed to reach about -10 LUFS, and then did a second pass including the desired hard limit.  More information on the whole conversion process can be found on the Github page for the metadata extractor.

Ultimately, I’m fairly pleased with the results of this project. I did get my entire mod library converted to MP3 with some snazzy album art and good sound.  But I also did end up having to manually adjust a lot of the artist names and titles in MusicBrainz Picard to catch all the missing artists and make them all uniform, so that was a bit of a drag. Also, there are a few songs that seem to have minor issues with conversion accuracy, primarily Necros songs coincidentally.  I may still end up manually recording a number of the songs ultimately, but what I’ve got so far is pretty damn good.

Mods MP3 library in Dark Audio Station

Mods MP3 library in Dark Audio Station

Deus Ex Soundtrack v2

Given that I was already binging old mods, my conversion of the Deus Ex Soundtrack—which was originally in the mod format—kept coming up on shuffle.  However, I was getting pretty annoyed at how quiet the songs were as I had stupidly only normalized the volume instead of hard limiting it.  I thought it would be a quick couple day project of loading up the original wave recordings and tweaking the volume levels, but I soon found lots of other lingering issues with those recordings.  It was mainly just clicking from bad sample loops or poorly recorded/encoded samples.  I imagine this was due to a combination of time crunch and crude audio tools during the soundtrack’s original creation, so I can’t fault Alex Brandon too much.  Coincidentally, if you need to go insane, try finding the right loop points that make an audio sample not click and sound decent. 😛

Eventually, I ended up re-doing from scratch about a third of the soundtrack as I had also stupidly not saved the intermediate mod files from the original conversion. 😄  So, every one of the those bad 8-bit samples had to be cleaned up again.  To be fair, I think I did an even better job with that as audio editors have gotten a bit more advanced in the interim.  I’d like to redo the entire soundtrack, but many of the songs were pretty decent already and I’m kinda burnt out on it for now. But maybe in the future…

At this time, I’ve already uploaded the MP3 version of the new soundtrack conversion to its page.  I’m still working on getting a new FLAC version done as it has a different tagging format.  And I’m also thinking about making the intermediate mod files available for download, although obviously that would only include the tracks I redid recently.  These files would be Impulse Tracker format with all the samples cleaned up and other fixes and new outros included.  Additionally, I’m also exploring the possibility of copying the cleaned up samples back to the original UMX files to improve the game music as well.

Deus Ex Soundtrack Cover Art

Deus Ex Soundtrack Cover Art

Diablo 2 Mods

And in another kind of modding, Diablo 2 mods!  Yes, I am still modding this old ass, janky game.  However, that may be changing soon with the imminent release of the Remastered version of the game.  Blizzard said modding is still possible in the new release, but I highly doubt it’s as comprehensive.  I would be delighted to hear they switched the data format away from TSV text tables, though.  I’d think something more object-oriented where you could define a default item, inherit and change what needs to in child items, and modify some of the raw functions would be the dream.  But, I’d be pleased with at least a switch to JSON for the data definitions.

Regardless, I haven’t done too much modding this time around. I just overhauled how the respec and socketing mod works.  I realized that I could just add the Token of Absolution—an item which resets your skill and stat point allocation—right to a vendor instead of continuing to use the Horadric Cube recipe.  It’s a little janky this way as I had to change its item type to that of a potion to get the tooltip to work, but right-clicking on the ToA still gives the desired result, albeit with the drawback that the game crashes if you try to give the vendor more than one to sell, it can be put on your belt, and its cost changes based on what level the character is.

I also realized that I should include a recipe for adding sockets to items in the mod as there already is one but it’s crazy high-level and convoluted.  Tangent, but, isn’t it lame how you have to “remember” all these cube recipes to play the game.  We’re all looking them up on a wiki anyways and that’s not fun.  I’m glad Diablo 3 got rid of that aspect.  Anyways, I changed the recipe that adds sockets to something more reasonable but still balanced.  And I also discovered that there was an unused recipe function that allowed gems to be removed from sockets without destroying them, so I added a new recipe for that as well.  However, both of these recipes require gems to perform.  I’ve been thinking about adding a new rare crafting material that could be used in the socket recipes, but it seems like a lot of work plus would take valuable inventory space even if the mats stacked.

I’m also thinking about removing the Magic Find attribute from my drops mod.  It’s kind of a counter-productive stat to have on items, like it doesn’t help you survive or kill monsters but you want it maxed out so you can find the best loot.  I just feel like the loot drops should always be good—in a fun and balanced way.  So I might just remove magic find and increase the drop chances even more, but it’s a tough one because it needs lots of testing before release.

Final Thoughts

I hope you enjoyed this developer diary of a post.  My apologies for not doing more awesomeness in recent years, but… it’s something at least.  I think next I might try to give this site an overhaul; I’ve been neglecting to add proper mobile support for many years and the WordPress theme is like a decade old.  I’m still dreaming of doing an update to Cursor Lock, though; I think it’s passed about a half-million downloads across all sites now.  However, I’d really love to do a major update on File Lister as it’s the program of mine that I use the most.  It’s just so crazy useful for doing batch operations and management on files, and I’d like to extend that capability.

Take care, everyone.  Stay safe and don’t get the ‘rona!

Posted in Media, Miscellaneous, Modding, Programming | Tagged , , , , | Leave a comment

Diablo II Mods and Code Stuff

Hello all. My apologies for not updating this website more.  My life has become complicated lately, and in these uncertain times I find it difficult to want to write about it.  A shame really, as the site has never been more popular.  Seems like every time a new game comes out lacking multi-monitor support, I get hundreds of new visitors and users for Cursor Lock; a few weeks ago, it was Cites: Skylines.  And today with the announcement of another new Deus Ex game, my version of the soundtrack is hotter than ever.  It does make me feel good to know that I can produce things that people need, even if it’s only for video games.

Speaking of video game content, I spent a lot of time a few months ago working on a new class for Diablo II.  Well, it’s not really a completely new class, more like a subclass since I only changed one skill tree for the Amazon.  It just really bugged me how the Amazon felt so lame compared to the Diablo 3 Demon Hunter.  It’s really difficult to keep the monsters from swarming the Amazon, so I designed some Demon Hunter-inspired skills to help remedy the problem, such as caltrops, turrets, and smokescreens.  You can see these skills in action in the video below.

I also just wanted to fulfill my desire to do some really hardcore modding for Diablo II.  The game has a rather awkward system for making modifications.  If it were made today, we’d probably have XML files and LUA scripts to work with.  But since it was made 15 years ago, we instead have to settle for massive CSV files.  You can find the Demon Hunter mod on my Diablo II mod page.  And massive props to the Phrozen Keep for continuing to support D2’s modders.

Another thing that bothered me about Diablo II for so long is that when you die your corpse keeps all your equipment on it, and you respawn basically naked and unarmed.  Your only options are to run in, snatch everything off your corpse, and teleport back to town, or rage quit and hope that your corpse returns to town like it’s supposed to.  Obviously, this is almost always zero fun and is why no games handle death like this anymore.

Unfortunately, there’s no way to change this in the game’s CSV tables.  But I didn’t let that stop me.  Every now and then, a problem comes along which must be solved through assembler hacking, and this was one of those times.  But I didn’t really have a clue which function was involved in character death.  So, I just put breakpoints on every function in IDA and attached to the running process.  It took a while of breaking, disabling breakpoints, and resuming, but I eventually narrowed it down to several dozen functions involved in death.  Some functions did death animations, some saved character data, but then I found a suspicious bit of code that would loop 14 times—the number of equipment slots.  This was the code where the game looped through each equipment slot and moved the item from the player to the player’s dead body.  And then there was nothing left to do but some trial and error to figure out where I could safely jump over the offending code and re-enter.  Now the only problem is that this mod will have to be updated every time there’s a Diablo II patch. 😥

Here we see the fateful jump operation to bypass the character equipment being removed.

Here we see the fateful jump operation to bypass the character equipment being removed.

Since then, I’ve been turning back to more PHP/HTML/CSS/JS coding.  I’m working on a project that I can’t disclose at this time but which quite possibly could be my most epic work yet.  Wish me luck in completing it.

Recently, I’ve also been using PHP as my go to scripting language for everyday projects.  A couple days ago, I wanted to be able to pull all GPS image data from a directory and display it in Google Earth.  PHP has file IO, EXIF, and XML libraries, so it was real convenient to bash out a script using that.  Then I realized I had created an account on Github recently to comment on some projects and thought why not just put this code on there.  So I did.  Maybe I’ll add more small projects like this in the future.

Posted in Modding, Programming, Website | Tagged , , , , , | 2 Comments

Steam Widget in the Wild!

Steam Widget on WordPress.org

As I said I would last weekend, I got my new Steam Widget up on WordPress.org.  I still want to add some things like stats links and currently in-game, but I think it’s a good first release.

Also, I forgot to mention this in my last post, but it’s pretty cool still.  A German guy did a drum remix using my remastered versions of the Deus Ex UNATCO and Area 51 themes and posted them on Youtube a few months ago.  Check it out.

Posted in Media, Programming | Tagged , , , | Leave a comment

Deus Ex and such

I just finished my second playthrough of the new Deus Ex game, Human Revolution. It has a few bugs but is generally the best game I’ve played in a while. Though, I must say that the original Deus Ex is still a smidge better. So far I haven’t given a full review, but if I did so it’d be on Metacritic where I’ve been doing my other reviews.

Also, in my last playthrough of DX:HR, I took a bunch of screenshots of the weapon mods and Praxis Kits that I found and then gave descriptions of where they’re located. With Steam’s nifty new screenshot management, I was able to easily upload them all to my Steam page for your reference. It’s probably the beginnings of a new DX guide.

So I’m still doing a ton of gaming since I started working full-time and less of being productive. However, one thing I’ve been contemplating is converting my site to WordPress for a few reasons. It would add commenting features for all my posts and other content, and I’m hoping that getting more feedback would be a good motivator for me. Also, having a slick backend should help me post more often. Plus I’ve been using WP a lot at work lately and I’m pretty comfortable developing for it now so it shouldn’t be much trouble to extend it to my needs.

The only thing I’m stumbling on is the design of the new WordPress site. I’ve been toying with a mockup for the last month but I’m not sure I like any of it. I’ve been trying to keep some of the colors and graphics of the current site’s style. Maybe I need to start over from scratch on this.

Posted in Gaming, Website | Tagged , , | Leave a comment

OMG!! Deus Ex 3!!!1

I’m crazy psyched about the upcoming Deus Ex game. Maybe I’m just being a fanboy, but I think the trailers Eidos Montreal have put out for it are the best I’ve ever seen for a video game. The style, clarity, music, action, and glimpses of story are all hyper-intense–a couple even get me choked up at times. In the HD trailers, it’s hard to even tell the difference between pre-rendered CG, in-game cutscenes, or actual gameplay footage.


Beyond the feel of the game, the play sounds like it’s shaping up quite nicely as well. PC Gamer has a couple of good articles about all the gameplay aspects up:

Posted in Gaming | Tagged | Leave a comment

Snake crunches more numbers

(Any excuse to make a spreadsheet.)

Since the election is over (as predicted, Obama landslide–yes, I am a happy snake) and I’m now lacking my daily dose of poll data, I’ve turned to crunching other data to support my statistical addiction. Obviously, the first data I looked at was the final election results so I could update my “blue shift” map. Naturally, this led to an examination of the differences between my previous map (from the last blog post), which used predictions based on polls, and the final results. The map this data produced basically only shows where polls were over- and understating support for a candidate. While I was at it (and because it was trivial to drop new data into my SVG generator program), I generated maps for the 2004 and 2008 final presidential election results. All four maps follow–click for the full image, obviously.

The aspect that jumps out the most in the first image (Blue Shift) is how Arkansas is the only state shifting decidedly more Republican; Louisiana and some other adjacent states are also slightly more red or neutral. As I alluded to last time, it appears that the demographics in these states are such that: A. there was profound white prejudice/misinformation against Obama and B. there wasn’t enough black/minority support to overcome this.

The poll performance map is even more interesting. Immediately, North Dakota and Wyoming stand out as performing way better for McCain than expected–I’m going to attribute these two to the limited number of polls. It’s also likely that Rhode Island, Vermont, and Hawaii fall into that same category except in the Democratic direction. Arkansas, as previously discussed, also under-performed prominently for Obama. But I think the biggest conclusion we can draw from this map can be seen if we look at the bigger picture. The Southeast and Central states are all mostly under-performers for Obama, while the western states over-performed (in general). Perhaps, when they get in the polling booth, rural westerners are generally more open-minded and less bigoted (and thus more accepting of a black president) than rural southerners? It could also say something about the turnout regionally. More information is required before we can make a decisive conclusion, but it’s interesting nonetheless.

It occurs to me that the maps aren’t particularly useful for seeing specific results. I considered rectifying that at one point but decided that the purpose of the maps was mainly to compare states to each other, which the maps do quite well. However, if you want to see the data I used, I uploaded the spreadsheet here (Excel 2002 format).

More recently, I’ve been studying the visitor demographics for my site–pondering my precarious IE support and wishing IE6 would just go away already. Though sadly, the data suggests that IE6 usage will persist. It’s like the herpes of web development. Anyways, I collected the data using this site’s raw logs, counting only distinct IPs for a particular browser (i.e. multiple hits are filtered out). Then, I made some pretty charts in Excel to show off the results. Nothing is really surprising here, but… it’s interesting nonetheless. 😉 Charts below.

As a status update, I’ve been working on my Deus Ex guide again and… yes… it’s almost complete 😮 . And I’ve only had to play DX what must be 12 times over 7 years to write it! I’m not complaining, though. Really, it feels like the definitive guide to Deus Ex on the internet and I’m quite proud. Look for an updated GameFAQs version soon.

Also, I’m working on a massive overhaul of the SnakeByte content system which will feature tabviews (emulated with clever HTML, DOM, JavaScript, and CSS, of course), more images, changelog support, and even some AJAX. It’s about 75% complete as of this post, with expected completion before the end of the year.

Posted in Website | Tagged , , | Leave a comment