LBA2:Entity information: Difference between revisions

From LBA File Information
Jump to navigation Jump to search
[checked revision][checked revision]
Content deleted Content added
Created page with "{{Infobox format | extension = F3D | lba2 = true | colour = | defaultsort = entity }} This is the LBA 2 equivalent to the LBA 1 File3d.hqr file. It contains entities of th..."
 
Xesf (talk | contribs)
No edit summary
 
(5 intermediate revisions by 4 users not shown)
Line 10: Line 10:
{{Cleanup|It should be reformatted to use wikitext instead of <pre> tags.}}
{{Cleanup|It should be reformatted to use wikitext instead of <pre> tags.}}
<pre>
<pre>
--------------------------------------------------------------------------------
L I T T L E B I G A D V E N T U R E 1 & 2
LBA File3D format
Revision 1

Author: Alexandre Fontoura [alexfont]

Last Modification: 13.11.2005


[#] [ INFORMATION ] ------------------------------------------------------------
[#] [ INFORMATION ] ------------------------------------------------------------


This document describes the format in which the LBA1\Relentless and LBA2\Twinsen
This document describes the format in which the LBA2\Twinsen Odyssey File3D
Odyssey File3D (character informations) are stored in.
character informations) are stored in.
If you find any errors in this document please email me the details, also if you
find new stuff please notify me. This information is provided AS IS.




[#] [ NOTE ] -------------------------------------------------------------------
[#] [ NOTE ] -------------------------------------------------------------------



In LBA1 the format I'll explain are inside File3D.HQR with many files, each one
In LBA2 this only exists in one unique file which as all this information inside.
correspond the following format.
This file can be found inside Ress.HQR in the entry 44 (LBA2 Character Informations).
In LBA2 only exist one unique file with all this information inside. This file
could be found inside Ress.HQR in the entry 45 (LBA2 Character Informations).




Line 45: Line 31:
+ = to add previeous bytes count
+ = to add previeous bytes count


The file is laid out like an HQR file, but does not have the size/compression header
The first thing you need to get is the number of entries it will have. For both
at each offset given. Refer to the HQR document on how to read the intro.
games we extract the number the same way, and I'll assume you know it by now, so...

00: s32 First offset


00: s32 Number of Entries


Do this "number of entries" times
Do this "number of entries" times
[ Entries ]
[ Entries ]


First of all you need to read the entrie content for each entrie of course.
First of all you need to read the entry content for each entry of course.
I'll assume you know this. Also you need to create a variable or structures
I'll assume you know this. Also you need to create a variable or structures
to handle the anim and body content and count.
to handle the anim and body content and count.


Do the next block while the readed byte isn't 0xFF (End of each entrie content).
Do the next block while the read byte is not 0xFF (End of each entry content).

02: Make here a offset backup. (Will be needed later)


[ Content ]
[ Content ]
Line 69: Line 54:


[ Body = 1 ]
[ Body = 1 ]
+00: byte Body index (in File3D.HQR)
+00: byte Body index
01: s16 Body real index (in Body.HQR)
01: byte Body data size - 1 (only take the following values)
|-> 0x04 (4) -> When no collision box is used
|--> 0x11 (17) -> When used a collision box
02: s16 Body real index (in BODY.HQR)
04: byte Collision box flag
|-> flag = 0x00 (0) -> Model doesn't use collision box
|--> flag = 0x01 (1) -> Model use collision box


[ IF Collision box flag is set ]
You can check if the body real index is correct by testing with 0x8000
05: byte Number of bytes to read minus 2.
In this case the value is always 0x0E, so it will have more 0x0E-0x02 = 0x0C bytes
06: u16 X (bottom left)
08: u16 Y (bottom left)
0A: u16 Z (bottom left)
0C: u16 X (top right)
0E: u16 Y (top right)
10: u16 Z (top right)


[ /IF ]
03:
Here we have some more informations about the body that I'll describe in a
future revision because lake of time. Sorry, I think it isn't so important
for now.

Count here one more body for the total number of bodies in the entrie.


[ / Body ]
[ / Body ]
Line 85: Line 79:


[ Anim = 3 ]
[ Anim = 3 ]
+00: s32 Anim index (in File3D.HQR)
+00: byte Anim index
04: s32 Anim real index (in Anim.HQR)
01: byte Anim real index (in ANIM.HQR)
02: byte Data size - 3

03 until Data Size: ??
Count here one more anim for the total number of anims in the entrie.


[ / Anim ]
[ / Anim ]


Now you should add the offset backup to the current pointer you using
to get the content of.

Something like:
[LBA 1 & 2 for body] -> current pointer = backup content + backup offset;
[LBA 1 for anim] -> current pointer = backup content + backup offset;
- Note for LBA2 anim you should count plus 1:

[LBA 2 for anim] -> current pointer = (backup content + 1) + (backup offset + 1);


[ / Content ]
[ / Content ]
Line 111: Line 93:


{{providers|[[provider::Alexfont]]}}
{{providers|[[provider::Alexfont]]}}




EDIT: I will eventually fix this document, but want to make sure this info is not lost,



<pre>
8bit anim
8bit unknown
16bit real anim
8bit num of anim actions in this instance
for this num of actions do
8bit action type
if type=0x06 - sample sounds (will play the sample in the specified animation keyframe)
8bit keyframe
16bit sample
if type=0x10 or type=0x0F - brick sample (I didn't find yet why we have 2 action for the same thing)
8bit keyframe (this will play the sample according with the brick type in the specified animation keyframe)
if type=0x09 - throw projectile (don't know yet the meaning of the content)
end for
</pre>


Actions from LBA1 - can be the same

<pre>
enum ActionType {
ACTION_HITTING = 0,
ACTION_SAMPLE = 1,
ACTION_SAMPLE_FREQ = 2,
ACTION_THROW_EXTRA_BONUS = 3,
ACTION_THROW_MAGIC_BALL = 4,
ACTION_SAMPLE_REPEAT = 5,
ACTION_UNKNOWN_6 = 6,
ACTION_UNKNOWN_7 = 7,
ACTION_SAMPLE_STOP = 8,
ACTION_UNKNOWN_9 = 9, // unused
ACTION_SAMPLE_BRICK_1 = 10,
ACTION_SAMPLE_BRICK_2 = 11,
ACTION_HERO_HITTING = 12,
ACTION_UNKNOWN_13 = 13,
ACTION_UNKNOWN_14 = 14,
ACTION_UNKNOWN_15 = 15,
ACTION_LAST
};



Omni provided the below info:

0x9 Throw the magic ball
8bit_s trigger key frame
16bit_u y-offset from the actor's yposition from which the ball will be thrown
16bit_s vertical angle (adjusting the incline of the throw)
16bit_s velocity
8bit_s gravitational acceleration g

0x8 Throw extra
8bit_s trigger key frame
16bit_u y-offset from the actor's yposition from which the ball will be thrown
8bit_u type of extra (sprite id)
16bit_s vertical angle (adjusting the incline of the throw)
16bit_s velocity
8bit_s gravitational acceleration g
8bit_s harmfulness of extra

0x5 Hit near objects
8bit_s trigger key frame
8bit_s hit force

0x17 Twinsen attack
8bit_s trigger key frame
this action is using a hard-wired lookup-table to choose the hit force using twinsens magic level.
i didn't know twinsens hit force increased with his magic level

0x18 throw extra from custom offset into a custom direction
8bit_s trigger key frame
16bit_s offset x
16bit_s offset y
16bit_s offset z
8bit_s type of extra (sprite id)
16bit_s vertical angle
16bit_s horizontal angle
16bit_s velocity
8bit_s gravitational acceleration
8bit_s harmfulness of extra
these values all have to be interpreted relative to actor position and actor angle.

0x19 throw extra from custom offset into custom direction STRANGE VERSION
8bit_s trigger key frame
16bit_s offset x
16bit_s offset y
16bit_s offset z
8bit_s type of extra (sprite id)
16bit_s vertical angle
16bit_s horizontal angle
16bit_s velocity
8bit_s gravitational acceleration
8bit_s harmfulness of extra
the strange part of this version is, that an additional angle offset is added to the vertical angle. this offset is calculated this way:

does someone has an idea what this used for? maybe to throw grenades?

0x20 shoot a persecuting extra (aiming to hit another actor)
8bit_s trigger key frame
16bit_s offset x
16bit_s offset y
16bit_s offset z
8bit_s type of extra (sprite id)
8bit_s targeted actor (strange that this is fixed O_o)
16bit_s maxSpeed
8bit_s harmfulness
</pre>

Latest revision as of 19:33, 26 August 2019

Entity information
Extension

F3D

Occurence

LBA2

Programs supporting this format
References

Find entries of this type

This is the LBA 2 equivalent to the LBA 1 File3d.hqr file. It contains entities of the game Actors.

Specification[edit]

[#] [ INFORMATION ] ------------------------------------------------------------

This document describes the format in which the LBA2\Twinsen Odyssey File3D 
character informations) are stored in.


[#] [ NOTE ] -------------------------------------------------------------------


In LBA2 this only exists in one unique file which as all this information inside.
This file can be found inside Ress.HQR in the entry 44 (LBA2 Character Informations).


[#] [ FORMAT ] -----------------------------------------------------------------

s32 = signed int (32bit)
u16 = unsigned short (16bit)
s16 = signed short (16bit)
byte (8bit)
+ = to add previeous bytes count

The file is laid out like an HQR file, but does not have the size/compression header
at each offset given. Refer to the HQR document on how to read the intro.

00:	s32	First offset


Do this "number of entries" times
[ Entries ]

First of all you need to read the entry  content for each entry of course.
I'll assume you know this. Also you need to create a variable or structures
to handle the anim and body content and count.

Do the next block while the read byte is not 0xFF (End of each entry content).

[ Content ]
+00:	byte	Opcode

Opcode = 1 -> Body content
Opcode = 3 -> Anim content


[ Body = 1 ]
+00:	byte	Body index
01:	byte	Body data size - 1 (only take the following values)
		|-> 0x04 (4) -> When no collision box is used
		|--> 0x11 (17) -> When used a collision box
02:	s16	Body real index (in BODY.HQR)
04:	byte	Collision box flag
		|-> flag = 0x00 (0) -> Model doesn't use collision box
		|--> flag = 0x01 (1) -> Model use collision box

[ IF Collision box flag is set ]
05:	byte	Number of bytes to read minus 2. 
		In this case the value is always 0x0E, so it will have more 0x0E-0x02 = 0x0C bytes
06:	u16	X (bottom left)
08:	u16	Y (bottom left)
0A:	u16	Z (bottom left)
0C:	u16	X (top right)
0E:	u16	Y (top right)
10:	u16	Z (top right)

[ /IF ]

[ / Body ]


[ Anim = 3 ]
+00:	byte	Anim index
01:	byte	Anim real index (in ANIM.HQR)
02:	byte	Data size - 3
03 until Data Size:	??

[ / Anim ]


[ / Content ]

[ / Entries ]

Information provided by: Alexfont



EDIT: I will eventually fix this document, but want to make sure this info is not lost,


8bit anim
8bit unknown
16bit real anim
8bit num of anim actions in this instance
for this num of actions do
    8bit action type
    if type=0x06 - sample sounds (will play the sample in the specified animation keyframe)
         8bit keyframe
         16bit sample
    if type=0x10 or type=0x0F - brick sample (I didn't find yet why we have 2 action for the same thing)
         8bit keyframe (this will play the sample according with the brick type in the specified animation keyframe)
   if type=0x09 - throw projectile (don't know yet the meaning of the content)
 end for


Actions from LBA1 - can be the same

enum ActionType {
	ACTION_HITTING           = 0,
	ACTION_SAMPLE            = 1,
    	ACTION_SAMPLE_FREQ       = 2,
    	ACTION_THROW_EXTRA_BONUS = 3,
	ACTION_THROW_MAGIC_BALL  = 4,
	ACTION_SAMPLE_REPEAT     = 5,
	ACTION_UNKNOWN_6         = 6,
	ACTION_UNKNOWN_7         = 7,
	ACTION_SAMPLE_STOP       = 8,
	ACTION_UNKNOWN_9         = 9, // unused
	ACTION_SAMPLE_BRICK_1    = 10,
	ACTION_SAMPLE_BRICK_2    = 11,
	ACTION_HERO_HITTING      = 12,
	ACTION_UNKNOWN_13        = 13,
	ACTION_UNKNOWN_14        = 14,
	ACTION_UNKNOWN_15        = 15,
    ACTION_LAST
};



Omni provided the below info:

0x9 Throw the magic ball
8bit_s trigger key frame 
16bit_u y-offset from the actor's yposition from which the ball will be thrown
16bit_s vertical angle (adjusting the incline of the throw)
16bit_s velocity
8bit_s gravitational acceleration g

0x8 Throw extra
8bit_s trigger key frame 
16bit_u y-offset from the actor's yposition from which the ball will be thrown
8bit_u type of extra (sprite id)
16bit_s vertical angle (adjusting the incline of the throw)
16bit_s velocity
8bit_s gravitational acceleration g
8bit_s harmfulness of extra

0x5 Hit near objects
8bit_s trigger key frame
8bit_s hit force

0x17 Twinsen attack
8bit_s trigger key frame
this action is using a hard-wired lookup-table to choose the hit force using twinsens magic level.
i didn't know twinsens hit force increased with his magic level  

0x18 throw extra from custom offset into a custom direction
8bit_s trigger key frame
16bit_s offset x
16bit_s offset y
16bit_s offset z
8bit_s type of extra (sprite id)
16bit_s vertical angle 
16bit_s horizontal angle 
16bit_s velocity
8bit_s gravitational acceleration
8bit_s harmfulness of extra
these values all have to be interpreted relative to actor position and actor angle.

0x19 throw extra from custom offset into custom direction STRANGE VERSION
8bit_s trigger key frame
16bit_s offset x
16bit_s offset y
16bit_s offset z
8bit_s type of extra (sprite id)
16bit_s vertical angle 
16bit_s horizontal angle 
16bit_s velocity
8bit_s gravitational acceleration
8bit_s harmfulness of extra
the strange part of this version is, that an additional angle offset is added to the vertical angle. this offset is calculated this way:

does someone has an idea what this used for? maybe to throw grenades?

0x20 shoot a persecuting extra (aiming to hit another actor)
8bit_s trigger key frame
16bit_s offset x
16bit_s offset y
16bit_s offset z
8bit_s type of extra (sprite id)
8bit_s targeted actor (strange that this is fixed O_o)
16bit_s maxSpeed
8bit_s harmfulness