Prototype

So, someone convinced me to try working on Prototype, and so far it’s been a success. I’m currently working on an editor for the Pure3D (*.p3d) files, called Edit3D.

edit3d

It’s working pretty good, the big brunt of the work will be researching & writing code to serialize/deserialize the many, many different types of data in the Pure3D files. I did a test texture replacement of alex_body_dm.dds with good success:

prototypef 2009-06-21 18-19-15-08

Tags:

134 Responses to “Prototype”

  1. TheName says:

    It’s looking good.

    Glad that you are working on something like this, even if its basic, at least it is one more thing to use for the game and one more step closer to making it better.

  2. PiXeN says:

    Does anyone know how to modify sound files ? I just want to put the Heavy’s Om nom nom nom nom when you assimilate people :3

  3. TheName says:

    So far the editor seems to work well, after figuring out that the rcf files are what I needed to start.

    Man there are a lot of individual files.

  4. DerPlaya78 says:

    hi,

    1. nice work

    2. found some stuff:
    U00018201 = TextContainer
    U00018202 = TextData (Parent of TextContainer, for frontend text, subtitles etc.)

    U00010020 = Mesh, contains:
    – VertexBufferDeclaration (0x00010014)
    – VertexBuffer (0x00010012)
    – IndexBuffer (0x00010013)

    these are used by polyskin and others (try alex.p3d, midgeo.p3d, etc.)…

    i hacked in a basic ModelViewer (from GTA IV sparkiv (WPF))

    http://www.sendspace.com/file/tqnzhr

  5. Rick says:

    That is very impressive, thank you!

  6. DerPlaya78 says:

    …found another thing:

    *.gfx files are flash movies (*.swf) with a different header: replace ‘G’,’F’,’X’ with ‘F’,’W’,’S’ at the start of the file and rename it to *.swf…

  7. DerPlaya78 says:

    some more stuff (based on rev.25)

    http://www.sendspace.com/file/6ptlmc

    my code is rushed/incomplete and could be incorrect but displays some more 3d models, some with textures…
    wpf isn’t capable of using ps_2+, so correct texture mapping(using the shaders) isn’t really possible with it….

  8. Rick says:

    It may be a good idea to just make a seperate model viewer that can load P3Ds that have model data to render them using XNA.

  9. DerPlaya78 says:

    some more shader work to do then…

  10. DerPlaya78 says:

    i did some more research, here is what i found (based on rev.30)

    http://www.sendspace.com/file/elg823

    this contains some info about animations, joints, limbs, etc…
    there’s still wpf code which should be probably removed and made with xna in a different project…

    i found a very interesting program:
    http://pages.cpsc.ucalgary.ca/~parker/cpsc585-radical/local_only/p3dExplorer/

    …and some files to test:
    http://pages.cpsc.ucalgary.ca/~parker/cpsc585-radical/local_only/art/

    these are very old but they are from radical and contain some info (typeids, structs, etc.) are applicable to prototype pd3s…

  11. Rick says:

    Very cool, I’ll take a look at that stuff. It’s very nice having someone else beside me work on this too. 🙂

  12. omer says:

    With this program , i can not modfy the subtitle files fe_textbible.p3d and textbible_english.p3d. I open the files , modify but can not save, what is the problem ?

  13. DerPlaya78 says:

    Here are some corrections/additions. Would be cool if i had some more files to test with p3dexplorer to find more animation type chunks, but i don’t have any other radical games…

    http://www.sendspace.com/file/vwtdxf

  14. DerPlaya78 says:

    I found a strange bug which breaks Gibbed.Prototype.Cement Unpack:

    the offending code is

    [code]
    Debug.Assert(stream.Read(data, 0, 4) == 4);
    [/code]

    in StreamHelpers.ReadValueU32()

    the funny thing is, this works:

    [code]
    int read = stream.Read(data, 0, 4);
    Debug.Assert(read == 4);
    [/code]

  15. Rick says:

    Huh, that is weird. What file causes that?

  16. DerPlaya78 says:

    I tried several files (scripts.rcf, art.rcf, …), it seems to happen only if i use Release configuration. It works when debugging…

  17. DerPlaya78 says:

    Here’s some more stuff (compressed animation data, some shader info, etc.)

    http://www.sendspace.com/file/s341ix

    taking a break now… perhaps i have some time tomorrow.

  18. Rick says:

    Ahhh, it’s probably my bad usage of Debug.Assert there, I’ll go and fix all the spots where I do it like that.

  19. Artikia says:

    Uhhm, I love your work, but can we download it already? as a demo or something? I cant wait :P. And if we cant do you know another funny mod/trainer for Prototype?

  20. TheName says:

    currently it can only be downloaded as source, he hasn’t compiled it yet and put it up, that I know of, you would have to compile it yourself.

  21. DerPlaya78 says:

    here are some fixes/additions for compressed animations (this time only FileFormats project)

    http://www.sendspace.com/file/zo2ozt

  22. Rick says:

    DerPlaya78 – you have a small bug in Camera.cs, namely you serialize Look twice instead of Look them Up.

  23. DerPlaya78 says:

    thanks… this won’t be the last bug 🙂

  24. Rick says:

    Yeah of course, I just noticed it when I started pulling in your changes.

  25. DerPlaya78 says:

    i have to take a break now, here is the last version:

    http://www.sendspace.com/file/03t5xq

    …this contains some code for compressed quaternions but i’m not sure if this is right. there are 2 classes which store quaternions as short[3] / byte[3]. I think these are euler angles but my math sucks…

  26. DerPlaya78 says:

    just to let you know: i figured out the format of the sound files:

    the raw sound data is stored as intel/dvi adpcm

    Files which contain audio data have this format:

    …header data…
    FourCC = ‘RADP’
    uint Channels
    uint SampleRate
    uint unk
    uint Length

    then follow blocks of 20 bytes each:

    struct block {
    short[2] // [0] = index, [1] = sample
    byte[16] // codes
    }

    for multichannel files these blocks are interleaved.

    i will post something more soon…

  27. DerPlaya78 says:

    here’s some code for audio files:

    – include the files in Pure3D.7z in Gibbed.FileFormats.Pure3D
    – Extract *.radp files
    – use radp2wav to convert to wave

    http://www.sendspace.com/file/p07ul2

    I was to lazy to implement extraction in Edit3D and only decompression is included…

  28. DerPlaya78 says:

    hi.

    i hope you’re still working on this… here is a compilation of my research:

    http://www.sendspace.com/file/agv1kk

    this contains some info about all the types, lua stuff, and some more changes…

  29. Rick says:

    I am, just been busy. 🙂

  30. Rawr says:

    I don’t know much about this stuff at all, but I was wondering, if you guys are able to extract or play sound, like dialog? all I have been able to do is extract p3d files from rcf files, but dunno what next, and I read p3d are graphic files so they arent even the sound files? and bik files from the movie.rcf which play in bink and smacker rad player, but no voice, and some don’t have any sound at all.

    Any help would be appreciated >.<.

  31. TheName says:

    Read above, DerPlaya78 has come up with a way to get sound files, it may or may not work with the format the dialogue is in but you could try.

  32. Rawr says:

    I downloaded those things, but i’m really not sure how to use em =x.

  33. DerPlaya78 says:

    …some more research:

    http://www.sendspace.com/file/kaljkl

    – contains some stuff for physics including visualization of different volumes (capsule, sphere, obb, cylinder, mesh …still using WPF because I’m too lazy 🙂 )
    – alot more types in all catogories (billboards, particlesystem, etc.)
    – included wave export for audiofile types
    – disabled *.p3d save (because i didn’t implement serialize for most things…)

  34. Rawr says:

    Any chance you could explain how to use em?

    I’d just like to be able to get some of the sound files extraced or w/e

  35. DerPlaya78 says:

    here are some more changes (shadertemplate, physics, animation)

    http://www.sendspace.com/file/0hkpjr

    …this contains a compiled exe for edit3d…
    to export audio:
    – open p3d containing audio data (ex. ‘audio\alex.p3d’)
    – click on a ‘UFE000000_AudioData (AudioFile)’ node
    – click on Export Node Data (blue icon)
    use at own risk.

  36. MilkandHoney says:

    It seems these tools only compress rather then extract or play the audio. Looks promising though. Eagerly waiting for more results, great work guys. I’m also trying to get the dialogue from the files but only got the CG and WOI out, without the voices but music in the bg. So damn hard >=/

  37. TheName says:

    With those tools you can extract just about every sound, and play any that you can extract with even the default windows media player.

    The p3d files that start with “nis” should be for the web of intrigue or cut scenes.

    The WOI and other videos are bik files which are known to not include dialogue to save overall space in multi language games, that is why you will find what you need separately.

  38. Rawr says:

    “With those tools you can extract just about every sound, and play any that you can extract with even the default windows media player.”

    But just how can we do that? >.<

  39. MilkandHoney says:

    I suppose no one really wants to go all out and explain how to do that? As in exactly how to get the dialog out. I even tried to get help from 2 other people who are pretty familiar with this stuff but they don’t understand. I’m about ready to PAY someone to do it for me.

  40. ESR says:

    How about extracting meshes, textures, uv’s, bones, and animation, so they can be usable in max or maya?

  41. TheName says:

    To be able to get anything you first have to compile.
    Then you use “Gibbed.Prototype.Cement.exe” in the main bin folder to decompress the .rcf files, running “Gibbed.Prototype.Cement.exe” one time in cmd will tell you what you need to do.
    Then you just use the Edit3d program to open the p3d files and extract.

  42. Rawr says:

    Thanks, its workin~

    You wouldn’t happen to know how to open/save a bunch at a time? or know which files are which >.<, was lookin for the voice files of alex but it seems they are just random mixed with others named things like "160cbf87.p3d" but when opened or saving it its "23880_alex_008.wav"

  43. X-Man says:

    How can I open the p3d Text files ? (need for subtiles Please )

    cu X-Man

  44. X-Man says:

    and save the changed p3d subtile file ?

  45. MilkandHoney says:

    X-Man

    http://www.sendspace.com/file/0hkpjr

    In the bin folder is the edited exe, use it to open p3d files, then click the little blue mic to save them.

    I wish there was a way to save multiple files like Rawr said, this is gonna take a really long time lol

  46. X-Man says:

    Thanks you MilkandHoney

  47. X-Man says:

    Okay.
    I exportet the english Subtiles as TXT-Format.
    I translate the english Subtiles in German

    Question:
    Like must import the translated file I and as as new. P3D file store ? ( NIS_0_1_FMV.p3d )

    I need help…The button with “stores new P3D” doesn’t go
    I am desperately friends….

    Thx X-Man

  48. DerPlaya78 says:

    importing textbibles is not implemented yet… so you can only export the subtitles.

  49. DerPlaya78 says:

    @Rick:

    if you’re still interested in this:

    http://www.sendspace.com/file/ur3tfb

    – contains some more info on audio files
    – ignore my changes to fightfile…

    …look into ‘fightstuff’ instead:
    there is another way to parse fightdata without knowing all the types. the data actually contains a kind of tree similar to p3d content.
    i wrote a little program to test this:
    – ‘data\figsrc’ contains all the dumped fightdata nodes (format context + ‘_’ + name)
    – ‘figinfo’ contains the source for my little tool. it parses all dumped info and saves the result as xml files in ‘data\figxml’
    – ‘data\figdump*’ contains all the individual nodes dumped in textformat – helps to figure out the format of a node
    – ‘\figinfo\figinfo\Entries’ contains some deciphered nodes (just the content, not its meaning)

Leave a Reply