Jump to content


Photo

Desperados modding research


  • Please log in to reply
32 replies to this topic

#1 Salvadorc17

Salvadorc17

    title available

  • Members
  • 490 posts
  • Location:Colombia
  • Projects:https://github.com/salvadorc17/CommandosMaker

Posted 22 November 2016 - 10:09 PM

Hi, you guys, want to start the research of the game files, and be able to mod the mission script and other stuff, if you want to help me any information is apretiated.

 

11rc8rk.png

 

-Desperados game files.

 

.sbc: Scripts

 

Found this line of codes, so the important here is to know what is the adress 1020, and which function calls.

 

 sizeOfVolatile 0, sizeOfTempor 268
functionName CheckVictoryCondition , address 1020, nbOfParams 2, sizeOfRetVal 4, sizeOfParams 4
functionParameters

 

.dat: Save Files.

 

Binary data with all level info, useful mostly for cheats, will find into values.



#2 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 23 November 2016 - 12:31 PM

You can edit the *.dat files with the program FileCarver and my definition files:

Attached File  desperados_filecarver_definitions.zip   893bytes   116 downloads

 

screenshot.png

 



#3 Sancho Perez

Sancho Perez
  • Members
  • 15 posts

Posted 23 November 2016 - 06:49 PM

You can edit the *.dat files with the program FileCarver and my definition files:

attachicon.gifdesperados_filecarver_definitions.zip

 

attachicon.gifscreenshot.png

Wow, so with your file we can change the attribute of the ennemies and of the weapons ?  :w00t:


Edited by Sancho Perez, 23 November 2016 - 06:56 PM.


#4 Salvadorc17

Salvadorc17

    title available

  • Members
  • 490 posts
  • Location:Colombia
  • Projects:https://github.com/salvadorc17/CommandosMaker

Posted 23 November 2016 - 07:53 PM

You can edit the *.dat files with the program FileCarver and my definition files:

attachicon.gifdesperados_filecarver_definitions.zip

 

attachicon.gifscreenshot.png

Good work herbert, how did you find those parameters for the game, and which game files you was exploring, same save game??



#5 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 23 November 2016 - 10:51 PM

Good work herbert, how did you find those parameters for the game, and which game files you was exploring, same save game??

Thanks. Well, I just opened the files Characters.dat and Weapons.dat with a hex editor and tried to figure out the file structure.

But I'm not sure if I named the fields correctly (for example Overheat and Recover).

 

And the scb files will be hard to crack, those are compiled mission scripts.



#6 Salvadorc17

Salvadorc17

    title available

  • Members
  • 490 posts
  • Location:Colombia
  • Projects:https://github.com/salvadorc17/CommandosMaker

Posted 24 November 2016 - 07:21 PM

And the scb files will be hard to crack, those are compiled mission scripts.

Yes, i know, but if you open those with text editor you will be able to read some part of the script definitions that list names and address, maybe if we can find which addres does reference, will be able to reuse those functions and change scripts.



#7 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 25 November 2016 - 05:59 AM

It looks like the addresses point to the start of the functions in the scb byte code.

hex.png

 

Each statement is 10 (0xA) bytes long and ends with 7E
For example:
13 04 C0 00 00 1D 09 00 00 7E

Each function starts with:
03 00 00 28 00 00 00 00 00 7E    (the value, in this case 28, is not the same in all functions)

Each function ends with:
01 00 00 00 00 00 00 00 00 7E
06 00 00 00 00 00 00 00 00 7E
04 00 00 00 00 00 00 00 00 7E


I guess the first byte is always the opcode and the remaining bytes (except for the last) are the operands.
0F 04 C0 00 00 B2 02 00 00 7E    (B2 02 00 00 looks like an integer)
14 4C C0 00 00 00 00 80 3F 7E    (00 00 80 3F is a float)

 

Update:

I just found the following strings in the game.exe:

+I
-I
*I
/I
+F
-F
*F
/F
<=I
<I
>=I
>I
!=I
==I
<=F
<F
>=F
>F
!=F
==F

 %s 
 := (FLOAT)
 := (INT)
 :=F -
 :=I -
 :=I
 :=F
 == 0 ) THEN GOTO
 != 0 ) THEN GOTO
IF (
GOTO
 := NATIVEGETRETURN
NATIVECALL
NATIVEPARAM
 := GETRETURN
 :=
SETPARAM
 := GETPARAM
RETURN

CALL 
PARAM
NOP

Now we'll have to figure out which opcode relates to which operation.



#8 Salvadorc17

Salvadorc17

    title available

  • Members
  • 490 posts
  • Location:Colombia
  • Projects:https://github.com/salvadorc17/CommandosMaker

Posted 25 November 2016 - 07:51 PM

Now we'll have to figure out which opcode relates to which operation.


That info is not hardcode in exe?? Have tried to modify scripts values, but crashed before enter mission, seems compression thing..

 

For the characters values i have found:

 

v04 = Health

Default villian is 50

 

v10 = Weapon

Default villian is Colt Standard


Edited by Salvadorc17, 25 November 2016 - 09:40 PM.


#9 Sancho Perez

Sancho Perez
  • Members
  • 15 posts

Posted 26 November 2016 - 01:55 PM

Salvadorc17, on 25 Nov 2016 - 8:51 PM, said:snapback.png

 

herbert3000, on 25 Nov 2016 - 06:59 AM, said:snapback.png

v04 = Health

Default villian is 50

 

No, v01 = Health for sure, Demonio have 150HP and Dillon 140 for example, and all the main characters have 100HP.  ;)

I'm a big fan of Desperados, so by seeing the attributes I know exactly about which ennemy it correponds

I think v08 is the value used to find the speeches of each ennemy, because it's exactly in the same order of "Expressions" (go to Game/Data/Sounds/Expressions)

 

V21 is about how an ennemy reacts when hearing a gunshot : the value is set to "0" for ennemies who run directly where the sound came from and "100" for those who stand and hold their position.

I think the values between v16 and v20 are about the traps (Cooper's watch, Kate's seduction, Sanchez's Tequila...) but I'm not sure about the order.

About the weapons, I assume that v05 is a kind of "Area of damage" because it's bigger for the gattling and even bigger for Sanchez sawed'off shotgun.

Thanks for sharing this tools !


Edited by Sancho Perez, 26 November 2016 - 02:39 PM.


#10 Salvadorc17

Salvadorc17

    title available

  • Members
  • 490 posts
  • Location:Colombia
  • Projects:https://github.com/salvadorc17/CommandosMaker

Posted 29 November 2016 - 07:51 PM

No, v01 = Health for sure, Demonio have 150HP and Dillon 140 for example, and all the main characters have 100HP.  ;)

I'm a big fan of Desperados, so by seeing the attributes I know exactly about which ennemy it correponds

I think v08 is the value used to find the speeches of each ennemy, because it's exactly in the same order of "Expressions" (go to Game/Data/Sounds/Expressions)
 
V21 is about how an ennemy reacts when hearing a gunshot : the value is set to "0" for ennemies who run directly where the sound came from and "100" for those who stand and hold their position.

I think the values between v16 and v20 are about the traps (Cooper's watch, Kate's seduction, Sanchez's Tequila...) but I'm not sure about the order.

About the weapons, I assume that v05 is a kind of "Area of damage" because it's bigger for the gattling and even bigger for Sanchez sawed'off shotgun.

Thanks for sharing this tools !


Ok, maybe youre right, now what we need to find is where in files are located enemies positions, and definitions like in commandos, to allow better mission editing.



#11 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 03 December 2016 - 01:53 PM

At the Xentax forum, atom0s pointed me to Sebastian Wick's wiki which contains all the file formats from the game:

https://odvwiki.sebastianwick.net/



#12 Salvadorc17

Salvadorc17

    title available

  • Members
  • 490 posts
  • Location:Colombia
  • Projects:https://github.com/salvadorc17/CommandosMaker

Posted 03 December 2016 - 08:57 PM

At the Xentax forum, atom0s pointed me to Sebastian Wick's wiki which contains all the file formats from the game:

https://odvwiki.sebastianwick.net/

Well, thats a mine treasure but all the code listed seems to be parsed in machine or assembly format and not decompressed, so its really hard to me for understand it, for sure most interesting file is the DVD, where all misions data seems to be added, for example ELEMs , that contains the game objects, but thats much of for now what can understand, do you can help with that?


Edited by Salvadorc17, 03 December 2016 - 09:01 PM.


#13 Specop75

Specop75
  • Members
  • 10 posts
  • Location:Austria
  • Projects:Desperados & Helldorado

Posted 22 February 2017 - 11:57 PM

I have gathered some information about the ELEM part. Here is a little introduction and tutorial about adding new characters.

 
Take for instance Level_12.dvd (Escape from El Paso). I played around a bit there with the sheriff and also added another enemy.
After ELEM come 4 bytes for the section size. This size ends right before FXBK (The next section) but the 4 bytes for the section size and the section name itself do not count towards the whole size. In this case ELEM is C7 1D 00 00.
Then come 4 bytes (usually 1C 00 00 00) not sure what that is.
And finally 2 bytes for the number of elements. Here 0x7B = 123(dec) elements.
Next come the elements themselves. I guess it begins with animated stuff such as here the Flag, lady at door where Sam is...
I haven't researched these too much but its probably info about the position, if the anim is playing...
Now come the PC-s. (Doesn't have to be sorted like this) 
 
Cooper:
01 00 06 00 43 6F 6F 70 65 72 0B 00 4A 6F 68 6E 20 43 6F 6F 70 65 72 00 00 40 00 44 00 4C 00 4A 00 01 3B 00 41 00 51 00 4D 00 69 03 EA 01 02 00 79 00 17 00 00 0A 00 00 07 00
Length is 0x3A.
Offset - Info:
+0x00 (2 bytes) - ID of some sort, 
01 00: Cooper, 02 00: Doc, 03 00: Sam, 04 00: Kate, 05 00: Sanchez, 06 00: Mia, 01 01: Enemy, 02 01: Civilian, 10(Dog)/12(Han)/13(Pig) 02: Animal (Each with its own ID), 01 02: Horse...
ID-s seem to influence what data will be present after the name. If you change it, you must change the structure after it.
 
+0x02 (2 bytes) - Length of name, Cooper has 6 letters so size is 0x06. Each elements has two (sometimes different) names associated with it.
For instance after "Cooper" comes "John Cooper" but before it another 2 bytes with the length of the second name. In this case 0x0B.
 
Since each element has a different name length, I will start counting from the last letters of the second name, where the structure starts.
 
Lets compare a PC, Enemy and Civilian.
 
Cooper: (PC)
00 00 40 00 44 00 4C 00 4A 00 01 3B 00 41 00 51 00 4D 00 69 03 EA 01 02 00 79 00 17 00 00 0A 00 00 07 00
 
Sheriff: (Enemy)
00 00 40 00 44 00 4C 00 4A 00 01 3B 00 41 00 51 00 4D 00 02 03 8F 03 00 00 00 00 00 00 00 01 00 00 05 00 00 00 00 00 03 00 18 00 00 00
 
Cowboy Civilian: (Civilian)
00 00 40 00 44 00 4C 00 4A 00 01 3B 00 41 00 51 00 4D 00 D4 07 D9 03 00 00 00 00 00 00 00 07 00 00 0E 00 00 00 03 00 FF FF 00 00
 
The first 0x13 bytes are exactly the same on every mission so I haven't looked much into that.
At offset +0x13 we have 2 bytes for X starting position (larger values move right) and 2 bytes for Y (larger values move down). I guess that the next 7 bytes are the starting height.
If I change Cooper's values to 00, he will spawn on the ground next to the starting building (not sure how exactly that works tho). And finally the value at offset +0x1E (2 bytes I think) is the starting rotation (Here 0A 00 for Cooper and I think it goes clockwise).
This here is mostly about testing different values until you found a good starting position.
 
This is now where things start to change...
At +0x21 (2 byte) is Cooper's starting stance. 00 00 is for standing, 07 00 (like in this case) is prone, 10 00 mounts the char to the nearest horse (even if it doesn't have a saddle!), and there might be more...
 
We continue with the NPC-s at offset +21: Actual character. The name at the beginning is actually just the look. The "spirit" lies in this byte. Changing Sheriff's 05 to 15 will make him behave like a Desperado3.
He will start with 140 health, do massive damage, have a different voice... These values correspond to the ID-s in the Characters.dat file. For civilians this mostly changes the voice.
 
Here comes the difference between a Civ and an Enemy. Enemies have 5 00s between the next usefull byte where as civilians have 3. (not sure why but it has to be like this otherwise it crashes the game if you change their ID at the beginning)
 
The byte at +27 (2 bytes) for enemy and +25 for civ is their "neutrality".
For enemies: 01 = neutral, wont attack unless sees drawn weapon or something suspecious (like the lopez in the first mission), 02 = agressive but carefull means that he wont instantly recognize the player but will instead try to get closer to confirm and 03 = normal agressive will shoot on sight.
For the civilians: 00 = will ignore but stop for a second when seeing the player, 01 = will ignore the player, 03 = will run away or alert the guards
 
The next 2 bytes starting at 29/27 is the patrol route. FF FF means stand at spawn position. Here the sheriff has his route ID set to 18 00. Changing it to FF FF will make him stand at spawn point. (Multiple chars can patrol the same route)
And finally the last 2 bytes are like the PC-s last 2 bytes. The starting stance. 00 = standing, 01 = sitting, 06 = crouched, 10 = mounted (horse must have a saddle), 54 = sleeping...
 
I haven't done much testing with the animals so I am not sure about those...
 
Now I am gonna show you a process of adding a new enemy to the map. We will change the Sheriff to a Desperado3 and add a Desperado4 that will be sitting on the bench nerby.
 
Step 1: We look for the sheriff (using text search)
 
....Sheriff..Sheriff
01 01 07 00 53 68 65 72 69 66 66 07 00 53 68 65 72 69 66 66
 
Here we must change the name to: 
 
....Desperado4..Desperado 04
01 01 0A 00 44 65 73 70 65 72 61 64 6F 34 0C 00 44 65 73 70 65 72 61 64 6F 20 30 34
For that we must insert a few bytes and update the new lengths.
 
Step 2: We change his char ID from 05 to 15 (at offset +21 starting after the name)
 
00 00 40 00 44 00 4C 00 4A 00 01 3B 00 41 00 51 00 4D 00 02 03 8F 03 00 00 00 00 00 00 00 01 00 00 05 00 00 00 00 00 03 00 18 00 00 00
to
00 00 40 00 44 00 4C 00 4A 00 01 3B 00 41 00 51 00 4D 00 02 03 8F 03 00 00 00 00 00 00 00 01 00 00 15 00 00 00 00 00 01 00 18 00 00 00 
(I also made him neutral by changing the "neutrality" byte from 03 to 01)
 
Step 3: We now want to add a completely new character, so we copy Desperado3 (whole thing) 
01 01 0A 00 44 65 73 70 65 72 61 64 6F 33 0C 00 44 65 73 70 65 72 61 64 6F 20 30 33 00 00 40 00 44 00 4C 00 4A 00 01 3B 00 41 00 51 00 4D 00 02 03 8F 03 00 00 00 00 00 00 00 01 00 00 15 00 00 00 00 00 01 00 18 00 00 00
and paste it at the end of the ELEM section. It seems that pasting it somewere in the middle corrupts the scripts or something so you have to paste it just before the FXBK section.
 
Step 4: Change the new character's data
Here I changed him to a Desperado4 and made him sit by the bench. (Had to restart the mission a couple of times to get the right position)
01 01 0A 00 44 65 73 70 65 72 61 64 6F 34 0C 00 44 65 73 70 65 72 61 64 6F 20 30 34 00 00 40 00 44 00 4C 00 4A 00 01 3B 00 41 00 51 00 4D 00 E4 02 5A 03 00 00 00 00 00 00 00 05 00 00 16 00 00 00 00 00 01 00 FF FF 07 00
Note the "E4 02 5A 03" for the position and "05" for rotation. Also "16" for Des4 char and "FF FF 07 00" for sitting with no patrol route.
If you want to make an enemy to a civilian change the first byte to 02 and remove 2 bytes before the "neutrality" byte. You can also change the char "spirit" byte for a specific voice. (for instance if the game crashes you can try that)
 
Step 5: Update the section size and elemnts count.
Start selecting from the last byte (before FXBK) all the way to the "1C" at the beginning of ELEM and replace the old size (write the new length reversed)
Here C7 1D becomes 18 1E.
Now increase the element counter after 1C (from 7B to 7C)
 
And thats it!
 
Now when testing this do NOT skip the intro cinematic at the start of a mission or else some changes wont work. Also you don't have to restart the whole game for something like position testing, just go back to the main menu and load the level again.
But again, do NOT click at SKIP during the cutscene.
Also there are some sound problems that I can't figure out. Since this mission has no character that uses twin colts, there will be no shooting sounds for the Desperado3 but his voice will be there since Jackson for some reason uses his char ID (0x15).
Desperado4 on the other hand won't have a voice but will have a shooting sound effect since he uses a rifle like some other chars here. Gotta figure this one out. Also how to manipulate patrol routes or create your own.
 
I have done some testing with the scripts as well, managed to figure some interesting things out, but I will post about those another time.
I attached a more compact version of this info for easier reading.
 
Hope this helps in further research. :-)
 

 

15xan7o.jpg

Attached Files



#14 Sancho Perez

Sancho Perez
  • Members
  • 15 posts

Posted 23 February 2017 - 04:46 PM

Amazing ! A dream is becoming reality ! Adding new ennemies on Desperados map !

 

Wonderful job, Specop17  :thumbsuphappy:



#15 Sancho Perez

Sancho Perez
  • Members
  • 15 posts

Posted 26 February 2017 - 03:00 PM

 

Now when testing this do NOT skip the intro cinematic at the start of a mission or else some changes wont work. 
But again, do NOT click at SKIP during the cutscene.

Thanks for this advice, I didn't not understand why, using the Herbert3000 file to change the HP of an ennemy, the changements were not implemented. Now it's working ;)

 

A stupid question, which software should I use to edit the ".dvd" files ?



#16 Specop75

Specop75
  • Members
  • 10 posts
  • Location:Austria
  • Projects:Desperados & Helldorado

Posted 26 February 2017 - 04:17 PM

I use HxD ( https://mh-nexus.de/...php?product=HxD ), but any HEX editor will do. This one is free, fast and even allows real time memory editing.

 
Btw, I finally fixed the sound issues. Here is how:
 
FXBK: (Next section: MISC)
+04 - +07: Section Size  [4 byte]
 
First come all the fx_xxxx.wav-s, [2 bytes] for the number of elemtents, open Sound/desperados.fxg and find the ID of a sound effect (ID comes BEFORE the name of the file) [2 bytes] for element
Second, come all the SND_xxxx.wav-s, [2 bytes] for the number of elemtents, open Sound/desperados.sbk and same as above. [4 bytes] for element
And third, come all the expressions (voices)
Devided into 3 sections, each start with the number of elemtents [2 bytes]
1. Enemies (XET) 2. Civilians (XCT) 3. Heroes (XPT) [2 bytes] for element
Here, the ID is the actual file number. For instance XET23.dat -> ID = 0x17
 
 
Just after ELEM comes FXBK, so all you have to do here is insert the new sound effects. Here is the fix for our last case with the Desperado4 voice and twin colt sound:
 
1. We open desperados.fxg since this is where all the sound effect ID-s are. Now we open up each file until we find the twin colt effect (Weapon effects start at fx_1017).
   Once we found our file (fx_1088) we look for it in the .fxg file, since the ID comes before the name and its size (07 00) here we find that the ID is: 40 04
  
2. We check for his voice in Sounds\Expressions. Again, by listening to the various speeches, we find that the voice of Desperado4 has the ID of 24. (ID is the num after XET: DVI_XET24E00V00.wav)
 
3. We go to the FXBK section in the .dvd file and first insert the 40 04 ID between 3F 04 and 41 04, then increase the counter at the beginning from 3E to 3F.
 
4. We go down to the voices part, find that it contains 07 enemy voices, increase that to 08 and add (anywhere) 18 00 (ID 24 = 18(HEX)).
 
5. At the beginning of FXBK we increase the section size from 40 01 to 44 01.
 
Now the sounds should be fixed.
 
You can even try to add Sanchez to the mission and give him a voice. Best you look up the other missions for all the other sound effects asocciated with new PC-s.
For his equipment, add them through ELEM-s. There are 2 types: The starting equipment and the one found on the map. Play around with it, it's easy to figure out.
If you are having trouble with that here are the bytes you have to insert at the end of ELEM-s and don't forget to update the element count (+3) and section size (+77).
 
05 00 07 00 53 61 6E 63 68 65 7A 0D 00 50 61 62 6C 6F 20 53 61 6E 63 68 65 7A 00 00 40 00 44 00 4C 00 4A 00 01 3B 00 41 00 51 00 4D 00 20 03 F7 01 02 00 79 00 17 00 00 05 00 00 07 00 0D 11 0B 00 41 63 63 65 73 73 6F 72 69 65 73 05 00 53 54 4F 4E 45 00 01 FF FF 03 00 03 11 0B 00 41 63 63 65 73 73 6F 72 69 65 73 07 00 54 45 51 55 49 4C 41 00 01 FF FF 02 00
 
For his firing sound: ID = 0C 04 (fx_1036), and voice ID: 04 00 -> PC voices section will now look like this: 00 05 00 00 00 01 00 02 00 03 00 04 00 (Old: 00 04 00 00 00 01 00 02 00 03 00)
Have fun playing around with this stuff, I also found out how to easily find starting positions for the chars around the map using real time memory locations, but I still have troubles with the Z location (it's a bit wierd how that works).


#17 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 26 February 2017 - 09:57 PM

That's absolutely fantastic!  :thumbsupsmiley:

 

I'm thinking about converting the whole ELEM section into a human-readable format. So far I read the ELEM stuff into Java classes and then dump it as a .JSON file, which looks like this:

{
  "elements" : [ {
    "type" : "ANIMATION",
    "dvfName" : "Level12",
    "objectName" : "Level 12 - Drapeau 01",
    "x" : 690,
    "y" : 125,
    "u1" : 298,
    "u2" : 0,
    "u3" : 1,
    "u4" : 1
  }, {
    "type" : "ANIMATION",
    "dvfName" : "Level12",
    "objectName" : "Level 12 - Fontaine 1",
    "x" : 1533,
    "y" : 452,
    "u1" : 0,
    "u2" : 0,
    "u3" : 1,
    "u4" : 0
  }, {
    "type" : "ANIMATION",
    "dvfName" : "Level12",
    "objectName" : "Level 12 - Ombre 01",
    "x" : 610,
    "y" : 202,
    "u1" : 0,
    "u2" : 0,
    "u3" : 1,
    "u4" : 0
  }, {
    "type" : "ITEM",
    "dvfName" : "Level12_ Lady at door",
    "objectName" : "L12 Lady at door",
    "x" : 245,
    "y" : 374,
    "u1" : 0,
    "u2" : 1,
    "u3" : 1,
    "u4" : 1,
    "x2" : 0,
    "y2" : 0,
    "u5" : 0,
    "u6" : 0,
    "u7" : 0,
    "u8" : 1,
    "className" : "Copine_de_Sam47a6250"
  }, {
    "type" : "PLAYER",
    "id" : "COOPER",
    "dvfName" : "Cooper",
    "objectName" : "John Cooper",
    "p00" : 0,
    "p01" : 64,
    "p02" : 68,
    "p03" : 76,
    "p04" : 74,
    "p10" : 1,
    "p11" : 59,
    "p12" : 65,
    "p13" : 81,
    "p14" : 77,
    "x" : 873,
    "y" : 490,
    "u1" : 2,
    "u2" : 121,
    "u3" : 23,
    "u4" : 0,
    "direction" : 10,
    "className" : "",
    "stance" : "PRONE"
  }, {
    "type" : "PLAYER",
    "id" : "SAM",
    "dvfName" : "Sam",
    "objectName" : "Sam",
    "p00" : 0,
    "p01" : 64,
    "p02" : 68,
    "p03" : 76,
    "p04" : 74,
    "p10" : 1,
    "p11" : 59,
    "p12" : 65,
    "p13" : 81,
    "p14" : 77,
    "x" : 214,
    "y" : 379,
    "u1" : 1,
    "u2" : 93,
    "u3" : 57,
    "u4" : 0,
    "direction" : 3,
    "className" : "",
    "stance" : "STANDING"
  },
... etc.

Here's the full file:

Attached File  Level_12.dvd.ELEM.zip   3.16KB   43 downloads

This format is probably easier to edit than the binary dvd file using a hex editor. What do you think? :)

The next task will be reading the JSON file and writing everything back to the dvd file.

 

By the way, could anyone please tell me what stance 0x02 and stance 0x21 are? For some reason the game won't start on my PC, so I can't check it myself.



#18 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 28 February 2017 - 07:51 AM

Alright, here's a tool (still in beta phase) to convert the ELEM section of a .dvd file to a text file - and also back to dvd.

--removed--

the latest version is on the next page of this thread


Edited by herbert3000, 28 February 2017 - 09:56 PM.
removed attachment


#19 Specop75

Specop75
  • Members
  • 10 posts
  • Location:Austria
  • Projects:Desperados & Helldorado

Posted 28 February 2017 - 02:36 PM

Excelent work Herbert!  :thumbsupxd:

This will surely make the job much easier.
 
Now we just need more documentation. (like writing somewere what options there are for stances and neutrality...)
 
I have a little to-do list:
1. Find a way to easily find positions (game memory seems to store a similar value, at lvl 12 just add 46 for X and 47 for Y). Of course Z is still a problem...
 
2. It would be nice if the tool automatically fixed the sound issues. (We would have to find all related sound files for every element)
 
3. Create new patrol routes, find out how to spawn characters into buildings and how to lock/make picklockable doors.
 
4. Find more info about the ELEM section. (Animals, horses, accessories...)
 
5. Research scripting (Made a little progress here).
 
6. Research the game memory. I have made some progress here and I am working on a nice cheat table for CE.
 
7. If somehow possible make AI gunfights (like level 21 but with AI actually trying to kill each other, probably with disassembly)

 

By the way, could anyone please tell me what stance 0x02 and stance 0x21 are? For some reason the game won't start on my PC, so I can't check it myself.

 
As for the stances, 0x02 does nothing for PC-s and enemies and 0x21 crashes for PC-s while enemies appear dead.
Btw, are you using DXWnd to start the game? It works perfectly on Windows 10. After all, you don't want to miss the fun, right?
Thanks again for the tool!  :wink_new:
 
As a little bonus here is my old cheat table with a few sweet features. (Check the Table Extras or Comments for info)

Attached Files



#20 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 480 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 28 February 2017 - 03:59 PM

Ok, this is how I mapped the values to strings.
I'm still not happy with the neutrality for example, first I thought it was a good idea to use color names but now I think it's stupid :)
Please tell me if, if you have any suggestions about any of those names.
TYPE:
 0    PLAYER
 1    NPC
 2    ANIMAL
 8    ITEM
16    ANIMATION
17    ACCESSORY

PLAYER:
 1    COOPER
 2    DOC
 3    SAM
 4    KATE
 5    SANCHEZ
 6    MIA
 7    LEONE

ANIMAL:
 1    HORSE
16    DOG
17    COW
18    HEN
19    PIG
20    CROW
21    CROCODILE

NPC:
 1    ENEMY
 2    CIVILIAN

NEUTRALITY:
 0    SUSPICIOUS
 1    NEUTRAL
 2    INSECURE
 3    AGGRESSIVE

STANCE:
 0    STANDING
 1    SITTING
 2    CHATTING
 6    CROUCHING
 7    PRONE
16    MOUNTED
33    DEAD
84    SLEEPING

ACCESSORY:
 1    DYNAMITE
 2    SCARECROW
 3    TEQUILA
 4    SNAKE
 5    WATCH
 6    CARD
 7    KNIFE
 8    TNT
 9    FLASKS
10    PEANUTS
11    SADDLE
12    GATTLING
13    STONE
14    FLASH
16    ITEM_DYNAMITE
17    ITEM_GAS
18    ITEM_LUMINA
19    ITEM_MEDIKIT
20    ITEM_NUTS
21    ITEM_SNIPES
22    ITEM_TEQUILA
23    ITEM_BARREL

CHARACTER:
 0    DEFAULT_VILLAIN
 1    DEFAULT_CHILD
 2    LOPEZ
 3    COWBOY1
 4    COWBOY2
 5    SHERIF
 6    COWBOY3
 7    PEDRO1
 8    GARCIA1
 9    PEDRO2
10    PEDRO3
11    PEDRO4
12    SOLDAT1
13    SOLDAT2
14    GARDE1
15    GARCIA2
16    GARDE2
17    DESPERADO1
18    COWBOY4
19    LINO
20    DESPERADO2
21    DESPERADO3
22    DESPERADO4
23    DEMONIO
24    COURAGE_5
25    IQ_100
26    IQ_10
27    JUST_A_TEST
28    CARLOS
29    LOPEZ2
30    CARLOS2
32    GROSDEBILE
33    SCHWARZENEGGER
34    SANCHEZ_NPC
35    BIGBILL_PEUREUX
36    TUNIQUE_BLEUE
37    TUNIQUE_BLEUE_OF
38    EL_DIABLO
39    COWBOY3_SNIPER
40    DILLON
About the two stances:
stance 0x21 is used in Level_16 and Level_21 (only by enemies)
stance 0x02 is used in Level_04 by three civilians
 
Also what's the deal with the sound issue, is this a game bug?
 
Btw, I now downloaded and installed the game from gog.com :)
 
Thanks for the cheat table, I'll check it out...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users