4ds files hacked

This is for general discussion about Hidden & Dangerous 2, talk about what you liked or what you didn't like about the sequel. Talk about multiplayer games, setup matches etc.
hdmaster
Sergeant
Posts: 84
Joined: Thu Jan 27, 2011 9:31 pm
Location: Germany

Re: 4ds files hacked

Unread post by hdmaster » Thu Aug 11, 2011 12:19 am

Thanks for the advice!
Is an exact vertex position of a mesh somehow important for the LMs? Because the exported positions do not coincide completely. A vertex imported to X = 0.000041 may show up in a 3ds Max exported file as 0.000042.
Last edited by hdmaster on Thu Aug 11, 2011 11:28 am, edited 1 time in total.

User avatar
Marvin (hun)
Sergeant
Posts: 59
Joined: Sat Mar 19, 2011 3:01 pm
Location: Hungary

Re: 4ds files hacked

Unread post by Marvin (hun) » Thu Aug 11, 2011 11:13 am

The other interesting thing is that the original game has many-many lightmap bugs. I play the full campaign now on skill3, so I need to stay in hidden. During the game I can easy "find" points on the map with extreme visible value. For example: I creep in the shadow with ~18m visible value and in the next step I'm suddenly visible from 227m or 452m (and I stayed in the shadows of course) I found this kind of bug almost on every map.

User avatar
Ikaros
Sergeant
Posts: 82
Joined: Wed Mar 23, 2011 11:30 am
Location: Italy
Contact:

Re: 4ds files hacked

Unread post by Ikaros » Thu Aug 11, 2011 4:01 pm

If the tree.klz comprehension proves out right (and clues are at our side  :grin:),
what do we miss to make maps from scratch?

Maybe, just the lightmaps and light sectors?
http://malgolan.altervista.org/
Italian politicians - Not in my name!

lexov
Private
Posts: 6
Joined: Sun Aug 07, 2011 11:21 pm

Re: 4ds files hacked

Unread post by lexov » Thu Aug 11, 2011 5:28 pm

hdmaster wrote: Thanks for the advice!
Is an exact vertex position of a mesh somehow important for the LMs? Because the exported positions do not coincide completely. A vertex imported to X = 0.000041 may show up in a 3ds Max exported file as 0.000042.
Hm no, that should be no issue, at least for Mafia. Things that need to match (at least IIRC) are
  • the # of lod levels of each lightmap level compared to the number of lod levels of the mesh (<- not sure on that one)
  • the # of face groups of each lightmap lod level compared to the # of face groups of the corresponding mesh lod level
  • the # of indices of each lightmap lod level compared to the # of indices of the corresponding mesh lod level
  • the order of the face groups in each lightmap lod level compared to the order of the face groups of the corresponding mesh lod level
Maybe H&D 2's lightmaps are a little bit more advanced and require additional data to match. The best approach is probably to compare the orignal mesh with the exported one to see what's different.

User avatar
MCh2207Cz
Private
Posts: 11
Joined: Wed Jun 01, 2011 5:01 pm

Re: 4ds files hacked

Unread post by MCh2207Cz » Sat Aug 13, 2011 12:57 am

hdmaster wrote: Screenshot of Africa1_mp exported from 3ds Max. I don't know why that turquoise color appears..
I remember seeing this error on several surfaces (mostly outside rubble) at coop map Poland (Enemy HQ) by Zdenda.
When I tryed to see the default DM Poland map, the error was not there.

User avatar
-ViTaMiHnM203-
SAS Soldier
Posts: 1347
Joined: Wed May 11, 2005 7:52 am
Location: Classified
Contact:

Re: 4ds files hacked

Unread post by -ViTaMiHnM203- » Sat Aug 13, 2011 11:37 am

It was before SS, that map was made using the original maps files, named London. The SS patch/expansion updated the map, and named it Poland.
Eight, 8, the burning eight; between Sunday and Monday exists a day so great, it will devastate. :twisted:

User avatar
Marvin (hun)
Sergeant
Posts: 59
Joined: Sat Mar 19, 2011 3:01 pm
Location: Hungary

Re: 4ds files hacked

Unread post by Marvin (hun) » Sat Aug 13, 2011 3:15 pm

Maybe the HDD-editor can help to make the lightmaps

User avatar
MCh2207Cz
Private
Posts: 11
Joined: Wed Jun 01, 2011 5:01 pm

Re: 4ds files hacked

Unread post by MCh2207Cz » Sat Aug 13, 2011 5:55 pm

To -ViTaMiHnM203-
So you mean that Zdenda made his coop Poland map from the early "London" version (not from the corrected "Poland" version)?

It could be true because the coop Poland map (asside from that lighting problem) had a lot of nonfunctional ladders.
On the contrary, the Poland DM map has functional ladders.

User avatar
-ViTaMiHnM203-
SAS Soldier
Posts: 1347
Joined: Wed May 11, 2005 7:52 am
Location: Classified
Contact:

Re: 4ds files hacked

Unread post by -ViTaMiHnM203- » Sun Aug 14, 2011 3:00 am

Yes, as far as I know.
Eight, 8, the burning eight; between Sunday and Monday exists a day so great, it will devastate. :twisted:

User avatar
Ikaros
Sergeant
Posts: 82
Joined: Wed Mar 23, 2011 11:30 am
Location: Italy
Contact:

Re: 4ds files hacked

Unread post by Ikaros » Tue Aug 23, 2011 10:15 am

Am I wrong, or the standard for rotation is different between .BIN and .4DS?

It seems to me that for .4DS, null rotation is 0 0 0 1, while for .BIN null rotation is 1 0 0 0.

HDMaster (in his script) import the 4 floats from .4ds to 3dsmax in the same order as they are written in the file. And I think that, for 3dsmax standard, null rotation is 0 0 0 1:
http://www.cuneytozdas.com/tutorials/maxscript/

Otherwise, many many objects found in scene2.bin have the 4 floats equal (or very close) to 1 0 0 0,
which let me suppose .bin have a different standard.

Does anybody found out how exactly this works?
I'd like to have info on how to convert quaternion to eulerian angles and back.

Until now, I've used this code to convert angles from .BIN files (and seems to me it's working):

Code: Select all

        double sqw = qReal*qReal;
        double sqx = qIf*qIf;
        double sqy = qJf*qJf;
        double sqz = qKf*qKf;
        double unit = sqx + sqy + sqz + sqw; // if normalised is one, otherwise is correction factor
        double test = qIf*qJf + qKf*qReal;
        if (test > 0.499*unit) { // singularity at north pole
            rZf = 2.0f * (float)Math.atan2(qIf,qReal);
            rYf = (float)Math.PI/2;
            rXf = 0.0f;
        }else if (test < -0.499*unit) { // singularity at south pole
            rZf = -2.0f * (float)Math.atan2(qIf,qReal);
            rYf = (float)-Math.PI/2;
            rXf = 0.0f;
        } else {
            rZf = (float)Math.atan2(2*qJf*qReal-2*qIf*qKf , sqx - sqy - sqz + sqw);
            rYf = (float)Math.asin(2*test/unit);
            rXf = (float)Math.atan2(2*qIf*qReal-2*qJf*qKf , -sqx + sqy - sqz + sqw);
        }
Where qReal, qIf, qJf, qKf are the 4 floats, found in this very order inside the .bin file, while rYf is rotation along the VERTICAL axis (as used by DC|ED, and not by 3dsmax, which uses Z as vertical axis)

How can I use the same code to convert angles from .4DS, then?

Real, I, J, K from .bin translate to I, J, K, Real from .4ds? Or maybe to K, J, I, Real?

Edit:
I think the correspondence is:
- .BIN > Real (or W), I, J, K
- .4DS > I, J, K, Real
Last edited by Ikaros on Tue Aug 23, 2011 2:05 pm, edited 1 time in total.
http://malgolan.altervista.org/
Italian politicians - Not in my name!

lexov
Private
Posts: 6
Joined: Sun Aug 07, 2011 11:21 pm

Re: 4ds files hacked

Unread post by lexov » Tue Aug 23, 2011 2:12 pm

From my experience there's no standard on the order of the components of a quaternion. Some write it according to alphabet (w,x,y,z), others prefer (x,y,z,w). Interestingly IS used the same order for both file types in Mafia IIRC...

hdmaster
Sergeant
Posts: 84
Joined: Thu Jan 27, 2011 9:31 pm
Location: Germany

Re: 4ds files hacked

Unread post by hdmaster » Sat Sep 03, 2011 4:37 pm

@lexov:
Thanks, it was the number of face groups and the face order that caused the problem.

So here's the new version. Click Me. Don't forget to read the readme file

New in 2.1:
  • import files with morph data ( morph data will be skipped ) e.g. soldiers
  • CREATE sectors, occluder and LODs (Level of detail)
  • EXPORT sectors, occluder and LODs
  • texture import has been improved: twosided materials, reflection maps, color keys...
Currently only available for 3ds Max and tested only with 2011 x64. But I've also have a 'working' version for GMAX ( still a few bugs ). PM me for the GMAX version.

If you have any trouble running the tools or any error messages occure, please let me know.
Last edited by hdmaster on Sat Sep 03, 2011 5:28 pm, edited 1 time in total.

User avatar
JonnySniper
Lieutenant
Posts: 101
Joined: Thu Dec 24, 2009 11:33 am
Location: Germany
Contact:

Re: 4ds files hacked

Unread post by JonnySniper » Sat Sep 03, 2011 6:28 pm

Hi,installation for 3D Max 2010 dont work for me...
ive changed many things like compatipility and i dont see the HD2 button in 3D Max.
-Win 7 64bit
www.object-arts.de.tl
Idee := Brain.Activate(self);

hdmaster
Sergeant
Posts: 84
Joined: Thu Jan 27, 2011 9:31 pm
Location: Germany

Re: 4ds files hacked

Unread post by hdmaster » Sat Sep 03, 2011 6:50 pm

Do you have a folder called 'H&D 2' in '3ds Max\Scripts\' and does the folder '3ds Max\Scripts\Startup' contain 3 .ms files starting with 'HD2_' ?

User avatar
JonnySniper
Lieutenant
Posts: 101
Joined: Thu Dec 24, 2009 11:33 am
Location: Germany
Contact:

Re: 4ds files hacked

Unread post by JonnySniper » Sat Sep 03, 2011 8:50 pm

'3ds Max\Scripts\Startup' contain 3 .ms files starting with=>no

ive only "3ds Max Design 2010\4ds Tools\Scripts\Startup"
and there "HD2_init.ms","HD2_plugins.ms" and "HD2_toolbar.ms" files.
Last edited by JonnySniper on Sat Sep 03, 2011 8:52 pm, edited 1 time in total.
www.object-arts.de.tl
Idee := Brain.Activate(self);

Post Reply

Who is online

Users browsing this forum: No registered users and 67 guests