IFP is the animation format of the Grand Theft Auto series since GTA III. With GTA San Andreas there came a new version of the file format but it still supports animations of the old version. IFP files can contain several single animations which are split up to objects and linked to the animated object or actor in that way. Each object contains a certain number of frames including a time key. Two frames are interpolated by the game.

Contents

File Specification

Animation packages are building a simple hierarchy which is constant over all versions. Basicly each animation file consists of an header storing general file information. This header is followed by the animations themselves. In this way one animation file stores animations just like archive files holds different data as a flat list.

Each animation consists of multiple objects representing a bone of the model the animation gets linked to. Each object holds a list of frames. Those define information about the mathmatical description of the object in the world like translation, scaling and rotation.

Version 1

Strings

Even though strings are null terminated they are aligned to a 4 byte padding what means that their length (including the terminating zero byte) must be a multiple of 4. The trailing bytes are usually zero, too. The following part of the article uses TString for identifying string types. All those strings are following the rule descriped in here.

Data structures

Version 1 packages are introducing some additional data structures. Those are always indicated by an 4 byte constant length string. The following table lists the different data structures and their formats. All data structures are inherting from an abstract base data structure. This base data structure must not be used inside the file (also this would not make sense since it does not hold any data except information about identifying itself). The whole file follows this rules so animation package itself can be seen as one section.

Structure and description

Specification

BASE

Abstract base section.(8 byte)

identifier : CHAR[4]
offset : UINT // offset to the end of the section
// Note: Offsets are always relative to the current file position.

Note: The sections are listed in the order they appear inside the file for better understanding.

Animation

The data structures descriped above can be used to define the data structure for animations. Note that TAnimation does not inherit from BASE. Offset information are stored inside the encapsuled animation data.

Structure and description

Specification

TAnimation

An animation entry of the package.(8 byte)

anim. name : NAME
anim. data : DGAN

Exact version 1 hierarchy

The following tree shows an basic hierarchy of an version 1 animation file: