IG ModeloCombate.dt file format

Imperial Glory mods, modding tools and more!

Moderator: TAFN staff

Post Reply
icanus
Soldier
Posts: 14
Joined: Sun Aug 14, 2005 3:39 am

IG ModeloCombate.dt file format

Post by icanus »

Hi all, new poster here, though I've been reading with interest and trying out a few of the mods.

I have gathered that ModeloCombate.dt is where all the juicy stuff (unit stats etc) are located. I've been working on trying to make some sense of the format for about a week now, though progress is extremely slow, as I'm having to teach myself C++ and spanish as I go :?

I'm working on the basis of the DescTropa struct defined in the editor tools source code, though it looks as though there might be several different sets of data all in the one file.

Presently I've got a program to translate the binary values into readable text according the the struct definition, and then I'm going to manually scan through for values I recognise from the game to try and figure out where in the file the unit stats are kept.

Eventually I hope to have enough info to pull out the binary values for the unit stats and put them in a human-readable format (hopefully allowing us to edit the values and then import them back into the .dt file).

I'll update with my progress as I go along.

Any info that anyone else has on the file format would be much appreciated, and of course I'm more than happy to share what I can figure out with anyone else working on this.
User avatar
@m
TAFN Staff
Posts: 999
Joined: Sat Sep 18, 2004 9:54 pm
Location: Belgium
Contact:

Re: IG ModeloCombate.dt file format

Post by @m »

icanus wrote:Any info that anyone else has on the file format would be much appreciated
Nice work, I've contacted the producer of IG a few weeks ago, and sent him a list with modding questions, including the DT file format. At the time the Lead Programmer was on vacation but I believe he'll be back this week so I hope we can get an answer from him, will post it when it arrives.
icanus
Soldier
Posts: 14
Joined: Sun Aug 14, 2005 3:39 am

Post by icanus »

I've contacted the producer of IG a few weeks ago, and sent him a list with modding questions, including the DT file format
Looking foward to hearing any info the devs can give.

a bit more info: I've managed to find a few unit definitions within the file now (though as yet I'm unable to determine which unit stats I've found. There seems to be an infantry unit starting at byte 16, and a cavalry unit at byte 2140. I'm going to try modifying a few of the more easily testable values with a hex editor (probably movement speed), and see if I can get any changes reflected in-game.

It also looks like the unit stats are slightly more complex than I first thought - it seems as though there's one data structure containing all the values common to all unit types, then a second one in addition to this with different structures for artillery and other units.

If I can get all this figured out, then it should just be a case of "mapping" where in the file each unit is stored, writing a function to pull the data into text files, and another to plug it back intot the .dt.

On a side note, do any spanish speakers know what's meant by "Cuadro"? I'm guessing that its either Column or Square formation, as every time I see it it's paired with another variable for Line formation, but every online translator I can find translates it as "Picture".
User avatar
@m
TAFN Staff
Posts: 999
Joined: Sat Sep 18, 2004 9:54 pm
Location: Belgium
Contact:

Post by @m »

icanus
Soldier
Posts: 14
Joined: Sun Aug 14, 2005 3:39 am

Post by icanus »

Thanks for the translation. Guess I should stop believing Babelfish :)

I've made some more progress - figured out the locations of most of the infantry stats (not the arabian/spanish infantry yet, as I can't test them in Quick Game), as well as a fair bit of the format. The data for infantry units starts at the following locations in the dt file:

byte 16: Militia
byte 192: Line Infantry
byte 368: Light Infantry
byte 544: Riflemen
byte 720: Grenadiers
byte 896: Black Watch

It seems that all the nations depend on the same unit data, so changing Light Infantry also changes Voltigeurs and Grenzers. even the "Unique" units are all looking at the same stats, so changing Black Watch also changes the Imperial, Royal and Imaslovski(sp?) Guards.

So far I've succeeded in changing the number of soldiers in different unit types (sadly I've only managed to reduce the number - any more than 60 crashes the game) using a hex editor.

I'll keep on mapping the file, try and find the cavalry and artillery, then have a try at changing some other stuff like range, speed and damage.
User avatar
TAFNsick
TAFN Staff
Posts: 704
Joined: Sun Sep 19, 2004 11:16 am
Location: the Netherlands
Contact:

Post by TAFNsick »

Great your making so many progress. Have you also had a look at the .dt file information provided by Pyro Studios? If not, download this.

Keep up the good work!! :yes:
icanus
Soldier
Posts: 14
Joined: Sun Aug 14, 2005 3:39 am

Post by icanus »

A little bit more progress to report:

I've been messing around with a few more of the stat values for the units I've found so far and have managed to successfully change the following:

Unit size

Spacing between soldiers (could be useful for making skirmishers actually spread out like they should)

Weapon Range

So far I've done all this through hex editing the dt file, though I'm some way towards writting a program to extract the data to a text file (so far I've just been using this to try and decypher the file format - eventually I hope to get it to import new values back in).

I'll try and get a proper description of which stats are stored at which addresses within the file up in the next couple of days so that other people can start tweaking the stats.
icanus
Soldier
Posts: 14
Joined: Sun Aug 14, 2005 3:39 am

Post by icanus »

Here is a first draft of theinfo to let people start changeing things with a hex editor... more on the way soon, hopefully

edit: You can get a good free hex editor here http://www.chmaas.handshake.de

The following contains the addresses with the ModeloCombate.dt file for various unit stats.

first an important note: BEFORE CHANGEING ANYTHING MAKE A BACKUP OF "Imperial Glory/Gamemodes/ModeloCombate.dt", AS GETTING THINGS WRONG CAN STOP THE GAME WORKING ENTIRELY.

These can be edited with a hex editor (make sure you overwrite the existing data, don't insert it

or everything following will be thrown out of whack).

All the data is either 4 bit unsigned integer (LONGINT) or 4 Bit floating point numbers(IEEE SINGLE). I've included the default values to help in figuring out which ones are of which type.
<pre>
Unit Data for Militia/Recruits/Landwehr, starting at byte: 16

BYTE VARIABLE VALUE NOTES
---------------------------------------------------------
16 m_uValTropa: 100 * Seems to have no effect
20 m_uValTropa: 60 * Seems to have no effect
24 m_uValTropa: 6000 * Total Health of unit
28 m_uValTropa: 6000 * Current Health of unit
32 m_uResDis: 0 * Resistance to Ranged attacks
36 m_uResCar: 20 * Resistance to Charges
40 m_uResCue: 30 * Resistance to Hand to Hand attacts
44 uTieRec: 3 * Weapon Reload time (seconds)
48 fRngDet: 8400 * Range to detect other units (cm)
52 fRngDis1: 2625 * Range of muskets (cm), close range
56 fRngDis2: 4200 * Range of muskets (cm), medium range
60 fRngDis3: 5250 * Range of muskets (cm), long range
64 m_uPrecDis1: 90 * Accuracy of muskets (%), close range
68 m_uPrecDis2: 90 * Accuracy of muskets (%), medium range
72 m_uPrecDis3: 90 * Accuracy of muskets (%), long range
76 m_uPrecCue: 90 * Accuracy of Hand to Hand attacks
80 m_uPrecCar: 90 * Acuuracy of Charge attacks
84 m_fVelNor: 200 * Movement Speed
88 m_fVelForColumna: 300 * Movement speed in Column
92 m_fVelCor: 360 * Running speed
96 m_fVelCar: 400 * Charge speed
100 m_SepNormal: 130 * Distance between soldiers
104 m_SepExpandida: 130 * Distance between soldiers
108 m_unused: 240 * Unknown
112 m_FlagsAccDisIni: 240 * Actions diabled for unit
116 m_FlagsAccDis: 0 * Actions diabled for unit
120 m_uModDanDis: 75145 * Unknown
124 m_uModDanCar: 75144 * Unknown
128 m_uModDanCue: 0 * Unknown
132 m_fVelForLinea: 10 * Unknown
136 m_fVelForCuadro: 10 * Unknown
140 m_fGastResPorSec: 240 * Unknown
144 m_fGanResPorSec: 120 * Unknown
148 m_fDurFatiga: 2 * Unknown
152 m_fPenMelee: 1 * Unknown


Unit Data for Line Infantry/Fusilliers/Musketeers, starting at byte: 192

BYTE VARIABLE VALUE NOTES
---------------------------------------------------------
192 m_uValTropa: 100 * Seems to have no effect
196 m_uValTropa: 60 * Seems to have no effect
200 m_uValTropa: 6000 * Total Health of unit
204 m_uValTropa: 6000 * Current Health of unit
208 m_uResDis: 10 * Resistance to Ranged attacks
212 m_uResCar: 30 * Resistance to Charges
216 m_uResCue: 45 * Resistance to Hand to Hand attacts
220 uTieRec: 1 * Weapon Reload time (seconds)
224 fRngDet: 8900 * Range to detect other units (cm)
228 fRngDis1: 2200 * Range of muskets (cm), close range
232 fRngDis2: 3800 * Range of muskets (cm), medium range
236 fRngDis3: 6000 * Range of muskets (cm), long range
240 m_uPrecDis1: 90 * Accuracy of muskets (%), close range
244 m_uPrecDis2: 90 * Accuracy of muskets (%), medium range
248 m_uPrecDis3: 90 * Accuracy of muskets (%), long range
252 m_uPrecCue: 90 * Accuracy of Hand to Hand attacks
256 m_uPrecCar: 90 * Acuuracy of Charge attacks
260 m_fVelNor: 200 * Movement Speed
264 m_fVelForColumna: 300 * Movement speed in Column
268 m_fVelCor: 360 * Running speed
272 m_fVelCar: 400 * Charge speed
276 m_SepNormal: 130 * Distance between soldiers
280 m_SepExpandida: 130 * Distance between soldiers
284 m_unused: 240 * Unknown
288 m_FlagsAccDisIni: 240 * Actions diabled for unit
292 m_FlagsAccDis: 0 * Actions diabled for unit
296 m_uModDanDis: 94153 * Unknown
300 m_uModDanCar: 94175 * Unknown
304 m_uModDanCue: 0 * Unknown
308 m_fVelForLinea: 20 * Unknown
312 m_fVelForCuadro: 10 * Unknown
316 m_fGastResPorSec: 240 * Unknown
320 m_fGanResPorSec: 200 * Unknown
324 m_fDurFatiga: 2 * Unknown
328 m_fPenMelee: 1 * Unknown


Unit Data for Light Infantry/Voltigeurs/Grenzers, starting at byte: 368

BYTE VARIABLE VALUE NOTES
---------------------------------------------------------
368 m_uValTropa: 100 * Seems to have no effect
372 m_uValTropa: 60 * Seems to have no effect
376 m_uValTropa: 6000 * Total Health of unit
380 m_uValTropa: 6000 * Current Health of unit
384 m_uResDis: 0 * Resistance to Ranged attacks
388 m_uResCar: 0 * Resistance to Charges
392 m_uResCue: 0 * Resistance to Hand to Hand attacts
396 uTieRec: 2 * Weapon Reload time (seconds)
400 fRngDet: 9950 * Range to detect other units (cm)
404 fRngDis1: 3200 * Range of muskets (cm), close range
408 fRngDis2: 4800 * Range of muskets (cm), medium range
412 fRngDis3: 7000 * Range of muskets (cm), long range
416 m_uPrecDis1: 90 * Accuracy of muskets (%), close range
420 m_uPrecDis2: 90 * Accuracy of muskets (%), medium range
424 m_uPrecDis3: 90 * Accuracy of muskets (%), long range
428 m_uPrecCue: 90 * Accuracy of Hand to Hand attacks
432 m_uPrecCar: 90 * Acuuracy of Charge attacks
436 m_fVelNor: 260 * Movement Speed
440 m_fVelForColumna: 340 * Movement speed in Column
444 m_fVelCor: 400 * Running speed
448 m_fVelCar: 400 * Charge speed
452 m_SepNormal: 130 * Distance between soldiers
456 m_SepExpandida: 130 * Distance between soldiers
460 m_unused: 240 * Unknown
464 m_FlagsAccDisIni: 240 * Actions diabled for unit
468 m_FlagsAccDis: 0 * Actions diabled for unit
472 m_uModDanDis: 94153 * Unknown
476 m_uModDanCar: 94175 * Unknown
480 m_uModDanCue: 10 * Unknown
484 m_fVelForLinea: 0 * Unknown
488 m_fVelForCuadro: 0 * Unknown
492 m_fGastResPorSec: 300 * Unknown
496 m_fGanResPorSec: 200 * Unknown
500 m_fDurFatiga: 2 * Unknown
504 m_fPenMelee: 1 * Unknown


Unit Data for Riflemen/Tirailleurs/Jagers, starting at byte: 544

BYTE VARIABLE VALUE NOTES
---------------------------------------------------------
544 m_uValTropa: 100 * Seems to have no effect
548 m_uValTropa: 60 * Seems to have no effect
552 m_uValTropa: 6000 * Total Health of unit
556 m_uValTropa: 6000 * Current Health of unit
560 m_uResDis: 30 * Resistance to Ranged attacks
564 m_uResCar: 10 * Resistance to Charges
568 m_uResCue: 20 * Resistance to Hand to Hand attacts
572 uTieRec: 3 * Weapon Reload time (seconds)
576 fRngDet: 9950 * Range to detect other units (cm)
580 fRngDis1: 3700 * Range of muskets (cm), close range
584 fRngDis2: 5300 * Range of muskets (cm), medium range
588 fRngDis3: 7500 * Range of muskets (cm), long range
592 m_uPrecDis1: 90 * Accuracy of muskets (%), close range
596 m_uPrecDis2: 90 * Accuracy of muskets (%), medium range
600 m_uPrecDis3: 90 * Accuracy of muskets (%), long range
604 m_uPrecCue: 90 * Accuracy of Hand to Hand attacks
608 m_uPrecCar: 90 * Acuuracy of Charge attacks
612 m_fVelNor: 260 * Movement Speed
616 m_fVelForColumna: 340 * Movement speed in Column
620 m_fVelCor: 400 * Running speed
624 m_fVelCar: 400 * Charge speed
628 m_SepNormal: 130 * Distance between soldiers
632 m_SepExpandida: 130 * Distance between soldiers
636 m_unused: 240 * Unknown
640 m_FlagsAccDisIni: 240 * Actions diabled for unit
644 m_FlagsAccDis: 0 * Actions diabled for unit
648 m_uModDanDis: 94153 * Unknown
652 m_uModDanCar: 94175 * Unknown
656 m_uModDanCue: 30 * Unknown
660 m_fVelForLinea: 0 * Unknown
664 m_fVelForCuadro: 10 * Unknown
668 m_fGastResPorSec: 300 * Unknown
672 m_fGanResPorSec: 200 * Unknown
676 m_fDurFatiga: 2 * Unknown
680 m_fPenMelee: 1 * Unknown


Unit Data for Grenadier Guards/Grenadiers, starting Guards at byte: 720

BYTE VARIABLE VALUE NOTES
---------------------------------------------------------
720 m_uValTropa: 100 * Seems to have no effect
724 m_uValTropa: 60 * Seems to have no effect
728 m_uValTropa: 6000 * Total Health of unit
732 m_uValTropa: 6000 * Current Health of unit
736 m_uResDis: 40 * Resistance to Ranged attacks
740 m_uResCar: 40 * Resistance to Charges
744 m_uResCue: 60 * Resistance to Hand to Hand attacts
748 uTieRec: 2 * Weapon Reload time (seconds)
752 fRngDet: 8900 * Range to detect other units (cm)
756 fRngDis1: 2700 * Range of muskets (cm), close range
760 fRngDis2: 4300 * Range of muskets (cm), medium range
764 fRngDis3: 6500 * Range of muskets (cm), long range
768 m_uPrecDis1: 90 * Accuracy of muskets (%), close range
772 m_uPrecDis2: 90 * Accuracy of muskets (%), medium range
776 m_uPrecDis3: 90 * Accuracy of muskets (%), long range
780 m_uPrecCue: 90 * Accuracy of Hand to Hand attacks
784 m_uPrecCar: 90 * Acuuracy of Charge attacks
788 m_fVelNor: 200 * Movement Speed
792 m_fVelForColumna: 300 * Movement speed in Column
796 m_fVelCor: 360 * Running speed
800 m_fVelCar: 400 * Charge speed
804 m_SepNormal: 130 * Distance between soldiers
808 m_SepExpandida: 130 * Distance between soldiers
812 m_unused: 240 * Unknown
816 m_FlagsAccDisIni: 240 * Actions diabled for unit
820 m_FlagsAccDis: 0 * Actions diabled for unit
824 m_uModDanDis: 94153 * Unknown
828 m_uModDanCar: 94175 * Unknown
832 m_uModDanCue: 10 * Unknown
836 m_fVelForLinea: 30 * Unknown
840 m_fVelForCuadro: 25 * Unknown
844 m_fGastResPorSec: 240 * Unknown
848 m_fGanResPorSec: 200 * Unknown
852 m_fDurFatiga: 2 * Unknown
856 m_fPenMelee: 1 * Unknown


Unit Data for Black Watch/Imperial Guard/Royal Guard/Ismailovski Guard, starting at byte: 896

BYTE VARIABLE VALUE NOTES
---------------------------------------------------------
896 m_uValTropa: 100 * Seems to have no effect
900 m_uValTropa: 60 * Seems to have no effect
904 m_uValTropa: 6000 * Total Health of unit
908 m_uValTropa: 6000 * Current Health of unit
912 m_uResDis: 60 * Resistance to Ranged attacks
916 m_uResCar: 50 * Resistance to Charges
920 m_uResCue: 75 * Resistance to Hand to Hand attacts
924 uTieRec: 3 * Weapon Reload time (seconds)
928 fRngDet: 8900 * Range to detect other units (cm)
932 fRngDis1: 3200 * Range of muskets (cm), close range
936 fRngDis2: 4800 * Range of muskets (cm), medium range
940 fRngDis3: 7000 * Range of muskets (cm), long range
944 m_uPrecDis1: 90 * Accuracy of muskets (%), close range
948 m_uPrecDis2: 90 * Accuracy of muskets (%), medium range
952 m_uPrecDis3: 90 * Accuracy of muskets (%), long range
956 m_uPrecCue: 90 * Accuracy of Hand to Hand attacks
960 m_uPrecCar: 90 * Acuuracy of Charge attacks
964 m_fVelNor: 220 * Movement Speed
968 m_fVelForColumna: 300 * Movement speed in Column
972 m_fVelCor: 360 * Running speed
976 m_fVelCar: 400 * Charge speed
980 m_SepNormal: 130 * Distance between soldiers
984 m_SepExpandida: 130 * Distance between soldiers
988 m_unused: 240 * Unknown
992 m_FlagsAccDisIni: 240 * Actions diabled for unit
996 m_FlagsAccDis: 0 * Actions diabled for unit
1000 m_uModDanDis: 94153 * Unknown
1004 m_uModDanCar: 94175 * Unknown
1008 m_uModDanCue: 30 * Unknown
1012 m_fVelForLinea: 40 * Unknown
1016 m_fVelForCuadro: 40 * Unknown
1020 m_fGastResPorSec: 300 * Unknown
1024 m_fGanResPorSec: 240 * Unknown
1028 m_fDurFatiga: 2 * Unknown
1032 m_fPenMelee: 1 * Unknown
</pre>
There seem to be some more values associated - each unit record is 176 bytes long, and these values only account for 144 bytes, but as yet I have not figured out the format for these values.

The file also contains a LOT of other data besides unit stats (it seems that unit stats can only account for about the first 10% of the file - what the rest is is as yet unknown, but I'm guessing things like the price of units, both for Quick games and in the campaign, as well as all the naval unit stats are in here too).

Any feedback on what effects changeing these values have would be much appreciated - I'll try to keep this list up to date with any new values I find, and will add the addresses for other unit types as I go.

Thanks to PYRO STUDIOS for releasing the source code chunks in the editor tools - without that decyphering this stuff would have been next to impossible.
Last edited by icanus on Thu Aug 18, 2005 6:07 pm, edited 1 time in total.
icanus
Soldier
Posts: 14
Joined: Sun Aug 14, 2005 3:39 am

Post by icanus »

I'm now moving on to the next step with this;

I've already written a program that extracts the known variables to a text file (this is what I used to create the list above) I've also got some experimental code that can write the data, with changes made, into a new dt file.

Next up is to finalize a format for the output text, and write a prog to read the text file and import it back into the dt.

This will allow people to simply extract the data, edit the values in the text file and then import them straight back into the game.

I may opt for a format that generates a seperate text file for each unit, as this would allow people to distribute unit mods individually, without overwriting changes to all the other units in the game.

I'll also try to make the program look to a seperate "roadmap" file to tell it where to look for unit data within the file, as this would allow it to be updated as people find more units without having to release a whole new program.

I'll also try and have some features like automatically backing up the original .dt file on first use, and include an option to restore the default values.

Hopefully I should have a beta version ready in a week or so.

Afraid for the moment its going to be a console application, since I'm pretty new to C++ and can't get my head round the windows API at all.
icanus
Soldier
Posts: 14
Joined: Sun Aug 14, 2005 3:39 am

Post by icanus »

Things are now looking a bit more complicated - it seems that for each unit, the stats for each experience level are stored seperately, so changes to Line infantry will be lost when they reach level 2.

It's going to make the design of my stat editor program a bit more complicated, which will probably delay things.

On the plus side, I've discovered that the unit size can be set to more than 60 without causing the game to crash, as well as ironing out some errors I'd made in decyphering some of the variables.
Gunfreak
Soldier
Posts: 8
Joined: Mon May 23, 2005 3:04 pm

Post by Gunfreak »

icanus wrote:On the plus side, I've discovered that the unit size can be set to more than 60 without causing the game to crash, as well as ironing out some errors I'd made in decyphering some of the variables.
you just made me the happiest little boy... no more imperal skirmish
icanus
Soldier
Posts: 14
Joined: Sun Aug 14, 2005 3:39 am

Post by icanus »

The first version of the editor is now in the downloads section.

http://www.tafn.info/TAFN/commandos/scr ... file&id=68

the zip file contains the program, a readme, and an introduction to some of the most useful stats that can be changed
User avatar
Jovan
TAFN Staff
Posts: 431
Joined: Sun Sep 19, 2004 7:16 pm

Post by Jovan »

Well, that even shocks me!

Job well done! (It saved ME the trouble :))

If you include the source code I'll reprogram it a bit so its in Win32 instead of console.
Gunfreak
Soldier
Posts: 8
Joined: Mon May 23, 2005 3:04 pm

Post by Gunfreak »

just as a test, i tried to increase the unit size to 160,( only line as a test)

but when i hit the squere formation, the game just CTD's
icanus
Soldier
Posts: 14
Joined: Sun Aug 14, 2005 3:39 am

Post by icanus »

Gunfreak wrote:just as a test, i tried to increase the unit size to 160,( only line as a test)

but when i hit the squere formation, the game just CTD's
I guess there might be a hard limit on how many troops it can handle in one unit, probably the formations are defined in such a way that there are only a fixed number of "spots" for men to stand in.

That said, I think one of the guys over at the Eidos forum has succeeded in making units of 180.

Are you using the new version (0.8) of my program? 0.7 exported 2 variables which caused some problems with formations in campaign mode (even if they were imporrted back in unchanged - must be something unusual about the data type in those variables), so it could be related to that.
Gunfreak
Soldier
Posts: 8
Joined: Mon May 23, 2005 3:04 pm

Post by Gunfreak »

used v 0.8

i'm gonna try to se if it works with 120.-
Post Reply