Jump to content

Opening .mds files


Recommended Posts

I am in the mds file. I will now do an experiment based on Jace's info. I will edit/alter a non-needed gear group to allow the edit/alter of a needed gear group WITHOUT changing the file length of the mds.

<puts on gloves and faceshield>...

I will let you all know...

EDIT: SUCCESS!!!!

What I did: So, Italians do not have assault rifles so that gear item in the German M43 when renamed as Italian M38 is non-needed. I used text string german_ammo-rifle-aslt-right with a string length in hex of 1C which is 28 characters. I was focused on getting pitbull's modded italians a radio gear item so german_radio had to become italian_radio going from 0C (12 characters) to 0D (13 characters), so I changed german_ammo-rifle-aslt-right to german_ammo-rifle-aslt-righ and edited the 1C (28 characters) to 1B (27 characters). In program HxD I searched for hex 1B and 0D and then pasted them as needed versus typing 1B and 0D. 

EXPERIMENT 2:

Jace said that he did not even see a checksum in the mds, so now I will try to make an edit/alter WITHOUT worrying about mds file length and see if that even works. As long as my "gear groups" have that string length accurate... <stands behind sandbags and sounds klaxon to alert household> Standby

EDIT: SUCCESS!!!!

Edited by kohlenklau
Link to comment
Share on other sites

Experiment #3: I will attempt to take the gear grouping from one mds and paste it into another mds. This would be the proper xyz for the Italian holster pasted into the german holster's grouping...<viewing New Mexico desert test range through old black and white tube TV>...standby

EDIT: well, good news, it did not crash BUT the holster did not go where I thought it would go based on normally where it goes unmodded for an Italian officer m38 mds. Maybe something else is going on but I CAN ALWAYS Blender mod the Italian holster and move it...

I was thinking that I pasted in a generic reference to where the gear item goes on the uniform's 3D structure described elsewhere in the mds file. There are many text strings called "bip" and I imagine that it means "body insertion point", nudge nudge wink wink, is she a sport?  So bip1 could be described elsewhere in the mds file and when I drop in my italian holster and my pasted in part just says go to bip1 and the program follows the guidance...I DUNNO but no worry maybe I STILL need to quickly tweak stuff in Blender. oh well...

Edited by kohlenklau
Link to comment
Share on other sites

Very interesting ... so you think that bip01 spine2d is a location on the model, can you change the location to say spine2c and have the equipment move? Or is all the gobbledygook after spinexx the location relative to the bip spinexx - that is to say for example bip (body insertion point) spine02 is at ,.3/...Ãõ etc?

Link to comment
Share on other sites

Very interresting indeed, @RockinHarry was used something similar something with hexagone,  and has also good result, but I dont remember about the sofware that he were used !?

can you pointed me to the sofw that you are using ?

It is good that we are working together on the mds question 

thanks 

JM

Edited by JM Stuff
Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

It is very complicated but I can try to explain it better. This is for myself or other beginners.

The mds file is like a computer program. A code to instruct the computer. 

In the mds file there is hexadecimal entries to tell the computer how to draw the 3D soldier model and also how and where to put each of the gear items on the soldier.

We cannot see exactly how the computer sees.

Each mds has the gear section of the code.

It is in a format that tells the computer what gear to get from the folders and where to put it on the 3D soldier.

We can edit this part to maybe change the gear or to change the location.

You must be very careful like a surgeon.

You must have a plan before you make changes. 

BEFORE YOU CHANGE THE MDS, THERE ARE OTHER TOOLS TO TRY.

Examples:

RENAME MDR FILES

Just simply rename a gear item mdr file. You can put a radio where the pistol holster goes. Rename radio as holster. Then put in z. Run the game and see the officer with a radio on his hip. hahaha This is funny and silly but it shows how you can change things BEFORE going into mds.

USE BLENDER TO CHANGE THE MDR

Blender can make the pistol holster mdr also have something extra or new or turned different.  Then put in z. Run the game and see the officer with a holster upside down? hahaha This is funny and silly but it shows how you can change things BEFORE going into mds.

WHEN DO WE EDIT THE MDS FILE?

Often we can put a new uniform on some unit. Example is the British shorts. It is only for allies British Army. Maybe we want it on the Soviet soldiers? In my small experience, it is possible by renaming and put in CMRT z folder. But the Soviets will appear WITHOUT ANY GEAR. So, we go INTO the mds and edit to change these formatted entries to the Soviet gear names. Carefully change the entries. It can work.

Link to comment
Share on other sites

I am not so smart. If my brain had 12v of power years ago when I was younger and sharper, then now it is down near 9v.

Anyway...

this is how mds renaming works...

The game code only knows the filenames. if it sees the correct filename for the unit, then it uses that 3D model.

We trick the game code by grabbing the 3D model we REALLY want and rename it to what the game code uses for the situation.

If we are successful there, the game code is then building the 3D model to display in the game.

But depending on what mds we grabbed, in the mds, the gear nomenclature might not match what is normally strapped to the soldier, so then no gear is issued out.

NOW we must again trick the game code and edit the mds file text to use gear filenames it thinks match to that soldier's nation.

Back somewhere in this thread, Jace11 kindly told me that these mds have no overall checksum. I was always worried before and did unnecessary tricks to keep the file length the same. 

The gear item part of the mds file does have a SUM ENTRY FIELD for the number of characters in the gear file name.

0E is hexadecimal SUM ENTRY FIELD for the decimal 14 for number of characters for american-radio followed by 00 and then the hexadecimal equivalent for the letters

..american-radio is 0E 00 61 6D 65 72 69 63 61 6E 2D 72 61 64 69 6F

you can paste in ..german-radio as long as your SUM ENTRY FIELD is correct.

Everything after this is the exact 3D position.

Then the next gear item entry starts with its SUM ENTRY FIELD

 

 

 

 

Edited by kohlenklau
Link to comment
Share on other sites

MDS FILE PROJECT WALK-THROUGH

I have an idea to just do a project here in the thread and maybe it better shows how to work with mds files AS I UNDERSTAND IT. Maybe some smarter guy spots my big mistakes or has a better way. Fine by me. Holler out!

This is a project for the CMFI France 1940 Mod. I will offer it to @PEB14 if he can use it for his April 1940 scenario. If not, I am sure I can use it somewhere or maybe @kevinkin

Corps Francs

These were like adhoc French commando units. Volunteers. Maybe the more aggressive and skilled soldiers in a unit? I don't know for sure. Their uniforms were a bit different than the normal. Here is our opportunity to do a CM mod. Oh boy oh boy!

lLrhZD7.jpg

5jQbpSu.jpg

Analysis

Just looking at them we already have most of the parts. Adrian helmet? Check! The @Falaise Memorial Ammo pouch? Check! Fashionable stubble? We can find that!

The jackets? Well, this is where we gotta go mds shopping. I think right off the bat that we will use the German Winter skeleton. We go into the exploded files to find it.

We need that main mds and his 5 buddies. 

Find the skeleton files

I bought a foreign made mini-external SSD and it holds 1TB. I have my entire 22GB CMFI REZEXPLODE collection on it. Plus all my other CM crap. Very handy. When I get retired from CM I will throw it in the lake. Just kidding! :D

Folder v210b/soldiers-axis/germans /skeletons has my stuff.

smod_german_winter.mds plus smod_german_winter-lod-1.mds thru smod_german_winter-lod-5.mds

I copy them to my CMFI z folder and put in a working folder called [corpsfrancs]

My modtag will be [corpsfrancs] or maybe it must be a double modtag of [corpsfrancs france1940]? We shall see.

So, recall the below from my post above...

  

3 hours ago, kohlenklau said:

The game code only knows the filenames. if it sees the correct filename for the unit, then it uses that 3D model.

We trick the game code by grabbing the 3D model we REALLY want and rename it to what the game code uses for the situation.

If we are successful there, the game code is then building the 3D model to display in the game.

What mds file do we use to trick the game code? Well, it has to be on one of our modded France 1940 French units. I want it as easy as possible if I ship this to Pierre so I will use the actual French and not our other choices; Brazilians or Poles.

I think we'll use the greatcoat mds. The French use the American greatcoat mds so we need the exact filenames so we can rename our german winter mds. 

smod_american_greatcoat.mds and his 5 buddies smod_american_greatcoat-lod-1.mds thru smod_american_greatcoat-lod-5.mds

I usually just paste the 6 files in the same folder with the german winter mds we want to see.

Click on the filename you want to copy to the clipboard. Hit F2. Hit control C. Then delete that file. Then click on the correlating file for german winter and hit F2 and then hit control v. hit enter and it has been renamed. crank this process out for the 5 buddies and eventually all you have are the secretly renamed mds files. Then we can add the modtag using my bulk renamer.

Then we make a modtag text file or in this case we edit an existing one to add in the new modtag.

Then we fire up old Bessy CMFI.

We go into the editor and make or use a little testing scenario. Set dates. Purchase units. Set appearance. Check what is displayed.

This is what we see:

G9mbq0u.png

It is a texture for a different 3D model so it looks all messed up.

So then I rename a german winter uniform that matches 3D to the REAL 3D model but has the filename the game code wants to see.

smod_french_greatcoat_uniform [corpsfrancs france1940].bmp

smod_french_greatcoat_uniform_normal map [corpsfrancs france1940].bmp

I just happened to ALREADY have one I modded for the R35 tank crews.

So, then here is what we see.

deG01iy.png

 

I still have to get them some proper footwear by file renaming.

I also want to do normal texture modding to add BACK IN the suspender straps on SOME guys. For looks - for variety. see above photos.

Then we can try and add back the gear using the mds file editing techniques.

They say these guys operated with minimal gear so it will not be all the usual kit a recruit carries!

Headed off to my job.

TO BE CONTINUED.

 

 

 

Edited by kohlenklau
Link to comment
Share on other sites

1 hour ago, kohlenklau said:

MDS FILE PROJECT WALK-THROUGH

I have an idea to just do a project here in the thread and maybe it better shows how to work with mds files AS I UNDERSTAND IT. Maybe some smarter guy spots my big mistakes or has a better way. Fine by me. Holler out!

This is a project for the CMFI France 1940 Mod. I will offer it to @PEB14 if he can use it for his April 1940 scenario. If not, I am sure I can use it somewhere or maybe @kevinkin

Corps Francs

These were like adhoc French commando units. Volunteers. Maybe the more aggressive and skilled soldiers in a unit? I don't know for sure. Their uniforms were a bit different than the normal. Here is our opportunity to do a CM mod. Oh boy oh boy!

lLrhZD7.jpg

5jQbpSu.jpg

Analysis

Just looking at them we already have most of the parts. Adrian helmet? Check! The @Falaise Memorial Ammo pouch? Check! Fashionable stubble? We can find that!

The jackets? Well, this is where we gotta go mds shopping. I think right off the bat that we will use the German Winter skeleton. We go into the exploded files to find it.

We need that main mds and his 5 buddies. 

Find the skeleton files

I bought a foreign made mini-external SSD and it holds 1TB. I have my entire 22GB CMFI REZEXPLODE collection on it. Plus all my other CM crap. Very handy. When I get retired from CM I will throw it in the lake. Just kidding! :D

Folder v210b/soldiers-axis/germans /skeletons has my stuff.

smod_german_winter.mds plus smod_german_winter-lod-1.mds thru smod_german_winter-lod-5.mds

I copy them to my CMFI z folder and put in a working folder called [corpsfrancs]

My modtag will be [corpsfrancs] or maybe it must be a double modtag of [corpsfrancs france1940]? We shall see.

So, recall the below from my post above...

  

What mds file do we use to trick the game code? Well, it has to be on one of our modded France 1940 French units. I want it as easy as possible if I ship this to Pierre so I will use the actual French and not our other choices; Brazilians or Poles.

I think we'll use the greatcoat mds. The French use the American greatcoat mds so we need the exact filenames so we can rename our german winter mds. 

smod_american_greatcoat.mds and his 5 buddies smod_american_greatcoat-lod-1.mds thru smod_american_greatcoat-lod-5.mds

I usually just paste the 6 files in the same folder with the german winter mds we want to see.

Click on the filename you want to copy to the clipboard. Hit F2. Hit control C. Then delete that file. Then click on the correlating file for german winter and hit F2 and then hit control v. hit enter and it has been renamed. crank this process out for the 5 buddies and eventually all you have are the secretly renamed mds files. Then we can add the modtag using my bulk renamer.

Then we make a modtag text file or in this case we edit an existing one to add in the new modtag.

Then we fire up old Bessy CMFI.

We go into the editor and make or use a little testing scenario. Set dates. Purchase units. Set appearance. Check what is displayed.

This is what we see:

G9mbq0u.png

It is a texture for a different 3D model so it looks all messed up.

So then I rename a german winter uniform that matches 3D to the REAL 3D model but has the filename the game code wants to see.

smod_french_greatcoat_uniform [corpsfrancs france1940].bmp

smod_french_greatcoat_uniform_normal map [corpsfrancs france1940].bmp

I just happened to ALREADY have one I modded for the R35 tank crews.

So, then here is what we see.

deG01iy.png

 

I still have to get them some proper footwear by file renaming.

I also want to do normal texture modding to add BACK IN the suspender straps on SOME guys. For looks - for variety. see above photos.

Then we can try and add back the gear using the mds file editing techniques.

They say these guys operated with minimal gear so it will not be all the usual kit a recruit carries!

Headed off to my job.

TO BE CONTINUED.

 

 

 

Looking very good I was thinking also to take the famous crew jacket that you did already perhaps added a helmet cover ?

I hope only that people's with a common interrest to the mds files let show their noze to help the Master of mds file's that you are, because me I was trying but I am far from a good result.

But now that you post your last infos I will try again.

 

Edited by JM Stuff
Link to comment
Share on other sites

ok, we shall continue onward. Where did we leave off?

Right here. This is what we see.

deG01iy.png

 

to do list:

proper footwear by file renaming. 

normal texture modding to add BACK IN the suspender straps on SOME guys.

some other tones or shades of the uniforms.

Then we can try and add back the gear using the mds file editing techniques.

They say these guys operated with minimal gear so it will not be all the usual kit a recruit carries!

LET'S MOVE OUT!

ok, we did the footware and some UI stuff I figured I would do. I read they had a blue star symbol. 

 

7STw3pP.png

TO BE CONTINUED

Edited by kohlenklau
Link to comment
Share on other sites

So, now the actual mds file editing. I use HxD freeware

open your mds file with HxD and scroll down to around line A3D0.

That is where all the gear directions occur.

Below is a previously used image but it shows an entire "gear block" copied to the clipboard.

Go after that ? all the way to after the NEXT ?

You grab american gear blocks from the normal uniforms the French wear and paste over the similar entry for the German winter uniform.

Then save.

I already last night did the ammo rifle, smg and they were successful. I am now working on the LMG.

0jFWiFq.png

SUCCESS WITH THE GEAR! still need some texture work on the French y-straps. AND i gotta track down the unshaven faces mod.

6Wqebqp.png

FbeK3UF.png

I WILL CONSIDER THIS LITTLE TUTORIAL COMPLETED. This thread will probably drift down the stream into obscurity but I tried. :D

 

 

 

Edited by kohlenklau
Link to comment
Share on other sites

  • 3 months later...

Here I am again messing with mds files. This time I am in CMRT trying to make it show British soldiers delaying the Germans outside Calais in May 1940 with their Boys and Girls Anti-tank rifles.

Let me see if my brain remembers what to do. Standby lads

EDIT: it didn't work but immediately after I remembered what to do. This mds manipulation is a bit different than the one above. 

The above one was this...

A. In the same title, an Axis uniform placed on an allied soldier and then allied soldier gear pasted over what is normally there.

This time I am doing this...

B. Allied soldier uniform brought to a different title to place on a different nation allied soldier with different gear nomenclature. Hmmm

Has it been over an hour? I guess not.

I fixed it and all is looking well. I better explain in the NEXT post. My hour is almost up.

Edited by kohlenklau
Link to comment
Share on other sites

B. Allied soldier uniform brought to a different title to place on a different nation allied soldier with different gear nomenclature. 

The normal British pattern 37 mds file is brought to CMRT z folder and renamed as M43 Soviet uniform. All the associated pattern 37 BMP files must be renamed as M43 bmp files. modtag everything. in CMRT z, open the now renamed pattern 37 mds file in hex editor and go to the gear section. rename the gear titles to match soviet gear. You must also change the gear title length hex characters to match the new length in characters.

for example

british_canteen at 15 characters 0F in hex is now edited to soviet_canteen at 14 characters so change 0F to 0E.

THEN take the gear mdr for british_canteen from CMFI and put in CMRT z and rename as soviet_canteen with modtag. Also bring along the bmp textures for british canteen but they do not need to be renamed.

C Troop, 1st Searchlight Battalion defends the bridge at Les Attaques. Uniforms and helmets by @Falaise...merci mon ami. A belated Happy Bastille Day to you and the family (N,P&A)!

274-in-prog.png

 

 

Edited by kohlenklau
Link to comment
Share on other sites

  • 2 weeks later...

NEW PROJECT ALERT

@Kuli

CMFI FJ will wear the British shorts uniform

step 1 is we rename that mds to be what the FJ normally wear. CHECK (Very easy to do) This just changes the 3D model shape.

They will look very ugly as they are still being dressed in the uniforms, boots and skins of the normal mds for FJ

You trick the game code by taking the proper bmp's for shorts and renaming as FJ uniforms for "the set" (soldiers, nco's, officers at 3 levels)

For the shorts there is another element of the gnarly leg haired bastard skins with forearms too.

You gotta have the files of German skins to match what is needed. Maybe boots too need renamed.

THEN AFTER ALL THIS ART BMP FILES ARE RENAMED AND SHOW PROPERLY IN GAME - CAN BE REWORKED TO LOOK GERMAN IN GIMP or PHOTOSHOP.

THEN we can go into the mds and add back the German gear.

Long ago I had the Italians in British shorts.

 

Edited by kohlenklau
Link to comment
Share on other sites

Alrighty, I am assisting @Kuli with his mod idea of CMBN 12th SS HJ soldiers famously wearing an Italian camo pattern coveralls. Kuli asked to use the British battledress mds 3D model. I set up a folder in CMBN z and label it "kuli mod" and bring there the 3D model smod_british_m37.mds file and make a copy too. Keep a copy there always as you screw up it is handy to delete the bad one and start fresh. The same with the mds you are "taking over"...I decided to use smod_german_m43-ankleboots.mds. Make a copy there in the working folder just in case.

Open up the smod_german_m43-ankleboots and the smod_british_m37 next to each other in HxD. 2 tabs. m37 gets edited. But m37 is renamed as smod_german_m43-ankleboots [kuli]. 

I have swapped all the gear I could doing normal cut and paste in HxD hex editor software. I think the mds file has an index number of the gear slots somewhere and I have a maximum number I can paste over? @Jace11. At first I did something really aggressive and tried to paste a HUGE block. It loaded the game to 97% and was unresponsive as it didn't like what I tried. After that I went slowly with "one for one" swaps. The priority is the ammo pouches and I pasted in these. 2 for rifle, 2 for SMG, 1 for Auto rifle, LMG kit, pistol holster, breadbag cluster left and right, horizontal poncho, horizontal gasmask can, shovel-bayonet combo. Maybe a few others I forget. 15 total.

 

Edited by kohlenklau
Link to comment
Share on other sites

Cool stuff, the copy pasting of data chunks works in mdr files too.  I use the same points you do.. the name sum to the next name sum. It works most the time. I’ve tried recently and failed when I’ve moved something to a different parent, so parent / child relationships for objects are determined in the hex data somewhere I think. There could also be a list, honestly not sure. I haven’t found it, but I haven’t really spent time looking into this either. I mostly look at mdr files and there are lots of differences between mds and mdr.

Link to comment
Share on other sites

57 minutes ago, Jace11 said:

I mostly look at mdr files and there are lots of differences between mds and mdr.

I can open mdr files in Blender, you could too if you download the right version of Blender and the special CM mdr plug-in. It allows you to see the parent-child relationships. I do use HxD to change the names of the texture files for a mdr. I can pull off some nice tricks doing that.

I have had fun and moderate success editing the mds uniform files. But messing with mdr files is a ton of fun. 

Link to comment
Share on other sites

I do use blender, but I prefer to copy-paste data chunks for reasons to do with the plugin (the double vertex shading issue). So if I'm modding a weapon or animation (have had some success with fixing broken animations recently) I will modify in blender, export that model, then copy the data chunk of the object I modded back into the original mdr. This reduces the occurance of the shading bug. The shading bug isn't a big deal, most people won't even notice and its not often visible depending on where a mesh wraps back on itself. The best example is the Fallschirmjager helmet. Try opening and exporting it, then use it in game, you will see a shading "seam" across the top of the helmet no matter what you try but the default model doesn't. Just opening that model using the blender plugin introduces that issue. It occurs on cylinders (like gun barrels), spherical shapes etc. Basically the plugin doesn't work perfectly. This is only one artifact (there may be more) and I have no idea how to fix it.

So.. that's why I prefer to use HEX but guided by blender. Sometimes I have no choice and have to export the whole model though especially if there is a lot of parent swapping, reordering involved (like the JPzIV(A) muzzle fixes I tried a couple of days ago).

FJ helmet shading "seam" (note each vertex along the seam is a double vertex - using "remove double vertices" function will get rid of the seam but will corrupt the UV texture mapping.

Vzx8mAQ.jpg

 

The point I was trying to get across in the previous post was I have not been able to move data chunks to different parents successfully (I can move objects to new parents in blender -  but not with raw hex data). There is probably some data, like a list or number of children somewhere in the mdr, which means there may be something similar in mds.

Edited by Jace11
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...