Gildor's Forums

Author Topic: About import file into MassEffect2 UPK  (Read 8022 times)
dogkarl
Newbie
*
Posts: 9


View Profile
About import file into MassEffect2 UPK
« on: March 22, 2010, 10:12 »

Well, I made a tool to import modified file back into MassEffect 2 UPK, which works fine on PC version. But as I tried to use it with XBOX360 version, the modified UPK doesn't work well. If the imported file is same size with the origin file, the game runs. But as I tried to put in a file with different size, the game just stop while loading.
So I would like to know if there's anything in the UPK except the "DWORD offset ""DWORD size"in the export table item that relates to the file's size & offset ?
Thanks a lot...
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: About import file into MassEffect2 UPK
« Reply #1 on: March 22, 2010, 13:12 »

There are a lot of "DWORD Size", "DWORD SkipOffset" etc. in Unreal data structures.
Logged
dogkarl
Newbie
*
Posts: 9


View Profile
Re: About import file into MassEffect2 UPK
« Reply #2 on: March 22, 2010, 13:26 »

typedef struct
{
   long dwIndex;   //*.xxx Index
   DWORD dwUnknown1;
   DWORD dwParentIndex;
   DWORD dwName;   //NameIndex for example :GlobalTLK
   DWORD dwReserved1;

   DWORD dwSize;    //File Size
   DWORD dwOffset; //FileOffset


   DWORD dw2nd;    //Flag part1
   DWORD dw3rd;     //Flag part2
   DWORD dw1st;

   DWORD dw6th;

   DWORD dwNumSUB_ITEM;
   SUB_ITEM *pSUB_ITEM;

   DWORD dwNumArray;
   DWORD* pArray;

   QUAD  qUnknown2;     //GUID?
   DWORD dwUnknown3;
}EXPORT_TABLE;
Well I do not quite figure out the export table. But except the bold Offset Size, is there any thing in this structure related to size and offset of File?
Thanks again..never thought you'd reply so soon..
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: About import file into MassEffect2 UPK
« Reply #3 on: March 22, 2010, 13:50 »

This is a list of object export fields for Mass Effect 2:
Code:
int ClassIndex
int SuperIndex
int PackageIndex
Name ObjectName
int Archetype
int64 ObjectFlags
int SerialSize
int SerialOffset
Map<Name, int> ComponentMap
int ExportFlags
Array<int> NetObjectCount
int[4] Guid
int unknown

There are a lot of "offsets" inside game objects (i.e. outside export table).
Logged
dogkarl
Newbie
*
Posts: 9


View Profile
Re: About import file into MassEffect2 UPK
« Reply #4 on: March 22, 2010, 15:29 »

Now I kind of understand..You mean the Objects in the UPK package use offset to refer to another object.
For example "Obj1 Obj2 Obj3",Obj2 size 0x100, Obj1 use a offset 0x100 to directly refer to Obj3, independent of ExportTable.
So if replace Obj2 with something bigger, let's say 0x200 bytes, and we modify ExportTable. But the Obj1's internal offset is wrong now, so if obj1 is important ,we crash.
To make things work, now we must have a complete knownledge of each Object's internal structure.
Is this what you mean?
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: About import file into MassEffect2 UPK
« Reply #5 on: March 22, 2010, 15:35 »

No. Objects are referenced by indices, like names.
Some objects (for example - textures and sounds) uses data structures which has file offset information inside. Check UntypedBulkData_Mirror (and its derived structures) in Object.uc. This is what I'm talking about.
Logged
dogkarl
Newbie
*
Posts: 9


View Profile
Re: About import file into MassEffect2 UPK
« Reply #6 on: March 22, 2010, 15:45 »

Thank you! Grin
You are truly a UPK expert.
Logged
dogkarl
Newbie
*
Posts: 9


View Profile
Re: About import file into MassEffect2 UPK
« Reply #7 on: March 22, 2010, 18:39 »

I kind of used a temorary method to solve my problem. I inserted the new data to file end, then modify the ExportTable to point to these data. In this way, I don't need to understand/modify all the file after the target in package...
Thanks gildor again.
Logged
McElger
Newbie
*
Posts: 1


View Profile
Re: About import file into MassEffect2 UPK
« Reply #8 on: October 12, 2011, 17:13 »

Hello there sorry for bringing back an old topic but, as i found on searching, this one was the closer to my search.
First of all Gildor that your doing is amazing, keep it up.
As i see in this post dogkarl have made a tool to be able import new files (adding or replacing) to a UPK or PCC i guess, wich as saying works good with PC version. Is that true and if is can you make that tool public.
I have made some models over UDK ways that i wish to import it to mass effect 2, but as you already know the game uses some kind of compration/algorithm for PCC files. Any help will be AMAZING Shocked.
Logged
dogkarl
Newbie
*
Posts: 9


View Profile
Re: About import file into MassEffect2 UPK
« Reply #9 on: October 19, 2011, 13:36 »

The problem is about a structure whicn called "UntypedBulkData",some member of this structure refer to the offset of the raw data, so if you insert data, offset will be wrong.
    There are 2 ways to solve this. 1.analyse all the file in the upk which has "UntypedBulkData",of course it requires a lot of work. 2. insert the file to the end of the data.
    Yes, I 've made a tool, I use it extensively to localize the unreal games. However, every bit of hint information is in chinese, and I didn't analyse the model format, so sorry, the tool won't be made public.
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7971



View Profile WWW
Re: About import file into MassEffect2 UPK
« Reply #10 on: October 19, 2011, 13:47 »

I have made some models over UDK ways that i wish to import it to mass effect 2
It is not possible to import UDK mesh (in modern UE3 format) into Mass Effect 2 (which uses 4 years old engine). Plus, even conversion from UT3 to Mass Effect is not possible despite both games are uses similar engine, because Mass Effect has heavy modifications of data formats.
Logged
Jump to:  

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