File format Documentation

This is the place to talk about everything and anything.
Timeout
Private
Posts: 7
Joined: Fri May 23, 2014 3:03 am

File format Documentation

Unread post by Timeout » Tue Feb 28, 2017 10:26 pm

Dear Hidden and Dangerous .net members,

I would like to beg you to consider putting together a documentation on the file formats used by H&D1 and H&D2.
(Articles would be great, if I am not asking too much)
I am aware that there is the H&D1 editor, dta unpacker and 4ds plugin tools. I thank for the nice work, but I could not find how they were made.


Related links:
Mafia DTA format (note: doesn't work for every dta)
H&D 2 Unpacker Links
4ds files hacked

Thanks in advance. My apologies in case of incorrect posting.

User avatar
Jason
Administrator
Posts: 1841
Joined: Thu Sep 02, 2004 7:26 pm
Location: Perth, Australia
Contact:

Re: File format Documentation

Unread post by Jason » Wed Mar 01, 2017 4:50 pm

What exactly were you after in the documentation?

There's more information available on the HD2 wiki

Timeout
Private
Posts: 7
Joined: Fri May 23, 2014 3:03 am

Re: File format Documentation

Unread post by Timeout » Fri Mar 03, 2017 7:01 am

Hello Jason, thank you very much for your kind answer!
Jason wrote:
Wed Mar 01, 2017 4:50 pm
There's more information available on the HD2 wiki
My apologies as I didn't know that. Still I find it lacking some details...
Examples include:
  1. DTA compression? The Mafia article cites that but recommends using DLLs. If we could not reuse the DLLs, for instance, that would not be enough.
  2. DTA versions? There are version listings but they are unclear;
  3. Perhaps the article should include where the encryption keys are stored inside the executable.
  4. More detailed scripting grammar if we wished for a script checker or remake that uses the script files.
  5. Several file formats have lots of unknown fields which make it harder to create new files from scratch. (Yes I know it's hard to decode, do not take this as criticism)
Jason wrote:
Wed Mar 01, 2017 4:50 pm
What exactly were you after in the documentation?
I was just curious about the possibility of improving the tools and so on.
If things were really detailed, there could be lots of improvement, for instance:
  1. Improve decoders and encoders;
  2. Create a editor for H&D2;
  3. Create some tool set to convert H&D1 scenes into H&D2;
  4. Import files into other tools/engines without conversion;
I am not saying I could do these by myself, I was just curious about the possibility, as in "do we have enough information if we were going to do it?".

I could not find a few details, but I guess I might be able to find them later and try to help it myself. (If I have the time)

Thank you.

Stern
Sergeant
Posts: 55
Joined: Sun Nov 09, 2014 11:44 am

Re: File format Documentation

Unread post by Stern » Fri Mar 03, 2017 4:40 pm

Any info that's available is basically discovered by modders, not published by the developers.
That is why its not complete.
I have done some programs for HD2 and had many more ideas that wasn't finished because lack of knowledge about file structure and also some confusion about mission script, I can script them perfect but no script referents or tutorial from developers.

When I made missions I made experiments with scripts to discover ways to code it to function faster.

Example:
//-------------------------
integer rnd1 // declaration of variable rnd1 as integer to hold integer value
rnd1= (_randomint(5)+1) // getting random value for rnd1
if (rnd1>2) // if statement to check if rnd value exceeds 2
...
//-------------------------

This can be written:

//-------------------------
if ((_randomint(5)+1)>2) //all this done in one line
...
//-------------------------
No need for the variable and no need to declare variable as a integer anyway because randomint already gives "integer" value.

Timeout
Private
Posts: 7
Joined: Fri May 23, 2014 3:03 am

Re: File format Documentation

Unread post by Timeout » Sat Mar 04, 2017 6:34 am

Stern wrote:
Fri Mar 03, 2017 4:40 pm
Any info that's available is basically discovered by modders, not published by the developers.
I have noticed that, thank you very much for your efforts on modding.

I often work on converters, interpreters and compilers.
I would like to try improving the knowledge base once I have time. Unfortunately I have other priorities right now that I cannot dismiss.


Regarding H&D2 scripting, I must admit that I find the dependency on integer identifiers scattered across several files a bit cumbersome.
The major problem is not the integers, however, if I were the designer of H&D2, I would certainly group the identifiers, group the files into folders to separate what is common, campaign specific and so on, so it would be easier to add more campaigns, missions and find their assets instead of using large dta files.

Sometimes it feels like they intentionally wanted to make it harder for modders.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests