I posted this a few months ago on the translation's blog thread at PCEngineFX, but I figure that some folks here might be interested in this technique, too. So ...
As I said a few days ago, the Weapon Shop and Status Bar have been a real PITA to do a graphics cleanup pass on.
It's finally done, and I thought that it might be good to explain the technique used, since it's not one that's been commonly seen since the 4th-generation development days, and someone might want to use it in another translation, or a homebrew game.
Here are the original Japanese Status Bar and the Weapon Shop's Gems Box ...
If you look carefully, you'll see that the background of each of the boxes is actually made up of a repeating 8x16 texture ...
The regular English text that is displayed in the Message Boxes is drawn by first decompressing a copy of the blank Message Box graphic, and then copying that to VRAM before finally drawing the text pixels on top of that clean background.
That's fine for the Message Boxes, where the game itself is stopped, but it's too slow a process for the numbers that are displayed on the Status Bar.
For the Status Bar, where the numbers change on a constant basis as you kill the monsters, Falcom are using a different technique.
What they're doing is to store a copy of that 8x16 background texture permanently in memory, and then just figure out what part of the texture corresponds to the pixels underneath the digit that they want to display.
Here is something to show how that actually works in practice, with the numbers that are displayed on different lines for the top and bottom of the Status Bar, and the middle of the Current Gems Box.
Then, as Falcom are writing the digit, line-by-line, into the box sprite, they can use that texture data to replace the pixels that were overwritten by the previous digit that was displayed in that location.
That's a pretty fast way of updating the numbers that are displayed on the Status Bar and Weapon Shop, and it's very efficient in terms of the memory used.
But ... it's a bit of a PITA when it comes to trying to add a drop-shadow to the numbers in order to make them pop off the background and be easier to read, and more consistent with the other shadowed text that's in the game now.
I couldn't just draw a separate drop-shadow, the way that I'm doing on the Message Boxes, because that would be too slow, and effect the game's frame rate.
There isn't enough free memory to store pre-drawn copies of each digit, in each location, with a real drop shadow baked into the texure.
What I've done is to dredge up a really old technique that's not perfect, but it gives the illusion that there's a drop-shadow on the digit, but without causing any runtime overhead, and with only minimal extra memory usage.
For this to work, you just keep a 2nd copy of the background texture, and then use the original "clean" version if you're displaying a "space" character, but use the new background texture whenever you're writing a digit.
The new background texture has a drop-shadow baked into it that works well-enough to look good for each and every different digit that can be drawn at each of the 3 different positions in the texture.
Creating the new texture is a bit of an "art", and requires a lot of compromise between what a real drop-shadow should look like, and what is good-enough to create the right impression without making the entire box too dark for numbers like "1" and "7" that contain lots of blank space in them.
Here's what that looks like, with the original texture on the left, and then the new shadow texture next to it, together with a before-and-after for the 3 different lines that the numbers are displayed on ...
It definitely darkens the outline of the digits, but you'll probably think that it looks pretty horrible.
That's because you're seeing the whole 8x16 texture at once.
In reality, the game code only writes the 7 lines of each digit that are displayed, and leaves the rest of the texture untouched. That's what makes this technique work ... you only use the new drop-shadow background texture on the lines that it is needed on.
Here's my test example of how it actually looks in practice, with the new fake-shadowed text on top, and the original non-shadowed text on the bottom.
The effect is pretty subtle, but it does manage to look like there is a drop-shadow on the numbers, and it definitely lifts them visually off the background and makes them more readable, at least IMHO. It's not pixel-perfect, but it's good-enough to fool the eye.
So, after all of that messing around, and after modifying the boxes themselves to add a drop-shadow to the icons and the "GEMS", this is the final result (with the high-contrast palette) ...
If you can't immediately see difference between those and the Japanese originals ... then that's the point. The idea is to add just-enough change to help the text pop out more, but without screwing up the look of Falcom's game. :wink: