Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Beholder

[Q/P] ifp file format

Recommended Posts

Beholder

I've been searching all over the place and can't seem to find any info on the ifp file format. sad.gif I would really appreciate it if somebody can point in the right direction.

 

Thanks a bunch!

-Beholder

Share this post


Link to post
Share on other sites
REspawn

yea, Hollower wrote up a txt doc before that I have reposted below, its old so dont know how much of it is true for SA.

 

 

=================================================================IFP file format for Grand Theft Auto III and Vice City animation   Written by Hollower ([email protected])=================================================================(updated Jan 2004)This file is intended for programmers only.First column is the number of bytes. V means that the length varies.Second column is the suggested data type (C/C++).Third column is a brief description of the data.Strings are padded to 4-byte alignment.This is how I broke up the file for reading in. The section markersindicate the more "correct" way, but I used this simpler grouping(ie. why worry about the parent section of "INFO" blocks when theyshould always be in this order anyway), and I used the section markersfor error checking. Using my grouping also makes it easier to outputan IFP file that is valid for GTA3/GTA:VC. This may change in futureGTA games.IFP FILE HEADER----------------4       (char[4])       "ANPK" --- section marker4       (int)           Offset to end of file4       (char[4])       "INFO" --- section marker4       (int)           Offset to end of header4       (int)           Number of animsV       (char[V])       Internal file name (null terminated string)ANIMATION INFO----------------4       (char[4])       "NAME" --- section marker4       (int)           Length of anim name stringV       (char[V])       Anim name (null terminated string)4       (char[4])       "DGAN" --- section marker4       (int)           Offset to end of animation4       (char[4])       "INFO" --- section marker4       (int)           Offset to first object (usually 8)4       (int)           Number of objects4       (int)           NULLOBJECT INFO----------------4       (char[4])       "CPAN" --- section marker4       (int)           Offset to end of object4       (char[4])       "ANIM" --- section marker4       (int)           Offset to frame info (usually 48)28      (char[28])      Object name (null terminated string, padded to 28 bytes)4       (int)           Number of frames4       (int)           NULL4       (int)           Index of last frame (Number of frames - 1)4       (int)           Index of next sibling (-1 if none)4       (int)           Index of previous sibling (-1 if none)FRAME INFO----------------4       (char[4])       Frame type (see below)4       (int)           Length of frame dataFRAME DATA----------------Frame data is all floats. Structure depends on frame type.Frame types:"KRT0"  Root    quaternion rotation (float x,y,z,w),               vector translation (float x,y,z),               time (float seconds)"KR00"  Child   rotation, time"KRTS"  Scaled  rotation, translation, scale (float x,y,z), timeRoot frames contain extra data for translating the model in theworld. Child frames are simply rotations, concatenated as theygo up the hierarchy.You can probably guess, the letters here stand for (K)eyframe, ®otation, (T)ranslation, (S)cale, (0)Noneso presumably there could also be other combinations like "K0T0" butthe above are the only ones found in all of the files I studied.Notes----------------Overall file structure looks like this:Header | +-Animation |    | |    +-Object |    |   | |    |   +-Frame |    |   +-Frame |    |   +-Frame |    |   +- ... |    | |    +-Object |    |   | |    |   +-Frame |    |   +-Frame |    |   +-Frame |    |   +- ... |    | |    +- ... | +-Animation |    | |    +-Object |    |   |...and so on.Object names are a reference to the DFF mesh or bonewhich will be rotated with the frame data. The stringis not case sensitive.An animation does not need to reference every part of amodel, only the ones that will move. They also do notrequire an equal number of frames or matching time index.There are sometimes anomalies like anims with 0 objectsor objects with 0 frames.For reference, the base pose can be viewed by creatinganimations with Rotation = {0.0f, 0.0f, 0.0f, 1.0f}.I hope this file has been helpful. Now let's see some editors!- Hollower

 

Share this post


Link to post
Share on other sites
Beholder

Wow, should be interesting. Thanks REspawn! colgate.gif

 

Would it be possible to add it to the file formats sticky? It seems to have most everything else but this.

 

Thanks again.

 

-Beholder

Share this post


Link to post
Share on other sites
REspawn

No worries, yea must really get back to finishing that list notify.gif

Share this post


Link to post
Share on other sites
steve-m

The file format for SA is different though (four character code is "ANP3"), but I don't think that's documented anywhere either. If you desperately need it, I could try to assemble a format doc from some old code I once wrote. But aren't there import/export scripts for 3dsmax that allow editing .ifp files? I guess their authors could help you out as well.

Share this post


Link to post
Share on other sites
Beholder

steve-m,

 

I guess it would it depend on how different SA is from VC. At quick glance it looks as though the section markers aren't in SA's ped.ifp, as well as the frame types. Also, there is a reference to studio max in the first animation, abseil. I'm not usually much when it comes to cracking file formats, but I have a pretty decent base to work from and can take a crack at it (no pun intended). If I get stuck I'll try to seek one of those 3ds authors and if that doesn't go anywhere I'll just post back here and cry myself to sleep.

 

For anybody else that plans to use the doc posted here, I would like to mention that as far as VC's ped.ifp file is concerned, in the object infp section, the NULL int following the number of frames should not be read/written if the offset to frame info is 44, as opposed to if the offset is 48. monocle.gif

 

Thanks REspawn and steve-m, you guys rock!

 

-Beholder

Share this post


Link to post
Share on other sites
AK-73

If you're concerned with animations in Vice, I'd like you to refer you to two mods of mine:

 

First my ifp suite which is open source and which enables exporting directly into the (VC) .ifp from gmax. It does contain a bug though which I can't fix because I can't upload files onto gtagarage. (Anybody knows when this is going to change?) But the exporter is open source, so depending on what you want to do, it might help.

 

Secondly my GTA:MA mod which allows adding new animations as a side-benefit. I have even added new animations from SA into VC with it. Just ask ceedj. wink.gif

 

Anyway, I don't know the SA file format but I am fairly well-acquainted with the VC .ifps. If you need some help, feel free to pm me.

 

Now if I could only convince steve-m or some of the other veterans to help me make sense of the rest of the ps2 lcs .mdl file format... wink.gif Wäre richtig gut. wink.gif

 

Alex

 

Share this post


Link to post
Share on other sites
Aschratt

Well... I took a look to the ANP3-Format some moths ago... I haven't realy finished my work on this, cause I thought I can find something out about Cutscenes, and how they work, but then I found out that cutscenes are ANPK-Animations... I posted this stuff to the wiki:

http://www.gtamodding.com/index.php?title=Cutscene

 

There are not many differencies between ANPK and ANP3. Section Markers are removed and sections are more sorted and compressed now (Like the compression in the COL3 - collision-files).

 

Yesterday I found time to create an txt like hollower did once:

 

 

=================================================================IFP file format for Grand Theft Auto San Andreas animation  Written by Aschratt ([email protected])=================================================================(updated Jan 2008)This file is based on the decodings of hollower from 2004.For more information search GTA Forums.Binary Structure:====    Header    ============4b     - CHAR[4]   - 'ANP3' (Version Identifier String)4b     - INT32     - Offset to end of file (Relative to stream position pointer, so usually you have to add 8 to get the file's content size)24b    - CHAR[24]  - File's Internal Name4b     - INT32     - Number of Animations====    Animation Info    ====24b    - CHAR[24]  - Animation Name (!!! String stops with first null-char ('\0'). Everything after this is ignored... R* Put some debug stuff there sometimes (Like 3dsm directorys))4b     - INT32     - Number of Objects4b     - INT32     - ?4b     - INT32     - ?====    Object Info    ========24b    - CHAR[24]  - Object Name4b     - INT32     - ?4b     - INT32     - Number of Frames4b     - INT32     - ? (Frame DATA TYPE: KRT0 = 0, KR00 = 1, KRTS = 2)====    Frame Info    =========2b     - INT16     - ? (RX)2b     - INT16     - ? (RY)2b     - INT16     - ? (RZ)2b     - INT16     - ? (RW)2b     - INT16     - ? (TX)2b     - INT16     - ? (TY)2b     - INT16     - ? (TZ)2b     - INT16     - ? (TIME)Like nearly all new coordinate formats in SA the Animation Packages are compressed.To get the real-world floating coordinates simply divide the short values with 128!================================Notes: I think that there is a constant value in the object-info section which defines the frame's data type. This means that there are still those data-types like in ANPK.But I am not sure about this and still have to search some examples and try a little bit around. Mostly the frame info data type is like the root structure.These decodings are done by scratch in an hour. I had not much time, but I hope it will help you for further decodings.Greetings... Aschratt!Homepage: http://www.aschratt.comE-Mail:   [email protected]

 

 

I hope this helps!

 

To the cutscene animations:

They are ANPK-Packages, but somehow they got an diffrent structure in some phrases... somehow the sibling numbers are mission sometimes or only one of them exists... sometimes the number of frames is too high and the last frame seems to be removed.

Maybe in SA ANPK is Version 2 and ANP3 Version 3, so that VC-Animations are not longer compatible to SA Animations. But I have to test this (Maybe it is only an mistake of mine).

 

Greetings... Aschratt!

Edited by Aschratt

Share this post


Link to post
Share on other sites
Beholder

Thanks Aschratt!

 

I haven't looked at the cut scenes stuff but for the SA ped.ifp, you're notes did the job. I think the object structure is a bit backwards though, I believe it should look something like this...

 

 

====    Object Info    ========24b    - CHAR[24]  - Object Name4b     - INT32     - ? (Frame DATA TYPE: KRT0 = 4, KR00 = 3, KRTS = 2(?))4b     - INT32     - Number of Frames4b     - INT32     - ?

 

 

I didn't find any frames that use KRTS. Another thing I'm kinda curious about is that are objects with only 2 frames, and no change in the translation/rotation values. Other than that all is good. I'm moving on to dff files now. smile.gif

 

Thanks everybody!

-Beholder

Share this post


Link to post
Share on other sites
steve-m

To convert the transformation data in Frame Info to floats, divide the signed INT16s by the following values:

  • real part of the quaternion (RX, RY, RZ): -4096
  • imaginary part of the quaternion (RW): 4096
  • position vector: 1024
  • time key: 60

Haven't checked those, just looked them up in my old code. Especially the quaternion seems a bit weird, likely I got that wrong.

 

The third INT32 in Object Info is the Bone ID, it (usually) matches those used in DFF files.

 

Here is some code I used to map animations to dff frames, might be helpful:

 

// Check, which of the animations can be applied to the loaded model// must do in reverse order, because VC models have 2x "root"!Animation[i1].AnimObject[i2].ObjFrame := -1;j := length(DFF.Frame)-1;while (Animation[i1].AnimObject[i2].ObjFrame = -1) and (j >= 0) do begin if (AssignByBoneID and (Animation[i1].AnimObject[i2].BoneID = DFF.Frame[j].BoneID)) or (not AssignByBoneID and (CompareText(Animation[i1].AnimObject[i2].Name, DFF.Frame[j].Name) = 0)) then Animation[i1].AnimObject[i2].ObjFrame := j;  dec(j); // j--end;

 

(AssignByBoneID is a Boolean for using BoneIDs rather than frame names for matching, preferably for SA models/anims)

Share this post


Link to post
Share on other sites
derty
Another thing I'm kinda curious about is that are objects with only 2 frames, and no change in the translation/rotation values.

Maybe these are like the TVs/VCRs, ETC? 2 frames: the static state and the "lifted"/interacted state?

Just a guess, watchin this topic, interesting. Greets Steve.

Share this post


Link to post
Share on other sites
Aschratt
Another thing I'm kinda curious about is that are objects with only 2 frames, and no change in the translation/rotation values.

Maybe these are like the TVs/VCRs, ETC? 2 frames: the static state and the "lifted"/interacted state?

Just a guess, watchin this topic, interesting. Greets Steve.

I don't think so...

I think that this is like in cutscene animations... they are only used as "spaceholders". Means: You got one frame at point 0 and one at point X. between those points the animation does nothing.

So you can stop an animation for a certain time (e.g.). In cutscenes this is used very often.

 

Imagine: the first Cutscene in SA.

 

It has many animations (The suitcase, CJ, the Stuartess, the Taxi and the taxi Driver.) But how to combine those animations? (There is no info about the time they are loaded).

Easy awnser: All Animations started at the same point. but thos who aren't used until they are in view are stopped for this time span. So for example in the first cutscene the Taxi starts to drive after the suitcase falls into the hole. But the taxi-animation is startet when CJ starts to walk.

 

To make this more imaginable (if you haven't understand me ^^), simply import the cutscene into 3ds max (KAMs supports them).

Share this post


Link to post
Share on other sites
Gian_Yagami

Nice, but is too elusive.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.