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 » Wed Sep 21, 2011 12:44 pm

@Marvin: I forgot to mention that the values are stored in little endian so you have to read them backwards. So "00 01 0F B7" ( I padded it with zeros, because the value is an int which has always 4 bytes ) becomes "B7 0F 01 00". Yes, "32" for the 50 and "96" for 150 is correct.

Maybe Ilussion Softworks messed that up :lol:

@betteryouthanme:
Is the stair just invisible or completely missing?

Occluders are meshes which prevent the engine from rendering objects which are occluded by other meshes, have a look at http://www.lerk.de/2009/03/occlusion-culling/ for an example.

Well the option lets you choose whether the sector meshes are shown in the viewport. You can think of a sector as a room that has windows and doors ( or other "holes" like a hangar ). The sector prevents the engine to render all meshes that cannont by seen from inside a sector except through windows/doors.

This is the sector HL_m1_01 from Africa1 with the actual sector mesh ("sector HL_m1_01") hidden and all child nodes visible:
Image

And this is the sector mesh. Grey/black are areas defined as windows/doors, so that are the areas you can see trough
Image

Sector mesh and sector child nodes visible. The "holes" perfectly overlap with the windows and the door
Image

Uploaded with ImageShack.us


------------------------------------------

I've added a custom material to 3ds Max with all properties that can be set for H&D 2 materials so far. The new material supports also color keying which means that areas of a specific color appear transparent.

Image

And here's an example of color keying. The color field below the checkbox "Colorkey" displays the color thats being keyed out.

Colorkey off
Image

Colorkey on
Image

I've also fixed a few other things. The new update will be available soon

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) » Wed Sep 21, 2011 1:56 pm

Yes, I noticed that I have to read them backward, but thanks.

Can you see any chance to making completely new maps for hd2 in the near future, hdmaster? Because I don't know what can we do without the collisions. Do you have any idea to making the collisions? (or lightmaps?)

As I promised before, I separated the textures of the hd2 into different folders. If you want, I can send the filelist on e-mail to you!

User avatar
betteryouthanme
Lieutenant
Posts: 116
Joined: Thu Jun 12, 2008 1:37 pm
Location: Germany
Contact:

Re: 4ds files hacked

Unread post by betteryouthanme » Wed Sep 21, 2011 5:21 pm

Now after importing & exporting (without change) and importing again it looks like on the pics below.
One stair is displayed correctly (in-game its glimmering? -> 3rd picture, with collision), in most cases the stairs look like on the picture of my previous post. (just the ramp without collision) and one stair is not displayed at all. (no ramp, no stairs, no collision)
stairs_2.jpg
stairs_2.jpg (99.31 KiB) Viewed 18098 times
stairs_1.jpg
stairs_1.jpg (36.56 KiB) Viewed 18098 times
stairs_3.jpg
stairs_3.jpg (28.43 KiB) Viewed 18098 times
Thanks for your explanations. Very helpful. thup01

User avatar
betteryouthanme
Lieutenant
Posts: 116
Joined: Thu Jun 12, 2008 1:37 pm
Location: Germany
Contact:

Re: 4ds files hacked

Unread post by betteryouthanme » Fri Sep 23, 2011 11:17 am

@ Jason: Could not find an "edit your post" button. Thought i've done that with my last post now it seems to be gone?

Where are the .bin loading options in your newest script version hdmaster? ;)

Also i want to add a door into a map where doors are not existing yet, if somebody tried that already what i have to mind?
Door definitions are stored in scene2.bin. Should be no problem to add. The door itself is a model and i can simply import it? Was trying to find the Libya1 doors model, but no luck yet.

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 Sep 24, 2011 10:13 am

Do the occluders matter anything with using a ~2009-2011 PC-performance? Or it depends only from the engine?
I imported and exported Libya2 and I found some holes on the map between the meshes in the game.

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

Re: 4ds files hacked

Unread post by Jason » Tue Nov 15, 2011 4:37 pm

hdmaster come back :cry:

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 Nov 18, 2011 10:10 pm

Jason wrote:hdmaster come back :cry:
Hmmm, I also start to worry about him. :sad:

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

Re: 4ds files hacked

Unread post by hdmaster » Sun Nov 27, 2011 5:24 pm

Jason wrote:hdmaster come back :cry:
I'm back here grin01
Marvin (hun) wrote:Do the occluders matter anything with using a ~2009-2011 PC-performance? Or it depends only from the engine?
I imported and exported Libya2 and I found some holes on the map between the meshes in the game.
I'd say both. I once read an interview where a developer said that the engine will handle about 30000 polygons in the FOV. But I've already had framerates > 25 in a FOV where I've added like 10 tanks each with about 70000 polys and I didn't use any occluders there. But there's a certain limit of polycount for each PC. The advantage of occluders is that they tell the engine which faces should not be rendered (cause they're behind walls or whatever) so more polys are available until it reaches the limit again.
betteryouthanme wrote: Where are the .bin loading options in your newest script version hdmaster? ;)
I've started again developing on the whole HD2 tools this week. There will be some really cool features including the .bin import. Here's a screen of an editor similar to DC-ED inside 3ds Max that will be available soon

Image

Uploaded with ImageShack.us

I've also fixed a few bugs of the 4DS import & export tools. I'll upload this version soon. thup01

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) » Mon Nov 28, 2011 5:56 pm

Nice news, you are a God, hdmaster!

off: Thanks for your tips about the editing on the bin files: I succesfully finished (after a half-year) the new version of my hungarian translate! :))

User avatar
betteryouthanme
Lieutenant
Posts: 116
Joined: Thu Jun 12, 2008 1:37 pm
Location: Germany
Contact:

Re: 4ds files hacked

Unread post by betteryouthanme » Wed Nov 30, 2011 2:47 pm

Great that you're back and still into it!
We all hang by a thread and the thread is you. You were lost without trace for that long i thought you would come up with H&D 3 :mrgreen:
Please don't forget about checkpoints.

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

Re: 4ds files hacked

Unread post by hdmaster » Fri Dec 02, 2011 8:06 pm

betteryouthanme wrote: Please don't forget about checkpoints.
I had a look again on the check2.bin files and came finally up with an improved script that creates the connection grid and also imports the vehicle cps.

Copy & Paste that script into the Maxscript Editor, edit the filename in the script and run the script:

Code: Select all

FILENAME = "E:\\Spiele\\Hidden & Dangerous 2\\UnpackedNew\\Missions\\co_burgundy1\\check2.bin"
FILESIZE =  getFileSize FILENAME
BUILDGRID = False

fn createPath cp1 cp2 = (
	spline = SplineShape pos:cp1.position
	addNewSpline spline
	addKnot spline 1 #smooth #line cp1.position
	addKnot spline 1 #smooth #line cp2.position
	updateShape spline
)


struct checkpoint (
	position, connections = #(), additional = #(), name = ""
)

fn main = (
	if not doesFileExist FILENAME do ( MessageBox ("ERROR: File '"+FILENAME+"' does not exist"); return false )
	f = fopen FILENAME "rb"
	if f == undefined do ( MessageBox ("ERROR: Opening '"+FILENAME+"' failed"); return false )
	s
	do (	
		if ReadHex f 4 == "0x0901D07E" then (
			theLength = ReadLong f
			
			nCheckpoints 	= ReadLong f
			nUnk1			= ReadLong f
			nCP18			= ReadLong f
			nUnk2			= ReadLong f
			nCPVar			= ReadLong f
			
			CPs = #()
			TEST = #()
			
			for i = 1 to nCheckpoints do (
				print (ftell f)
				
				theCP = checkpoint()				
				X = ReadFloat f; Z = ReadFloat f; Y = ReadFloat f
				theCP.position = [X,Y,Z]
				
				unk1 = ReadLong f -- ??????????????????????????????
				unk2 = ReadHex f 4 -- ???????????????????????????????
		
				nConnections = ReadByte f
				unk3 = ReadByte f -- ???
				
				if not bit.And nConnections 0x40 == 0 do nConnections -= 0x40
				
				fseek f 10 #seek_cur
			
				for j = 1 to nConnections do (
					append theCP.connections (ReadShort f #unsigned+1)
					append TEST (ReadShort f #unsigned)
				)
			
				print theCP
				
				append CPs theCP
			)
			
			for i = 1 to nCP18 do (
				cpIndex = ReadShort f #unsinged+1
				CPs[cpIndex].name = ReadFixedString f 16
			)
			
			for i = 1 to nCPVar do (
				cpIndex = ReadShort f #unsinged+1
				CPs[cpIndex].name = ReadString f
			)
			
			if BUILDGRID do (
				for x in CPs do (
					for connection in x.connections do (
						createPath x CPs[connection]
					)
				)
			)

			for x in CPs do (
				cp = Point pos:x.position name:x.name size:1.0 centermarker:True cross:False box:False constantscreensize:True
			)
			
		) else (
			MessageBox ("Stopped reading @ "+(ftell f) as string)
			exit
		)
	) while (ftell f) < FILESIZE
		
	OK
)

main()
I've tested this only on a few files but worked for all of them. The result is something like this (Tutorial map):

Image

Uploaded with ImageShack.us

Unfortunately I have not collected all information on this file type, so I am not yet able to write an exporter no_01
Last edited by hdmaster on Sat Dec 10, 2011 1:32 pm, edited 3 times in total.

User avatar
betteryouthanme
Lieutenant
Posts: 116
Joined: Thu Jun 12, 2008 1:37 pm
Location: Germany
Contact:

Re: 4ds files hacked

Unread post by betteryouthanme » Tue Dec 06, 2011 12:56 pm

Seems not to work for co_burgundy1
Now i've edited the path to "E:\\Programme\\Hidden & Dangerous 2\\Missions\\bytm_bur1\\check2.bin"
But it stops at line 49
"--Nein ""+"" Funktion für undefined"

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

Re: 4ds files hacked

Unread post by hdmaster » Tue Dec 06, 2011 4:44 pm

Has been fixed. Updated the code in my previous post.

User avatar
betteryouthanme
Lieutenant
Posts: 116
Joined: Thu Jun 12, 2008 1:37 pm
Location: Germany
Contact:

Re: 4ds files hacked

Unread post by betteryouthanme » Fri Dec 09, 2011 12:22 pm

Is there a way to show only vehicle checkpoints? Cause with all the checkpoints & grids it's very confusing.
Also it won't show the checkpoints names. Maybe just a setting in 3ds Max i've to set?
Thanks again! Hope you'll find a way exporting checkpoints.

Lars told me, some time ago, about "Chameleon" a game that is using the same engine like HD2.
http://www.youtube.com/watch?v=Pu31Aj8VLtU

There are the same folders like in HD2 (missions.dta, models.dta, ...) or at least very similar and maybe you could extract them the same way you done with Sabre Squadron and then let's see if and in what way we can use these maps in HD2.. The maps of Chameleon are looking very very nice. And of course we'd have probably some new 4ds model files.
Maybe you know already about it, just wanted to mention so we won't miss something. ;)
Last edited by betteryouthanme on Mon Dec 12, 2011 2:17 pm, edited 1 time in total.

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

Re: 4ds files hacked

Unread post by Jason » Fri Dec 09, 2011 1:06 pm

betteryouthanme wrote:Lars told me, some time ago, about "Chameleon" a game that is using the same engine like HD2.
http://www.youtube.com/watch?v=Pu31Aj8VLtU

There are the same folders like in HD2 (missions.dta, models.dta, ...) or at least very similar and maybe you could extract them the same way you done with Sabre Squadron and then let's see if and in what way we can use these maps in HD2.. The maps of Chameleon are looking very very nice. And of course we had probably some new 4ds model files.
Maybe you know already about it, just wanted to mention so we won't miss something. ;)
It would be awesome if we could crack open the Chameleon files and translate it to English!

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests