Valhalla Legends Forums Archive | Battle.net Bot Development References | *bni

AuthorMessageTime
Blade_360
What are and how do I use *bni files ??? Since I got them from Blizzard I awsume they stand for Battle.net Icons and I think there the icons for all the icons but still don't know how to use them
December 30, 2002, 1:42 AM
dRAgoN
processing them you could look over bnetd's bniutilitys files. the icons them selves are if i remember standered .tga files.

~l)ragon
December 30, 2002, 6:27 AM
Blade_360
??? Where do I find bnetd's bniutilitys files? I tried searching for them on the new but didn't find anything tried searching on Bnetd's website still nothing
December 30, 2002, 4:09 PM
dRAgoN
bnetds sourceforge page in the cvs archive
December 30, 2002, 6:30 PM
Blade_360
Ok I feel really stupid for this :-[ but I can't find it I went the the CVS Archieves. I found the Bnetd Utilities source code but not the regular >:( could someone please give me an exaclt link or something?
December 30, 2002, 11:05 PM
tA-Kane
I think this may help you...

http://kbserver.homeip.net/kanebot/misc/bni_file.html
January 2, 2003, 9:38 AM
Skywing
Looks good.  Some minor corrections, though:

The first two DWORDs are 0x10 and 0x01, respectively (at least for all icons.bnis which I've ever seen).  They're probably used as a kind of signature to verify that the file really is a bni file, the same as MPQs and BNCache files have a MPQ\x1a or BN3\x1a signature.

If the flags field is nonzero, then it's a flags match (tested with AND, not direct equality, btw! -- "User's flags must be this value for this icon to be valid." is a bit misleading about that).  The product field is included only if the flags field is zero, and the unused zero field after it is always included.

Icons should be matched in the order in which they appear in the file, and after the first match you should stop searching for other matches and display that icon.  Blizzard (0x01), Battle.net (0x08), Operator (0x02), and Moderator (0x04) flagged users are always sorted above other users in that order; although these appear above all other icons in icons.bni, the sort order is hardcoded in the game and is not extracted from icons.bni.

The old icons.bnis started in the top right corner, so it might be a good idea to support that too.  Additionally, the bnetd icons.bnis that I've seen use some format options that have never been used in Battle.net icons.bnis.  Beware!

Just to clairify: The TGA in icons.bni is a strip of icons stacked on top of eachother, with each icon appearing in the same order as it's icon usage fields in the BNI header relative to other icons.

I suppose I'll do some more research on the game's icons.bni processor, and find what it does with that zero field.  Anyways, nice spec :)
January 2, 2003, 2:09 PM
zorm
Thanks a ton Kane, that was what I needed to start working on adding icons.bni support to my bots.
January 2, 2003, 2:44 PM
tA-Kane
Thanks for the compliments, and you're welcome, zorm.

Anyways, I've updated it to include Skywing's corrections and clarifications.
January 2, 2003, 8:31 PM
Adron
Theories about the unknown dword:

It's possible that it's just a string with a terminating zero byte and then zero padding to the next dword.

Also possible that the game name is actually a list of games, each one occupying a dword, terminated with a dword zero. This could be tested with a real game and putting multiple game id's into the same entry.


I'm sure Skywing's investigations will tell us exactly what the dword is. Will be interesting to see if any of these guesses were close.
January 21, 2003, 11:05 AM
tA-Kane
[quote]It's possible that the game name is actually a list of games, each one occupying a dword, terminated with a dword zero. This could be tested with a real game and putting multiple game id's into the same entry.[/quote]

I had thought that at first, but I've not yet found a .bni file with an actual list of entries...

I suppose it wouldn't be hard to emulate the binary/ftp servers, have the game download test .bni files, and see what the results would be...
January 21, 2003, 1:02 PM
Skywing
Adron and I did some in depth investigations into icons.bni tonight; here's a brief overview of what we found:

Battle.snp supports 24-bit and 32-bit TGAs.
The two DWORDs starting the file are really a DWORD and two WORDs.

The first DWORD must be 0x10, and the first WORD must be 0x01.  The second WORD does not appear to be examined by the client, but is always set to 0.

The client supports up to 31 product matches per icon; these are provided in a zero terminated list, which is what that zero field is used for.
January 22, 2003, 12:43 AM
MiLF
is it possible to change your icon by altering what packets are sent?
January 22, 2003, 10:29 AM
Zakath
You can alter several icons: you can ensure that your "lag" icon is always 6 red bars by neglecting to respond to the server's ping attempt during logon. You can also change it to a plug by indicating that you do not support UDP packets. Finally, try becoming the moderator of a channel or squelching someone - both of those things will change the primary icon.
January 22, 2003, 11:12 AM
tA-Kane
kthx Skywing, Adron.

I've updated my Battle.net Icons File document, at http://kbserver.homeip.net/kanebot/misc/bni_file.html to reflect what you two have found.

*nudges Spht to update the file on his documents page*
January 22, 2003, 4:33 PM
Skywing
I've written a program to view and edit .bni files.  You can grab it here.  The editor allows you to use any program which can save TGAs to modify the icon strip itself.  The BNI header itself is provided in a format similar to Visual C++ .RC files.  You should be able to save BNIs with 24-bit or 32-bit TGAs, and both the bottom-up and right-left ordering flags.

This might come in handy for testing your support for rarely used features (the editor also supports setting multiple product matches per icon).
January 25, 2003, 12:00 AM

Search