Gildor's Forums

Author Topic: Major changes in the file format of Batman:arkham city  (Read 4813 times)
dogkarl
Newbie
*
Posts: 9


View Profile
Major changes in the file format of Batman:arkham city
« on: October 19, 2011, 13:48 »

The unreal format is generally very easy to understand.UPK file is a container of multiple small files.The individual files are consist of basic data elements, it goes like this:
DWORD dwElementNameIndex
DWORD dwReserve0
DWORD dwElementTypeIndex
DWORD dwReserve1
DWORD dwSize
DWORD dwReserve2
Actual Data....

dwElementNameIndex refer to a name in the namelist of upk package, it is the Name of the Elements, for example:"Text"
dwElementTypeIndex refer to a name in the namelist of upk package, it is the type of the Elements, for example:"IntProperty" means the element is a integer;
dwSize refer to the size of the element, and at the tail is the actual data of the element.

However, in Batman:arkham city, there seems to be some major change.
Now it seems goes like this:
WORD Type
WORD Name
Actual Data....

and it does not relate to the namelist in any obvious way.
So is it really changes,or just I made a mistake....
Wating confirmation.Pls share the information you know, thanks.

Logged
Gildor
Administrator
Hero Member
*****
Posts: 7973



View Profile WWW
Re: Major changes in the file format of Batman:arkham city
« Reply #1 on: October 19, 2011, 14:01 »

Let's say things with their real names
UPK file is a container of multiple small files.
UPK is a container of objects. These objects are became files only after processing with package extractor (not "exporter") tool.
Quote
The individual files are consist of basic data elements, it goes like this:
DWORD dwElementNameIndex
DWORD dwReserve0
DWORD dwElementTypeIndex
DWORD dwReserve1
DWORD dwSize
DWORD dwReserve2
... this looks like single export table entry
Quote
Actual Data....
No idea what you mean "actual data". May be you should say - N export table entries followed by N actual object data? (otherwise I don't understand what you're speaking about)
Quote
dwElementNameIndex refer to a name in the namelist of upk package, it is the Name of the Elements, for example:"Text"
that's "FName" entry (probably you could find information about it on this forum or inside old EpicGames documentation)
Quote
However, in Batman:arkham city, there seems to be some major change.
Now it seems goes like this:
WORD Type
WORD Name
Actual Data....

and it does not relate to the namelist in any obvious way.
So is it really changes,or just I made a mistake....
Wating confirmation.Pls share the information you know, thanks.
I have no information at the moment (I have no new Batman files at all).
Try decompress.exe and extract.exe, also you could try "umodel -list" with forcing game = Batman. If all these tools would crash then the package format is really changed.
Logged
dogkarl
Newbie
*
Posts: 9


View Profile
Re: Major changes in the file format of Batman:arkham city
« Reply #2 on: October 21, 2011, 07:28 »

Sorry I didn't make myself clear.
The upk format doesn't change much in batman, there is only a extra DWORD in every export table entry.
What I mean is that the files contained in the upk have major changes.For example, the "Texuture2D"file.

Let me demostrate.
First, look at this "Texture2D.Texture2D" I grabbed from "Red orchestra:Stalin..", main version of UPK is 0x2FD:
It's from PC version, so all the things is in Little Endian

Attach1

Here is the names related to it:
...
0xb = ByteProperty
...
0x24 = Format
...
0x2d = IntProperty
...
0x38 = OriginalSizeX
0x39 = OriginalSizeY
....
0x42 = SizeX
0x43 = SizeY
........

So it's fairly easy to understand the content using what I mentioned above.
The element "1"'s first dword is 0x42, so the name of the element is "SizeX", the third dword is 0x2D,so the type is "IntProperty". Its size is 4 bytes, no surprise there, and finally the value,0x100, so the image is 256 pixels wide.
The element "2",using the same rules, we know it's "SizeY",the type is "IntProperty", value is 0x80,so the image is 128 pixels high.
The element "3" tells us the Image's "OriginalSizeX"is 256
The element "4"  tells us the Image's "OriginalSizeY"is 128
So basically the old format is a human readable format.Using the method combined with the src .uc files from UDK,every object's format is relatively easy to understand.

However,every thing changes in Batman: Arc City.
Let me demostrate. this "Texture2D.Texture2D" I grabbed from "Batman:arkham city", main version of UPK is 0x325:
It's from Xbox360 version, so all the things is in Big Endian.

Attach2
Here is the names related to it:
....
0x2 = AddressY
.....
0xa4 = bUsedWithFracturedMeshes
....
0xa8 = bUsesFontlib
....
0xac = CanStripVertexColours
.....
0xb0 = CH0_ENCRYPTION_CARD2_03
....
0x15a = IntProperty
.....
0x24f = OriginalSizeX
0x250 = OriginalSizeY
....
0x2be = SizeX
0x2bf = SizeY
.....
Now you can see clearly there's nothing like the old format.
   The element "1" ,first WORD I guess is a binary value indicate the value is Int type, because if you look it up in namelist,AddressY obviously makes no sense, and the first WORD is the same in all 4 elements.
   The second WORD I guess is the element's offset in the C++ object in memory. Because the "bUsedWithFracturedMeshes"obviously have nothing to do with Texture2D class.

    So I guess the format is now binarilized, it's nolonger a human readable format.It can boost the loading speed of course, but it just makes the analyse of UPK object much more labour intensive.Now we must know the memory structure of a upk object/classs to understand the meanings of the data.
    Hope I am wrong, if else I will have to disassemble every new Unreal2 game to know the format...

[вложение удалено Администратором]
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7973



View Profile WWW
Re: Major changes in the file format of Batman:arkham city
« Reply #3 on: October 21, 2011, 08:24 »

Let's wait for PC game release, so I could help you.
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS