Go Back   the Magicball Network > Forums > LBA Modifications > LBA Modifications - General
Buy LBA1/Relentless from GOG.com Buy LBA1/Relentless from DotEmu Buy LBA2/Twinsen's Odyssey from DotEmu Buy LBA2/Twinsen's Odyssey from GOG.com Buy Little big Adventure from GOG.com or DotEmu Buy Little big Adventure 2 from DotEmu or GOG.com

Welcome to the Magicball Network.

You are currently viewing our site as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Reply
 
Thread Tools
  #1  
Old 2007-05-05, 22:02
1nick 1nick is offline
Magic Level: Yellow Ball
 
Join Date: May 2007
Location: Prague
Posts: 5
LBA 2 ILE and OBL file formats

Hi there,

Nice to meet you all. I'm Nick and new to this forum even though i've been browsing it for quite a while. Many thanks from the start for all of you who maintain and post in this forum.

I am playing around with the game files and i bumped into this problem when trying to decifer what those two files contain.
I've been looking into them with the package editor and the information there is useful but by far incomplete.

Ok, let's take citadel.ile

I understand that the file contains a 256 bytes header, two 65KB texture tables (for ground and buildings) and then is divided in 9 parts that make up a so called "island". Speaking of which, even though i think you allready talked about it, can someone explain the compression algorithm? is it the same as for hqr files?

Question 1: How is the texture data organized? So far i guess that in each of the 2 texture tables there are 16 textures each 64x64 pixels large. My guess is that each pixel in the texture is actualy a 0..255 color palette position index. Are they really 64x64 or another proportional size?


Then, each of the 9 parts is divided into 6 smaller ones, each containing the same information but for a different zone in the island.

One of my questions about it was how the 9 different zones are connected to each other. I answered to myself looking at the 256 bytes header with a HEX editor. If you look at it it is very clear that the zones are connected in a square grid like manner which is depicted in the file with 01 02 ... 09 numbers somewhere in the middle of the file (the other bytes are zero so it's very easy to see).

Ok, so there are 6 information categories in each of the 9 areas:
1. Object Information - Always 40 bytes
2. Building Information - Size varies
3. "Sea information" - Always 32768 bytes
4. Background textures - Size varies
5. Surface 3D data - Always 8450 bytes
6. "Clouds information" - Always 4225 bytes

Question 2: Except 3 and 6 all of the names are self explainatory, but I don't understand what Sea Information or Clouds Information is supposed to mean. Another puzzle is where can you find out in the file the block sizes of sections 2 and 4. It should be in the header but the 256b header only contains information on how the 9 areas are drawn on the screen relative to each other.

The 1st section is obviously pointing to the similar OBL file and probably an object index, like "this area uses following objects from the OBL file: a, b, c,...". What puzzles me is the placement of those objects. could it be that it is also a rectangular grid like table considering that the game uses tiles a lot? Speaking of which, I have no idea about the data format in the obl file even though i guess is pretty x,y,z.

The second, Building Info, eventhough the size of the block varies, it is never too big, so in my opinion is not 3D data so it may point to the OBL file as well. How exactly, beats me.

The same with the background textures. By the way, what backgrounds are we talking about here?

And the final ... the 3D surface data. How exactly this information is organized (this is BigQuestion 3)? I tried many solutions but ended up with just a bunch of nonsense triangles rendered.
So here goes: The block is always 8450 bytes in size. I know is 3D, which means there has to be some x,y,z coordinates for the triangles inside the block, but where exactly are they i don't know. Aside this, there has to be some color information and even texture coordinates. In some code i found here on the forum from Yaz0r (which i thank a lot already) i found out that the block is unsigned int16 which leads to only 4225 integers. But this number only divides corectly to 5 and 13. any more than that would lead to a very small amount of triangles. If this block is divided by 5, then i assume is x,y,z,color and texture but no uv mapping. If it is 13 then there are too many things to be considered and too few triangles. Can someone shed a alight on the matter?


Many thanks in advance for whoever posts.

Cheers and nice weekend
Reply With Quote
  #2  
Old 2007-05-05, 23:13
LBAWinOwns's Avatar
LBAWinOwns LBAWinOwns is offline
Magic Ball Master
 
Join Date: Mar 2004
Location: Sweden
Posts: 5,570
Send a message via MSN to LBAWinOwns
Yazor has done a viewer of LBA2 3D scenes I think. You can try to ask him.

Thank you for documentation .
__________________

LBA Image Creator project
(image by leoboe! )

Get the Jump-Save-Bug graphically explained here
Reply With Quote
  #3  
Old 2007-05-06, 00:35
Battler's Avatar
Battler Battler is offline
Welcome to Zirla!
 
Join Date: Apr 2004
Location: Koper, Slovenia
Posts: 5,316
Send a message via ICQ to Battler Send a message via AIM to Battler Send a message via MSN to Battler Send a message via Yahoo to Battler
- 1nick: The format of the entry, that has the size of 8450 bytes, is as follows: each two bytes represents a 16-bit point in the map, and more specifically, its height. It's a total of 65x65 points in the map, their X, and Y coordinates are easy to get (each ranges from 0 to 64), and the Z coordinate is the 16-bit value (the height), which ranges from 0 to 32767.
__________________
Join #doki-doki on irc.ringoflightning.net for some nice chit-chat about anime, manga, and other aspects of Japanese culture now!
Reply With Quote
  #4  
Old 2007-05-06, 01:03
1nick 1nick is offline
Magic Level: Yellow Ball
 
Join Date: May 2007
Location: Prague
Posts: 5
Thanks for answering.

I have another question though. Ok, the file is a 65x65 grid of short ints (16 bit). From what you say i get 4225 points from this. The question is: how are the points connected to each other? And onther one: isn't the height too high? I mean, if you have vertexes with x and z coordinates ranging from 0 to 64 and a y coordinate ranging from 0 to 32767 isn't it going to be a bit unproportional?

Thanks
Reply With Quote
  #5  
Old 2007-05-06, 01:12
1nick 1nick is offline
Magic Level: Yellow Ball
 
Join Date: May 2007
Location: Prague
Posts: 5
Oh yeah, got it now and renders the file corectly. But the second question is still on. My opinion is that i have to clamp the height value to a 0..64 range also to display proportionaly
Reply With Quote
  #6  
Old 2007-05-06, 03:01
Battler's Avatar
Battler Battler is offline
Welcome to Zirla!
 
Join Date: Apr 2004
Location: Koper, Slovenia
Posts: 5,316
Send a message via ICQ to Battler Send a message via AIM to Battler Send a message via MSN to Battler Send a message via Yahoo to Battler
- 1nick: Yes, you have to scale the value from the range 0 to 32767, to the range 0 to 64.
The easiest way to do that, would be to divide the height by 32767, and then, multiply it by 64, and in the end, convert the result into an integer.
__________________
Join #doki-doki on irc.ringoflightning.net for some nice chit-chat about anime, manga, and other aspects of Japanese culture now!
Reply With Quote
  #7  
Old 2007-05-06, 13:31
xesf's Avatar
xesf xesf is offline
Magic Ball Master
 
Join Date: Sep 2002
Location: Dublin
Posts: 7,766
First of all welcome to the forum. Hope you like your stay.

Quote:
Originally Posted by 1nick View Post
Question 1: How is the texture data organized? So far i guess that in each of the 2 texture tables there are 16 textures each 64x64 pixels large. My guess is that each pixel in the texture is actualy a 0..255 color palette position index. Are they really 64x64 or another proportional size?
The texture are normal LBA image like the intro screens, etc.. They are exactly like that, each byte correspond a color index in the palette. You can see those texture with LBA Screen Viewer.


Quote:
Originally Posted by 1nick View Post
Question 2: Except 3 and 6 all of the names are self explainatory, but I don't understand what Sea Information or Clouds Information is supposed to mean. Another puzzle is where can you find out in the file the block sizes of sections 2 and 4. It should be in the header but the 256b header only contains information on how the 9 areas are drawn on the screen relative to each other.
That names are a bit outdated and I didn't care more about rewriting them, but I'll someday when I get what exactly that means for sure.

Entry 3 isn't the "Sea Information" but the "Ground Information". The content of it tell if the ground will be textured or not and also something else I don't know.

Entry 6 isn't the "Clouds Informations" but "Map Intensity Informations" which should give lighting info for the render.

The block size in Entry 2 is 48 (4x12) which have the "Object Informations" in the map. Its coordinates, its angle, its identification,etc..

The block size in Entry 4 is 12 (2x6) which have the texture coordinates for the triangles if I'm not wrong.
__________________
Personal Blog - blog.xesf.net

TwinEngine v0.2.1 win32 beta released - open source re-implementation of the LBA 1 original engine.
[Discuss]|[Download]|[Changes]|[SourceCode]|[Issues]


The Sacred Carrot website
Reply With Quote
  #8  
Old 2007-05-06, 15:38
1nick 1nick is offline
Magic Level: Yellow Ball
 
Join Date: May 2007
Location: Prague
Posts: 5
Object Information

Thank you for the welcome and all you have done so far for LBA
And yes, I enjoy my stay here very much.

It's impressive how many people are here after all this time LBA has been out. They/We just don't give up


First, I want to correct myself

An island can contain up to 16x16=256 areas, not just 9 as I said in the begining. The 256bytes header in the begining of the ILE file is just a 16x16 grid that depicts the placement of each area relative to each other.

Quote:
Originally Posted by alexfont View Post
The block size in Entry 2 is 48 (4x12) which have the "Object Informations" in the map. Its coordinates, its angle, its identification,etc..

The block size in Entry 4 is 12 (2x6) which have the texture coordinates for the triangles if I'm not wrong.
Ok, so Entry 2 is not actualy 40 bytes long? And if it's 48, that means that there are a maximum of 12 objects in each small area, right? Is this data linearly organized? Can i write a structure like this?

struct ObjectInfo {
unsigned char x;
unsigned char y;
unsigned char orientation;
unsigned char id;
};
Reply With Quote
  #9  
Old 2007-05-06, 16:00
xesf's Avatar
xesf xesf is offline
Magic Ball Master
 
Join Date: Sep 2002
Location: Dublin
Posts: 7,766
Quote:
Originally Posted by 1nick View Post
An island can contain up to 16x16=256 areas, not just 9 as I said in the begining. The 256bytes header in the begining of the ILE file is just a 16x16 grid that depicts the placement of each area relative to each other.
Exactly. We actually can make 256 pieces of an island. So we can really make a big one

Quote:
Originally Posted by 1nick View Post
Ok, so Entry 2 is not actualy 40 bytes long? And if it's 48, that means that there are a maximum of 12 objects in each small area, right? Is this data linearly organized? Can i write a structure like this?

struct ObjectInfo {
unsigned char x;
unsigned char y;
unsigned char orientation;
unsigned char id;
};
You can actually make this:
struct objEntry
{
int objIdx;
int X;
int Y;
int Z;
int unk1;
int angle;
int pX1;
int pY1;
int pZ1;
int pX2;
int pY2;
int pZ2;
};
__________________
Personal Blog - blog.xesf.net

TwinEngine v0.2.1 win32 beta released - open source re-implementation of the LBA 1 original engine.
[Discuss]|[Download]|[Changes]|[SourceCode]|[Issues]


The Sacred Carrot website
Reply With Quote
  #10  
Old 2007-05-13, 08:34
Exie Exie is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2005
Posts: 32
Great! I came here today for this info exactly!
BTW, where do we get info on how the tileset is sliced? I've found tileset's configuration pretty complicated, not a 16x16 tileset. Or they are always sliced 16x16
and then some of the slices are merged into bigger tiles when mapped?
And unfortunately I've stucked with "ground information". I've tried to examine Yaz0r's code which he kindly published here, but no luck. His "ground information" structure has no sense for me. I know there should be 64x64 blocks, 4 bytes for each face, but there I see 32 byte blocks. Don't know what to think.

Last edited by Exie; 2007-05-14 at 00:33.
Reply With Quote
  #11  
Old 2007-05-14, 14:54
xesf's Avatar
xesf xesf is offline
Magic Ball Master
 
Join Date: Sep 2002
Location: Dublin
Posts: 7,766
The size of each sliced island part is 64x64.
About the other thing I can't help you.
__________________
Personal Blog - blog.xesf.net

TwinEngine v0.2.1 win32 beta released - open source re-implementation of the LBA 1 original engine.
[Discuss]|[Download]|[Changes]|[SourceCode]|[Issues]


The Sacred Carrot website
Reply With Quote
  #12  
Old 2007-05-14, 15:15
Exie Exie is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2005
Posts: 32
Quote:
Originally Posted by alexfont View Post
The size of each sliced island part is 64x64.
I mean texture tilesets, which are 256x256 and then sliced into smaller pieces. Some of the tiles are bigger (1/16 of tileset) and some are smaller (1/64). No ideas how they are sliced.
Reply With Quote
  #13  
Old 2007-05-14, 19:02
Battler's Avatar
Battler Battler is offline
Welcome to Zirla!
 
Join Date: Apr 2004
Location: Koper, Slovenia
Posts: 5,316
Send a message via ICQ to Battler Send a message via AIM to Battler Send a message via MSN to Battler Send a message via Yahoo to Battler
Quote:
Originally Posted by alexfont
The size of each sliced island part is 64x64.
Actually, it's 65x65.
- Exie: I think the textures are defined by two points each, from which, the game gets the rectangle to cut off. Maybe the shape to cut off is defined there too. I have to reserch that thing a bit more.
__________________
Join #doki-doki on irc.ringoflightning.net for some nice chit-chat about anime, manga, and other aspects of Japanese culture now!
Reply With Quote
  #14  
Old 2007-05-14, 20:53
Exie Exie is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2005
Posts: 32
OBrasilo: Yes, I've got it, finally. It seems to me the whole info how the texture tileset is sliced and how the tiles correspond to particular polygons is defined in (4) texture info block. I was distracted with idea that each sliced tile should have its own id and then ids are given to particular polygons ))
Reply With Quote
  #15  
Old 2007-05-14, 20:59
xesf's Avatar
xesf xesf is offline
Magic Ball Master
 
Join Date: Sep 2002
Location: Dublin
Posts: 7,766
So, are you trying to make a program to load the islands?
__________________
Personal Blog - blog.xesf.net

TwinEngine v0.2.1 win32 beta released - open source re-implementation of the LBA 1 original engine.
[Discuss]|[Download]|[Changes]|[SourceCode]|[Issues]


The Sacred Carrot website
Reply With Quote
  #16  
Old 2007-05-15, 02:39
Exie Exie is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2005
Posts: 32
Not exactly. My primary task is to extract landscapes for further magic. I don't need the whole data. But if I will be lucky enough to make more work than I need myself, I will be glad to share it with others )))
Reply With Quote
  #17  
Old 2007-05-15, 03:14
xesf's Avatar
xesf xesf is offline
Magic Ball Master
 
Join Date: Sep 2002
Location: Dublin
Posts: 7,766
Good to know. I hope you could do what you want
__________________
Personal Blog - blog.xesf.net

TwinEngine v0.2.1 win32 beta released - open source re-implementation of the LBA 1 original engine.
[Discuss]|[Download]|[Changes]|[SourceCode]|[Issues]


The Sacred Carrot website
Reply With Quote
  #18  
Old 2007-05-20, 15:39
1nick 1nick is offline
Magic Level: Yellow Ball
 
Join Date: May 2007
Location: Prague
Posts: 5
Thumbs Up Texture Info Block

Quote:
Originally Posted by Exie View Post
OBrasilo: Yes, I've got it, finally. It seems to me the whole info how the texture tileset is sliced and how the tiles correspond to particular polygons is defined in (4) texture info block. I was distracted with idea that each sliced tile should have its own id and then ids are given to particular polygons ))

Hi Exie, can you post the Texture Info block structure?
Btw, I'm trying to do the same thing - namely getting the terrain data and maybe some objects.
Reply With Quote
  #19  
Old 2007-05-20, 18:57
Exie Exie is offline
Magic Level: Yellow Ball
 
Join Date: Jul 2005
Posts: 32
1nick, I haven't tried to manage with textures yet. You may want to check
Yaz0r's source code which he had posted in similar topic earlier.
He refers to (4) block as defTextureEntry and listTexDef there.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:52.




News Feed
Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2016, the Magicball Network