GTA5: Animation files (YCD)

GTA:V Modding with ZModeler3 discussion.

Moderator: madga182

Post Reply
User avatar
Oleg
Site Admin
Posts: 11692
Joined: Fri Feb 06, 2004 3:54 am
Contact:

GTA5: Animation files (YCD)

Post by Oleg »

Got some cute update for ZModeler3 released.
Image
Since I've been making this all on a laptop device, I can't make a video guide, so a brief forum guide topic will be added later.

It took a really long even though the main decode work was done years ago - you've seen animations in OpenIV already. Another major step was done in CodeWalker that is able to decode YCD files to XML. To my surprise I haven't found a "YCD from XML" recreation feature there, as this would make the task much easier (an XML import/export).

Well, using the native YCD files was always a preferred choice for me, so I pinned to this approach.

YCD files can be imported with automatic parts/bones assignment. Playback is quite natural. A set of YCD features can not be mapped onto ZModeler's available tools set, so some data is ignored and lost on import. This is still a subject to decide whether this is an important data or not. Additionally, I've added user-defined options in animations and tracks, so they can hold some unknown data for later use. In particular, user-defined options are utilized for audio binding.
Image

Features list:
  • Import of full YCD file or individual clips from a package.
  • Export of full YCD file only (several annimations in one YCD in a single export run). One clip (replacement/injection mode) will be added later.
  • Animation files do not contain bone names, so the model file (YFT) have to be loaded first, so you get a properly named tracks.
  • Animations use hashes all around, there is no any text references there except the clip name itself. Some hashes are resolved to object names from the scene, some have evaluated hashes coded in the filter already. However, you might have some settings that will still contain hash instead of a text representation. Hash could be either "Hash_2345DF01" or "0x2345DF01" (leading Hash_ and 0x are equivalent).
  • Animation events (key frame with event and event number in ZModeler) are used to insert properties and tags onto animation. Meanwhile, only tags (a property at some key time) is available, general-purpose properties are currently ignored. See a section about "Tags" below.
  • Animation quality and performance is not optimized. The file size of animation can increase because ZModeler does not utilize all possible packing and optimization of animation data, only some techniques are used. Performance can suffer too, as natural game's animation are made "low-resolution" with additional "high-resolution" (e.g. feet, hands and fingers movements are additional hi-res animation). ZModeler merges them together into a single high-resolution animation.
  • Key frames could be interpolated, it's not a must to create smooth curves with a dozen of key frames. Use available ZModeler animation features to create curves, exporter will do the rest.
  • Root (skeleton base) animation is also imported/exported as a "[root]" track. However, importer disables it by default on import, so playback will not affect skeleton position, only bones are animated. Most of ped's movement animations do use root animation (e.g. walking, start and stop of walking).
  • Some unknown properties are moved into animation's (and track's) User-defined options. So far I've seen them on "SKEL_ROOT" bone and unknown bone with ID "0x3cd2". The latest one has no animation keys, just property assigned.
My laptop dies of overheat while game is loading, so I run in-game test for just few seconds only and, in particular, have no idea how to test ped animations.

Video guides
Video guides on YCD Animations (by C.Stewart Gaming).

(1/3). Importing animations to ZModeler:
https://www.youtube.com/watch?v=F8rQAU0VR3I

(2/3). Exporting animations from ZModeler:
https://www.youtube.com/watch?v=eFewZ-M7fqE

(3/3). Create a GTA 5 Animation using ZModeler3
https://www.youtube.com/watch?v=jxWz4wcYM0E
lol200004
Posts: 4
Joined: Tue Nov 01, 2016 2:30 am

Re: GTA5: Animation files (YCD)

Post by lol200004 »

It took a really long even though the main decode work was done years ago - you've seen animations in OpenIV already. Another major step was done in CodeWalker that is able to decode YCD files to XML. To my surprise I haven't found a "YCD from XML" recreation feature there, as this would make the task much easier (an XML import/export).
Hi Oleg, the latest version of CodeWalker supports import and export ycd.xml via RPF Explorer
Join the CodeWalker Discord server at and check #release section: https://discord.gg/BxfKHkk
Source code on github: https://github.com/dexyfex/CodeWalker
User avatar
Oleg
Site Admin
Posts: 11692
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: GTA5: Animation files (YCD)

Post by Oleg »

Hmm.. this could help me several months ago while I was decoding the .ycd and testing my guess and thoughts on some details. So far, I expect ZModeler-generated .ycd files to work fine. However, I still need to consider whether some unknown properties are really important or not. I see most of them named as "unknown" inside generated XML file, so I suppose CodeWalker guys don't know the purpose of this data.
lol200004
Posts: 4
Joined: Tue Nov 01, 2016 2:30 am

Re: GTA5: Animation files (YCD)

Post by lol200004 »

Thanks for your hard work. In the #animations section of the CW discord there are some clarifications regarding character animation and some unknows hashes.
To play animations for characters in the game, you can use the Scripthook and use it in conjunction with the Simple-trainer in which you can play animation for ped and yourself
Post Reply