View Full Version : bif reader

05-31-2001, 10:25
if someone has a file reader that will handle and accurately read the .bif files that shogun uses, please let me know, either here or thru starfire@apex.net.



05-31-2001, 11:05
I'm sure there was someone posting a while back who seemed to hint that they had, but I can't remember who.

06-02-2001, 03:43
While you're at it, let ME know, too! I've got most of the .LBM's done, so the figure images are done. I just need to swap them into the animations! http://www.totalwar.org/ubb/mad.gif

-- B)

06-05-2001, 15:11

from what i've been able to discern, the .lbm files are 'base' graphic files...at least the ones for the units. what i mean by this is that each .lbm file for a unit is a base file from which other things are done to it. i believe there is one base graphic file for each unit type. thus there is one base file for arqu's, one for muskets, one for monks and so on. each .lbm, as you already know if you've been editing them, is a composite of all the facings that a unit can make/have.

what i believe is being done is that there is no animation file per se, but rather it's a composite of files. each base file is loaded into ram at game start and is then 'painted' for its owner's colors. the program calls up whatever sub-image in the .lbm painted file in ram that it then needs to display that facing for that unit.

i also believe that the files used for coloring the base images is the .bif and .txt file found in the same directory as the .lbm file. i believe this was in shogun\textures\men, or something like that.

if you are altering the sub-images in the .lbm file you are therefore altering how ALL units of that type will look, both for you and your opponent(s) and, when the coloring is added for each army it may not color them correctly in the right places, since the .bif and .txt may well be saying we're going to color this pixel in this location. since you've altered, ostensibly the shape of the sub-images, the color may be applied as if the image still had the original shape. i'm not real sure of this, but it could be. it might also just look for certain colors in the sub-images and say, 'change all of color xx to yy'. again, i'm not sure.

.bif files are 'binary image files' or 'binary image format' type files. these files have no header information. they are just raw sequential data files. the header file for these is normally a .txt file. thus, it takes 2 separate files to make this file type work, or, one .bif and a program to input and interpret the data in the raw file.

for a game like shogun, i can see certain advantages in doing things this way; i can also see disadvantages, but it 'appears' to be how they are doing it. this is why we've had such a hard time trying to read the .bif files. they are just raw data, just a string of numbers that mean nothing by themselves.

so, it doesnt appear we can have an orc army fighting a human army, since if you alter any 'human' file you are also altering the 'orc' file at the same time, since they both use the same base file for the images. the only way it could be done, short of adding more programming by the dev guys, would be to make, say 8 of the files to be used by a human army and the other 8 to be used by the orc army and then players would have to agree to only take one or the other during startup.

and that's one of the disadvantages of doing the graphics the way they did. the good news is that ca IS adding more units to the game with the expansion pack, so perhaps something could still be done along these lines.

so, in looking thru the other files in the game you might ask, 'where are all the other .txt files for all those other .bif files?'. remember, i said it takes either 2 files to make a .bif work, or one .bif and program. i suspect the program is loading several different arrays with these .bif data files and doesnt really need the .txt files in those cases.

the last i'll say on this is that i could be completely wrong about this whole mess, but that's the way it seems to me, currently, and roughly.

hope that helps a bit.


06-06-2001, 04:01
Thanks, Kraellin!!! I've made other comments in the other thread, too, mostly about BIF ideas.

As part of my experimentation, I created the new LBMs from the originals, keeping the same dimensions, color palette, soldiers outlines and everything, so the only "change" was in the direct unit figure itself. The original "control" test was just making a big "X" on the chest one soldier set, using a color that was already present in the unit. This was to avoid changing the actual sprite outline, colors, or anything. No consistent success, which was my tip that there was more going on than just reading the LBM. (Drat!)

I was indeed aware of the fact that all armies were using the same sprites, but found a way around that. I was toying with the scripted campaign idea from a million years ago (or at least six months...) and had made a fantasy set, where the YS, SA, YC, CA and WM were for "good" and YA, ND, HC, NG, and muskets were "evil..." I think you get the picture. It was to be a series of six battles, where you are either the noble humans staving off the hordes of darkness, or else you can be bad, and harvest some tasty human corpses for lunch.

Thanks for your insight and ideas! I figure that if we work on this long enough A) we'll figure out what's going on, or B) someone at CA will give us a hint. http://www.totalwar.org/ubb/smile.gif

-- B)