Results 1 to 7 of 7

Thread: GIMP plugin for BIF/BUF/LBM formats

  1. #1
    Needs more flowers Moderator drone's Avatar
    Join Date
    Dec 2004
    Location
    Moral High Grounds
    Posts
    8,721

    Default GIMP plugin for BIF/BUF/LBM formats

    I'll preface this with: I'm not a modder, I'm out of touch, feel free to point and laugh.

    I've searched through the old threads on editing MTW images, and it seems like generating the image files is a bit of a hassle. Would there be any point in creating an import/export plugin for BIF/BUF formats for GIMP? There is an LBM plugin (for Linux anyway, source code available, still looking for a Win binary) out there, so there is a start point. I've got the basics of the BIF format, but I'm sure there are some quirks I'm missing. Would this be useful, or are people satisfied with the current editing technique?
    The .Org's MTW Reference Guide Wiki - now taking comments, corrections, suggestions, and submissions

    If I werent playing games Id be killing small animals at a higher rate than I am now - SFTS
    Si je n'étais pas jouer à des jeux que je serais mort de petits animaux à un taux plus élevé que je suis maintenant - Louis VI The Fat

    "Why do you hate the extremely limited Spartan version of freedom?" - Lemur

    Member thankful for this post:

    Axalon 


  2. #2
    Member Member Axalon's Avatar
    Join Date
    Aug 2008
    Location
    Sverige
    Posts
    666

    Default Re: GIMP plugin for BIF/BUF/LBM formats

    Are you kidding me?!

    The current tools for it is hardly impressive and it is indeed a hassle to create new-bif/buf stuff for MTW1 (and STW1). I don't think many people understand that. Make it work on Windows, I will then install Gimp and give this a serious try. No BS, I could very well be your tester. A key factor will be to make sure the various palettes stays intact and this in the saved results as well, and you should focus on making that stuff work properly with the game. Then this tool will probably offer a very serious alternative to the already existing tools. I fail to see how that is somehow a bad thing.

    Make it work for Windows, Make the palettes stay put (the colour-indexes). I have yet to find the tools that can handle both castle and army-pieces correctly (If anybody knows these tools and where I can get them, then PLEASE post it!). As I understand it, Barocca (former admin) had some tool or magic that could pull it off - however he left the boards in 2008(?) after an disagreement with Tosa and was never seen here ever since (I don't know the details for it). If I had that tool he had, or the ones used for HTW or NTW (for MTW), I certainly would tinker and make changes on both castles and army-pieces (and the ships too) as well for Redux. Make no mistake about it.

    - A
    Last edited by Axalon; 05-07-2012 at 18:02. Reason: clarification...

  3. #3
    Needs more flowers Moderator drone's Avatar
    Join Date
    Dec 2004
    Location
    Moral High Grounds
    Posts
    8,721

    Default Re: GIMP plugin for BIF/BUF/LBM formats

    I will need to look into how GIMP handles the color palette for GIFs, fundamentally BIFs are similar, but I know the indexing of the palette matters (0 = transparent, 1 = semi-transparent(?), any other restrictions?) for the MTW engine. You can run GIMP in Indexed mode, with private indexed palettes, and you can import palettes, so I think it's doable it would just be a question of maintaining the order throughout the import/edit/export process. If worst comes to worst, a temp palette file can be saved when importing.

    The BIF color palette is only 16 bits (5/6/5 or 6/6/4 RGB iirc), not sure how each primary is translated to/from 8 bit (clipped or normalized). RSW's source for the BIF reader is available, I'll look through that to see how it's done and how the compression works. GIFs also can have multiple frames, I believe they are treated as separate layers in GIMP so that should be easy (and GIMP lets you preview GIF animation, might be useful with unit animations).

    Info on BUF files is hard to find. Any ideas on how these work?
    The .Org's MTW Reference Guide Wiki - now taking comments, corrections, suggestions, and submissions

    If I werent playing games Id be killing small animals at a higher rate than I am now - SFTS
    Si je n'étais pas jouer à des jeux que je serais mort de petits animaux à un taux plus élevé que je suis maintenant - Louis VI The Fat

    "Why do you hate the extremely limited Spartan version of freedom?" - Lemur

  4. #4
    Member Member Axalon's Avatar
    Join Date
    Aug 2008
    Location
    Sverige
    Posts
    666

    Default Re: GIMP plugin for BIF/BUF/LBM formats

    Quote Originally Posted by drone View Post
    ... I know the indexing of the palette matters (0 = transparent, 1 = semi-transparent(?), any other restrictions?) for the MTW engine.
    I think you should take an army-piece (any) and have a look for yourself at the index (use the RSW) - there are a lot of indexed colours that matters. The RSW 22.b Bif-reader can't handle that all. All I get is a screwed up file that won't work in the game as it fails to reflect the numbers of each army (or garrisoned in castle). The banner is either empty or full - nothing in between. Obviously, I want to change all that so I can mod and change army- and castle-pieces as well, and still have it functional 100%... NTW, HTW and SW proves it can be successfully done - I just don't know how... And what tool(s) is needed to pull it off.

    BUF are essentially BIFs that can do shadows (semi-transparent, index 001 then), otherwise there seems to be little difference. Other then that I know diddly... :D

    - A

  5. #5
    Needs more flowers Moderator drone's Avatar
    Join Date
    Dec 2004
    Location
    Moral High Grounds
    Posts
    8,721

    Default Re: GIMP plugin for BIF/BUF/LBM formats

    Is the "faction color" color on the model animations a particular index, or is that just a particular color that can be anywhere in the colormap?

    Progress report: I don't write code for Windows, so the degree of difficulty on this task was hazy. After a little googling, I have a build setup in place, and can compile executable code (MingW ftw!). I coded up a basic plugin, installing it into GIMP is easy, just put the plugin's .exe in the plugin directory, and it gets loaded when GIMP starts up. I've written the code to read BIF files and decode/encode the frame data, I just need to go through the GIMP API manual for the right calls to hook in loading/saving images. The existing .ilbm plugin code has most of this, I'll use it as a reference. Once I get BIFs to load and save, I'll start looking into the weird stuff. GIMP lets you do a lot of things through the plugins, so I should be able to write code for colormap manipulation when I figure out the special cases. An old post by macsen mentioned problems editing either shield or flag LBMs in PSPro, Ultimate Paint apparently doesn't corrupt so I will need to sort that out as well.

    I'll go ahead and apologize ahead of time, this might take a while. The code isn't that difficult, but RL is a drag.
    The .Org's MTW Reference Guide Wiki - now taking comments, corrections, suggestions, and submissions

    If I werent playing games Id be killing small animals at a higher rate than I am now - SFTS
    Si je n'étais pas jouer à des jeux que je serais mort de petits animaux à un taux plus élevé que je suis maintenant - Louis VI The Fat

    "Why do you hate the extremely limited Spartan version of freedom?" - Lemur

  6. #6
    Member Member Axalon's Avatar
    Join Date
    Aug 2008
    Location
    Sverige
    Posts
    666

    Default Re: GIMP plugin for BIF/BUF/LBM formats

    Quote Originally Posted by drone View Post
    Is the "faction color" color on the model animations a particular index, or is that just a particular color that can be anywhere in the colormap?
    It is both... Both colour and index matters. Anyways, I'm no programmer so most of what you are saying sounds like Marsian to me (and I never used Gimp either), sorry for that. All the same, I hope you will find time to work on this eventually - I guess I'm stuck waiting for you as I don't have the skills to do this on my own. Otherwise I would. I do hope you manage to make this stuff fly eventually.

    - A

  7. #7
    Member Member Stazi's Avatar
    Join Date
    Jun 2008
    Location
    Poland
    Posts
    272

    Default Re: GIMP plugin for BIF/BUF/LBM formats

    I've finally figured it out!! As usually, when you know how to do it looks quite easy (tedious but easy). It's 97% of work in Photoshop, 1% Pro Motion (LBM for seqgrab), 1% seqgrab (BIF) and 1% Buffy the Bif Slayer (BUF). But.. it's 2 am so if you want more details let me know tomorrow.
    "Do not fight for glory. Do not fight for love of your lord. Do not fight for hatred, honor or faith. Fight only for victory and you will succeed." - Uji sensei.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •