1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

UE2 - UT2kX UC2 - StaticMesh decopmpilation

Discussion in 'Modeling & Skinning' started by VendorX, May 12, 2013.

  1. VendorX

    VendorX Member

    Joined:
    Aug 2, 2010
    Messages:
    220
    Likes Received:
    3
    UC2 - StaticMesh decompilation

    OK Guys... Unreal2 Golem is done now it's time for UC2 - yep, Unreal Championship 2... I'm working on UC2Decompiler - script export is almost done, but I need some help with StaticMesh decompilation. I mean, I have all needed data, but don't know how to link MeshTri with MeshVert to produce exportable data - probably to .psk (extention will be changed to .psm, but format will remain the same) .
    If someone can explain to me correlations between those two (and maybe material stuff too) I will be grateful.
     
    Last edited: May 12, 2013
    Niuva likes this.
  2. meowcat

    meowcat take a chance

    Joined:
    Jun 7, 2001
    Messages:
    789
    Likes Received:
    1
    What exactly do you mean? Any idea of what kind of data it is? (list of integers or floats etc.)

    The reason I ask is that I assume if you've already made the other exporter then you know the .psk format. Myabe your question was aimed at others (I'm just tossing out a few ideas...)

    In most of the other model conversion stuff I've written for milkshape3D, tri lists were usually sets of 3 integers that were the indices into the list vertices (and obviously the vertices were just 3 float structs, though the static mesh data may also have another float (or maybe 3 ints for "color") corresponding to a "weight" variable used for mesh painting, I don't know exactly). I'd also expect some sort of UV list (with an index as to which vert corner it is for) kind of like what is used in the .ASE file format.
     
    Last edited: May 12, 2013
  3. dr.flay

    dr.flay Dr.Flay™

    Joined:
    Sep 19, 2011
    Messages:
    387
    Likes Received:
    3
    Are my ears believing my eyes ?
    You are porting the slash-fest of UC2 into 2K4 ?
    :eek:
    XXXXX....

    ... uuum, I mean a brief and embarrassing man-hug :lol:

    I think you should look at http://www.forums.chaoticdreams.org/viewtopic.php?f=8&t=6632

    As far as I can see, UC2 was a natural extension of the Chaos melee system.
    Both your current work may overlap, and both your experience would be useful.

    I imagine it would be most practical to bolt onto the current v3.81, as the code is available to those that ask.
    "Azarael" asked in the IRC room for permission, and is now balancing the Chaos-melee for a new release.

    Any improvements either way can be incorporated into a new Chaos update and UC2.

    Does that sound good ?
     
  4. VendorX

    VendorX Member

    Joined:
    Aug 2, 2010
    Messages:
    220
    Likes Received:
    3
    Thanks guys, but:

    @meowcat: this is not about .psk or other any other format to export (.psk I can write with eyes closed...) - it's about format written in .usx (to be clear: UC2 StaticMesh format is different from standard used in UE2.5. Tomorrow I will give you guys some sample of code and UC2 SM format.

    @dr.flay: It's not conversion - only decompiler/exporter for UC2 stuff like script, static meshes, textures and so one...
     
    Last edited: May 16, 2013
  5. dr.flay

    dr.flay Dr.Flay™

    Joined:
    Sep 19, 2011
    Messages:
    387
    Likes Received:
    3
    Oh well in that case, the UC2 stuff may still be useful for Chaos :D
     
  6. VendorX

    VendorX Member

    Joined:
    Aug 2, 2010
    Messages:
    220
    Likes Received:
    3
    Here is the dump of some StaticMesh.


    // Sample: CIN_Tech_pod.org_mid_console
    //-----------------------------------------------------
    SectionCount = 2;

    0:
    Unknown = 1;
    TListOffset = 0;
    VListOffset = 0;
    VertMax = 485; <- (485 + 3) / 4 = 122
    TriCount = 302;
    TrisMax = 667; <- 667 + 2 = 669

    1:
    Unknown = 1;
    TListOffset = 669;
    VListOffset = 122;
    VertMax = 129;
    TriCount = 6;
    TrisMax = 7;

    EdgeCount = 171;

    0:
    Point0; <- 3*Float
    Point1; <- 3*Float
    ListId; <- 0 or 1
    ListOffset0; <- IDMax < WedgeCount ( - 2 )
    ListOffset1; <- IDMax < TriangleCount ( - 3 or 4 )

    TriangleCount = 307;

    0:
    V0; <- VertId
    V1; <- VertId
    V2; <- VertId
    SectionId; <- MaterialId

    //-----------------------------------------------------

    There is no FMeshVert or FMeshUV data written - at some point these two must be calculated from given data - how to do this..?
    Any help will be appreciated.
     
  7. meowcat

    meowcat take a chance

    Joined:
    Jun 7, 2001
    Messages:
    789
    Likes Received:
    1
    Since you'd already written the exporter I kind of figured you had the .psk format down cold :)

    The excerpt you posted above, is that kind of a header output? Do you have the raw binary file available to look at? The mention of 'WedgeCount' sounds like it might have to do with the UV coords (Hoppe's wedge reference in the source file for animated meshes). Could they have lumped the 3 Floats for the vertices in with 2 floats for the UV coordinate, and then a couple of bytes for material IDs or other values, so that a total vertex memsize was something like 6 floats all lumped together?
     
  8. VendorX

    VendorX Member

    Joined:
    Aug 2, 2010
    Messages:
    220
    Likes Received:
    3
    I've checked both Points and in most of case they're points in space - I mean, i.e. in Plane they are all the same:
    Point0: -9.0, 2.4, 4.2
    Point1: 9.0, 2.6, -4.2

    I have an idea: what if Point0 and Point1 is only a collection of six floats and V0, V1, V2 is used to construct the vector (vertex). No idea for UV...
    Later, will post the Plane sample with raw data.


    As for "animated meshes" - StaticMesh inherit UPrimitive...
     
  9. VendorX

    VendorX Member

    Joined:
    Aug 2, 2010
    Messages:
    220
    Likes Received:
    3
    Sorry for the delay...
    Code:
    CreateExport 8: StaticMesh -> Plane
    
      [COLOR="red"]UObject.Serialize -> Position: 530903[/COLOR]
      bSkipProperties: 0
      FPropertyTag.Position: 530904
        PropertyName: Materials
        ItemName: 0
        Type: 9
        Size: 2
        ArrayFlag: False
        ArrayIndex: 0
        DataSize: 26
      bEndOfProperty: True Count: 1
      ParentId: 0
    
      [COLOR="red"]UPrimitive.Serialize -> Position: 530941[/COLOR]
      BoundingBox: -9.8497 2.0295 -4.5407 9.8497 2.6271 4.5407
      Raw: 5F 98 1D C1 54 E3 1 40 6A 4D 91 C0 5F 98 1D 41 68 22 28 40 6A 4D 91 40 
    
      BoundingSphere: 0.0 2.3283 0.0 10.86091
      Raw: 00 00 00 00 DE 02 15 40 00 00 00 00 4B C6 2D 41
    
    
      [COLOR="red"]UStaticMesh.Serialize -> Position: 530981[/COLOR]
      SectionCount: 1
      0:
        TListOffset: 0
        VListOffset: 0
        VertMax: 15
        TriCount: 8
        TrisMax: 20
    
        Raw: 01 00 00 00 00 00 00 00 0F 00 08 00 14 00 
    
      BBox (6*4): -9.8497 2.0295 -4.5407 9.8497 2.6271 4.5407
      Raw: 5F 98 1D C1 54 E3 01 40 6A 4D 91 C0 5F 98 1D 41 68 22 28 40 6A 4D 91 40 
    
      Origin (3*4): 9.8497    0.2988   4.5407
      Raw: 5F 98 1D 41 50 FC 98 3E 6A 4D 91 40
    
      Normal (3*4):  0.1015259 3.34672  0.2202304
      Raw: D4 EC CF 3D AA 30 56 40 11 84 61 3E
    
      EndOfBlock: 1
      Raw: 01 00 00 00
    
      UnknownData (20):
        01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        DE 02 15 40
    
      UnknownFloat (4): 0.0
      Raw: 00 00 00 00
    
      SMProperty (13*4):
        01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00
        01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 00
        00 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00
        00 00 00 00
    
      Unknown0Count (4): 3
        0:
          Point0: -9.8497 2.0295 -4.5407 
          Point1:  9.8497 2.6271  4.5407 
          GroupIndex: 0
          ListOffset0: 1
          ListOffset1: 2
    
          Raw: 5F 98 1D C1 54 E3 01 40 6A 4D 91 C0 5F 98 1D 41
               68 22 28 40 6A 4D 91 40 00 00 00 00 01 00 02 00 
        1:
          Point0: -9.8497 2.0295 -4.5407 
          Point1:  9.8497 2.6271  4.5407 
          GroupIndex: 1
          ListOffset0: 4
          ListOffset1: 0
    
          Raw: 5F 98 1D C1 54 E3 01 40 6A 4D 91 C0 5F 98 1D 41
               68 22 28 40 6A 4D 91 40 01 00 00 00 04 00 00 00
        2:
          Point0: -9.8497 2.0295 -4.5407 
          Point1:  9.8497 2.6271  4.5407 
          GroupIndex: 1
          ListOffset0: 4
          ListOffset1: 4
    
          Raw: 5F 98 1D C1 54 E3 01 40 6A 4D 91 C0 5F 98 1D 41
               68 22 28 40 6A 4D 91 40 01 00 00 00 04 00 04 00
    
      Unknown1Count (4): 8
        0:
          V0: 0
          V1: 1
          V2: 2
          SectionIndex: 0
    
          Raw: 00 00 01 00 02 00 00 00
    
        1:
          V0: 12
          V1: 13
          V2: 14
          SectionIndex: 0
    
          Raw: 0C 00 0D 00 0E 00 00 00
    
        2:
          V0: 4
          V1: 5
          V2: 6
          SectionIndex: 0
    
          Raw: 04 00 05 00 06 00 00 00
    
        3:
          V0: 8
          V1: 9
          V2: 10
          SectionIndex: 0
    
          Raw: 08 00 09 00 0A 00 00 00
    
        4:
          V0: 4
          V1: 6
          V2: 7
          SectionIndex: 0
    
          Raw: 04 00 06 00 07 00 00 00
    
        5:
          V0: 8
          V1: 10
          V2: 11
          SectionIndex: 0
    
          Raw: 08 00 0A 00 0B 00 00 00
    
        6:
          V0: 0
          V1: 2
          V2: 3
          SectionIndex: 0
    
          Raw: 00 00 02 00 03 00 00 00
    
        7:
          V0: 12
          V1: 14
          V2: 15
          SectionIndex: 0
    
          Raw: 0C 00 0E 00 0F 00 00 00
    
      UnknownInt: 14
      UnknownByteAtEnd: 0 [COLOR="Red"]<- if successful, always 0[/COLOR]
    
    [COLOR="Red"][B]SerialSize: 400 -> ReadedSize: 400[/B][/COLOR]
    
    
    This was supposed to be a simple plane... As you see, there is no unread data. If you want, I can dump more SM and post download link.
     
  10. NoBigDeal

    NoBigDeal New Member

    Joined:
    Jun 28, 2014
    Messages:
    4
    Likes Received:
    0
    Sorry for bumping an old thread, but any news on the topic? I'm interested too.

    OffTopic:
    I can't understand - UC2 is like a tabu - anywhere I ask about, immediately I walk on a wall of silence. This game is almost 10 years old, so maybe it's time to stop keeping it in secret.
     
  11. Unreal4Eva

    Unreal4Eva BioHazard!

    Joined:
    May 19, 2009
    Messages:
    230
    Likes Received:
    0
    This looks familiar. You know the UCBP mod is still alive right?
     
  12. VendorX

    VendorX Member

    Joined:
    Aug 2, 2010
    Messages:
    220
    Likes Received:
    3
    Can you tell me how it's done exactly (code snippet will be useful) or point to part of source code which is responsible for decode this?

    Sorry, but nothing new ... As you already know, people do no want to cooperate. :(

    It's not about the UC2 content (maps, models etc.), it's about the gameplay - I want to port UC2 gameplay to a newer version of UE.

    People please, help me with this ...
     
    Last edited: Jul 14, 2014
  13. Unreal4Eva

    Unreal4Eva BioHazard!

    Joined:
    May 19, 2009
    Messages:
    230
    Likes Received:
    0
    Gameplay such as the style of movements, implementing the UC2 HUD, rewite the Adrenalin system, implementing the UC2 style melee? Sounds cool, keep us updated.
     
  14. meowcat

    meowcat take a chance

    Joined:
    Jun 7, 2001
    Messages:
    789
    Likes Received:
    1
    Hi VendorX, for the data you posted above (with the raw data) could you post a few orthogonal screenshots of the mesh from within the map editor (if that is possible) from the x, y, and z axis? I'd like to compare the data you posted against how the mesh appears when centered on the origin.

    How did you know what some of those data sets were? (like the bounding box and bounding sphere)

    And was this a plane or a cube? (I'm trying to work out what the set of 8 data points were)
     
  15. VendorX

    VendorX Member

    Joined:
    Aug 2, 2010
    Messages:
    220
    Likes Received:
    3
    Update:
    Never mind ... got it ... :D
     
  16. meowcat

    meowcat take a chance

    Joined:
    Jun 7, 2001
    Messages:
    789
    Likes Received:
    1
    Very cool! Do you mind explaining some of it here (even if vaguely just to get an idea of how they format stuff)? Was it mainly just an array of indices into an array of float or int pairs (maybe 16 bit ints or floats for the UVs since they typically are trying to conserve memory on the consoles...)

    I was going to ask if any of the meshes in UC2 were similar to other UT games (possibly the same meshes) so I could compare the two.
     
  17. VendorX

    VendorX Member

    Joined:
    Aug 2, 2010
    Messages:
    220
    Likes Received:
    3
    These six floats are just Collision Primitive, the real SM data (Points, UVs etc.) was split and stored in different .xpr packages.

    Off Topic:
    It's a shame, despite fact that there is so many great minds here, no one (except meowcat - btw: thanks for trying ...) was even trying to help. Moreover, I'm sure that some of these 'minds' knew exactly UC2 package structure and how to read it - so thanks for no help ...
    ... history likes to repeat it self - the same was with the Golem. Strange thing is, that when solution to the problem was found, everyone want it on a plate ... Jeez, people, what happened with cooperation, sharing of information ..? In the end, this is an old game - considered as abandonware - exchange of information certainly will does not hurt anyone.

    ... why I'm still here ... this forum is dying ...
     
    Niuva likes this.
  18. AlCapowned

    AlCapowned Member

    Joined:
    Jan 20, 2010
    Messages:
    235
    Likes Received:
    15
    I don't think more than a few BU know and understand file formats (I certainly don't). I think that a forum with a lot of people who specialize in model/file formats like Xentax would be a good place to ask for help. It may not have been helpful for me, but maybe you would have better luck there.

    Thanks again for all of your hard work.
     
  19. VendorX

    VendorX Member

    Joined:
    Aug 2, 2010
    Messages:
    220
    Likes Received:
    3
    Yeah, I know Xentax but the problem is that they do warez and I will not support this kind of forum (donation is mandatory to stay their member).

    @meowcat:
    As for Xbox optimisation: Each texture carry multiple data streams for each geometry, where it was used. So, loading a geometry takes much less time because its data is already in the memory - in other words: in case of missing texture, there will be missing part / section of geometry.
    It's like Precaching in UE2.5 but much more effective.
     
    Last edited: Jul 24, 2014
    Niuva likes this.
  20. DeusIX

    DeusIX Engineer

    Joined:
    Mar 22, 2009
    Messages:
    168
    Likes Received:
    1
    I'm waiting for Wormbo to appear here and help. I think he drinks uscript for breakfast.
     

Share This Page