Forum Discussion

Re: What Filetype do MOD's use

@GENERALZOOL 

@CNCJack_TD 

I've been looking into this, and this is what I dug up so far...

The basics is, you go to your Documents folder, open the "CnCRemastered" folder in there, go to "Mods", and pick your game ("Tiberian_Dawn" or "Red_Alert")

In the correct folder, make a folder for your mod, and name it something identifiable, like, say, "BuildableAnts"

Now, under that you'll need 2 things: a "ccmod.json" file, and a "data" folder.

The "ccmod.json" file is plain text. Note that Windows hides file extensions by default, so if that is true on your system, and you just right click to create a "new text file", the file will have a hidden ".txt" at the end of the name that won't be shown to you, meaning the real name of the file will be "ccmod.json.txt", and then the mod won't work. Look up online how to enable file extensions, and you can trim off that extra part to ensure the name of the file is really "ccmod.json".

This is what is expected inside it:


{
    "name": "My Mod Name",
    "description": "This does mod stuff.",
    "author": "Me",
    "load_order": 2,
    "version_high": 1,
    "version_low": 0,
    "game_type": "RA"
}


In that, edit the name, description, and author. For "game_type", you need "TD" for C&C1, and "RA" for Red Alert. The "version_high" and "version_low" create the version number of your mod; the example settings above would create version number "1.0". So you can increase that if you update the mod.

The "load_order" is a bit special; normally this is put on 1 for mods that change the core DLL (more on that later), and 2 for mods that only change assets. This basically means core engine changes take precedence over asset mods, since you can obviously only have one core gameplay engine dll file. Asset mods can be stacked on that.

Note, "rules.ini" mods are a bit of an odd case here; they change core behaviour but are not a dll. Likewise , there are GlyphX xml files that apply global data, like the lists of objects it has graphics for. If any of these are modified , I'd advise putting the "load_order" to 1.

The "data" folder is where all your mod assets will be put. For replacing existing assets, and for seeing how the internal assets are structured, I advise you to download OS Big Editor:

https://www.ppmsite.com/osbigeditorinfo/

This program can open all the .meg files in the "data" sub-folder in the game's install folder. Once you open a file there, you will see all assets internally are in directory trees that start with a "data" folder. Well, this is the same "data" root you made in your mod folder. So just build on that, as indicated in the .meg files. If you extract multiple assets from OS Big Editor (select them in the tree, then go to Edit -> Extract), and select the root folder of your mod (not the "data" one, the one below that) you'll see OS Big Editor will create the entire folders tree for you, which is really handy.

You don't need to create .meg files in your mod folder, by the way. Just use the same directory structure as the one inside the .meg files, and the game will find the assets.


The graphical assets in the .meg files use two formats... well, three, actually, if you distinguish internal types.

The first is 32-bit .tga files, used for all structures and units, and icons too I think. I haven't really looked into that yet. Editors like Gimp should have no problems with opening and writing that format.

The second type is .dds; DirectDraw Surface files. These are actually scalable textures, which save smaller versions of themselves internally inside one file for very quick texture scaling, or, in the remaster's case, zooming. There are two types of dds files; the 32-bit type with transparency, used for terrain decorations like trees, and the 24-bit type, without transparency, used for terrain tiles.

I found a Gimp plugin for handling DDS files, but when I tried the files created by it, they were not readable by the game. Maybe I just did something wrong, I dunno, but in the end, I stumbled on this Nvidia toolset that did the trick:

https://developer.nvidia.com/gameworksdownload#?dn=dds-utilities-8-31

They're command line tools, but they do the job well. I just saved my edited tiles as png, and then used this command to convert them to usable Remaster tiles:

nvDXT.exe -24 dxt1c -quality_production -file *.png

Note that .dds files, as mentioned, contain smaller resized versions of themselves. For this conversion, however, you should completely ignore that; you only need the full-sized frame saved as png, and the above command will convert it to a correctly working terrain tile. It generates the smaller internal versions automatically.

For the trees and bibs and such, it needs alpha blending, so you'll need to use -32 rather than -24. The full command line becomes this:

nvDXT.exe -32 dxt5 -quality_production -file *.png


This is about as far as I got. Some useful hints for further modding:


Any legacy items are read from a "ccdata" folder directly under the mod folder (so in the same folder that "ccmod.json" and the "data" folder are in). This includes "rules.ini", so that allows easy oldskool rules modding. Note that the legacy assets in the Remaster's own installed files are under a "cncdata" folder. This mod folder is "ccdata", not "cncdata"; don't confuse the two. (An easy way to remember is that mods have "ccmod.json" and a "ccdata" folder. So the pattern is consistent.)

Items in this folder obey the same rules as modding did in the original games. This means that most graphics assets you add here will need to be in an sc*.mix file for the game to read them. For Red Alert, you might need to include an entire edited copy of "expand2.mix" to override certain assets, since sadly the sc*.mix files don't override RA's expansion archives.


To actually add entirely new art assets, they need to be defined in the game's xml definition files. Those control the GlyphX user interface part, which acts independently from the old game core, and needs information to display everything concerning all units and structures. I don't know where those are located in the .meg files, but I know that under "data" they end up in an "xml" folder. The main data definitions file is "GameObjectFiles.xml", and it will tell you that one of the loaded files is "Objects\Units\RABuildables.xml". I believe that is the file which you would need to edit to add filenames for the build icons for the ants, but the folder in which those assets need to be put should follow the pattern used by the game's other assets, as seen in the .meg files.


You can add a "ModText.csv" in the mod's "data" folder to define custom text to be used in the user interface. Text in the Remaster is defined for all languages at once. I don't know if there are any examples of the format to be found in the game internally. The data is basic comma separated file format, but you need to make sure the file is saved in the text encoding "UTF-16-LE", with BOM (byte order mark).

The first line defines the columns:


"TEXT ID","AUDIO TAG","CHARACTER","ENGLISH","UNITED_KINGDOM","GERMAN","FRENCH","SPANISH","ITALIAN","JAPANESE","KOREAN","CHINESE","RUSSIAN","POLISH","THAI","CZECH","TURKISH","PORTUGUESE","HUNGARIAN","DUTCH_NL","ARABIC","ROMANIAN","CHINESE_TAIWAN"


As you see, that's basically the text ID, some internal data you probably don't need, and then a list of languages. There seem to be more in there than the Remaster officially supports... not sure what's up with that.

Anyway, every comma in a CSV will define a column end. A build description for the ant could look like this:


"TEXT_UNIT_ANT1_DESC",,,"The Warrior Ant has a strong corrosive bite that makes short work of heavy armor.","","","","","","","","","","","","","","","","","","",""

This example defines the text for English only (4th column). If you want to be nice to other-language users, but don't know the language, at least copy the same thing over into all other columns so it's not just empty.

The first column, "TEXT_UNIT_ANT1_DESC", needs to be added under the ANT1 entry in the aforementioned "RABuildables.XML" to be used. You'll see when you open the file and look around a bit.

To edit the original text IDs, here is a dump I made of all the original text in the game:

https://www.mediafire.com/file/ek447p8zcyt4ooy/CnCRemastered-alltext.txt/file


If you want to dig into deeper modding than what rules.ini can offer, you can edit the game's actual program core using the source code released by EA. You can find that here:

https://github.com/electronicarts/CnC_Remastered_Collection/

I'm not going to give any help on that here; some guides are already out, so, check those:

https://ppmforums.com/topic-48415/step-by-step-on-how-to-create-petroglyphs-nuke-tank-td/

When you compile the project, you will end up with a "RedAlert.dll" file. This file is simply put into the "data" folder under your mod folder.


Welp. That's all, folks!

I linked to ppmsite before in this guide, well; there's a whole modding forum there. So if you need more in-depth info on any of that, I'd say look around there a bit:

https://ppmforums.com/forum-1073/cc-remastered-collection-editing-forums/

20 Replies

  • wow that is a lot of stuff to leaen, but i am willing to have a look at it.

    Actually i am going to try make something simple. Adding additional Warheads / Armor Classes - something like that. Would be a nice upgrade for Rules-Modding.

    Thx for your advice.

  • @Nyerguds
    Well, it's a start, I appreciate your swift response.

    It looked like my OSBig Editor was out-of-date, so thanks for leaving a link to the updated version.

    I would just have one quick question, what is the Cameo Size these Days?

    Edited (added content):

    As I'm only making a simple Cameo addon, would I really need to go to the extent of making a DLL file (since the units themselves already exist, just need Cameo's).

  • Nyerguds's avatar
    Nyerguds
    Hero+
    6 years ago

    @GENERALZOOL 


    I would just have one quick question, what is the Cameo Size these Days?


    No idea. Look up the ones in the game with OS Big Editor and find out?


    As I'm only making a simple Cameo addon, would I really need to go to the extent of making a DLL file (since the units themselves already exist, just need Cameo's).


    No, as I said, that's all defined in those xml files.

  • @Nyerguds

    I haven't actually found the Cameos in the MEG files yet, any idea where they would be. Anyone found them yet, I haven't (got a little lost looking for them).

    So you're saying I need make a DLL file even though the only bit of code that might need looking at is Cameo/Image listed under units ANT1/ANT2/ANT3.

    I don't know, but maybe I'm looking in the wrong place, but the MEG files I've looked at have not mentioned ANT1/ANT2/ANT3, only the ANT Missions.
  • Nyerguds's avatar
    Nyerguds
    Hero+
    6 years ago

    @GENERALZOOL wrote:
    So you're saying I need make a DLL file even though the only bit of code that might need looking at is Cameo/Image listed under units ANT1/ANT2/ANT3.

    What part of "no" don't you understand? I said the exact opposite! All you need are the xml files for that stuff!

    As for the MEG files, I'm not sure tbh. Just look around a bit?

    Once opened, right click in the tree and select "collapse all", so you can more easily browse the folders inside without getting overwhelmed.

  • Nyerguds's avatar
    Nyerguds
    Hero+
    6 years ago

    @GENERALZOOL wrote:
    I haven't actually found the Cameos in the MEG files yet, any idea where they would be. Anyone found them yet, I haven't (got a little lost looking for them).

    I don't know, but maybe I'm looking in the wrong place, but the MEG files I've looked at have not mentioned ANT1/ANT2/ANT3, only the ANT Missions.

    Uh. I thought the whole issue was that ants don't have them in the first place... so looking for the ant cameos seems rather useless 🤨

    Anyway, seems cameos in the original remaster archives are not separate files; they're inside a megatexture TGA file inside "TEXTURES_SRGB.MEG".

    The file inside is DATA\ART\TEXTURES\SRGB\MT_COMMANDBAR_COMMON.TGA

    The actual cameo images in there seem to be 343x258 in size.

    But there are already examples out there of how to mod in your own cameos; check out the example nuke tank mod or the Funpark mod for TD.

  • @Nyerguds
    I was actually looking for the other Cameos so that I know where the game expects to see Cameos, so when I do add the ANT Cameo Files, I know where to put them.

    Thank you for telling me where to find them, and what size they are.
  • GENERALZOOL's avatar
    GENERALZOOL
    6 years ago

    @Nyerguds 

    Any idea on how to make units Amphibious?

    I intend to add one new type of Ant (I might as well), and that is a Cryo Ant. The Cryo Ant would be able to walk on Water or Land without restriction.

    Would I need to invent some new Movement type all together, or is there something I could use?

  • Nyerguds's avatar
    Nyerguds
    Hero+
    6 years ago

    @CNCJack_TD 

    In C&C1, "Locomotion type" is just one of the options of units, but in RA, with boats simply split off to their own type, this is no longer in there.

    In addition; the C&C1 SPEED_HOVER type has been completely replaced by SPEED_FLOAT for boats, in Red Alert, so there is no amphibious type in it at all.

    So I'm afraid that might be a lot more work than you bargained for, especially with the difference in cell sizes for water based units. (Nevermind, that's in Warcraft II, not RA)

  • @Nyerguds
    So it would be impossible to give the unit a Locomotion Type that had Amphibious capability without coding in the Locomotor from scratch.

    While I know that it's impossible to give a single unit two Locomotion Types, could an IF Statement be included to provide one of two different Locomotors depending on what Ground Type it's moving on.

    If that wasn't possible maybe changing the passage types (adding a new type). Currently in the base game there are:
    -Foot
    -Track
    -Wheel
    -Float

    Would it be possible to add an additional 'Amphibious' Movement Type, if so, how would I begin about doing that? (where should I start).

    If that wasn't possible, would forcing every single vehicle to use Tracked Movement, and then giving Wheeled Movement to anything I want o be Amphibious, then changing Water Passage so Wheeled units can move on it. Would that work properly as a work-around?
  • zoolex's avatar
    zoolex
    6 years ago

    @GENERALZOOL
    I was going to say, you're mad, but you might actually have a method of pulling it off. LUNATIC!

    Moving around using Wheeled movement as the Amphibious Movement would be a lot easier to code in though, all be it long-winded. Since you'd need to change every Wheeled Unit, and every Water and Shore piece most likely.

    Though I will say: "You're insane" - Quoting Lizbeth SAO

    Edit: Also, wouldn't that actually speed up all Wheeled Vehicles, since if you change them to use Tracked movement, they will move as good as a Tracked unit. Since Tracked Units don't have the same penitently as Wheeled Units on Shorelines and on Ore.

  • zoolex's avatar
    zoolex
    6 years ago
    @Nyerguds
    Quick question, how do you compile a MOD into a DLL file anyway. I've seen that the few MOD's out at the minute all have a DLL file with them. Along with a 'PDB' file, a 'LIB' file and an 'EXP' file.

    Is there some sort of BAT file I need like with CNC3TW?
  • Nyerguds's avatar
    Nyerguds
    Hero+
    6 years ago

    @GENERALZOOL wrote:
    If that wasn't possible, would forcing every single vehicle to use Tracked Movement, and then giving Wheeled Movement to anything I want o be Amphibious, then changing Water Passage so Wheeled units can move on it. Would that work properly as a work-around?

    That... actually sounds plausible. In fact that should be possible just by messing with the terrain type passability types in rules.ini (the "Land Characteristics" section), without requiring coding.

    And I'm guessing the "Tracked=yes" line in the unit options in rules.ini may make the difference in locomotor between the two, meaning you may be able to manage all of it through the rules.

    Maybe an easy way out there is indeed to just add in a clone of Wheeled or Tracked, make an "Amphibious=yes" option for units that does the same as Tracked but switches the unit to your new type, and add a new key for the terrain type passability which you can then add to all the Land Characteristics sections to tweak it to your wishes and make water and land passable for it.

  • @Nyerguds
    OK, so I've got some of my MOD done, but the game isn't reading the Cameo Files, what have I likely missed?

    Sounds silly, but I've missed something somewhere.
  • Nyerguds's avatar
    Nyerguds
    Hero+
    6 years ago

    @GENERALZOOL wrote:
    @Nyerguds
    OK, so I've got some of my MOD done, but the game isn't reading the Cameo Files, what have I likely missed?

    Sounds silly, but I've missed something somewhere.

    Honestly no idea... never messed with that myself. It's something in these xml files but that's all I know. But there should be mods out there that add cameos, no? Just look into those.

  • Nyerguds's avatar
    Nyerguds
    Hero+
    6 years ago

    @zoolex wrote:
    @Nyerguds
    Quick question, how do you compile a MOD into a DLL file anyway. I've seen that the few MOD's out at the minute all have a DLL file with them. Along with a 'PDB' file, a 'LIB' file and an 'EXP' file.

    Is there some sort of BAT file I need like with CNC3TW?

    You just compile it with a C++ compiler. The only required result file should be the dll. The pdb file contains debug symbols that should make the mod give better information to the programmer in case of a crash. I don't think that's ever shown to the end user anyway though, so just the dll should be all.

    As for how to compile it, there's a TiberianDawn.vcxproj and a RedAlert.vcxproj; those are Visual Studio project files. Just opening them and compiling them should be simple. All you need is Visual Studio.

  • @Nyerguds
    I've tried reverse engineering a MOD that uses custom Cameos, and I can't figure out what's gone wrong. Even that MOD doesn't appear to run anymore (since Updates). Maybe we should wait until EA finish the game properly before we rewrite the rules of it.
  • dcom67's avatar
    dcom67
    5 years ago

    @Nyerguds 

    The Image formats differ from DXT1 , DXT5 ,A8R8G8B8.

    Here is a list from TD  Desert images  . you can infer that all B*.DES-0000.DDS  images are all  DXT1 , and all BIB*.DES images are DXT5

    Basically if the image doesn't have any animations it is DXT1 or A8R8G8B8  for non standard image sizes that are not divisible by 128

    B1.DES-0000.DDS = DXT1
    BIB1.DES-0000.DDS = DXT5
    BR1.DES-0000.DDS = DXT1
    BRIDGE3.DES-0003.DDS = DXT5
    CLEAR1.DES-0000.DDS = DXT1
    CR1.DES-0000.DDS = DXT5
    D01.DES-0001.DDS = DXT1
    FALL1.DES-0000-0000.DDS = DXT5
    FALLS1.DES-0000-0000.DDS = DXT5
    FORD1.DES-0000-0000.DDS = DXT5
    P01.DES-0000.DDS = DXT1
    ROCK1.DES-0000.DDS = A8R8G8B8
    RV14.DES-0000-0000.DDS = DXT5
    S01.DES-0000.DDS = DXT1
    SC1.DES-0000.DDS = A8R8G8B8
    SH17.DES-0000-00.DDS = DXT5
    SPLIT3.DES-0000.DDS = DXT5
    T04.DES-0000.DDS = A8R8G8B8
    TI4.DES-0000.DDS = DXT5
    V20.DES-0000.DDS = DXT5
    W1.DES-0000-00.DDS = DXT5
    SHADOW-00.DDS = DXT5

      For a complete list http://www.blacknails.ca/textures2.txt  

    As well they seem to have used this tool  at least in all of the ones i opened .

    https://github.com/castano/nvidia-texture-tools 

About Command & Conquer Franchise Discussion

Chat about your favorite games in the Command and Conquer franchise and get help from the player community.13,574 PostsLatest Activity: 23 hours ago