You must be logged in to post messages.
Please login or register

AoW1 Mod Packs
Moderated by Enginerd, Ziggurat Mason

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: reading a .ILBv1.1 (same news and update )l
posted 07-05-03 04:18 PM EDT (US)   
i paste this from notepad, so there could be trouble for format :

reading a file .ILB version 1.1
by NEKRALL
nekrall@libero.it

send me an e-mail if you like my work or to tell me trouble you find or if you have any question, note i'm italian ,do you like my english? (it's my first work!)

-----------------------------v1.1 UPDATE--------------------------

yuph! i wrote lib instead of LIB
i've discovered image lenght has to be precise.
i've discovered some other header's feature.

--------------------------------START----------------------- ----
this guide provides informations about decoding a file .ILB so you can make your personal libraries for your AoW MOD.
i'll explain meaning of codes using the file ShieldsM.ilb as example because it's first file i've edited, but other .ilb work as well.
please be careful when editing a file , always make a copy and store it in another directory!
if you make heavy alteration to a .ilb Aocge usually will not open it but don't worry,AoW still run it (if you make the right changes obviously)

oohh!!! read my intro about hex numbers with care

let's go!!!

a file .ilb usually is made up by 2 parts:
headerS part, where info about using images are stored
data part , where images are stored


to edit the file you must open it with an exadecimal/ascii editor (i'use UltraEdit32)
now you can see 3 columns :
1° row address
2° exadecimal code (HEX)
3° ascii code

each ascii simbol is made by a couple of exadecimal numbers
each ascii row contains 16 simbol
each exadecimal row contains 16 couple
there's no difference between normal and capital letter in HEXcode

everytime you change 2° column you change 3° column as well and vice versa
NNNBBB: always change 2° columns because many hexadecimal codes share same ascii code , exception :editing text like " elf.bmp" in 3° column is faster

i'll use this rules in my guide:

i use plain number for decimal number ( es : 12)
i use 'h' after exadecimal number ( es: A1F2h)except when i refer to 2° column where all number are exadecimal
i always refer to positions in ascii columns , ultraedit tells your actual position in ascii column on to the bottom of the window both in exadecimal and in decimal numbers
i mark vital information with '!'
i mark unknown info with'?' don't touch them

NNNNBBBBB: numbers greater than FFh are splitted between more couple in REVERSED order example : 63262=F7IEh become 'IE F7' in 2° column

if you got trouble with exadecimal-decimal conversion open the calculator of WINDOWS (under the start menu , find it) click on 'view' and select 'scientific'

now let's go to see how a lib is made:

1° row : contains the word LIB and same other useless ( i'think) informatins
2° row : codes 1-4 , first image starting point !!!!!!!!!!
codes 5-8 , LIB total lenght ( useless,you can change real lenght without changing this)

these are standard info for all lib , after that in race .ilb you can see a pack of strange rows ( ??) and then the header codes,in shieldM.ilb there're immediately header codes.

so let's see the header codes (vital info), open aow/int/shieldM.ilb and follow my explanation:
each header is made up of 74+ codes ( i 'think), because there are different type of header; there's a header for each image in the .ilb.

now you can see the name of each image in the ascii column,
put your cursor onto the SECOND name'shieldM'(i'll explain why later) , this ISN'T the header start but you can recognize always it, you are on a 'S' if you take a look on 2°column you can see code'53h'

move backward 13 codes exactly after the 'ÿÿÿÿ' : you're on '01h',this's the start of a header and this's the image index (NB 2° image has index 01h),IT'S THE SAME INDEX AOCGE SHOWS YOU on each image.
(NB: if you move backward from 1° 'shieldM' you'll find '00h' because 1°image has index 00h and there aren't the 'ÿÿÿÿ')

move forward 3 codes onto '16h', this's instruction type ,
in this LIB you'll find type 10h,12h,16h.
each is different i'll explain later.

mov fw 4 codes onto '03h' ?????
mov fw 1 code onto '0Ch' this's image name's lenght (includes .bmp) !!!
mov after 'bmp' onto '28' this's image width in pixel !!!
mov fw 3 onto '35' this's image height in pixel !!!
mov fw 12 onto '01' useless
mov fw 4 onto '01' ???
mov fw 1 onto '68' this and the next 3 codes tell how greater image is, example : you can read '68 0d 00 00h' ->'d68h'(you remember how to read number greater than FFh?) -> 3432 that's number of ascii code image takes.!!!!!
next 4 codes '18 0c 00 00': this's image offset,
it's added to the number in 2°row to get image beginning!!!!
next code '28' image width repeated , change always both !!
mov fw 4 onto '35' image height repeated !!!
mov fw 5 onto '01' ??
mov fw 7 onto '10 93 50' this's ending of standard header , you can notice there are other codes because this's a type'16h'header
see it:
mov onto '27' this's real image width!!!!
mov fw 4 onto '2c' this's real image height!!!
mov fw 8 onto '04' this number seems to control starting height in the box (null rows above image) !!!
mov fw 4 onto '0a' ???
mov fw 4 onto 'ff ff ff ff' (=ascii 'ÿÿÿÿ') this's default after each header

next start another header ('02h' , 3°image)

types of header :
'16h' : this's first type you can see, after the 'PV'(ascii) there are info about resizing of images , example :shields are 43x59 pixel but the Human shield is only 40(28h)x53(35h) if you put it directly in the 43x59 box it appears messed up so you must resize.

'12h' : this is 2° type before the ending 'ff ff ff ffh' there's '14 60 46 00' , i can't figure how does this work , i think it's used for transparence because this shields are placed in the event box , it's used for the shields 14-26(0Dh -1Ah)

'10h' : 3°type , used for shield 27-39, header finish after 'PV'(ascii) , used for images that doesn't require resizing


QUESTIONS AND ANSWER:

-why do i start from 2° image?

because 1° image start with '00h' and there isn't ÿÿÿÿ before,now you can find 1° header by yourself.

-can i change one image with one other in same file?

this is simple : open the .ILB with aocge and decide which image swap then edit the lib swapping the index number of the two images
example :if you want AoW using azrac shield for humans and viceversa find the index ( first code of each header) '00h','0Dh','1Bh' and swap with '01h','0Eh','1Ch'
this's a very simple hacking, you can't assign same shield to 2 races but continue to read...

-can i use same image for 2 or more box?

yes, change the offset (starting point) of the image , remember to change also width and height .
example : azrac shield('01h') start at '18 0C 00 00' width '28' height '35' resize widht '27' height '2c' , i'll overwrite them with '00 00 00 00''28''35''24'2b' (change also image lenght!),save and finish.
Now Azracs got human shield too.

-can i swap image also between different header type ?

yes, if you put a image type 10 or 12 onto 16 you got no problem simply remember to resize all if you put image on type 10 remember to use width and heigth of the resizing window ( lesser value ,ok?)
if you put image 10 on type 12 you must delete the last bites until it look like type 16 then change image offset on the 2° row

-why images have different lenght ?

only first 26 shields have variable lenght because they use a lesser number of pixels, images 27-39 are all 43x59 ,
NB each pixel has a code of 2 couples like '00 0a' ( 16bit)
so images 27-39 need 43x59x2=5074 ascii codes

-can i edit images ?

not for now, you can change them pixel x pixel , but are you sure you want it?
aocge doesn't function properly , it opens the .ILB ,converts it to bitmap , but when reconverts use a slightly different codification.

-does this sistem work for all .ILB?

yes, swapping index always work , other sistem require an analisys of the header type ( many types exist with added features)

-can i swap images between different .ILB?

yes, but you must paid great care.
i swap city images from highmen in the halfling ilb so i've got yellow banners on high castles .
note that quite always images will be of different size so you must change offset and lenght.
i will not explain how i made but you can manage it with a bit of practice and using my guidelines above.

-i've changed image but it appears all messed up, why?

when you change one image you must change the header as well
vital info are : width , height, image lenght,address offset
please note that if you insert an image LONGER you must change header info also in other headers, if you put an image SHORTER simply insert null pixel( '00 0Ah') until you reach old lenght

-can i change image name ?

yes, if you don't change name lenght it's all ok
if you write a shorter name insert empty spaces
if you write longer you must change the name lenght in the header and starting offset in 2° row
note however names aren't never used so you haven't to change them to run aow


send your notes and questions to nekrall@libero.it
thanks for reading

[This message has been edited by Nekrall (edited 07-05-2003 @ 04:26 PM).]

Replies:
posted 07-09-03 03:18 AM EDT (US)     1 / 3  
Yesterday we manage to change building tiles

-Can I change the gfx tile which appears when I click on a building?

Yes, you can. The original gfx are stored in \Image\Border.ilb. You can open it with AoWCGE, but you cannot reimport correctly the file.
But there's a little trick.
Open DevEdit, click on the building and go to the layers. If I remember correctly the tiles are assigned to the 30,31,32 layers. If try to change them you'll see you could select images not only from border.ilb, but from a wide range of library, expecially you could seòect the FACE.ilb.
Now the trick: AoWCGE work perfectly to import faces, so you could import your new tiles as a portrait and then use it. Portraits and tiles don't share the same dimensions, portraits are larger and lower (I don't remember the exact values, but you can calculate them exporting Border.ilb to bmp by AoWCGE), so you must use same attention.
Note that the tiles are made by 3 image: one liiiittle (it is tall only a bunch of pixels), one average (usually the tile sky), one big (the main tile). They are assigned in this order to the layers. After same tries I got that the best way is to assign to the first level one original tiny image, to the third level the new main image, to the second a image to fill the gap. Only the left side will be visible during the game and what you see in the game IS NOT what you see in map editor.

P.S.: xSmurfhero: cause the portrait are recognized correctly, why don't you insert an option to import images encoded as portraits but with the tile size? Well, three options: one for little_tiles.ilb, one for average_tiles.ilb, one for big_tiles.ilb.
It's a good idea, not is?

posted 07-09-03 06:18 AM EDT (US)     2 / 3  

Quoted from Dhuval:

P.S.: xSmurfhero: cause the portrait are recognized correctly, why don't you insert an option to import images encoded as portraits but with the tile size? Well, three options: one for little_tiles.ilb, one for average_tiles.ilb, one for big_tiles.ilb.
It's a good idea, not is?


Yes it is. Actually I was already working on a 'custom image type' import where you can specify your own height & width. But I still think I can fix the tiles ilbs as well. I am only working on too many features at the same time, so none of them get finished ...

SmurfHero - Leader of the Smurf race
posted 10-10-03 02:40 AM EDT (US)     3 / 3  
I see that in a old topic Smurfhero tryed to change the TCombatMap association. Had you got something about it?

P.S.:and now also this topic is visible

Age of Wonders 2 Heaven » Forums » AoW1 Mod Packs » reading a .ILBv1.1 (same news and update )l
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Wonders 2 Heaven | HeavenGames