Jump to content

A question regarding Rock Raiders and Fonts


rockboy
 Share

Recommended Posts

Hey there Modders!

 

 

I wanted to ask a few questions regarding modding in Rock Raiders.

For starters, its been a long time since I've done this. Its starting to get more familiar though I am running against a few roadblocks, but I'm wanting to start working on a new overhaul with new levels, a (slightly if not fully) modified UI and more.

 

In order for me to do that, I have to use both my main workstation PC, in conjunction with my secondary PC. I use Teamviewer, and just drag drop replace in between. Seems to work fine so there's no problem there. Just letting this be known as its the reason why you see two mouse pointers in the game.

 

 

So onto the problem then.

 

The first bit of trouble I've ran into thus far is with the BMP images (I do expect more, given the engine doesn't seem really uhh.. stable?...)

So, easy, changing a background I thought.. Not easy. Rock Raiders is slightly.. picky about the format, the bit-depth, etc. So it has taken me quite a while to get to find a converter with a changeable bit depth.

 

I digress, now that I figured out how to do the Main Menu (which is a 24 bit BMP)

large.Screenshot_11.png.c73ce3e7281cbc19b1ae9b8306596c6c.png

 

I thought "Hey this goes pretty well, let's start working on other elements!" 

 

So, first I attempted to edit the menu font file. First the Hi one (called: Menu_Font_HI.bmp), located in:

LegoRR0\Interface\FrontEnd

(Note: All files I'm editing so far are located here, and of course I'm also editing the Lego.CFG)

 

It took a while to do but in the end I edited the image accordingly to the format. Making sure the background stays (As it's probably there for a reason) , and only replaced the main characters from A through Z. First, I had a game crash, which I realized was because apparently, fonts are in 8 bit BMP. So after going to the hassle of multiple new exports and then finally managing to replace it, I went in game without a crash at last, but... Nope. I was greeted with the font acting all off..

 

Here's a picture of the original font, the modified one and what it looks like in game. (Don't pay attention to the fact the letters aren't even, that's slightly off for now)

gFsu7_RlTj2ACOzpZChsrQ.png

 

 

That's weird I thought, it should work given the file is basically identical aside of the image itself obviously. 

 

So, I thought, oh well obviously it seems to key out the black, so if I make the red.. black... That should fix it, right?

 

Again, Nope, this seemed to just remove the red, literally, keeping the spaces..

 

cTZIlHFJTSW9fPWj7sp3Hw.png

 

It's here I run out of ideas, and am where I am now. What could be the thing causing this? Is it that I haven't replaced every single character?

(I'll have to open up a character sheet in order to find them, but I want to make sure it could be something else FIRST as it took me quite a bit of time to make that font as is) 

 

Also, after thinking for a bit, red should be a color it deletes, and black should be one it keys out (which makes sense as .. the keying part worked. Though now I'm getting slightly confused)?

 

It's not a big deal per se, the main thing I want to know though, in case it can't be fixed, is if there's a method of reducing the formatting, the spacing between characters. Because if in the end all fonts are replaced (which I aim to do), a master slider edit would fix the issue regardless. 

 

That's the main issue I've been dealing with for the past few hours. I couldn't find a related post to this after searching, so I decided to make one myself. 

 

 

 

Any help would be appreciated!

 

~Rockboy

 

 

Link to comment
Share on other sites

anowlcalledjosh

Interesting! I hadn't thought about how the game would handle the variable-width fonts.

 

Would you be able to upload a copy of your modified image, ideally inside some container like a ZIP so nothing tries to modify it? I wonder if there's something subtly different between the modified image and the original that's not enough to make the game crash, but makes it not recognise the character boundaries.

 

I guess you could also try just importing and exporting the image in whatever program you're using, without making any changes, and see if you have the same problem; if that works, then make a tiny change (change the colour of one pixel or something), and do the same thing.

Link to comment
Share on other sites

You probably need to make the background color the 255th color in the index. All of the 8-bit BMP files in this game are indexed, so sometimes the game looks at the color index instead of the color value when determining certain things. I opened a few fonts in GIMP to check this, and the few I did had red as the last color in the index. I'll bet it doesn't care what the color is, but instead only looks at its position. If you have GIMP, you can check this yourself by going to Colors -> Map -> Rearrange Colormap.

 

The game already has a way to forcibly make a certain color index transparent. Put "A###_" in front of the filename (with ### being the index number of the desired color), tell the CFG to look at this new file, and see if it works.

 

 

Link to comment
Share on other sites

8 hours ago, anowlcalledjosh said:

Interesting! I hadn't thought about how the game would handle the variable-width fonts.

 

Would you be able to upload a copy of your modified image, ideally inside some container like a ZIP so nothing tries to modify it? I wonder if there's something subtly different between the modified image and the original that's not enough to make the game crash, but makes it not recognise the character boundaries.

 

I guess you could also try just importing and exporting the image in whatever program you're using, without making any changes, and see if you have the same problem; if that works, then make a tiny change (change the colour of one pixel or something), and do the same thing.

Interesting, but infuriating haha.

While I was able to figure it out, I want to mention that changing a single pixel, even the slightest thing broke it completely. Which is understandable, as it wasn't the issue, read further down here.

 

 

Importing without any changes, through a converter, didn't break it. But that was to be expected as there wasn't any real change in the formatting of the color space. It seems the converter kept the prior values. But due to the fact that I have been editing the files in other programs, that very color space got messed up.

 

 

6 hours ago, Cirevam said:

You probably need to make the background color the 255th color in the index. All of the 8-bit BMP files in this game are indexed, so sometimes the game looks at the color index instead of the color value when determining certain things. I opened a few fonts in GIMP to check this, and the few I did had red as the last color in the index. I'll bet it doesn't care what the color is, but instead only looks at its position. If you have GIMP, you can check this yourself by going to Colors -> Map -> Rearrange Colormap.

 

The game already has a way to forcibly make a certain color index transparent. Put "A###_" in front of the filename (with ### being the index number of the desired color), tell the CFG to look at this new file, and see if it works.

 

 

That's awesome, this fixed it the problem very well!

 

I had never realized this to be the case, but you're right. There are other font files located in the LegoRR0.WAD that have different colors for the boundaries. Now it makes sense. I appreciate your help a lot! I used the Gimp method you described. Very clever thinking!

 

4WO7M0lmTcCT2Hsic7ss4A.png

huh, guess the font doesn't work too well. I'll be making a new one that fits better I suppose. 

 

As for the second method, that's really good to know, I'll keep this in mind when changing other parts of the game. Perhaps it then doesn't really matter what color it is, just that it's the last in the index.

 

I appreciate both comments, this has given me some insight in how the game handles these kinds of things, and thanks to Cirevam to the solution! 

Link to comment
Share on other sites

  • 2 years later...
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.