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.
User avatar
Ikaros
Sergeant
Posts: 79
Joined: Wed Mar 23, 2011 11:30 am
Location: Italy
Contact:

Re: 4ds files hacked

Unread post by Ikaros » Fri Mar 25, 2011 5:07 pm

Ah, sorry! I didn't notice that line. It's the first time I read/use maxscript.
I'm back to work, then..

Er.. do you know what exactly "attachObject" does?
Inversion of axis (X for Y and viceversa) reminds me of ROTATIONS..
http://malgolan.altervista.org/
Italian politicians - Not in my name!

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) » Fri Mar 25, 2011 7:27 pm

@HDmaster

Ok, I start the work. One question: After I open a map in 3dsmax, how can I display the texture name of the selected mesh? It would be much faster.

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

Re: 4ds files hacked

Unread post by hdmaster » Sat Mar 26, 2011 3:21 pm

@Ikaros:
This is the description of the function in the MAXScript help:

attachObjects [ move: ]


Makes a child of . Resets the current location of to the location of unless move:false is specified.

and with
move msh [std.pos.x,std.pos.z, std.pos.y]
i`m changing the relative position. Here the description

move name_obj []

where name_obj is the name of the object you want to move and is the amount you want it to move.

It is important to note that you are not moving the object to , but by the amounts .

@Marvin:
By setting SET_TEXTURE_PRINT to True in the first few lines of the hd2_4ds.ms file all texture names of the current imported model will be printed to the MAXScript listener window


//EDIT:
New version of the tool, coming next week,  will support
  • check2.bin import
  • import for models into the scene that are stored in scene2.bin/actors.bin
  • GMAX
Last edited by hdmaster on Sat Mar 26, 2011 9:35 pm, 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) » Sun Mar 27, 2011 8:21 am

Nice!  :lol:

I separated successfully the textures. There are 6-7 category by terrain + try to make 3-4 subcategory (walls, ceilings, grounds, doors...etc.) The work was faster than I thought it before, because I could easily export the filenames to excel with your help hdmaster.

I wonder about the common files (like wires, doors, glass...etc.) yet, but I will find the best solution about their separating.

I checked every version of the maps, like SP, DM, OBJ & OCC to "export" all of their textures... There was only 4 maps, what I couldn't open (but fortunatelly I could import the other version of these maps)
- Africa1 SP
- Normandy3 OCC
- Czech1 SP
- Czech6 OCC

There are some mesh on every map which didn't imported correctly yet, I hope you can fix them later.

Edit:
- I mixed the textures of Tutorial & London maps into a same folder + mixed the Arctic and Ardennes
- I found a lot of unused textures, but I'll try to find their place in the new folders.
Last edited by Marvin (hun) on Mon Mar 28, 2011 6:33 am, edited 1 time in total.

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

Re: 4ds files hacked

Unread post by Ikaros » Tue Mar 29, 2011 7:26 am

hdmaster wrote: Makes a child of . Resets the current location of to the location of unless move:false is specified.
Yeah, I found that quote, and I asked my question after reading it. Here only location is named, not rotation. So I was wondering if attachObject only move node2 in a position relative to node1. What about rotation of node1? It is applied (added) to node2 too?
I'll try to find out if misplaced objects are subsequent in chain to rotated object.

Another thing. Maybe you already know, but also map.4ds from Normandy2 has misplaced meshes. The blue/black poligons are rotated 90? wrong. And, maybe, undertanding map.4ds is easier than scene.4ds, because of the small amouny of bytes. Sadly, I have not too much time...
http://malgolan.altervista.org/
Italian politicians - Not in my name!

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) » Tue Mar 29, 2011 11:16 am

Ok, so I almost finished the complete texture-departing works of the Snow-maps (Arctic+Ardennes).

For the easier using I made the following subdirectories: "Nature", "Walls", "Grounds", "Waters", "Doors".
+ I make a folder named "Unsorted" what includes all other textures what I couldn't identify (these textures are smaller, for ex.: 64*128 pixels)
+ make a "Models" folder (with subfolders) what includes the texture of the models, so you will not need to try to identify them, during the mapping works (spitfire, ship...etc.)

If anyone has better idea, simply write it!
Last edited by Marvin (hun) on Tue Mar 29, 2011 1:33 pm, edited 1 time in total.

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

Re: 4ds files hacked

Unread post by hdmaster » Tue Mar 29, 2011 5:49 pm

@Ikaros:
I?ve just tested the functionality of attachObjects and besides moving node2 it also applies the rotation of node1 to node2.

Mhhh. Rotations are really confusing me at the moment because quaternions look quite complex to me ;). I've tested so many possibilities of applying rotations/moving nodes etc,
but as you see, I haven't figured out everything to get the script working properly.

Maybe you could help me? If i remember correctly, you've implemented the feature to edit the occupation zones into your editor and it looks like everything is placed correctly

I also wrote an email to an expert on 3d model hacking, i hope he'll response and provide some help.

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

Re: 4ds files hacked

Unread post by Ikaros » Wed Mar 30, 2011 8:30 am

@HDMaster:
You and I took different paths. You (I think) are more into a general purpose undestanding of the files. I tried to be more pragmatic and lead all effort in undestanding how to get things working, especially for occupation maps.

In my case, I started from Normandy2/map.4ds and I adapt that file for others maps. Here's what I do to place occupation zones...

I reconstruct position of mesh, vertices (11 floats), segments, faces and texture index as you do, for meshes named axisX and alliedX. To let you understanding how I work, I search the file specifically for the strings "allied" and "axis", I don't care of the whole structure, because those are the only I need to modify.

I also search for "zone" labels and reconstruct only position of these meshes.

In editor, "corners" coordinates for occupation zones will be (for example):
1st float value of vertix + X pos of "allied1" + X pos of "zone1"
3rd float value of vertix + Z pos of "allied1" + Y pos of "zone1"
(clearly, they're grouped 3 by 3, as indexes in faces state)

So I took Z instead of Y for both vertices and position of "allied" meshes, and it works. I did not investigate more, as it is sufficient for my purpose: having a working map in-game.
http://malgolan.altervista.org/
Italian politicians - Not in my name!

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

Re: 4ds files hacked

Unread post by Ikaros » Wed Mar 30, 2011 8:39 am

Here's some code snippets, beside I don't think they're much of use:

Drawing of triangles:

Code: Select all

            if(mf.map4ds.useY){
                highCoord = 1;
                alaxYZoffset = ps.alaxYoffset;
            }else{
                highCoord = 2;
                alaxYZoffset = ps.alaxZoffset;
            }
            
            for(int a=0; a<ps.numAreas; a++){
                for(int f=0; f<ps.numFaces[a]; f++){

                    xPoints[0] = ta.bg.cX2pix( ps.vertex[ps.faces[a][f][0]] [0] + ps.zoneXcoord + ps.alaxXoffset );
                    xPoints[1] = ta.bg.cX2pix( ps.vertex[ps.faces[a][f][1]] [0] + ps.zoneXcoord + ps.alaxXoffset );
                    xPoints[2] = ta.bg.cX2pix( ps.vertex[ps.faces[a][f][2]] [0] + ps.zoneXcoord + ps.alaxXoffset );

                    yPoints[0] = ta.bg.cY2pix( ps.vertex[ps.faces[a][f][0]] [highCoord] + ps.zoneYcoord + alaxYZoffset );
                    yPoints[1] = ta.bg.cY2pix( ps.vertex[ps.faces[a][f][1]] [highCoord] + ps.zoneYcoord + alaxYZoffset );
                    yPoints[2] = ta.bg.cY2pix( ps.vertex[ps.faces[a][f][2]] [highCoord] + ps.zoneYcoord + alaxYZoffset );

                    // il NOT ? messo poich? l'asse Y per i pixels ? rovesciato! ????????????
                    boolean clockwise = U3D.isClockwise(xPoints, yPoints, 3);

                    if(clockwise){
                        g2.setColor(CLRS.poly(lab, trasparency));
                        g2.fillPolygon(xPoints, yPoints, 3);
                    }else{
                        g2.setColor(Color.BLACK);
                        g2.fillPolygon(xPoints, yPoints, 3);
                    }
                    g2.setColor(CLRS.poly(lab, 255));
                    g2.drawPolygon(xPoints, yPoints, 3);
                }
            }
If you want more, just tell me. It's all spread in various parts, because of objects and functions..
http://malgolan.altervista.org/
Italian politicians - Not in my name!

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

Re: 4ds files hacked

Unread post by hdmaster » Wed Mar 30, 2011 4:24 pm

Thanks for your help. This looks a lot better now:

Image

Uploaded with ImageShack.us

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 Mar 31, 2011 6:20 pm

@hdmaster: I finished the texture-depart works of Arctic and Africa maps. Before I continue with the other maps, it would be great to test them on a simply map if the exporter is working.

another question: what can you do with the tree.klz files? (as I know this file includes the collision map. To be honest I don't know exactly what does it mean in the HD2, but don't tell it anyone ;))

User avatar
2k
Sergeant
Posts: 57
Joined: Wed Jul 04, 2007 6:32 pm

Re: 4ds files hacked

Unread post by 2k » Thu Mar 31, 2011 8:10 pm

I guess the collision map in hd2 means the same, like in any other game. Simple geometry which block the player. smile01

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

Re: 4ds files hacked

Unread post by Ikaros » Thu Mar 31, 2011 9:28 pm

I made some experiments:
Africa3 MP with only tree.klz from Czech 2: you fall into the void, everytime.
Africa3 MP with only scene.4ds from Czech 2: you fall into the void, everytime, and all around there is the Villa and not the Mosque.
Africa3 MP with only tree.klz from Africa 3 Obj: you fall into the void, everytime.
Africa3 MP with only scene.4ds from Africa 3 Obj: diffent things:
- often, you fall into the void
- some textures are missing
- there are deformed meshes
- some areas are fully playable

I also tried to move location (eg. -100 in height) of some mesh inside scene.4ds of a vanilla Mission:
- the map is fully playable
- the moved objects disappear (they are below ground)
- you can pass through, where those objects once where
- there are some light glicth

It's like tree.klz influences scene.4ds, in some manner. But collisions could be handled by scene.4ds too...
Last edited by Ikaros on Thu Mar 31, 2011 10:16 pm, edited 1 time in total.
http://malgolan.altervista.org/
Italian politicians - Not in my name!

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

Re: 4ds files hacked

Unread post by Ikaros » Thu Mar 31, 2011 10:14 pm

More experiments
I moved an external wall of the Train Station along X, as you can see in this picture:
[img width=800 height=600]http://malgolan.altervista.org/forumIma ... _moved.jpg[/img]

Now I can pass through the moved wall AND I can pass through where the wall was.
It seems to me that, if there is no correspondence between tree.klz and scene.4ds, objects are not solid.

Moreover, observing the inside of room from outside (before moving the wall was impossible)
leads to many light glitches.

Then, I restored the original file and then I moved only a single vertex.
One of the lower corners, creating a gap:
[img width=800 height=600]http://malgolan.altervista.org/forumIma ... _moved.jpg[/img]

Again, I can pass through that triangle gap, from outside into inside.
Near the gap, on the left, where the deformed polygon is in the same place of the original, it is solid.

In both cases, from inside, everything is ok, the internal wall is in his place, and I cannot neither pass (exit) nor see through the wall.
http://malgolan.altervista.org/
Italian politicians - Not in my name!

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) » Fri Apr 01, 2011 8:02 am

Nice work Ikaros! I only know that when I delete the scene.4ds file and leave the tree.klz, my player falling into the "nothing" with the other NPCs, so the collision map doesn't "work" without the 4ds file. I did it with the Ardennes map.

I only used the Hammer editor of HL2 and there was no need to make collision-map, except with the entity models. This is why I wrote before that I don't understand exactly what does it mean collision file of the full map. Before HL2 I made many maps for Wolf3d in ~1993, but that was in another world :)
Last edited by Marvin (hun) on Fri Apr 01, 2011 8:19 am, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests