:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Fri Jul 19, 2019 5:33 pm
All times are UTC + 0
 Forum index » Featured Tools » Community Tools
C&C1/RA1 filter effects (.mrf) viewer
Moderators: Community Tools Developpers
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
Author Message
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Sat Aug 16, 2014 11:55 am    Post subject:  C&C1/RA1 filter effects (.mrf) viewer
Subject description: Another mising link found
Reply with quote

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

Tool (+ test data):
http://nyerguds.arsaneus-design.com/project_stuff/2014/FilterCreator/filterviewer.rar
Source:
http://nyerguds.arsaneus-design.com/project_stuff/2014/FilterCreator/dev/filterviewer_src.rar



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.
_________________

Last edited by Nyerguds on Sat Aug 23, 2014 6:31 pm; edited 3 times in total

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Sat Aug 16, 2014 12:28 pm    Post subject: Reply with quote

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 Smile
_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Sat Aug 16, 2014 1:03 pm    Post subject: Reply with quote

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

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Sat Aug 16, 2014 1:28 pm    Post subject: Reply with quote

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. This image 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 Smile

Again though, this 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.
_________________

Last edited by Nyerguds on Sat Aug 23, 2014 7:08 pm; edited 4 times in total

Back to top
View user's profile Send private message Visit poster's website Skype Account
Askeladd
Soldier


Joined: 29 Dec 2013

PostPosted: Sat Aug 16, 2014 2:30 pm    Post subject: Reply with quote

Where in the mixes are those .mrf and vtx files?

Back to top
View user's profile Send private message
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Sat Aug 16, 2014 2:32 pm    Post subject: Reply with quote

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. Shocked
_________________

Last edited by Nyerguds on Thu Jan 25, 2018 11:37 pm; edited 1 time in total

Back to top
View user's profile Send private message Visit poster's website Skype Account
Nyerguds
General


Joined: 24 May 2004
Location: Flanders (Be) Posts:300000001

PostPosted: Mon Aug 18, 2014 7:20 am    Post subject: Reply with quote

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 Smile
_________________

Back to top
View user's profile Send private message Visit poster's website Skype Account
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [7 Posts] View previous topic :: View next topic
 Forum index » Featured Tools » Community Tools
Jump to:  
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
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


Powered by phpBB © phpBB Group

Wildcard SSL Certificates
[ Time: 0.1204s ][ Queries: 11 (0.0094s) ][ Debug on ]