EvilEngine/UIM: Difference between revisions

From Heavy Iron Modding
Content added Content deleted
No edit summary
Line 31: Line 31:
| 0x0C || uint32 || '''cmdSize''' ||
| 0x0C || uint32 || '''cmdSize''' ||
|-
|-
| 0x10 || float || '''totalTime''' ||
| 0x10 || float || '''totalTime''' || How long the motion lasts in seconds. The motion will end at this point, so if there are any commands after it, they won't be played.
|-
|-
| 0x14 || float || '''loopTime''' ||
| 0x14 || float || '''loopTime''' || The time offset in seconds of the loop point. When the motion loops, it will start over at this point instead of 0.
|}
|}


Line 70: Line 70:
| 0x00 || uint32 || '''type''' || Type ID (see above)
| 0x00 || uint32 || '''type''' || Type ID (see above)
|-
|-
| 0x04 || float || '''startTime''' ||
| 0x04 || float || '''startTime''' || Start time in seconds.
|-
|-
| 0x08 || float || '''endTime''' ||
| 0x08 || float || '''endTime''' || End time in seconds.
|-
|-
| 0x0C || float || '''accelTime''' ||
| 0x0C || float || '''accelTime''' || Ease in time in seconds.
|-
|-
| 0x10 || float || '''decelTime''' ||
| 0x10 || float || '''decelTime''' || Ease out time in seconds.
|-
|-
| 0x14 || uint8 || '''enabled''' ||
| 0x14 || uint8 || '''enabled''' || 0 or 1. If 0, this command will not run (likely for testing purposes).
|-
|-
| 0x15 || - || - || 3 bytes of padding
| 0x15 || - || - || 3 bytes of padding
|}
|}

Depending on the command type, the UI's corresponding property will be interpolated in between '''startTime''' and '''endTime''' to its new value (for example, the Color command will interpolate the UI's color from a starting red-green-blue value to an ending red-green-blue value). '''accelTime''' and '''decelTime''' can be used to "ease in" and "ease out" the interpolation so it appears to start and end smoothly.

Each command type is either absolute or relative. Absolute means the property will be ''overwritten'' with a set value and changed over time to a new value. Relative means the property will be changed from its ''existing value'' by a specified ''amount''.

Absolute commands:
* Opacity
* AbsoluteScale
* Brightness
* Color

Relative commands:
* Move
* Rotate
* Scale
* UVScroll


====Move (Type 0)====
====Move (Type 0)====
Move the UI by a specified amount, relative to its last position.
Size = 0x20 bytes

<source lang=cpp>
<source lang=cpp>
struct zUIMotionCmdMove : zUIMotionCmdAsset
struct zUIMotionCmdMove : zUIMotionCmdAsset
Line 96: Line 113:
! Offset !! Type !! Variable !! Description
! Offset !! Type !! Variable !! Description
|-
|-
| 0x18 || float || '''distX''' ||
| 0x18 || float || '''distX''' || How far to move in pixels on the X axis.
|-
|-
| 0x1C || float || '''distY''' ||
| 0x1C || float || '''distY''' || How far to move in pixels on the Y axis.
|}
|}

Size = 0x20 bytes


====Scale (Type 1)====
====Scale (Type 1)====
Change the scale of the UI by a specified ratio, relative to its last scale.
Size = 0x2C bytes

<source lang=cpp>
<source lang=cpp>
struct zUIMotionCmdScale : zUIMotionCmdAsset
struct zUIMotionCmdScale : zUIMotionCmdAsset
Line 118: Line 138:
! Offset !! Type !! Variable !! Description
! Offset !! Type !! Variable !! Description
|-
|-
| 0x18 || float || '''amountX''' ||
| 0x18 || float || '''amountX''' || How much to scale the X axis by as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
|-
|-
| 0x1C || float || '''amountY''' ||
| 0x1C || float || '''amountY''' || How much to scale the Y axis by as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
|-
|-
| 0x20 || uint8 || '''centerPivot''' ||
| 0x20 || uint8 || '''centerPivot''' || 0 or 1. If 1, the UI will scale from its center. If 0, the UI will scale from its top-left corner.
|-
|-
| 0x21 || - || - || 3 bytes of padding
| 0x21 || - || - || 3 bytes of padding
|-
|-
| 0x24 || float || '''centerOffsetX''' ||
| 0x24 || float || '''centerOffsetX''' || Offset in pixels of the scale center point on the X axis. '''centerPivot must be set to 1.'''
|-
|-
| 0x28 || float || '''centerOffsetY''' ||
| 0x28 || float || '''centerOffsetY''' || Offset in pixels of the scale center point on the Y axis. '''centerPivot must be set to 1.'''
|}
|}

Size = 0x2C bytes


====Rotate (Type 2)====
====Rotate (Type 2)====
Rotate the UI by a specified amount, relative to its last rotation.
Size = 0x24 bytes

<source lang=cpp>
<source lang=cpp>
struct zUIMotionCmdRotate : zUIMotionCmdAsset
struct zUIMotionCmdRotate : zUIMotionCmdAsset
Line 145: Line 168:
! Offset !! Type !! Variable !! Description
! Offset !! Type !! Variable !! Description
|-
|-
| 0x18 || float || '''rotation''' ||
| 0x18 || float || '''rotation''' || How far to rotate in degrees. (Positive is clockwise, negative is counter-clockwise)
|-
|-
| 0x1C || float || '''centerOffsetX''' ||
| 0x1C || float || '''centerOffsetX''' || Offset in pixels of the rotation pivot on the X axis.
|-
|-
| 0x20 || float || '''centerOffsetY''' ||
| 0x20 || float || '''centerOffsetY''' || Offset in pixels of the rotation pivot on the Y axis.
|}
|}

Size = 0x24 bytes


====Opacity (Type 3)====
====Opacity (Type 3)====
Change the opacity/alpha of the UI from a start to end value, overwriting its previous opacity.
Size = 0x1C bytes

<source lang=cpp>
<source lang=cpp>
struct zUIMotionCmdOpacity : zUIMotionCmdAsset
struct zUIMotionCmdOpacity : zUIMotionCmdAsset
Line 166: Line 192:
! Offset !! Type !! Variable !! Description
! Offset !! Type !! Variable !! Description
|-
|-
| 0x18 || uint8 || '''startOpacity''' ||
| 0x18 || uint8 || '''startOpacity''' || Start opacity/alpha (0-255).
|-
|-
| 0x19 || uint8 || '''endOpacity''' ||
| 0x19 || uint8 || '''endOpacity''' || End opacity/alpha (0-255).
|-
|-
| 0x1A || - || - || 2 bytes of padding
| 0x1A || - || - || 2 bytes of padding
|}
|}

Size = 0x1C bytes


====AbsoluteScale (Type 4)====
====AbsoluteScale (Type 4)====
Change the scale of the UI from a start to an end ratio, overwriting its previous scale.
Size = 0x2C bytes

<source lang=cpp>
<source lang=cpp>
struct zUIMotionCmdAbsoluteScale : zUIMotionCmdAsset
struct zUIMotionCmdAbsoluteScale : zUIMotionCmdAsset
Line 191: Line 220:
! Offset !! Type !! Variable !! Description
! Offset !! Type !! Variable !! Description
|-
|-
| 0x18 || float || '''startX''' ||
| 0x18 || float || '''startX''' || Start X axis scale as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
|-
|-
| 0x1C || float || '''startY''' ||
| 0x1C || float || '''startY''' || Start Y axis scale as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
|-
|-
| 0x20 || float || '''endX''' ||
| 0x20 || float || '''endX''' || End X axis scale as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
|-
|-
| 0x24 || float || '''endY''' ||
| 0x24 || float || '''endY''' || End X axis scale as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
|-
|-
| 0x28 || uint8 || '''centerPivot''' ||
| 0x28 || uint8 || '''centerPivot''' || 0 or 1. If 1, the UI will scale from its center. If 0, the UI will scale from its top-left corner.
|-
|-
| 0x29 || uint8 || '''textScale''' ||
| 0x29 || uint8 || '''textScale''' || Unknown
|-
|-
| 0x2A || - || - || 2 bytes of padding
| 0x2A || - || - || 2 bytes of padding
|}
|}

Size = 0x2C bytes


====Brightness (Type 5)====
====Brightness (Type 5)====
Unknown. Might be related to bloom on Xbox
Size = 0x1C bytes

<source lang=cpp>
<source lang=cpp>
struct zUIMotionCmdBrightness : zUIMotionCmdAsset
struct zUIMotionCmdBrightness : zUIMotionCmdAsset
Line 226: Line 258:
| 0x1A || - || - || 2 bytes of padding
| 0x1A || - || - || 2 bytes of padding
|}
|}

Size = 0x1C bytes


====Color (Type 6)====
====Color (Type 6)====
Change the color of the UI from a start to an end value, overwriting its previous color.
Size = 0x20 bytes

<source lang=cpp>
<source lang=cpp>
struct zUIMotionCmdColor : zUIMotionCmdAsset
struct zUIMotionCmdColor : zUIMotionCmdAsset
Line 245: Line 280:
! Offset !! Type !! Variable !! Description
! Offset !! Type !! Variable !! Description
|-
|-
| 0x18 || uint8 || '''startRed''' ||
| 0x18 || uint8 || '''startRed''' || Start red channel value (0-255).
|-
|-
| 0x19 || uint8 || '''startGreen''' ||
| 0x19 || uint8 || '''startGreen''' || Start green channel value (0-255).
|-
|-
| 0x1A || uint8 || '''startBlue''' ||
| 0x1A || uint8 || '''startBlue''' || Start blue channel value (0-255).
|-
|-
| 0x1B || uint8 || '''endRed''' ||
| 0x1B || uint8 || '''endRed''' || End red channel value (0-255).
|-
|-
| 0x1C || uint8 || '''endGreen''' ||
| 0x1C || uint8 || '''endGreen''' || End green channel value (0-255).
|-
|-
| 0x1D || uint8 || '''endBlue''' ||
| 0x1D || uint8 || '''endBlue''' || End blue channel value (0-255).
|-
|-
| 0x1E || - || - || 2 bytes of padding
| 0x1E || - || - || 2 bytes of padding
|}
|}


====UVScroll (Type 7)====
Size = 0x20 bytes
Size = 0x20 bytes

====UVScroll (Type 7)====
Change the UI's UV coordinates by a specified amount, relative to its last UV.

<source lang=cpp>
<source lang=cpp>
struct zUIMotionCmdUVScroll : zUIMotionCmdAsset
struct zUIMotionCmdUVScroll : zUIMotionCmdAsset
Line 273: Line 311:
! Offset !! Type !! Variable !! Description
! Offset !! Type !! Variable !! Description
|-
|-
| 0x18 || float || '''amountU''' ||
| 0x18 || float || '''amountU''' || How much to scroll the U (horizontal) coordinate (1.0 = full texture width).
|-
|-
| 0x1C || float || '''amountV''' ||
| 0x1C || float || '''amountV''' || How much to scroll the V (vertical) coordinate (1.0 = full texture height).
|}
|}

Size = 0x20 bytes


{{Assets}}
{{Assets}}

Revision as of 05:00, 25 May 2021

UIM
UI Motion
TypeBase
Games usedThe Incredibles


Format

A UI Motion asset begins with a 0x18-byte header which extends from xBaseAsset:

struct zUIMotionAsset : xBaseAsset
{
	uint8 cmdCount;
	uint8 in;
	uint8 pad[2];
	uint32 cmdSize;
	float totalTime;
	float loopTime;
};
Offset Type Variable Description
0x08 uint8 cmdCount Number of commands after the header
0x09 uint8 in
0x0A uint8[2] pad Padding
0x0C uint32 cmdSize
0x10 float totalTime How long the motion lasts in seconds. The motion will end at this point, so if there are any commands after it, they won't be played.
0x14 float loopTime The time offset in seconds of the loop point. When the motion loops, it will start over at this point instead of 0.

Following the header is a list of Commands (with a length of cmdCount). The format of each command is explained below.

Commands

There are 8 types of Commands defined:

  • 0 - Move
  • 1 - Scale
  • 2 - Rotate
  • 3 - Opacity
  • 4 - AbsoluteScale
  • 5 - Brightness
  • 6 - Color
  • 7 - UVScroll

Each command type has an 0x18-byte header:

struct zUIMotionCmdAsset
{
	uint32 type;
	float startTime;
	float endTime;
	float accelTime;
	float decelTime;
	uint8 enabled;
	// 3 bytes of padding
};
Offset Type Variable Description
0x00 uint32 type Type ID (see above)
0x04 float startTime Start time in seconds.
0x08 float endTime End time in seconds.
0x0C float accelTime Ease in time in seconds.
0x10 float decelTime Ease out time in seconds.
0x14 uint8 enabled 0 or 1. If 0, this command will not run (likely for testing purposes).
0x15 - - 3 bytes of padding

Depending on the command type, the UI's corresponding property will be interpolated in between startTime and endTime to its new value (for example, the Color command will interpolate the UI's color from a starting red-green-blue value to an ending red-green-blue value). accelTime and decelTime can be used to "ease in" and "ease out" the interpolation so it appears to start and end smoothly.

Each command type is either absolute or relative. Absolute means the property will be overwritten with a set value and changed over time to a new value. Relative means the property will be changed from its existing value by a specified amount.

Absolute commands:

  • Opacity
  • AbsoluteScale
  • Brightness
  • Color

Relative commands:

  • Move
  • Rotate
  • Scale
  • UVScroll

Move (Type 0)

Move the UI by a specified amount, relative to its last position.

struct zUIMotionCmdMove : zUIMotionCmdAsset
{
	float distX;
	float distY;
};
Offset Type Variable Description
0x18 float distX How far to move in pixels on the X axis.
0x1C float distY How far to move in pixels on the Y axis.

Size = 0x20 bytes

Scale (Type 1)

Change the scale of the UI by a specified ratio, relative to its last scale.

struct zUIMotionCmdScale : zUIMotionCmdAsset
{
	float amountX;
	float amountY;
	uint8 centerPivot;
	// 3 bytes of padding
	float centerOffsetX;
	float centerOffsetY;
};
Offset Type Variable Description
0x18 float amountX How much to scale the X axis by as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
0x1C float amountY How much to scale the Y axis by as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
0x20 uint8 centerPivot 0 or 1. If 1, the UI will scale from its center. If 0, the UI will scale from its top-left corner.
0x21 - - 3 bytes of padding
0x24 float centerOffsetX Offset in pixels of the scale center point on the X axis. centerPivot must be set to 1.
0x28 float centerOffsetY Offset in pixels of the scale center point on the Y axis. centerPivot must be set to 1.

Size = 0x2C bytes

Rotate (Type 2)

Rotate the UI by a specified amount, relative to its last rotation.

struct zUIMotionCmdRotate : zUIMotionCmdAsset
{
	float rotation;
	float centerOffsetX;
	float centerOffsetY;
};
Offset Type Variable Description
0x18 float rotation How far to rotate in degrees. (Positive is clockwise, negative is counter-clockwise)
0x1C float centerOffsetX Offset in pixels of the rotation pivot on the X axis.
0x20 float centerOffsetY Offset in pixels of the rotation pivot on the Y axis.

Size = 0x24 bytes

Opacity (Type 3)

Change the opacity/alpha of the UI from a start to end value, overwriting its previous opacity.

struct zUIMotionCmdOpacity : zUIMotionCmdAsset
{
	uint8 startOpacity;
	uint8 endOpacity;
	// 2 bytes of padding
};
Offset Type Variable Description
0x18 uint8 startOpacity Start opacity/alpha (0-255).
0x19 uint8 endOpacity End opacity/alpha (0-255).
0x1A - - 2 bytes of padding

Size = 0x1C bytes

AbsoluteScale (Type 4)

Change the scale of the UI from a start to an end ratio, overwriting its previous scale.

struct zUIMotionCmdAbsoluteScale : zUIMotionCmdAsset
{
	float startX;
	float startY;
	float endX;
	float endY;
	uint8 centerPivot;
	uint8 textScale;
	// 2 bytes of padding
};
Offset Type Variable Description
0x18 float startX Start X axis scale as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
0x1C float startY Start Y axis scale as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
0x20 float endX End X axis scale as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
0x24 float endY End X axis scale as a ratio (2.0 = 200%, 0.5 = 50%, etc.)
0x28 uint8 centerPivot 0 or 1. If 1, the UI will scale from its center. If 0, the UI will scale from its top-left corner.
0x29 uint8 textScale Unknown
0x2A - - 2 bytes of padding

Size = 0x2C bytes

Brightness (Type 5)

Unknown. Might be related to bloom on Xbox

struct zUIMotionCmdBrightness : zUIMotionCmdAsset
{
	uint8 startBrightness;
	uint8 endBrightness;
	// 2 bytes of padding
};
Offset Type Variable Description
0x18 uint8 startBrightness
0x19 uint8 endBrightness
0x1A - - 2 bytes of padding

Size = 0x1C bytes

Color (Type 6)

Change the color of the UI from a start to an end value, overwriting its previous color.

struct zUIMotionCmdColor : zUIMotionCmdAsset
{
	uint8 startRed;
	uint8 startGreen;
	uint8 startBlue;
	uint8 endRed;
	uint8 endGreen;
	uint8 endBlue;
	// 2 bytes of padding
};
Offset Type Variable Description
0x18 uint8 startRed Start red channel value (0-255).
0x19 uint8 startGreen Start green channel value (0-255).
0x1A uint8 startBlue Start blue channel value (0-255).
0x1B uint8 endRed End red channel value (0-255).
0x1C uint8 endGreen End green channel value (0-255).
0x1D uint8 endBlue End blue channel value (0-255).
0x1E - - 2 bytes of padding

Size = 0x20 bytes

UVScroll (Type 7)

Change the UI's UV coordinates by a specified amount, relative to its last UV.

struct zUIMotionCmdUVScroll : zUIMotionCmdAsset
{
	float amountU;
	float amountV;
};
Offset Type Variable Description
0x18 float amountU How much to scroll the U (horizontal) coordinate (1.0 = full texture width).
0x1C float amountV How much to scroll the V (vertical) coordinate (1.0 = full texture height).

Size = 0x20 bytes