Scaleform GFX
Scaleform GFX
Section titled “Scaleform GFX”The UI for the Sims 4 (and many older games) is written in Adobe Flash. It uses a file format called Scaleform GFX, which is really just a modified SWF file. This is an important detail when it comes to documentation.
GWX files support text, images, video, animation, sound, and scripting.
All GFX resources are located in UI.package, which is a base game file. This means UI mods shouldn’t create any DLC restrictions.
SWF File Structure
Section titled “SWF File Structure”SWF files contain blocks of data called Tags. Conceptually, this is the same as Sims 4 .package files.
.package files contains Sims 4 files called resources; GFX files contain Adobe Flash files called tags. Tags fall into two categories:
| Category | Description |
|---|---|
| Definition | Shapes, Text, Bitmaps, etc. |
| Control | Controls animation playback |
Additionally, each definition tag is assigned a unique ID, called the Character ID. For this reason, definition tags are also called Characters.
A GFX file viewed in S4E with the ExporterInfo tag selected.
While FFDec and S4E show tags organized into folders, this is purely visual. Internally, tags are stored in an ordered list. Tags can reference other tags, but only tags that come before it. This detail doesn’t matter when editing existing tags, but is important when creating new tags.
ActionScript 3
Section titled “ActionScript 3”GFX supports scripting using a language called ActionScript 3. However, GFX files don’t contain the original source code, but instead compiled byte code called P-code.JPEX allows you to edit either the source code or the P-code. Editing source code is easier, but considered less stable.
Adobe still has documentation for ActionScript 3.
SWF Documentation
Section titled “SWF Documentation”The SWF file format is defined in a 200+ page PDF. All of this information works for GFX.
This documentation is extremely detailed and goes well beyond what is required for Sims 4 modding, but this also means it has can be used to learn about virtually any feature of GFX if you’re curious enough.