Skip to content


Jury Rigging

One of the great charms and the great frustration of modding is the amount of jury rigging, hacking, and general improvising which is often necessary to do the things you want. The more moddable a game is, and the more resources you have at your disposal, the less you generally have to improvise, since you’ll be able to actually implement things properly instead.

I started modding way back in the Warcraft 2 days, and it was barely really modding at all, just mapping. I remember various attempts to turn Starcraft into a roleplaying game. I didn’t invent the method, but I did make thorough use of it in my various maps. In Starcraft, the basic builder unit could pick up and move certain objects. We’d cordon off a corner in the upper right of the screen, give the player a builder unit, and then place a “drop” beacon and a “use” beacon. Certain objects would be repurposed as usable items (such as medkits or powerups) and automatically moved to this makeshift inventory when the player moved over them. To activate a medkit, the player would simply have to pick it up with his builder unit and move it over the “use” beacon.

Later, I moved on to Warcraft 3, which had way better scripting and mapping tools. WC3 also already had an inventory for your hero units, so I was able to construct an RPG scenario without having to MacGuyver too heavily. I did, however, use the nicely flexible scripting system to code a simple pop-up dialog to present the player with some riddles, which was fun.

With TNM, things are a little different. Almost all of Deus Ex‘s gameplay systems are programmed with UnrealScript, which the editing tools give us full access to, so we can change pretty much anything we want. Occasionally we’ve seen fit to hook into the native functions and override them with our own code. The limitations we still have left are mainly technological, but no less significant for it. Most recently, we had to work around our lack of alpha channels to create new sniper scope HUD textures.

Allow me to demonstrate.

Deus Ex supports three types of transparency: Masking is the most primitive, but often quite effective, in that it simply takes one particular colour and turns it invisible. Translucency makes black completely invisible, and lighter colours increasingly visible such that pure white is entirely opague. Modulation works the same way, but makes pure grey (RGB 128,128,128) invisible and lighter or darker colours more visible.

The easiest way to make a scope would be to just mask out the glass part:

Masked scope texture.

Here, the pink part is invisible. Unfortunately, it looks terrible because the lack of antialiasing produces jagged edges. Making it transparent or modulated would definitely not help, since that would make parts of the “metal” ring translucent as well. The solution is to put a modulated texture beneath the masked one, which is incidentally also a great way to produce a glass effect:

Modulated scope texture.

This is pretty close to how the original DX scope looked, except the crosshairs were simpler and placed on the masked texture instead of the modulated texture. When placed beneath the masked texture, the fading edges of the modulated circle conceal the jagged edges of the masking:

Combined scope textures.

Since the crosshairs are on the modulated texture, making them fully black would make them completely opague, but Ricemanu has left them slightly grey so they’ll be about 80% transparent. Originally, the crosshairs were on the masked texture, but now that they’re on the modulated one, we could’ve easily put curved lines on it without having to deal with jagged edges. Here’s how the scope looks in-game:

In-game scope.

Hacks are generally something to be avoided, but there’s no denying that being forced to think outside the box can be very rewarding when you come up with a solution you’re happy with. And no matter how good your programmers are, there will always be technical limitations to work around. Might as well see it as a challenge.

Posted in Game design, The Nameless Mod.

Tagged with , , , , .


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Another Guy says

    Wow, that Ricemanu sure is a cool dude… and good work Jonas !

  2. Jonas says

    …you’re Ricemanu, aren’t you? ;)

    You’re right though, those are some really neat textures. Looking forward to seeing your next one!



Some HTML is OK

or, reply to this post via trackback.



Switch to our mobile site