Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Sat Aug 16, 2014 11:55 am Post subject:
C&C1/RA1 filter effects (.mrf) viewer
Subject description: Another mising link found
The MRF files in C&C/RA are something I discovered a while ago. XCC Mixer can't view them in any way, but I always suspected they were responsible for the colour effects in the game, like shadows, map shroud edges, the red effect of Red Alert's Iron curtain, etc.
Now, by creating a viewer for them, this is confirmed, and all the effects are actually viewable. All you need is a correctly-paletted screenshot of the game (which is easy to make with cnc-ddraw, since it adds ctrl+s as screenshot saving in C&C and RA), and the .mrf files extracted from the game.
The mrf format is actually simply a remap table (one .mrf file can be multiple of these tables). So the final effect of such a filter on the game graphics is achieved by going over the image of the filter-affected area pixel by pixel and remapping the colour index of each pixel to the new colour index on that index on the table. Since every theater in C&C1 has its own colour palette, this obviously means they are theater-sensitive; each theater has its own set of .mrf files inside the theater mix file.
Note that some of the files contain an extra table before their actual filter tables, which seems to act as "index". It seems to specify which palette index is remapped in the game by each of the tables it contains. The "shadow" ([t/d/w]shadow.mrf) file shows this quite clearly if you click "show remap" on the first table. I think this mrf represents the filters used for the shroud edge, though I'd have to look at the shp to test the 'index' theory.
Features:
-View the effects of the filters inside an .mrf file on a screenshot of the game
-View and save the screenshot's palette
-View and save the remapped palette
-See which colours on the palette are actually used on the remap filter
-Palette viewer shows tooltips showing the index and colour values of all colours
-Remapped palette viewer shows tooltips that indicates the original colour index of the colours you see
This tool is actually the first step in a .mrf generator. The final goal is to recreate the filter as a set of colour effects (hue / saturation / luminance / contrast / brightness changes), so it can be applied to any new palette, for any new theater. You can see a preview of my rudimentary test version of that here.
filterviewer.png
Description:
Filesize:
217.95 KB
Viewed:
729 Time(s)
_________________ Last edited by Nyerguds on Mon Apr 25, 2022 7:56 am; edited 4 times in total QUICK_EDIT
Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Sat Aug 16, 2014 12:28 pm Post subject:
Ah, looks like "[d/t/w]units.mrf" is the unit/building shadow filter; it has an index that specifies palette index 4 as the remap source _________________ QUICK_EDIT
Do i understand it right, that there is some kind of chrono vortex mrf file that tells the game how to distort the terrain under it?
Is there also a mrf for the stealth tank cloak effect?
Or are these 2 something different since they aren't only changing the color, but also the position of underlying pixel info?
Sounds a bit like an early version of a pixel and vertex shader.
The mrf being the pixel shader and the distortion effects of chrono vortex and cloak being the vertex shader. _________________ SHP Artist of Twisted Insurrection: Nod buildings
Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Sat Aug 16, 2014 1:28 pm Post subject:
The chrono vortex does indeed use an mrf file (though it's called .pal), but that is NOT for the actual animation. If you look closely at the chrono vortex, you see one edge of it has a fade to black. THAT is what it needs an .mrf for, just like how the shroud edges use one.
Opening the SNOW_VTX.PAL / TEMP_VTX.PAL files in my tool, you can see they contain 16 filters together forming a fade from black to normal game colours. The image attached below shows step #5 of that fade.
(this is the "view remap" function, btw, showing the actual effect on the palette. The previous pic showed the "View palette" function, with the checkbox to only show the actual colours used in the remap)
I didn't put the .pal extension in the tool, though... hadn't tried anything from RA1 so far.
As for the stealth effect, I suspect that'll be the ?shadow.mrf one. All the C&C ones are in the pack, so just download it and try it out
Again though, that is only for the colour change. The actual animation effect for the stealth is simply done by the game engine. Not by any external file.
ra1_vortex.png
Description:
Filesize:
141.04 KB
Viewed:
732 Time(s)
_________________ Last edited by Nyerguds on Mon Apr 25, 2022 2:24 pm; edited 7 times in total QUICK_EDIT
Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Sat Aug 16, 2014 2:32 pm Post subject:
The .mrf files are in the C&C1 theater mix files (temperat.mix / winter.mix / desert.mix / snow.mix)
The RA1 vtx.pal ones are generated in the RA1 game folder from the moment a map/mission of that theater is loaded.
[edit]
It seems RA1 has no .mrf files, or anything comparable, except for these vtx ones. Kind of understandable I guess, since it has only one palette, but still... hardcoding the effects if the palette is an external file? Bad practice...
[edit]
Looks like they're not hardcoded. They're generated. _________________ Last edited by Nyerguds on Thu Jan 25, 2018 11:37 pm; edited 1 time in total QUICK_EDIT
Joined: 24 May 2004 Location: Flanders (Be) Posts:300000001
Posted: Mon Aug 18, 2014 7:20 am Post subject:
Small update: added an option on the remapped palette viewer to filter out only the indices that are untouched by the remap (meaning, where the value on a certain index equals the index itself). This'll come in handy when recreating filters on the final mrf generator tool _________________ QUICK_EDIT
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum