LBA2:Entity information

From LBA File Information
Revision as of 22:19, 11 August 2016 by 37.228.225.138 (talk)
Jump to navigation Jump to search
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

--------------------------------------------------------------------------------
L I T T L E   B I G   A D V E N T U R E   2
LBA File3D format
Revision 1

Author:   Alexandre Fontoura [alexfont]
Email:    [email protected]

Last Modification: 13.11.2005


[#] [ 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