PDA

View Full Version : LBM file info.



giskard
09-21-2002, 06:35
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

barocca
09-21-2002, 11:32
:-(
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...

:-)

giskard
09-21-2002, 13:09
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 http://www.totalwar.org/ubb/smile.gif

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 http://www.totalwar.org/ubb/frown.gif

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

LordGuyOfRome
09-21-2002, 21:47
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

barocca
09-22-2002, 08:03
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...

scsscsfanfan
09-22-2002, 16:23
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?

giskard
09-22-2002, 20:58
Thanks Barocca. I'll check that out.

I hope it works on XP http://www.totalwar.org/ubb/smile.gif

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 http://www.totalwar.org/ubb/smile.gif

Giskard

LordGuyOfRome
09-23-2002, 01:15
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

Wellington
09-23-2002, 02:00
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

LordGuyOfRome
09-23-2002, 06:01
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]

Moorkh
09-23-2002, 21:07
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. http://www.totalwar.org/ubb/smile.gif

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 http://www.totalwar.org/ubb/wink.gif

@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. http://www.totalwar.org/ubb/smile.gif 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.

giskard
09-23-2002, 22:22
Wellington doesnt post much but when he does he certain posts useful info http://www.totalwar.org/ubb/smile.gif

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 http://www.totalwar.org/ubb/smile.gif

Thanks for your help guys http://www.totalwar.org/ubb/smile.gif

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 http://www.totalwar.org/ubb/smile.gif.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).]

LordGuyOfRome
09-23-2002, 23:02
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. http://www.totalwar.org/ubb/smile.gif[/QUOTE]

Er, basically, cause I thought Giskard has some already edited LBMs to test on it, which is not http://www.totalwar.org/ubb/smile.gif Nevermind... http://www.totalwar.org/ubb/smile.gif

G

giskard
09-23-2002, 23:49
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).]

giskard
09-24-2002, 00:17
Muhaaaa Wellington you God type person. I could kiss ya... but I wont http://www.totalwar.org/ubb/smile.gif

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 http://www.totalwar.org/ubb/smile.gif

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 http://www.totalwar.org/ubb/smile.gif

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

Giskard

Wellington
09-24-2002, 00:46
Glad you like it Giskard, but credit where credit's due - kiss the developers of Ultimate Paint - they deserve it.

Nice little package innit!

giskard
09-24-2002, 05:25
Yes, perhaps Barroca can finally rid him self of MS Paint now too http://www.totalwar.org/ubb/smile.gif

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

giskard
09-26-2002, 03:30
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

Wellington
09-26-2002, 04:20
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 http://www.totalwar.org/ubb/smile.gif.

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.

Kraellin
09-26-2002, 04:28
giskard,

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

K.


------------------
http://home.domaindlx.com/takiyama/kraellin/icons-1.gif

giskard
09-26-2002, 22:08
Thanks. That thread confirms most of my theories. Just a few smaller issues to clear up and Im happy http://www.totalwar.org/ubb/smile.gif

Giskard

USMCNJ
09-29-2002, 18:56
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

giskard
09-30-2002, 01:36
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

USMCNJ
10-01-2002, 01:13
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)

USMCNJ
10-01-2002, 01:15
*I'm NOW faced with two problems

giskard
10-01-2002, 06:06
When that happened in my tests it was because the sea region borders where not painted with colour 0.

Giskard

USMCNJ
10-01-2002, 17:16
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