Is this ok to do or not (involves SWBF1+2 for ps2 and xbox)

Started by jdee-barc, October 16, 2011, 05:08:15 PM

Previous topic - Next topic
158 references to imp_weap_inf_pistol in the PS2 IMP.lvl
133 references to imp_weap_inf_pistol in the PC IMP.lvl
that seems large, but after isolating the string-like structures, there are losts of them.
some are _ord refs and some are animation refs.

found the hp_fire for imp_weap_inf_pistol, so I must be close to it's modl.
But I don't recognize the tags in here. there are no CL1L, SEGM, or GEOM typ references, so it would take some time to parse it all out.
There are tags though. modl instead of MODL, but the size refs are still there and seem to work the same.(I love the data inspector in XVI32)

It appears that the models are split up into several different pieces. (perhaps to optimize load times?)
I made a list of alpha numeric strings for each(141000 for both, but most are data and garbage) and will comb through it to see if I can narrow it down to a reasonable list of tags.

With a list of tags I can chop the lvl up into chunks and those chunks can be further scrutinized to glean how the lvl is constructed. (and also how to put the stuff back in it's pre-lvl'ed state)

ETA on the tag list- tomorrow.... definatly not anytime today.
ETA on Scrutiny- well... yeah, thats the catch, isn't it. Later. More later than is ok, but sooner than never.

Pure reversing with a good data inspector, a scripting tool and a text editor that doesn't mess with nulls or whitespace. I feel like I'm 12, poking around on my old Vic-20 again.

Quote from: tirpider on October 18, 2011, 07:01:41 PM
158 references to imp_weap_inf_pistol in the PS2 IMP.lvl
133 references to imp_weap_inf_pistol in the PC IMP.lvl
that seems large, but after isolating the string-like structures, there are losts of them.
some are _ord refs and some are animation refs.

found the hp_fire for imp_weap_inf_pistol, so I must be close to it's modl.
But I don't recognize the tags in here. there are no CL1L, SEGM, or GEOM typ references, so it would take some time to parse it all out.
There are tags though. modl instead of MODL, but the size refs are still there and seem to work the same.(I love the data inspector in XVI32)

It appears that the models are split up into several different pieces. (perhaps to optimize load times?)
I made a list of alpha numeric strings for each(141000 for both, but most are data and garbage) and will comb through it to see if I can narrow it down to a reasonable list of tags.

With a list of tags I can chop the lvl up into chunks and those chunks can be further scrutinized to glean how the lvl is constructed. (and also how to put the stuff back in it's pre-lvl'ed state)

ETA on the tag list- tomorrow.... definatly not anytime today.
ETA on Scrutiny- well... yeah, thats the catch, isn't it. Later. More later than is ok, but sooner than never.

Pure reversing with a good data inspector, a scripting tool and a text editor that doesn't mess with nulls or whitespace. I feel like I'm 12, poking around on my old Vic-20 again.

What text editor would that be? I'm interested in trying some of these things you mention, and have the ps2 lvl files. It baffles me to think they got 65mb worth of stuff into 5mb without losing anything more than texture quality. The meshes alone are way bigger. Maybe it doesn't store mesh though?

They cut down alot on mshs and TGAS read the SWBFII Modtools documentation to find out more.

Quote from: SleepKiller on October 18, 2011, 07:18:09 PM
They cut down alot on mshs and TGAS read the SWBFII Modtools documentation to find out more.
I'm talking about swbf1 though.

hex editor - XVI32 (It has that data inspector and a groovy little script engine. good for cleaning out mangled data)

Text editor - AEdiX suite v3.0.5 (comes with a hex editor, but it is not very robust)(also has a script engine and text hilighting, but I just use it like notepad.) Old and not supported anymore I think.

Scripting Language - AutoIT and I use SciTE to edit my scripts. Simple Basic structure. Perfect for folks like me that never took the time to learn about object oriented programming. (I hate any kind of programming that forces handles on you.) There is a big problem with AutoIT though. It sets off virus scanners. Never had a problem, but still, it sets them off. If I could find a language as easy as basic, and free, I would replace it. (FreeBasic has a crazy addon dll system for user created modules, where autoit just works out of the box)

Links to their sites:

Kiry's Tech (AEdiX suite v3.0.5)
http://www.kirys.it/downloads.html

AutoIT (main download includes a slimmed down SciTE editor that works with lua as well.)
http://www.autoitscript.com/site/autoit/downloads/

XVI32
http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

All of the above are freeware, but they are also easily worth 100 times what I paid for my first copy of BF1. I can't count the hours I've spent in each.

re: the imp pistol.
I got the list down to 3000 and falling for the PS2 lvl. turns out the tags are there, just lower case. It might be as easy as finding the pieces and appending them together in the right order.

Perhaps they used lower res models, droped the shadow volume, and uther special "feature" geometry.
The PS2 version is really lw res compared to PC. I still am amazed by the ZeroEngine and my vid card bites.

Quote from: Phobos Developer on October 18, 2011, 07:19:35 PM
I'm talking about swbf1 though.
Yes but you forget SWBF1 and SWBFII use the same engine Zero engine so most of the information will still be relervent.

Quote from: SleepKiller on October 18, 2011, 10:30:40 PM
Yes but you forget SWBF1 and SWBFII use the same engine Zero engine so most of the information will still be relervent.
Most of the tga and msh you were referring to are only used in bf2 not bf1.

 :slap: You do not get what I was meanning the process they use to compress data for the console is describe some what in the SWBFII Modtools documentation. Understand the process is the same for the two games? Comprendo?

Quote from: SleepKiller on October 18, 2011, 10:54:09 PM
:slap: You do not get what I was meanning the process they use to compress data for the console is describe some what in the SWBFII Modtools documentation. Understand the process is the same for the two games? Comprendo?

The LVL compression process are too different to compare them the way you do. BF2 has way more code.

Banging out the tag list for the file by hand gave me a headache. so I turned to the header file of the lvl extract.exe and used his defines as a starting point.

Most all of his tags are valid, but there are some that turn up invalid sizes (several gigabytes.. might be movie refs, but in a side lvl?)

The partialy validated list follows.

ucfb   - the begining of the file
lvl_   - main sections. everything else is contained in one of these.
BODY   -
body   -
coll   - the 1billion + size refs, I bet I'm reading them wrong.
Coll   -
entc   -
expc   -
gmod   -
INFO   -
modl   -
NAME   -
ordc   -
prim   -
skel   -
zaa_   -
zaf_   -


lot of emptyness in that list, but the lvl_ file size refs (+ 8 for the ucfb and it's 4 byte value) mirror the file size exactly, so I'm on the right track.

As for the case, I'm willing to bet the uppercase ones are for something else, but haven't validated that yet.

The project I am in the middle of is exactly the same work, but with MSH files (I want so desperatly to swap the head of a tusken but can't track it down.) So I'll be moving back and forth from them as I develop better binary/hex/zipitydooda crunching functions.

Quote from: Phobos Developer on October 19, 2011, 08:37:37 AM
The LVL compression process are too different to compare them the way you do. BF2 has way more code.
Man, your stubbon. SWBF1 and SWBF2 use the same munge process the same data storing methods got it. And SWBFII has way more data because its packed to the maximim with content Pandemic even cut stuff from it. Get it the SWBFII side LVLS on the PC average 100MB and the ALL one is over 200 MB that is way more than the SWBF1 sides. Hence why their is more code. Do you get it now?

Quote from: SleepKiller on October 19, 2011, 01:10:39 PM
Man, your stubbon. SWBF1 and SWBF2 use the same munge process the same data storing methods got it. And SWBFII has way more data because its packed to the maximim with content Pandemic even cut stuff from it. Get it the SWBFII side LVLS on the PC average 100MB and the ALL one is over 200 MB that is way more than the SWBF1 sides. Hence why their is more code. Do you get it now?
That's exactly what I was saying, just more detailed.

ugh.

After a couple of days burried in 32 bit singles and longints, I'm pretty sure I have discovered why there isn't a full on lvl de-compiler.

It isn't that it is impossible. It's the time and sheer abstract nature of the data (and the headaches and nose-bleed from information overload.)

A real programer could get the models out, but I'm just a hack/scripter, learning as I go.

As for being able to use ps2 models on PC BF1, you might have to add or edit some things, but I'm sure the renderer for the ps2 expects the same geometry format. (It's still Zero, after all.) The texture will probably be a different format, the special flags (transperancy, glossyness,ect..) for materials and such, might be set diferent(more conservative for the limitations of the platform. )

All that can be overcome, IF someone could figure out how to extract it to be worked on.