Page 1 of 2 12 LastLast
Results 1 to 30 of 51

Thread: LBM file info.

  1. #1

    Default

    Hello.

    I have been doing a little research into the campaign LBM files in paint shop pro. I have figured somethings out but have yet to get it working.

    The LBM files used by MTW for the campaign use 235 colours. Compressed LBM's reduce the size of the LukMap2.Lbm to about 1.4meg but the original is roughly 700k.

    Trying to use compressed LBM files just crashes the game out though. Uncompressed files dont but they are 12meg in size.

    Also, whilst those files dont crash the game out they seem to loose boundry information and thus prevent the player from moving anywhere. Pressing shift doesnt bring up the owners of a regions colour nor anybody elses.

    The game seems to load in anything from 16bit to 8bit uncompressed LBM's in without any problems. I dont know if PSP always saves the image as a 16bit image regardless of the colour settings I make in the problem.

    If it does that would account for the extremely large LBM file that it creates (12meg instead of 700k).

    I believe the file format MTW expects is 256 colour uncompressed LBM image. There may be some palette attributes I have yet to figure out.

    First colour in the palette is used to determine the sea all boundies. In this case its a purpley Pink colour. The Sea regions do not seem to follow the same rules as land regions. They dont have any colours either side of them other than the regions own colour.

    I dont believe there is any set pattern to the land/sea region colours. I think they just all have to be different so the game can pick out the regions. Only the first colour on the pallete is used more than once it would seem.

    Now I just have to figure out why a simple load and save proceedure stops the LBM image from working.

    It doesnt look like PSP's LBM plugin actually supports the correct LBM options for this game. I may be wrong but the file sizes are twice the size they should be when compressed and 200 times the size when uncompressed. So i believe its not saving them as 256 colours as it should be.

    LBM and IFF between them support colour modes between 2 colours and 24bit. We dont seem to get the choice we usually get when saving off other image formats such as TGA.

    Giskard


  2. #2
    warning- plot loss in progress Senior Member barocca's Avatar
    Join Date
    Dec 2000
    Location
    (*disclaimer* - reality may or may not exist, in some societies reality is a crime, punishable by life)
    Posts
    5,341

    Default

    :-(
    thats why i use the grafx tool,
    a bit hard to begin with,
    but once you figure out the 2 main bugs its fairly straight forward,
    i rarely bother to edit anything in it,
    (sometimes, but rarely)
    i usually convert to bmp,
    use MSpaint to tinker with the file,
    then convert back to lbm.

    ====

    the first bug is the screen resolution,

    use a dos prompt, change to the gfx directory and type "gfx2 /?"
    this will list all the video modes supported
    remember your "preferred" mode,
    open this file in notepad
    "Gfx2.ini"
    scroll down to the last line and enter your preferred mode
    Default_video_mode = 58 ; (default 0)

    58 is mine = 800x600

    ====

    Second Bug is saving files to a new extension, GFX doesn't like doing this,

    so :-
    ensure you have view registered file extensions on in
    view / folderoptions / view for the gfx directory,

    then create a new text document image1.txt
    then change the extension to the file type you want gfx to save to,
    ie :- image1.bmp

    open your origianl image in gfx, then choose save, scroll down the file format list to bmp and choose overwrite original!

    then edit in a program that doesn't "fiddle" with the pallette, and use the same process to convert back to your chosen format...

    :-)
    The winds that blows -
    ask them, which leaf on the tree
    will be next to go.

  3. #3

    Default

    Hello

    grafx tool ?
    Not sure I follow you. Is that a PSP tool or another program. I dont usually bother with PSP, especially since i got photoshop so please bear with me here

    Btw i spent a few hours searching the net for something that supports LBM on the pc and I found a program called Pro Motion that saved IFF and ILBM images.

    I downloaded the trail version and it does list those formats. Trouble is, they are disabled in the trial version so I cannot test them to see if they will work

    I wont be buying it on the off chance it might work. Even if I could justify the paying money for a program for just one single task.

    Looks like and interesting program though so I might explore its functions a bit and see if it is useful to me in other ways.

    Heres the link for it incase anybody wants to try it out.
    http://www.cosmigo.com/promotion/

    There was very little else that would load and save LBM on the PC. On the miggy theres thousands. Might take a look at gimp for the PC. The linux version rox's so hopefully the PC version works just as well. Assuming there still is a PC version.

    Giskard

  4. #4
    Member Member LordGuyOfRome's Avatar
    Join Date
    Sep 2002
    Location
    Rome,Italy
    Posts
    19

    Default

    About the LBMs files.. I can't test it cause GFX (nor the BIFreader) wants to cooperate with me, but what happens if one modify the LBM files in PSP, save them as BMPs, import them into GFX and save them into LBMs from there? Not like the old proggy does the magic of saving them in the size we need? anyone tried that yet?

    regards

    G

  5. #5
    warning- plot loss in progress Senior Member barocca's Avatar
    Join Date
    Dec 2000
    Location
    (*disclaimer* - reality may or may not exist, in some societies reality is a crime, punishable by life)
    Posts
    5,341

    Default

    Grafx is available from the downloads section of the org,
    shogun files / tools

    ====

    i have not tried editng in photoshop, it is not a package that i use.

    the lbm is an ancient format, that was way ahead of it's time, and in some ways is still unique.
    I would imagine that any pure PC/windows based graphic editing software may cause similar errors to the ones Giskard is having.

    MSpaint was developed when windows was nothing more than a dos shell, does anyone else remember windows 2.0?
    - and yes i know windows it STILL a dos shell, MS just "hide" it a little better now...
    The winds that blows -
    ask them, which leaf on the tree
    will be next to go.

  6. #6
    Member Member scsscsfanfan's Avatar
    Join Date
    Sep 2002
    Location
    Adelaide, Australia
    Posts
    145

    Default

    hi guys, I've found the unit icon folder and tryed to change the picture, but why it dosen't show up in the game - I mean, in the unit production panel and info panels?
    Is there anything else I need to edit as well?
    could any one tell me?

  7. #7

    Default

    Thanks Barocca. I'll check that out.

    I hope it works on XP

    BTW Im an Ex Amiga user, never had to suffer windows 2.0 or 3.1. Hand a nice gui to work with and an excellent Shell back in those days

    Giskard

  8. #8
    Member Member LordGuyOfRome's Avatar
    Join Date
    Sep 2002
    Location
    Rome,Italy
    Posts
    19

    Default

    Quote Originally posted by barocca:
    i have not tried editng in photoshop, it is not a package that i use.
    [/QUOTE]

    You haven't lost much, cause Photoshop doesn't support LBM files at all. I do not know if there is any plugin that adds the feature either.

    regards

    G


  9. #9
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    The best LBM editor i've found is Ultimate Paint (vers 2.82). The browse feature is particularly nice for displaying thumbnails of all LBM files in a directory. I've been using it for modding the units.


    Download it here, and give it a try -
    http://www.downseek.com/download/3373.asp

  10. #10
    Member Member LordGuyOfRome's Avatar
    Join Date
    Sep 2002
    Location
    Rome,Italy
    Posts
    19

    Default

    IT WORKS!!!!

    I mean, I don't know if it does, but the .lbms saved with it have roughly the same size than teh original (5-8 Kbs more)... now, could someone (Giskard?) test them to see if they crash the game?

    Regards

    G

    Quote Originally posted by Wellington:
    The best LBM editor i've found is Ultimate Paint (vers 2.82). The browse feature is particularly nice for displaying thumbnails of all LBM files in a directory. I've been using it for modding the units.


    Download it here, and give it a try -
    http://www.downseek.com/download/3373.asp
    [/QUOTE]


  11. #11

    Default

    I'd gladly test your .lbms if you could make them available to me (why don't you test them yourself?), just send them to moorkh@zworg.com.

    I suppose you actually got that grafx program to work? I had some trouble running it under Win2k, but then I didn't have barocca's instructions

    @giskard: the 12mb uncompressed are just how large an image of this size has to be. Consider: it's around 3000x4000 pixels, 12 million altogether, in 8bit color depth. That's 96m bits altogether, or 12Mbytes. If you save this as a 16bit uncompressed image, it should end up sized 24mb. Anyway, it's great to hear the engine technically accepts 16bit images - otherwise we'd be stuck at 127 regions at most. Still, I'm pretty sure we'll need this tool Target mentioned to get any new campaign maps don - either that or finding out how borders are encrypted into the file by this tool.

  12. #12

    Default

    Wellington doesnt post much but when he does he certain posts useful info

    Thanks mate.

    Dont worry I'll be testing both programs out later today. I'll let you know what I find.

    Fingers crossed this is what we have all been waiting for. Now all we need is ingame support for total coversions and I will be a happy man

    Thanks for your help guys

    Just for record, im simply saving the LBM files and testing them unmodified in the game (unmodified except for a the Gisk was ere text across the med .Well i needed to know if the new image was actually being used or not hehe.

    Giskard

    [This message has been edited by giskard (edited 09-23-2002).]

  13. #13
    Member Member LordGuyOfRome's Avatar
    Join Date
    Sep 2002
    Location
    Rome,Italy
    Posts
    19

    Default

    Quote Originally posted by Moorkh:
    I'd gladly test your .lbms if you could make them available to me (why don't you test them yourself?), just send them to moorkh@zworg.com. [/QUOTE]

    Er, basically, cause I thought Giskard has some already edited LBMs to test on it, which is not Nevermind...

    G


  14. #14

    Default

    No need to have premade ones to test. Just need to mess with the existing ones. TGAs work fine. The problem is what happens when you load and save the original. Which should mean a file that already works and is known to work still works. However we know thats not the case. So we know the saving of the image is the problem.

    Ok GFX2.

    This runs our memory with these LBM files. It is a dos exe (Barocca is insane lol) after all and needs all the himem stuff id guess. It prefers to load files from its own directory to. Couldnt get it to load files else where.

    Wellingtons program achieved slightly better results but still didnt fix our little problem.

    Basically its a shareware windows program and a very nice one too. The game loads when the newly saved LBM files. The problem is it screws up the regions. You can see some regions change colour just like you do when you hold down shift. Unfortunately i wasnt holding down shift. It also prevents you from moving pieced about so we still have the same problem.

    On the plus side it seems to do better than PSP did so perhaps a setting some place may make it work for us. This program has a lot of settings for iff/ibm files too so all hope is not lost yet.

    I will keep experiementing with it for now.

    Giskard

    [This message has been edited by giskard (edited 09-23-2002).]

  15. #15

    Default

    Muhaaaa Wellington you God type person. I could kiss ya... but I wont

    Wellingtons program does work. It just messes with the palette. I did a little test and painted the purpley/pink areas over using colour 0. Eg the first colour on the pallett and it worked. The game loaded, the units moved, the regions showed up when i pressed the shift key.

    Even though i didnt bother repainting odd purple bits like islands, it still worked.

    Anyway here are the details using program wellington posted in the forum.

    Save the image as an 256 colour LBM.
    All sea borders (the purpley/pink bits) have to be painted with the first colour on the palette or it wont work.

    Dead easy

    It also looks like the seaborder is not a thin line because my paint attempt was done using the fill tool and it covered move of the map first click.

    Just watch for changes to your palett when loading into Ultimate paint.

    Thank you all

    Im off to put my old skills into use for MTW.

    Giskard

  16. #16
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    Glad you like it Giskard, but credit where credit's due - kiss the developers of Ultimate Paint - they deserve it.

    Nice little package innit!

  17. #17

    Default

    Yes, perhaps Barroca can finally rid him self of MS Paint now too

    Got started on a new campaign map. The LBM colour maps are all painted, just need coverting to 256 colours and saving as LBM now (cannot wait to see how it messes up my colours hehe).

    Got the terrain rendered, no names on the map yet though. Still trying to decide whether i should stick with the names for regions the developers used or go with some custom names. Sticking with the dev names has the advantage of using what I know already works.

    giskard

  18. #18

    Default

    I have made my own LBM file and im currently writing a campaign script to use it. Those of you that read the guide to making a campaign will have noticed that border regions require the coordinates of the border to be set. I believe I understand how this works now.

    The LBM file is actually the most important file. I believe the TGA pic is just a background image to please the eye. If true then you could test your campaigns with a picture of darth vader just to see if it works.

    Each region in the LBM is painted a slightly different colour and the regions all have a border zone painted in too, again a slightly different colour. The way I think this works is that the coordinates required are simply away of choosing the colour that will represent the border. Probably by its location in the palette rather than the colour it self.

    When playing the game and you move your pointer over the border some info pops up. I believe this is only possible because the computer is told in the campaign script that the colour at this position in the pallett matches the region info listed on the same line and displaces it.

    A simple case of coordinates giving the location the computer needs to look to find the colour that represents a region or border. This means all regions and borders need to use a different colour. I still need to test is there is a set palette that needs to be used.

    Giskard

  19. #19
    Senior Member Senior Member Wellington's Avatar
    Join Date
    Sep 2002
    Location
    Den Haag, Netherlands
    Posts
    1,442

    Default

    Giskard,

    FYI - As the map defines 243 areas/provinces, each being a different colour on a 256 colour palette, I strongly suspect that colour number of these areas/provinces equate to the identifiers in the scripts (ID_SCOTLAND, ID_WALES etc .

    EG: If Scotland has the colour number 6, the identifer ID_SCOTLAND also equates to 6.

    Therefore, if you swopped the colours in the LBM for the areas Scotland and Wales (for example), all characteristics in the campaign scripts associated with Scotland would now be attributed to Wales, and visa-versa.

    I suspect you know this already, but may be useful if you want to change region names in a future mod.

  20. #20
    Senior Member Senior Member Kraellin's Avatar
    Join Date
    Nov 2000
    Location
    Here
    Posts
    7,093

    Default

    giskard,

    i bumped the thread you need to read. it's this one: http://www.totalwar.org/ubb/Forum5/HTML/000655.html

    K.


    ------------------

  21. #21

    Default

    Thanks. That thread confirms most of my theories. Just a few smaller issues to clear up and Im happy

    Giskard

  22. #22
    Member Member USMCNJ's Avatar
    Join Date
    Sep 2002
    Location
    Clifton, NJ
    Posts
    388

    Default

    hey giskard can you post the number for that color. The one that is suppose to replace the sea borders. Cause for me that color is black, and needless to say the game is all meesed up.
    Thanks
    MILLER: I wish we lived in the day where you could challenge a person to a duel.

    MILLER: Now, that would be pretty good.

  23. #23

    Default

    All my tests showed it had to be the first colour on the palette. It didnt matter what the colour was as long as it was the first colour. However, you are not allowed to use the same colour twice so if your first colour is the same as another colour used else where it will mess up your map.

    Giskard

  24. #24
    Member Member USMCNJ's Avatar
    Join Date
    Sep 2002
    Location
    Clifton, NJ
    Posts
    388

    Default

    ok, i'm making progras, the game loads and the shift key works (for most provinces).
    All i did was open the LukMap files with Ultimate Paint and saved them. (no changes)

    i'm not faced with two promblems.

    1) some of the provinces shine threw. What i mean is that some of the provinces have shade of color from LukMap. And it's not a little shade it's so bad that i can barely see the name of the provinces.

    2) all the provinces are messed up, and in no particular order. ex. The english provinces are now parts of France, Egypt, and Some of the Mediterania sea regions.
    Now from the LukMap looks like that each fraction provinces are shaded in simular colors. (england red, france green, etc.)
    so i thought that this would explain why england exchanged provinces with france. But after looking around through the whall map. I noticed that most of the see regions are now land, and there is no patern for these changes.

    Does anyone know what i'm doing wrong and how to fix it. Or is it that if i want to make a new map i have to look through the whole in game map and write down new color/location to all 140 sea and land regions. (this would rely suck cause all my MOD requires is a couple additional province in africa, and asia, europe doesn't need much changing)
    MILLER: I wish we lived in the day where you could challenge a person to a duel.

    MILLER: Now, that would be pretty good.

  25. #25
    Member Member USMCNJ's Avatar
    Join Date
    Sep 2002
    Location
    Clifton, NJ
    Posts
    388

    Default

    *I'm NOW faced with two problems
    MILLER: I wish we lived in the day where you could challenge a person to a duel.

    MILLER: Now, that would be pretty good.

  26. #26

    Default

    When that happened in my tests it was because the sea region borders where not painted with colour 0.

    Giskard

  27. #27
    Member Member USMCNJ's Avatar
    Join Date
    Sep 2002
    Location
    Clifton, NJ
    Posts
    388

    Default

    Giskard can you post the map on website or email it to me. I've tried 40+ different colors and spend like 15 hours, and the same thing keeps on happening.

    USMCArtilleryNUKE@yahoo.com
    MILLER: I wish we lived in the day where you could challenge a person to a duel.

    MILLER: Now, that would be pretty good.

  28. #28
    warning- plot loss in progress Senior Member barocca's Avatar
    Join Date
    Dec 2000
    Location
    (*disclaimer* - reality may or may not exist, in some societies reality is a crime, punishable by life)
    Posts
    5,341

    Default

    Going to Try and gather all the LukMap posts into this thread
    Please Stand By

    From Target

    The lukmap.lbm files have 3 purposes. The first is to highlight the selected regions. The second is to display the borders between the land regions. The third is to act as a hotspot map for mouse interaction on the stratmap.

    This is how the interaction works:

    Each land region has two unique colours and each sea region has one unique colour. When the player uses the mouse on the stratmap, the x/y co-ordinates of the mouse on screen are translated to x/y coordinates on the lukmap.lbm file.

    The game asks for the colour that's at that particular x/y position on the lukmap file and compares the answer with a table that then tells it which region is associated with that particular colour. In this way, the game can find out which region you've floated over or clicked or dropped pieces into, and so on.

    The numbers in the SetBorderInfo:: lines in the startpos files aren't used for anything any more. Originally, there was a stratmap piece either side of each a border between countries, and right clicking on it would bring up info about that particular border's characteristics. Then, the whole border characteristics thingy was incorporated into the region border info parchment (where you select a border, rightclick to bring up the parchment and then float the mouse cursor over the border's neighbours to get information about what the terrain would be like if you crossed the border in that direction ).

    These pieces were in the shape of arrows of 16 frames. The numbers you're asking about are the x/y placing coordinates on the map for these pieces, followed by the orientation. Pretty much exactly the same way the SetPort:: command works. The numbers are huge because they've been converted to the coordinates that the game uses, rather than those of either lukmap file. Oh, and most of the orientations are 0 because the whole process was abandoned before it was completed, thank God.

    Edited to correct a whole slew of spelling mistakes.

    (etc.) of GilJay, (etc.)



    The winds that blows -
    ask them, which leaf on the tree
    will be next to go.

  29. #29
    warning- plot loss in progress Senior Member barocca's Avatar
    Join Date
    Dec 2000
    Location
    (*disclaimer* - reality may or may not exist, in some societies reality is a crime, punishable by life)
    Posts
    5,341

    Default

    From Kraellin

    target,

    so, would it be correct to say that one could edit the shape of the map and that as long as the same colors were used, one could ..reconfigure.. europe? i'm assuming the table you're referring to is hardcoded, yes? ("The game asks for the colour that's at that particular x/y position on the lukmap file and compares the answer with a table that then tells it which region is associated with that particular colour.") and if we had access to the table, ..if.., we could edit things like the names of provinces and so on?

    K.
    The winds that blows -
    ask them, which leaf on the tree
    will be next to go.

  30. #30
    warning- plot loss in progress Senior Member barocca's Avatar
    Join Date
    Dec 2000
    Location
    (*disclaimer* - reality may or may not exist, in some societies reality is a crime, punishable by life)
    Posts
    5,341

    Default

    From Target

    I was probably a bit misleading because I was trying to keep it all in laymen's terms rather than get overly complicated.

    Yep, you can change the shape of the countries and move their position around and whatnot so long as you stick to a few rules.

    The lukmaps are in lbm format which is a file format that supports a 256 colour palette. This palette acts as our lookup table and it built into the picture file rather than the game itself.

    So, you float over the map and the game goes to find out which colour corresponds with the mouse's current coordinates. Once it's found that it then searches through the palette, looking for the colour, and then returns with a palette index. The index is run through a quick calculation and end up with a region number, which is what tells the game which region the user is currently interested in.

    It's very important that the palette is made up of 256 different colours, because the search will return the first index that matches the colour we've got and then stop. If the colour in palette slot 46 is the same as the colour in palette slot 22, the game won't be able to tell which region is which and invariably mess up.

    The land regions get 2 colours each (one for the main body of land and one for the border) and the sea regions get one colour each. We allowed for a maximum of 40 sea regions, which left enough space for 108 land regions. We only use 100 land regions, and that's the limit for the game (and any mods you guys decide to make). Someone asked in a different thread why we didn't have more regions in the game and one of the reasons is the limiting factor of the 256 colour format of the lukmap file.

    What else? Nothing's stopping you from editing the names of the provinces, since these are all found in the translation files. These can be found in the loc directory and are completely defenceless, allowing you to hack them to bits to your heart's content.
    The winds that blows -
    ask them, which leaf on the tree
    will be next to go.

Page 1 of 2 12 LastLast

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
  •  
Single Sign On provided by vBSSO