Looking for VB.NET API to access BIC file

I want to use VB.NET to retrieve the Gender, Race, Alignment and Class level information from a BIC file .

Does anyone know of an API I could use or have any suggestions as to how I might access this information?

Many thanks for any help and guidance

I would use niv’s nim tools instead to json’ify them. Then you only open this text-file and search for those fields.

You can use them with cmd/bash like nwn_gff -i <toon.bic> -o <toon.bic.json> -p

@dunahan
Many thanks for your suggestion. However, this is something I want to include the NWN Installer Tool (NIT), which means I can’t rely on the user having Niv’s NIM tools and it is not something I would want to package with my download.

As far as I know, no one wrote a GFF parser in VB.NET, so if you’re hoping to include something as source, you’ll probably have to write your own. However, there are several (1, 2, 3) implementations in C# that you can compile as dotnet and call from the same application.

In addition, there are literally dozens of implementations in languages that compile to native code (C, C++, nim, rust, go) which you can build as a .dll and call from your VB app via P/Invoke.

@clippy
Many thanks for this information. I had a quick look at the source and it does not seem like I could find the GFF layout for a BIC file. If I could find some definition or routine, I would be happy to convert it to a DLL or a Class that extracts the specific information I am looking for.

@ClarkHill
Many thanks for taking the time to respond. I am aware of how to read the BIC file. Unfortunately, what I don’t have is the structure of the file so that I can reference the information I need. The BIC file is not a text file. As far as I know, it is a GFF file that requires a “map” to navigate to the required information. This is the knowledge I am missing.

I will keep looking, but it looks like I am not going to find what I need without the help or direction of someone more knowledgeable than me.

The official specification of the GFF file format is here: File Format Specification (Bioware) - Neverwinter Nights 1: EE - nwn.wiki

The official reference code that parses this is at neverwinter.nim/neverwinter/gff.nim at master · niv/neverwinter.nim · GitHub

The three linked C# repos all have equivalent code. Here are a few others as well:
C++: NWNFileFormats/FileFormats/Gff at master · Liareth/NWNFileFormats · GitHub
Ruby: nwn-lib/lib/nwn/gff.rb at master · niv/nwn-lib · GitHub
Perl: Neverwinter Nights tools / Downloads
Python: nwn/files/gff.py · master · Neverwinter Nights Utilities / Neverwinter Nights Toolset · GitLab
Rust: GitHub - Mingun/serde-gff: Реализация формата Bioware GFF для Rust
Java: nwntools-modpacker/src/java/org/progeeks/nwn at master · jakkn/nwntools-modpacker · GitHub

There’s literally dozen others, but I’m not sure that listing them all would provide any benefit to what is already there.

EDIT: Based on this:

I had a quick look at the source and it does not seem like I could find the GFF layout for a BIC file

I think you should spend a bit to read about the GFF format. One generally doesn’t parse the BIC file specifically. A GFF file is very similar to XML, JSON or YAML in that it can encode arbitrary information under a text ‘key’. In fact, it is possible to losslessly convert between GFF and XML/JSON/YAML. So probably the best first step would be to try the command dunahan mentioned already, convert to JSON and see what ‘keys’ the data you care about is under. Then read those keys using any of the generic GFF parsers mentioned above.

1 Like

am looking at my GeneralGFF code to see if i can pull those values out in a simple way.

@Surazal are you okay with translating c# into vb.net?

@kevL_s
Yes, no problem with that - I have coded a little in C# as well, so I should understand the code.

1 Like

@clippy
Thanks for this. Will take some more time to see if I can use this info. I already looked at Niv’s GFF format document, but that didn’t help me understand how to get the fields for the character information I need.

I am probably just too stupid :slight_smile:

its a very intricate fileformat, capable of storing seemingly any type of data … from localized strings to byte arrays …

ok i remembered enough to parse out some variables …

bicvals1

I still have to delete a bunch of stuff that pertains to the .net Gui. Id like to keep the GffReader class intact so that it can be used to grab any data from a GFF (with a bit of coaxing since things like ClassList are a “complex data type” w/ subfields).

However, keeping the reader-class intact means you’d have to translate hundreds of lines of somewhat intricate code … how bout i zip and send it all to you in a day or two and you can decide if you want me to remove any code that you’re sure won’t be used …

Sounds good to me - many thanks

1 Like

Thanks to @kevL_s, I can now get the information I want.

However, does anyone know where I can find some documentation that will allow me to convert the Race and Class numbers into a text description?

Many thanks for any help.

1 Like

Race should be the row# in RacialTypes.2da and Class should be the row# in Classes.2da

 
might have to create lookup tables (or access the user’s .2das directly, perhaps)

1 Like

I think I have it sorted now. I used Leto’s “Lists.leto.xml” file to get the values and it all works now.

Just have some documentation and other tidy up functions to perform before it is ready for release.

2 Likes

Do you plan to handle thr case where a character has a prestige class that’s specific to some module/hak? Or if they have some global override like CPP that adds more classes.

1 Like

@clippy
At the moment, I check if it is a valid class and, if it is not, simply display the class number.

The way in which NIT uses this data, does not rely on the Mod being installed, which I presume is a requirement to access an appropriate 2da file for custom installations. Also, I would then have the problem of trying to locate the 2da file, which does not appear to be a standalone file.

As always, I am open to guidance by people much more knowledgeable than I am.

1 Like