Jump to content

Recommended Posts

  • Engineers
Posted

Here's bms for unpack.

comtype zstd
get BaseFileName basename

idstring ERPK
get Version uint32
getdstring Dummy 0x8
get ResourceTableOffset uint32
getdstring Dummy 0x4
get ResourceTableSize uint32
getdstring Dummy 0x4
get DataBaseOffset uint32

goto ResourceTableOffset
get ResourceCount uint32
get ChunksCount uint32

for i = 0 < ResourceCount
	get ResourceInfoSize uint32
	get StrLen ushort
	getdstring Dummy 0x7
	math StrLen - 7
	getdstring FileName StrLen
	getdstring FileType 0x10
	getdstring Dummy 0x4
	get ChunkCount ubyte
	
	for j = 0 < ChunkCount
		getdstring Sign 0x4
		get Offset uint32
		get Unknown_0 uint32
		get DecompressedSize uint32
		get Unknown_1 uint32
		get Unknown_2 uint32
		get Unknown_3 ubyte
		get CompreesedSize uint32
		get Unknown_4 uint32
		
		string Name p= "%s/%s" BaseFileName FileName
		math Offset + DataBaseOffset
		
		if ChunkCount < 2
			if CompreesedSize == DecompressedSize
				log Name Offset DecompressedSize
			else
				clog Name Offset CompreesedSize DecompressedSize
			endif
		else
			if CompreesedSize == DecompressedSize
				append 0
				log Name Offset DecompressedSize
			else
				append 0
				clog Name Offset CompreesedSize DecompressedSize
			endif
		endif

	next j
	
	get Unknown_5 uint32
	get Unknown_6 uint32
	get Unknown_7 uint32
	get Unknown_8 uint32
next i

 

  • Thanks 1
  • Engineers
Posted

Well it's quite clear what is what. I noticed that anything ending with "mesh" is constructor. I found links to the vertices/indices etc in them.

 

  • Engineers
Posted (edited)

Yay, but how to find the suiting face indices file for a vertex file?

williams.png

edit: guess, I'll need to start with vb=0

Edited by shak-otay
  • Engineers
Posted

car name.idf_lod=all&ib=0

but you must find right offset + count which I believe is in mesh file. There are also normal buffers, uv buffers and more.

  • Engineers
Posted
33 minutes ago, shak-otay said:

edit: guess, I'll need to start with vb=0

Yes this is the main vertex buffer.

1 = most probably normals

2 = most probably uv's

  • Engineers
Posted (edited)

Yeah, the right offsets... needs some fiddling again...

 

partially.png

I have no idea how the meshes are organized. Most of them look pretty horrible:

Williams-meshes.png

Edited by shak-otay

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...