pepoluan

Members
  • Content Count

    29
  • Joined

  • Last visited

Blog Entries posted by pepoluan

  1. pepoluan
    Just an update on my project to create new modder tool:
     
    The .2da file parser works! Yaaay!
     
    This is the commit where the file parser works.
     
    Tonight (22:51 at my place as I typed this blog entry) I'm going to work on the .dlg parser. Especially because for unknown reasons KotOR Tools refuse to parse any .dlg files I have.
  2. pepoluan
    BioWare's GFF files are simply... uhh... perplexing.
     
    I had... quite an interesting time trying to grasp my head around the ideas.
     
    So this post is kind-of a self-note for me.
     
    So, we have "Structs". Inside a Struct, there's a property "FieldCount"
     
    A Struct can have one "Field", in which case the "DataOrDataOffset" property contains an index to the "Fields Array", pointing directly to the lone field definition of that Struct.
     
    So far so good.
     
    But what's interesting is if a Struct has more than one Fields. In this case, the DataOrDataOffset property points to -- here's the key -- somewhere within the "Field Indices" section of the file. Then you get N elements from the Field Indices starting from the location that DataOrDataOffset pointed to (where N is = FieldCount above).
     
    In other words, the "Field Indices" list is an "unlabeled" set of Fields. It's a looooong list formed from the list of Fields used by Structs.
     
    Illustration:
     
    Let's say Struct 1 uses fields 1, 4, 5. Struct 2 uses fields 1, 2, 5, 6. Struct 3 uses fields 3, 4, 5, 6, 7.
     
    The content of "Field Indices" will be:
     


    1, 4, 5, 1, 2, 5, 6, 3, 4, 5, 6, 7  
     
     

    Struct_1.FieldCount == 3
    Struct_1.DataOrDataOffset == 0 (numbering begins from 0)
    Struct_2.FieldCount == 4
    Struct_2.DataOrDataOffset == 3
    Struct_3.FieldCount == 5
    Struct_3.DataOrDataOffset == 7  

    WHew. Now, that's not difficult, isn't it?
     
    Now that I can (kinda) grasp the "major structure" and ERD of the GFF file, I should be able to parse dem files...
     
    And with this understanding, I also realize that I have to totally rewrite the logic of the current parser, to make things efficient and to enable a file validity checker.
     
    Huh.
     
    I need some rest.
  3. pepoluan
    So, as a challenge to my programming skill -- and in great desire of a better way to integrate mods -- I've started a project called "SWiKe ToolSuite".
     
    Haven't had enough time to actually develop the ToolSuite this week, but starting this weekend I'm going to pour forth some real effort.
     
    At the very least, thanks to the information kindly shared in this thread , I have managed to create a decoder of .2da files, yay!
     
    When I'm no longer embarrassed of the code's quality, I promise I'll share the code as an Open Source project, with a suitable license.